entity

package
v0.0.0-...-c015bec Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Customer

type Customer struct {
	ID          uuid.UUID       `db:"id" json:"id"`
	Name        string          `db:"name" json:"name"`
	CreditLimit decimal.Decimal `db:"credit_limit" json:"credit_limit"`
	CreatedAt   time.Time       `db:"created_at" json:"created_at"`
}

type Order

type Order struct {
	ID         uuid.UUID       `db:"id" json:"id"`
	CustomerID uuid.UUID       `db:"customer_id" json:"customer_id"`
	OrderTotal decimal.Decimal `db:"order_total" json:"order_total"`
	State      OrderState      `db:"state" json:"state"`
}

type OrderHistory

type OrderHistory struct {
	ID         primitive.ObjectID `bson:"_id" json:"id"`
	CustomerID uuid.UUID          `bson:"customer_id" json:"customer_id"`
	Orders     []struct {
		ID         uuid.UUID `bson:"id" json:"id"`
		State      string    `bson:"state" json:"state"`
		OrderTotal struct {
			Amount primitive.Decimal128 `bson:"amount" json:"amount"`
		} `bson:"order_total" json:"order_total"`
	}
	Name        string `bson:"name" json:"name"`
	CreditLimit struct {
		Amount primitive.Decimal128 `bson:"amount" json:"amount"`
	} `bson:"credit_limit" json:"credit_limit"`
}

type OrderState

type OrderState string
const (
	OrderRejected OrderState = "REJECTED"
	OrderApproved OrderState = "APPROVED"
	OrderPending  OrderState = "PENDING"
)

Jump to

Keyboard shortcuts

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