entity

package
v0.0.0-...-6163b3c Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Consignee

type Consignee struct {
	Name        string `json:"name"`
	PhoneNumber string `json:"phone_number"`
}

type Consigner

type Consigner struct {
	Name        string `json:"name"`
	PhoneNumber string `json:"phone_number"`
}

type Courier

type Courier struct {
	COD          bool `json:"cod"`
	RateId       int  `json:"rate_id"`
	UseInsurance bool `json:"use_insurance"`
}

type DataWithPaging

type DataWithPaging[T any] struct {
	Data   T       `json:"data"`
	Paging *Paging `json:"paging"`
}

type Destination

type Destination struct {
	Address string `json:"address"`
	AreaId  int    `json:"area_id"`
	Lat     string `json:"lat"`
	Lng     string `json:"lng"`
}

type Item

type Item struct {
	Name  string `json:"name"`
	Price int    `json:"price"`
	Qty   int    `json:"qty"`
}

type Metadata

type Metadata struct {
	Host     string
	Ip       string
	Protocol string
}

type Order

type Order struct {
	OrderId         string      `json:"order_id,omitempty" gorm:"column:order_id;primaryKey"`
	GrossAmount     int         `json:"gross_amount" gorm:"column:gross_amount"`
	Status          OrderStatus `json:"status" gorm:"column:status;default:PENDING_PAYMENT"`
	ShippingId      string      `json:"shipping_id,omitempty" gorm:"column:shipping_id"`
	Courier         string      `json:"courier" gorm:"column:courier"`
	RateId          int         `json:"rate_id" gorm:"column:rate_id"`
	RateName        string      `json:"rate_name" gorm:"column:rate_name"`
	RateType        string      `json:"rate_type" gorm:"column:rate_type"`
	COD             bool        `json:"cod" gorm:"column:cod"`
	UseInsurance    bool        `json:"use_insurance" gorm:"column:use_insurance"`
	PackageType     int         `json:"package_type" gorm:"column:package_type"`
	PaymentMethod   string      `json:"payment_method,omitempty" gorm:"column:payment_method"`
	SnapToken       string      `json:"snap_token,omitempty" gorm:"column:snap_token"`
	SnapRedirectURL string      `json:"snap_redirect_url,omitempty" gorm:"column:snap_redirect_url"`
	UserId          string      `json:"user_id" gorm:"column:user_id"`
	Email           string      `json:"email" gorm:"column:email"`
	Buyer           string      `json:"buyer" gorm:"column:buyer"`
	Height          int         `json:"height" gorm:"column:height"`
	Length          int         `json:"length" gorm:"column:length"`
	Width           int         `json:"width" gorm:"column:width"`
	Weight          float32     `json:"weight" gorm:"column:weight"`
	AddressOwner    string      `json:"address_owner" gorm:"column:address_owner"`
	Street          string      `json:"street" gorm:"column:street"`
	AreaId          int         `json:"area_id" gorm:"column:area_id"`
	Area            string      `json:"area" gorm:"column:area"`
	Lat             string      `json:"lat" gorm:"column:lat"`
	Lng             string      `json:"lng" gorm:"column:lng"`
	Suburb          string      `json:"suburb" gorm:"column:suburb"`
	City            string      `json:"city" gorm:"column:city"`
	Province        string      `json:"province" gorm:"column:province"`
	WhatsApp        string      `json:"whatsapp" gorm:"column:whatsapp"`
	CreatedAt       time.Time   `json:"created_at,omitempty" gorm:"column:created_at"`
	UpdatedAt       time.Time   `json:"updated_at,omitempty" gorm:"column:updated_at"`
}

type OrderStatus

type OrderStatus string
const (
	PENDING_PAYMENT   OrderStatus = "PENDING_PAYMENT"
	IN_PROGRESS       OrderStatus = "IN_PROGRESS"
	COMPLETED         OrderStatus = "COMPLETED"
	CANCELLED         OrderStatus = "CANCELLED"
	FAILED            OrderStatus = "FAILED"
	REFUND_PROCESSING OrderStatus = "REFUND_PROCESSING"
	REFUND_COMPLETED  OrderStatus = "REFUND_COMPLETED"
	RETURN_PROCESSING OrderStatus = "RETURN_PROCESSING"
	RETURN_COMPLETED  OrderStatus = "RETURN_COMPLETED"
	LOST_OR_DAMAGED   OrderStatus = "LOST_OR_DAMAGED"
)

type OrderWithProducts

type OrderWithProducts struct {
	Order    *Order          `json:"order"`
	Products []*ProductOrder `json:"products"`
}

type Origin

type Origin struct {
	Address string `json:"address"`
	AreaId  int    `json:"area_id"`
	Lat     string `json:"lat"`
	Lng     string `json:"lng"`
}

type Package

type Package struct {
	Height      int     `json:"height"`
	Items       []Item  `json:"items"`
	Length      int     `json:"length"`
	PackageType int     `json:"package_type"`
	Price       int     `json:"price"`
	Weight      float32 `json:"weight"`
	Width       int     `json:"width"`
}

type Paging

type Paging struct {
	TotalData int `json:"total_data"`
	Page      int `json:"page"`
	TotalPage int `json:"total_page"`
}

