feat: add printer types

This commit is contained in:
efrilm
2026-10-01 22:26:44 +07:00
parent 892575202b
commit b0ef226af1
25 changed files with 2048 additions and 66 deletions
+4 -4
View File
@@ -18,7 +18,7 @@ type Product struct {
Cost float64
BusinessType constants.BusinessType
ImageURL *string
PrinterType string
PrinterTypes []string
SellBy string
UnitID *uuid.UUID
HasIngredients bool
@@ -50,7 +50,7 @@ type CreateProductRequest struct {
Cost float64 `validate:"min=0"`
BusinessType constants.BusinessType `validate:"required"`
ImageURL *string `validate:"omitempty,max=500"`
PrinterType *string `validate:"omitempty,max=50"`
PrinterTypes []string `validate:"omitempty,dive,max=50"`
PrintToChecker *bool `validate:"omitempty"`
UnitID *uuid.UUID `validate:"omitempty"`
SellBy string `validate:"omitempty,oneof=unit weight"`
@@ -72,7 +72,7 @@ type UpdateProductRequest struct {
Price *float64 `validate:"omitempty,min=0"`
Cost *float64 `validate:"omitempty,min=0"`
ImageURL *string `validate:"omitempty,max=500"`
PrinterType *string `validate:"omitempty,max=50"`
PrinterTypes []string `validate:"omitempty,dive,max=50"` // Replaces the whole list when not nil
PrintToChecker *bool `validate:"omitempty"`
UnitID *uuid.UUID `validate:"omitempty"`
SellBy *string `validate:"omitempty,oneof=unit weight"`
@@ -112,7 +112,7 @@ type ProductResponse struct {
Cost float64
BusinessType constants.BusinessType
ImageURL *string
PrinterType string
PrinterTypes []string
SellBy string
PrintToChecker bool
UnitID *uuid.UUID