package contract

import (
	"time"

	"github.com/google/uuid"
)

type CreatePaymentMethodRequest struct {
	OrganizationID uuid.UUID              `json:"organization_id"`
	OutletID       uuid.UUID              `json:"outlet_id""'`
	Name           string                 `json:"name" validate:"required,min=1,max=100"`
	Type           string                 `json:"type" validate:"required,oneof=cash card digital_wallet qr edc"`
	Processor      *string                `json:"processor,omitempty" validate:"omitempty,max=100"`
	Configuration  map[string]interface{} `json:"configuration,omitempty"`
	IsActive       *bool                  `json:"is_active,omitempty"`
}

type UpdatePaymentMethodRequest struct {
	Name          *string                `json:"name,omitempty" validate:"omitempty,min=1,max=100"`
	Type          *string                `json:"type,omitempty" validate:"omitempty,oneof=cash card digital_wallet qr edc"`
	Processor     *string                `json:"processor,omitempty" validate:"omitempty,max=100"`
	Configuration map[string]interface{} `json:"configuration,omitempty"`
	IsActive      *bool                  `json:"is_active,omitempty"`
}

type PaymentMethodResponse struct {
	ID             uuid.UUID              `json:"id"`
	OrganizationID uuid.UUID              `json:"organization_id"`
	Name           string                 `json:"name"`
	Type           string                 `json:"type"`
	Processor      *string                `json:"processor,omitempty"`
	Configuration  map[string]interface{} `json:"configuration,omitempty"`
	IsActive       bool                   `json:"is_active"`
	CreatedAt      time.Time              `json:"created_at"`
	UpdatedAt      time.Time              `json:"updated_at"`
}

type ListPaymentMethodsRequest struct {
	OrganizationID *uuid.UUID `json:"organization_id,omitempty"`
	Type           *string    `json:"type,omitempty" validate:"omitempty,oneof=cash card digital_wallet qr edc"`
	IsActive       *bool      `json:"is_active,omitempty"`
	Search         string     `json:"search,omitempty"`
	Page           int        `json:"page" validate:"min=1"`
	Limit          int        `json:"limit" validate:"min=1,max=100"`
}

type ListPaymentMethodsResponse struct {
	PaymentMethods []PaymentMethodResponse `json:"payment_methods"`
	TotalCount     int                     `json:"total_count"`
	Page           int                     `json:"page"`
	Limit          int                     `json:"limit"`
	TotalPages     int                     `json:"total_pages"`
}
