Documentation ¶
Index ¶
Constants ¶
View Source
const ( RECEIVED_STATUS = "RECEBIDO" IN_PREPARATION_STATUS = "EM_PREPARACAO" DONE_STATUS = "PRONTO" FINISHED_STATUS = "FINALIZADO" )
View Source
const ( PAYMENT_STATUS_WAITING = 1 PAYMENT_STATUS_RECUSED = 2 PAYMENT_STATUS_APPROVED = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Customer ¶
type Customer struct { ID uint32 `gorm:"primary_key;auto_increment"` Name string `gorm:"size:255;not null;"` Email string `gorm:"size:255;not null;"` CPF string `gorm:"size:11;not null;"` gorm.Model } //@name domain.Customer
func NewCustomer ¶
func NewCustomer(customer dto.CustomerDto) (*Customer, error)
type Item ¶
type Item struct { ID uint32 `gorm:"primary_key;auto_increment"` Name string `gorm:"size:255;not null;"` Category string `gorm:"size:30;not null;"` Price float32 `gorm:"not null;"` ImageUrl string `gorm:"size:255;not null;"` gorm.Model } //@name domain.Item
func (Item) ValidateCategory ¶
type Order ¶
type Order struct { ID uint32 `gorm:"primarykey;autoIncrement" json:"id"` Items []OrderItem `gorm:"foreignKey:OrderID;references:ID;constraint:OnDelete:CASCADE" json:"items"` CustomerID uint32 `json:"customer_id"` Status string `json:"status"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } //@name domain.Order
type OrderItem ¶
type OrderItem struct { ID uint32 `gorm:"primarykey;autoIncrement" json:"-"` OrderID uint32 `json:"-"` ItemID uint32 `json:"id"` Quantity uint32 `json:"quantity"` Item Item `gorm:"references:ID" json:"-"` } //@name domain.OrderItem
func OrderItemToDomain ¶
type OrderPayment ¶
type OrderPayment struct { ID uint32 `gorm:"primary_key;auto_increment"` OrderID uint32 PaymentStatusID uint32 PaymentStatus PaymentStatus gorm.Model }
func NewOrderPayment ¶
func NewOrderPayment(orderID uint32, paymentStatusID uint32) (*OrderPayment, error)
func (*OrderPayment) SetPaymentStatus ¶
func (orderPayment *OrderPayment) SetPaymentStatus(statusID uint32) error
func (OrderPayment) Validate ¶
func (orderPayment OrderPayment) Validate() error
Click to show internal directories.
Click to hide internal directories.