Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateAddress ¶
ValidateAddress validates all address fields
func ValidateAddressCountry ¶
ValidateAddressCountry validates the country code format
func ValidateAddressPostalCode ¶
ValidateAddressPostalCode validates the postal code format
Types ¶
type Customer ¶
type Customer struct {
// ID is the unique identifier for the customer
ID string `db:"id" json:"id"`
// ExternalID is the external identifier for the customer
ExternalID string `db:"external_id" json:"external_id"`
// Name is the name of the customer
Name string `db:"name" json:"name"`
// Email is the email of the customer
Email string `db:"email" json:"email"`
// AddressLine1 is the first line of the customer's address
AddressLine1 string `db:"address_line1" json:"address_line1"`
// AddressLine2 is the second line of the customer's address
AddressLine2 string `db:"address_line2" json:"address_line2"`
// AddressCity is the city of the customer's address
AddressCity string `db:"address_city" json:"address_city"`
// AddressState is the state of the customer's address
AddressState string `db:"address_state" json:"address_state"`
// AddressPostalCode is the postal code of the customer's address
AddressPostalCode string `db:"address_postal_code" json:"address_postal_code"`
// AddressCountry is the country of the customer's address (ISO 3166-1 alpha-2)
AddressCountry string `db:"address_country" json:"address_country"`
// Metadata
Metadata map[string]string `db:"metadata" json:"metadata"`
// EnvironmentID is the environment identifier for the customer
EnvironmentID string `db:"environment_id" json:"environment_id"`
types.BaseModel
}
Customer represents a customer in the system
func FromEntList ¶
FromEntList converts a list of ent customers to domain customers
type Repository ¶
type Repository interface {
Create(ctx context.Context, customer *Customer) error
Get(ctx context.Context, id string) (*Customer, error)
List(ctx context.Context, filter *types.CustomerFilter) ([]*Customer, error)
Count(ctx context.Context, filter *types.CustomerFilter) (int, error)
ListAll(ctx context.Context, filter *types.CustomerFilter) ([]*Customer, error)
Update(ctx context.Context, customer *Customer) error
Delete(ctx context.Context, customer *Customer) error
GetByLookupKey(ctx context.Context, lookupKey string) (*Customer, error)
}
Repository defines the interface for customer data access
Click to show internal directories.
Click to hide internal directories.