domain

package
v0.0.0-...-238b7f8 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Quotation

type Quotation struct {
	ID          string     `db:"id"`
	CreatedAt   time.Time  `db:"created_at"`
	UpdatedAt   *time.Time `db:"updated_at"`
	TotalPrice  float64    `db:"total_price"`
	IsPurchased bool       `db:"is_purchased"`
	PurchasedAt *time.Time `db:"purchased_at"`
	IsDelivered bool       `db:"is_delivered"`
	DeliveredAt *time.Time `db:"delivered_at"`
	Products    []QuoteProduct
}

type QuoteProduct

type QuoteProduct struct {
	ID          string `db:"id"`
	QuotationID string `db:"quotation_id"`
	ProductID   string `db:"product_id"`
	Quantity    int    `db:"quantity"`
}

type ReadQuotationRepository

type ReadQuotationRepository interface {
	GetQuotationByID(ctx context.Context, id int) (*Quotation, error)
	ListQuotations(ctx context.Context, limit, offset int) ([]Quotation, error)
}

type WriteQuotationRepository

type WriteQuotationRepository interface {
	SaveQuotation(ctx context.Context, args Quotation) (Quotation, error)
	DeleteQuotation(ctx context.Context, id int) error
	UpdateQuotation(ctx context.Context, args Quotation) (Quotation, error)
}

Jump to

Keyboard shortcuts

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