type ProductOrder

type ProductOrder struct {
	OrderId     string `json:"order_id,omitempty" gorm:"column:order_id;primaryKey"`
	ProductId   int    `json:"product_id" gorm:"column:product_id"`
	ProductName string `json:"product_name" gorm:"column:product_name"`
	Image       string `json:"image" gorm:"column:image"`
	Quantity    int    `json:"quantity" gorm:"column:quantity"`
	Price       int    `json:"price" gorm:"column:price"`
}

type QueryJoin

type QueryJoin struct {
	TotalOrders     int         `json:"total_orders,omitempty" gorm:"column:total_orders"`
	OrderId         string      `json:"order_id,omitempty" gorm:"column:order_id"`
	GrossAmount     int         `json:"gross_amount" gorm:"column:gross_amount"`
	Status          OrderStatus `json:"status" gorm:"column:status"`
	ShippingId      string      `json:"shipping_id,omitempty" gorm:"column:shipping_id"`
	Courier         string      `json:"courier" gorm:"column:courier"`
	RateId          int         `json:"rate_id" gorm:"column:rate_id"`
	RateName        string      `json:"rate_name" gorm:"column:rate_name"`
	RateType        string      `json:"rate_type" gorm:"column:rate_type"`
	COD             bool        `json:"cod" gorm:"column:cod"`
	UseInsurance    bool        `json:"use_insurance" gorm:"column:use_insurance"`
	PackageType     int         `json:"package_type" gorm:"column:package_type"`
	PaymentMethod   string      `json:"payment_method,omitempty" gorm:"column:payment_method"`
	SnapToken       string      `json:"snap_token,omitempty" gorm:"column:snap_token"`
	SnapRedirectURL string      `json:"snap_redirect_url,omitempty" gorm:"column:snap_redirect_url"`
	UserId          string      `json:"user_id" gorm:"column:user_id"`
	Email           string      `json:"email" gorm:"column:email"`
	Buyer           string      `json:"buyer" gorm:"column:buyer"`
	Height          int         `json:"height" gorm:"column:height"`
	Length          int         `json:"length" gorm:"column:length"`
	Width           int         `json:"width" gorm:"column:width"`
	Weight          float32     `json:"weight" gorm:"column:weight"`
	AddressOwner    string      `json:"address_owner" gorm:"column:address_owner"`
	Street          string      `json:"street" gorm:"column:street"`
	AreaId          int         `json:"area_id" gorm:"column:area_id"`
	Area            string      `json:"area" gorm:"column:area"`
	Lat             string      `json:"lat" gorm:"column:lat"`
	Lng             string      `json:"lng" gorm:"column:lng"`
	Suburb          string      `json:"suburb" gorm:"column:suburb"`
	City            string      `json:"city" gorm:"column:city"`
	Province        string      `json:"province" gorm:"column:province"`
	WhatsApp        string      `json:"whatsapp" gorm:"column:whatsapp"`
	CreatedAt       time.Time   `json:"created_at,omitempty" gorm:"column:created_at"`
	UpdatedAt       time.Time   `json:"updated_at,omitempty" gorm:"column:updated_at"`
	ProductId       int         `json:"product_id" gorm:"column:product_id"`
	ProductName     string      `json:"product_name" gorm:"column:product_name"`
	Image           string      `json:"image" gorm:"column:image"`
	Quantity        int         `json:"quantity" gorm:"column:quantity"`
	Price           int         `json:"price" gorm:"column:price"`
}

type QueryJsonWithCount

type QueryJsonWithCount struct {
	Data  []byte `json:"data"`
	Total int    `json:"total"`
}

type ShippingOrder

type ShippingOrder struct {
	Consignee   Consignee   `json:"consignee"`
	Consigner   Consigner   `json:"consigner"`
	Courier     Courier     `json:"courier"`
	Coverage    string      `json:"coverage"`
	Destination Destination `json:"destination"`
	ExternalId  string      `json:"external_id"`
	Origin      Origin      `json:"origin"`
	Package     Package     `json:"package"`
	PaymentType string      `json:"payment_type"`
}

type Transaction

type Transaction struct {
	TransactionTime        string `json:"transaction_time"`
	TransactionStatus      string `json:"transaction_status"`
	TransactionId          string `json:"transaction_id"`
	StatusMessage          string `json:"status_message"`
	StatusCode             string `json:"status_code"`
	SignatureKey           string `json:"signature_key"`
	PaymentType            string `json:"payment_type"`
	OrderId                string `json:"order_id"`
	MerchantId             string `json:"merchant_id"`
	MaskedCard             string `json:"masked_card"`
	GrossAmount            string `json:"gross_amount"`
	FraudStatus            string `json:"fraud_status"`
	Eci                    string `json:"eci"`
	Currency               string `json:"currency"`
	ChannelResponseMessage string `json:"channel_response_message"`
	ChannelResponseCode    string `json:"channel_response_code"`
	CardType               string `json:"card_type"`
	Bank                   string `json:"bank"`
	ApprovalCode           string `json:"approval_code"`
}

Jump to

Keyboard shortcuts

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