This commit is contained in:
Aditya Siregar
2025-07-30 23:18:20 +07:00
parent 4a921df55d
commit a759e0f57c
57 changed files with 3633 additions and 190 deletions
+8
View File
@@ -17,6 +17,8 @@ type Product struct {
Price float64
Cost float64
BusinessType constants.BusinessType
ImageURL *string
PrinterType string
Metadata map[string]interface{}
IsActive bool
CreatedAt time.Time
@@ -43,6 +45,8 @@ type CreateProductRequest struct {
Price float64 `validate:"required,min=0"`
Cost float64 `validate:"min=0"`
BusinessType constants.BusinessType `validate:"required"`
ImageURL *string `validate:"omitempty,max=500"`
PrinterType *string `validate:"omitempty,max=50"`
Metadata map[string]interface{}
Variants []CreateProductVariantRequest `validate:"omitempty,dive"`
// Stock management fields
@@ -58,6 +62,8 @@ type UpdateProductRequest struct {
Description *string `validate:"omitempty,max=1000"`
Price *float64 `validate:"omitempty,min=0"`
Cost *float64 `validate:"omitempty,min=0"`
ImageURL *string `validate:"omitempty,max=500"`
PrinterType *string `validate:"omitempty,max=50"`
Metadata map[string]interface{}
IsActive *bool
// Stock management fields
@@ -89,6 +95,8 @@ type ProductResponse struct {
Price float64
Cost float64
BusinessType constants.BusinessType
ImageURL *string
PrinterType string
Metadata map[string]interface{}
IsActive bool
CreatedAt time.Time