init
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type OutletSetting struct {
|
||||
ID uuid.UUID
|
||||
OutletID uuid.UUID
|
||||
Key string
|
||||
Value string
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
type CreateOutletSettingRequest struct {
|
||||
OutletID uuid.UUID `validate:"required"`
|
||||
Key string `validate:"required,min=1,max=255"`
|
||||
Value string `validate:"required"`
|
||||
}
|
||||
|
||||
type UpdateOutletSettingRequest struct {
|
||||
Value string `validate:"required"`
|
||||
}
|
||||
|
||||
type OutletSettingResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
OutletID uuid.UUID `json:"outlet_id"`
|
||||
Key string `json:"key"`
|
||||
Value string `json:"value"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type OutletPrinterSettings struct {
|
||||
OutletName string `json:"outlet_name"`
|
||||
Address string `json:"address"`
|
||||
PhoneNumber string `json:"phone_number"`
|
||||
PaperSize string `json:"paper_size"`
|
||||
Footer string `json:"footer"`
|
||||
FooterHashtag string `json:"footer_hashtag"`
|
||||
}
|
||||
|
||||
type UpdateOutletPrinterSettingsRequest struct {
|
||||
OutletName *string `json:"outlet_name,omitempty" validate:"omitempty,min=1,max=255"`
|
||||
Address *string `json:"address,omitempty" validate:"omitempty,min=1,max=500"`
|
||||
PhoneNumber *string `json:"phone_number,omitempty" validate:"omitempty,e164"`
|
||||
PaperSize *string `json:"paper_size,omitempty" validate:"omitempty,oneof=58mm 80mm A4 A5 Letter"`
|
||||
Footer *string `json:"footer,omitempty" validate:"omitempty,min=1,max=500"`
|
||||
FooterHashtag *string `json:"footer_hashtag,omitempty" validate:"omitempty,min=1,max=100"`
|
||||
}
|
||||
Reference in New Issue
Block a user