model

package
v0.0.0-...-11b1029 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Email string = "email"
	SMS   string = "sms"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Notification

type Notification struct {
	weaver.AutoMarshal
	OrderID    string
	CustomerID string
	Event      string
	Modes      []string
}

func (*Notification) WeaverMarshal

func (x *Notification) WeaverMarshal(enc *codegen.Encoder)

func (*Notification) WeaverUnmarshal

func (x *Notification) WeaverUnmarshal(dec *codegen.Decoder)

type Order

type Order struct {
	weaver.AutoMarshal
	ID           string      `json:"order_id,omitempty"`
	CustomerID   string      `json:"customer_id,omitempty"`
	Status       string      `json:"status,omitempty"`
	CreatedOn    time.Time   `json:"created_on,omitempty"`
	RestaurantId string      `json:"restaurant_id,omitempty"`
	Amount       float64     `json:"amount,omitempty"`
	OrderItems   []OrderItem `json:"order_items,omitempty"`
}

Order aggregate

func (Order) GetAmount

func (order Order) GetAmount() float64

GetAmount returns total amount of the order

func (*Order) WeaverMarshal

func (x *Order) WeaverMarshal(enc *codegen.Encoder)

func (*Order) WeaverUnmarshal

func (x *Order) WeaverUnmarshal(dec *codegen.Decoder)

type OrderItem

type OrderItem struct {
	weaver.AutoMarshal
	ProductCode string  `json:"code,omitempty"`
	Name        string  `json:"name,omitempty"`
	UnitPrice   float64 `json:"unit_price,omitempty"`
	Quantity    int     `json:"quantity,omitempty"`
}

OrderItem value type

func (*OrderItem) WeaverMarshal

func (x *OrderItem) WeaverMarshal(enc *codegen.Encoder)

func (*OrderItem) WeaverUnmarshal

func (x *OrderItem) WeaverUnmarshal(dec *codegen.Decoder)

type OrderPayment

type OrderPayment struct {
	weaver.AutoMarshal
	OrderID    string
	CustomerID string
	Amount     float64
}

func (*OrderPayment) WeaverMarshal

func (x *OrderPayment) WeaverMarshal(enc *codegen.Encoder)

func (*OrderPayment) WeaverUnmarshal

func (x *OrderPayment) WeaverUnmarshal(dec *codegen.Decoder)

Jump to

Keyboard shortcuts

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