order

package
v0.0.0-...-d22e7c3 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coupons

type Coupons struct {
	OrderID        string
	UserID         int64
	CouponCode     string
	DiscountAmount int64
	// to track whether the coupon is really applied or not
	IsApplied bool
	CreatedAt time.Time
	UpdatedAt time.Time
	UpdatedBy int64
	IsTest    bool
	IsDeleted bool
}

Coupons of order, to track the usage of coupons

type Detail

type Detail struct {
	ID             string
	OrderID        string
	ItemID         string
	ItemName       string
	ItemPrice      int64
	ItemQuantity   int64
	ItemPriceTotal int64
	DiscountAmount int64
	RefundAmount   int64
	CashbackAmount int64
	// total = item price total - discount amount - refund amount
	Total     int64
	CreatedAt time.Time
	UpdatedAt time.Time
	UpdatedBy int64
	IsTest    bool
	IsDeleted bool
}

Detail of order

type Order

type Order struct {
	ID            string
	UserID        int64
	OrderType     int32
	Total         int64
	DiscountTotal int64
	RefundTotal   int64
	CashbackTotal int64
	// grand total = total - discount total - refund total
	GrandTotal       int64
	Status           Status
	Details          []Detail
	IsRefundable     bool
	RefundableBefore time.Time
	CreatedAt        time.Time
	UpdatedAt        time.Time
	UpdatedBy        int64
	IsTest           bool
	IsDeleted        bool
}

Order struct

type Refund

type Refund struct {
	ID          string
	OrderID     string
	Status      RefundStatus
	TotalAmount int64
	Details     []RefundDetail
	Description string
	CreatedAt   time.Time
	UpdatedAt   time.Time
	UpdatedBy   int64
	IsTest      bool
	IsDeleted   bool
}

Refund of order

type RefundDetail

type RefundDetail struct {
	RefundID      string
	OrderDetailID string
	Amount        int64
	CreatedAt     time.Time
	IsTest        bool
	IsDeleted     bool
}

RefundDetail struct

type RefundStatus

type RefundStatus int

RefundStatus of order

const (
	RefundStatusCreated  RefundStatus = 100
	RefundStatusComplete RefundStatus = 200
)

refund status list

type Status

type Status int

Status of order

const (
	// order is updateable
	StatusCreated                       Status = 10
	StatusWaitingForPayment             Status = 100
	StatusWaitingForPaymentConfirmation Status = 105
	StatusPaid                          Status = 150
	StatusWaitingForThirdParty          Status = 180
	StatusComplete                      Status = 200
	StatusRefundInProcess               Status = 400
	// order is not updateable
	StatusOrderRefunded     Status = 450
	StatusCancelled         Status = 500
	StatusCancelledBySystem Status = 505
)

status list of order

type Type

type Type int

Type of order

const (
	TypeBooking      Type = 1
	TypeDigitalGoods Type = 2
)

type list of order

Jump to

Keyboard shortcuts

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