init
This commit is contained in:
@@ -14,7 +14,8 @@ type CreateProductRequest struct {
|
||||
Price float64 `json:"price" validate:"required,min=0"`
|
||||
Cost *float64 `json:"cost,omitempty" validate:"omitempty,min=0"`
|
||||
BusinessType *string `json:"business_type,omitempty"`
|
||||
Image *string `json:"image,omitempty"` // Will be stored in metadata["image"]
|
||||
ImageURL *string `json:"image_url,omitempty" validate:"omitempty,max=500"`
|
||||
PrinterType *string `json:"printer_type,omitempty" validate:"omitempty,max=50"`
|
||||
Metadata map[string]interface{} `json:"metadata,omitempty"`
|
||||
IsActive *bool `json:"is_active,omitempty"`
|
||||
Variants []CreateProductVariantRequest `json:"variants,omitempty"`
|
||||
@@ -31,7 +32,8 @@ type UpdateProductRequest struct {
|
||||
Price *float64 `json:"price,omitempty" validate:"omitempty,min=0"`
|
||||
Cost *float64 `json:"cost,omitempty" validate:"omitempty,min=0"`
|
||||
BusinessType *string `json:"business_type,omitempty"`
|
||||
Image *string `json:"image,omitempty"` // Will be stored in metadata["image"]
|
||||
ImageURL *string `json:"image_url,omitempty" validate:"omitempty,max=500"`
|
||||
PrinterType *string `json:"printer_type,omitempty" validate:"omitempty,max=50"`
|
||||
Metadata map[string]interface{} `json:"metadata,omitempty"`
|
||||
IsActive *bool `json:"is_active,omitempty"`
|
||||
// Stock management fields
|
||||
@@ -63,6 +65,8 @@ type ProductResponse struct {
|
||||
Price float64 `json:"price"`
|
||||
Cost float64 `json:"cost"`
|
||||
BusinessType string `json:"business_type"`
|
||||
ImageURL *string `json:"image_url"`
|
||||
PrinterType string `json:"printer_type"`
|
||||
Metadata map[string]interface{} `json:"metadata"`
|
||||
IsActive bool `json:"is_active"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
package contract
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type CreateTableRequest struct {
|
||||
OutletID uuid.UUID `json:"outlet_id" validate:"required"`
|
||||
TableName string `json:"table_name" validate:"required,max=100"`
|
||||
PositionX float64 `json:"position_x" validate:"required"`
|
||||
PositionY float64 `json:"position_y" validate:"required"`
|
||||
Capacity int `json:"capacity" validate:"required,min=1,max=20"`
|
||||
Metadata map[string]interface{} `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateTableRequest struct {
|
||||
TableName *string `json:"table_name,omitempty" validate:"omitempty,max=100"`
|
||||
Status *string `json:"status,omitempty" validate:"omitempty,oneof=available occupied reserved cleaning maintenance"`
|
||||
PositionX *float64 `json:"position_x,omitempty"`
|
||||
PositionY *float64 `json:"position_y,omitempty"`
|
||||
Capacity *int `json:"capacity,omitempty" validate:"omitempty,min=1,max=20"`
|
||||
IsActive *bool `json:"is_active,omitempty"`
|
||||
Metadata map[string]interface{} `json:"metadata,omitempty"`
|
||||
}
|
||||
|
||||
type OccupyTableRequest struct {
|
||||
OrderID uuid.UUID `json:"order_id" validate:"required"`
|
||||
StartTime time.Time `json:"start_time" validate:"required"`
|
||||
}
|
||||
|
||||
type ReleaseTableRequest struct {
|
||||
PaymentAmount float64 `json:"payment_amount" validate:"required,min=0"`
|
||||
}
|
||||
|
||||
type TableResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
OrganizationID uuid.UUID `json:"organization_id"`
|
||||
OutletID uuid.UUID `json:"outlet_id"`
|
||||
TableName string `json:"table_name"`
|
||||
StartTime *time.Time `json:"start_time,omitempty"`
|
||||
Status string `json:"status"`
|
||||
OrderID *uuid.UUID `json:"order_id,omitempty"`
|
||||
PaymentAmount float64 `json:"payment_amount"`
|
||||
PositionX float64 `json:"position_x"`
|
||||
PositionY float64 `json:"position_y"`
|
||||
Capacity int `json:"capacity"`
|
||||
IsActive bool `json:"is_active"`
|
||||
Metadata map[string]interface{} `json:"metadata,omitempty"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
Order *OrderResponse `json:"order,omitempty"`
|
||||
}
|
||||
|
||||
type ListTablesQuery struct {
|
||||
OrganizationID string `form:"organization_id"`
|
||||
OutletID string `form:"outlet_id"`
|
||||
Status string `form:"status"`
|
||||
IsActive string `form:"is_active"`
|
||||
Search string `form:"search"`
|
||||
Page int `form:"page,default=1"`
|
||||
Limit int `form:"limit,default=10"`
|
||||
}
|
||||
|
||||
type ListTablesRequest struct {
|
||||
Page int `json:"page" validate:"min=1"`
|
||||
Limit int `json:"limit" validate:"min=1,max=100"`
|
||||
OrganizationID *uuid.UUID `json:"organization_id,omitempty"`
|
||||
OutletID *uuid.UUID `json:"outlet_id,omitempty"`
|
||||
Status *string `json:"status,omitempty" validate:"omitempty,oneof=available occupied reserved cleaning maintenance"`
|
||||
IsActive *bool `json:"is_active,omitempty"`
|
||||
Search string `json:"search,omitempty"`
|
||||
}
|
||||
|
||||
type ListTablesResponse struct {
|
||||
Tables []TableResponse `json:"tables"`
|
||||
TotalCount int `json:"total_count"`
|
||||
Page int `json:"page"`
|
||||
Limit int `json:"limit"`
|
||||
TotalPages int `json:"total_pages"`
|
||||
}
|
||||
@@ -30,6 +30,10 @@ type ChangePasswordRequest struct {
|
||||
NewPassword string `json:"new_password" validate:"required,min=6"`
|
||||
}
|
||||
|
||||
type UpdateUserOutletRequest struct {
|
||||
OutletID uuid.UUID `json:"outlet_id" validate:"required"`
|
||||
}
|
||||
|
||||
type LoginRequest struct {
|
||||
Email string `json:"email" validate:"required,email"`
|
||||
Password string `json:"password" validate:"required"`
|
||||
|
||||
Reference in New Issue
Block a user