fusenapi/constants/orders.go

143 lines
6.2 KiB
Go
Raw Normal View History

2023-09-15 09:58:45 +00:00
package constants
2023-09-19 11:17:04 +00:00
// 订单类型
const (
2023-10-07 07:38:59 +00:00
DELIVERYMETHODDIRECTMAIL int64 = 1 // 直邮
DELIVERYMETHODDSCLOUDSTORE int64 = 2 // 云仓
2023-09-19 11:17:04 +00:00
)
2023-09-15 09:58:45 +00:00
// 货币
type Currency string
const (
2023-09-19 11:17:04 +00:00
CURRENCYUSD Currency = "usd"
2023-09-15 09:58:45 +00:00
)
// 金额单位
2023-09-18 07:39:12 +00:00
type AmountUnit interface{}
// 汇率单位
type ExchangeRateUnit interface{}
2023-09-15 09:58:45 +00:00
// 交易方式
type PayMethods string
const (
2023-09-26 10:46:44 +00:00
PAY_METHOD_CARD PayMethods = "CARD"
2023-09-27 09:23:58 +00:00
PAY_METHOD_VISA PayMethods = "VISA"
2023-09-15 09:58:45 +00:00
)
// 支付状态
type PayStatusCode int64
const (
2023-09-27 09:23:58 +00:00
PAY_STATUS_UNPAID PayStatusCode = 10 //10,未支付
PAY_STATUS_PAID PayStatusCode = 20 //20,已支付
PAY_STATUS_REFUNDED PayStatusCode = 30 //30,已退款
2023-09-15 09:58:45 +00:00
)
2023-09-19 05:56:59 +00:00
// 订单支付状态
type OrderPayStatusCode int64
// 0,未付首款
// 10,已付首款
// 20,已退首款
// 30,已付尾款
// 40,已退尾款
const (
2023-09-27 09:23:58 +00:00
ORDER_PAY_STATUS_UNPAIDDEPOSIT OrderPayStatusCode = 0
ORDER_PAY_STATUS_PAIDDEPOSIT OrderPayStatusCode = 10
ORDER_PAY_STATUS_REFUNDEDDEPOSIT OrderPayStatusCode = 20
ORDER_PAY_STATUS_PAIDDREMAINING OrderPayStatusCode = 30
ORDER_PAY_STATUS_REFUNDEDREMAINING OrderPayStatusCode = 40
2023-09-19 05:56:59 +00:00
)
2023-09-15 09:58:45 +00:00
// 订单状态
type OrderStatusCode int64
const (
2023-09-28 09:53:41 +00:00
ORDER_STATUS_UNPAIDDEPOSIT OrderStatusCode = 0 // 0,未支付定金
ORDER_STATUS_CLOSE OrderStatusCode = 10 // 10,订单已关闭
ORDER_STATUS_COMPLETE OrderStatusCode = 20 // 20,订单已完成
2023-10-07 10:36:59 +00:00
ORDER_STATUS_DELETE OrderStatusCode = 30 // 20,订单已删除
2023-09-28 09:53:41 +00:00
2023-09-26 10:46:44 +00:00
ORDER_STATUS_DIRECTMAIL_ORDERED OrderStatusCode = 10100 // 10100,直邮单--已下单
ORDER_STATUS_DIRECTMAIL_ORDEREDMAINING OrderStatusCode = 10100001 // 10100001,直邮单--已下单--尾款
ORDER_STATUS_DIRECTMAIL_CANCEL OrderStatusCode = 10101 // 10101,直邮单--已取消
ORDER_STATUS_DIRECTMAIL_STARTPRODUCTION OrderStatusCode = 10200 // 10200,直邮单--开始生产
ORDER_STATUS_DIRECTMAIL_COMPLETEPRODUCTION OrderStatusCode = 10300 // 10300,直邮单--生产完成
ORDER_STATUS_DIRECTMAIL_SHIPPED OrderStatusCode = 10400 // 10400,直邮单--已发货
ORDER_STATUS_DIRECTMAIL_ARRIVED OrderStatusCode = 10500 // 10500,直邮单--已到达
2023-09-28 09:53:41 +00:00
2023-09-26 10:46:44 +00:00
ORDER_STATUS_CLOUDSTORE_ORDERED OrderStatusCode = 20100 // 20100,云仓单--已下单
ORDER_STATUS_CLOUDSTORE_ORDEREDMAINING OrderStatusCode = 20100001 // 20100001,云仓单--已下单-尾款
ORDER_STATUS_CLOUDSTORE_CANCEL OrderStatusCode = 20101 // 20101,云仓单--已取消
ORDER_STATUS_CLOUDSTORE_STARTPRODUCTION OrderStatusCode = 20200 // 20200,云仓单--开始生产
ORDER_STATUS_CLOUDSTORE_COMPLETEPRODUCTION OrderStatusCode = 20300 // 20300,云仓单--生产完成
ORDER_STATUS_CLOUDSTORE_ARRIVEDWAREHOUSE OrderStatusCode = 20400 // 20400,云仓单--直达仓库
2023-09-15 09:58:45 +00:00
)
// 订单状态名称
var OrderStatusMessage map[OrderStatusCode]string
// 支付状态名称
var PayStatusMessage map[PayStatusCode]string
2023-09-27 09:51:25 +00:00
// 支付状态名称
var OrderPayStatusMessage map[OrderPayStatusCode]string
2023-09-20 03:39:56 +00:00
// 订单状态--用户可见--直邮
var OrderStatusUserDIRECTMAIL []OrderStatusCode
// 订单状态--用户可见--云仓
var OrderStatusUserCLOUDSTORE []OrderStatusCode
2023-09-15 09:58:45 +00:00
func init() {
2023-09-27 09:51:25 +00:00
// 订单状态名称
OrderPayStatusMessage = make(map[OrderPayStatusCode]string)
2023-10-11 04:11:21 +00:00
OrderPayStatusMessage[ORDER_PAY_STATUS_UNPAIDDEPOSIT] = "Deposit Payment Unpaid"
OrderPayStatusMessage[ORDER_PAY_STATUS_PAIDDEPOSIT] = "Deposit Payment Paid"
OrderPayStatusMessage[ORDER_PAY_STATUS_REFUNDEDDEPOSIT] = "Deposit Payment Refunded"
OrderPayStatusMessage[ORDER_PAY_STATUS_PAIDDREMAINING] = "Final Payment Paid"
OrderPayStatusMessage[ORDER_PAY_STATUS_REFUNDEDREMAINING] = "Final Payment Refunded"
2023-09-27 09:51:25 +00:00
2023-09-15 09:58:45 +00:00
// 订单状态名称
PayStatusMessage = make(map[PayStatusCode]string)
2023-09-27 09:23:58 +00:00
PayStatusMessage[PAY_STATUS_UNPAID] = "Unpaid"
PayStatusMessage[PAY_STATUS_PAID] = "Paid"
PayStatusMessage[PAY_STATUS_REFUNDED] = "Refunded"
2023-09-15 09:58:45 +00:00
// 订单状态名称
OrderStatusMessage = make(map[OrderStatusCode]string)
2023-10-11 07:10:38 +00:00
OrderStatusMessage[ORDER_STATUS_UNPAIDDEPOSIT] = "Deposit Payment Unpaid" // 首款未支付
OrderStatusMessage[ORDER_STATUS_CLOSE] = "Closed" // 已关闭
OrderStatusMessage[ORDER_STATUS_COMPLETE] = "Completed" // 已完成
OrderStatusMessage[ORDER_STATUS_DELETE] = "Deleted" // 已删除
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_ORDERED] = "Order" // 直邮单--已下单
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_ORDEREDMAINING] = "Final Payment Paid" // 直邮单--已下单--尾款
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_STARTPRODUCTION] = "Start Production" // 直邮单--开始生产
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_COMPLETEPRODUCTION] = "Production Complete" // 直邮单--生产完成
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_SHIPPED] = "Shipped" // 直邮单--已发货
OrderStatusMessage[ORDER_STATUS_DIRECTMAIL_ARRIVED] = "Delivered" // 直邮单--已到达
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_ORDERED] = "Order" // 云仓单--已下单
2023-10-11 04:11:21 +00:00
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_ORDEREDMAINING] = "Final Payment Paid" // 云仓单--已下单-尾款
2023-10-11 07:10:38 +00:00
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_STARTPRODUCTION] = "Start Production" // 云仓单--开始生产
2023-10-11 04:11:21 +00:00
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_COMPLETEPRODUCTION] = "Production Complete" // 云仓单--生产完成
2023-10-11 07:10:38 +00:00
OrderStatusMessage[ORDER_STATUS_CLOUDSTORE_ARRIVEDWAREHOUSE] = "Arrived Inventory" // 云仓单--直达仓库
2023-09-26 10:46:44 +00:00
2023-09-20 03:39:56 +00:00
// 订单状态--用户可见--直邮
OrderStatusUserDIRECTMAIL = []OrderStatusCode{
2023-09-27 09:23:58 +00:00
ORDER_STATUS_UNPAIDDEPOSIT,
2023-09-26 10:46:44 +00:00
ORDER_STATUS_DIRECTMAIL_ORDERED, ORDER_STATUS_DIRECTMAIL_STARTPRODUCTION, ORDER_STATUS_DIRECTMAIL_COMPLETEPRODUCTION, ORDER_STATUS_DIRECTMAIL_SHIPPED, ORDER_STATUS_DIRECTMAIL_ARRIVED,
2023-09-28 09:53:41 +00:00
ORDER_STATUS_COMPLETE, ORDER_STATUS_CLOSE,
2023-09-20 03:39:56 +00:00
}
// 订单状态--用户可见--云仓
OrderStatusUserCLOUDSTORE = []OrderStatusCode{
2023-09-27 09:23:58 +00:00
ORDER_STATUS_UNPAIDDEPOSIT,
2023-09-26 10:46:44 +00:00
ORDER_STATUS_CLOUDSTORE_ORDERED, ORDER_STATUS_CLOUDSTORE_STARTPRODUCTION, ORDER_STATUS_CLOUDSTORE_COMPLETEPRODUCTION, ORDER_STATUS_CLOUDSTORE_ARRIVEDWAREHOUSE,
2023-09-28 09:53:41 +00:00
ORDER_STATUS_COMPLETE, ORDER_STATUS_CLOSE,
2023-09-15 09:58:45 +00:00
}
}