models

package
v0.0.0-...-ca96c0c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ORDER_STATUS_UNSET           OrderStatus = ""
	ORDER_STATUS_OPEN                        = "Aberto"
	ORDER_STATUS_WAITING_PAYMENT             = "Aguardando Pagamento"
	ORDER_STATUS_RECEIVED                    = "Recebido"
	ORDER_STATUS_PREPARING                   = "Em Preparação"
	ORDER_STATUS_DONE                        = "Pronto"
	ORDER_STATUS_FINISHED                    = "Finalizado"
	ORDER_STATUS_CANCELED                    = "Cancelado"
)
View Source
const (
	PAYMENT_STATUS_OPEN     PaymentStatus = "Aberto"
	PAYMENT_STATUS_APPROVED               = "Aprovado"
	PAYMENT_SATUS_REFUSED                 = "Recusado"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
	Name      string
}

type CategoryList

type CategoryList struct {
	Categories    []*Category
	Limit, Offset int
	Total         int64
}

type Order

type Order struct {
	ID        uuid.UUID
	UserID    uuid.UUID
	PaymentID uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt time.Time
	Price     decimal.Decimal
	Status    OrderStatus
	Products  []Product
}

type OrderList

type OrderList struct {
	Orders        []*Order
	Limit, Offset int
	Total         int64
}

type OrderProductionNotification

type OrderProductionNotification struct {
	ID        uuid.UUID   `json:"id"`
	UpdatedAt time.Time   `json:"updated_at"`
	Status    OrderStatus `json:"status"`
}

type OrderStatus

type OrderStatus string

type Payment

type Payment struct {
	ID        uuid.UUID
	CreatedAt time.Time
	UpdatedAt time.Time
	Price     decimal.Decimal
	OrderID   uuid.UUID
	Status    PaymentStatus
}

type PaymentStatus

type PaymentStatus string

func PaymentStatusFromClearingService

func PaymentStatusFromClearingService(status api.PaymentStatus) PaymentStatus

type PaymentStatusNotification

type PaymentStatusNotification struct {
	PaymentID uuid.UUID
	OrderID   uuid.UUID
	Status    PaymentStatus // Can be "approved" or "denied"
}

type Product

type Product struct {
	ID          uuid.UUID
	CategoryID  uuid.UUID
	CreatedAt   time.Time
	UpdatedAt   time.Time
	Name        string
	Description string
	Price       decimal.Decimal
}

type ProductList

type ProductList struct {
	Products      []*Product
	Limit, Offset int
	Total         int64
}

type ProductsSum

type ProductsSum struct {
	Products    []uuid.UUID
	RequestedAt time.Time
	Sum         decimal.Decimal
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL