define nats func - get supplier order cash and supplier withdraw cash

This commit is contained in:
Sinh 2022-11-02 17:18:11 +07:00
parent 868df4713d
commit 816316b558
7 changed files with 39 additions and 0 deletions

View File

@ -49,3 +49,7 @@ type OrderSupplierQuery struct {
SupplierID string `json:"supplierId"` SupplierID string `json:"supplierId"`
WarehouseIDs []string `json:"warehouseIDs"` WarehouseIDs []string `json:"warehouseIDs"`
} }
type OrderSupplierCashReq struct {
SupplierID string `json:"supplierId"`
}

View File

@ -33,3 +33,9 @@ type SupplierOrderDelivery struct {
Status string `json:"status" enums:"waiting_to_confirm,waiting_to_pick,picking,picked,delay_pickup,pickup_failed,delivering,delay_delivery,delivered,cancelled,delivery_failed,waiting_to_return,returning,delay_return,compensation,returned"` Status string `json:"status" enums:"waiting_to_confirm,waiting_to_pick,picking,picked,delay_pickup,pickup_failed,delivering,delay_delivery,delivered,cancelled,delivery_failed,waiting_to_return,returning,delay_return,compensation,returned"`
TPLCode string `json:"tplCode" enums:"SLY,GHTK,GHN,SSC,SPY,VTP,SE,NTL,BEST"` TPLCode string `json:"tplCode" enums:"SLY,GHTK,GHN,SSC,SPY,VTP,SE,NTL,BEST"`
} }
type OrderSupplierCashRes struct {
PendingCash float64 `json:"pendingCash"`
WaitingForReconcileCash float64 `json:"waitingForReconcileCash"`
ReconciledCash float64 `json:"reconciledCash"`
}

View File

@ -0,0 +1,5 @@
package model
type WithdrawSupplierCashReq struct {
SupplierID string `json:"supplierId"`
}

View File

@ -0,0 +1,7 @@
package model
type WithdrawSupplierCashRes struct {
PendingCash float64 `json:"pendingCash"`
SuccessCash float64 `json:"successCash"`
RejectCash float64 `json:"rejectCash"`
}

View File

@ -11,6 +11,7 @@ var prefixes = struct {
Seller string Seller string
SupplierUser string SupplierUser string
SupplierRole string SupplierRole string
Withdraw string
}{ }{
Communication: "communication", Communication: "communication",
Order: "order", Order: "order",
@ -22,4 +23,5 @@ var prefixes = struct {
Seller: "seller", Seller: "seller",
SupplierUser: "supplier_user", SupplierUser: "supplier_user",
SupplierRole: "supplier_role", SupplierRole: "supplier_role",
Withdraw: "withdraw",
} }

View File

@ -13,6 +13,7 @@ var Order = struct {
UpdateLogisticInfoFailed string UpdateLogisticInfoFailed string
ORNotUpdateStatus string ORNotUpdateStatus string
GetSupplierOrders string GetSupplierOrders string
GetSupplierCash string
}{ }{
UpdateORStatus: getOrderValue("update_outbound_request_status"), UpdateORStatus: getOrderValue("update_outbound_request_status"),
CancelDelivery: getOrderValue("cancel_delivery"), CancelDelivery: getOrderValue("cancel_delivery"),
@ -20,4 +21,5 @@ var Order = struct {
UpdateLogisticInfoFailed: getOrderValue("update_logistic_info_failed"), UpdateLogisticInfoFailed: getOrderValue("update_logistic_info_failed"),
ORNotUpdateStatus: getOrderValue("outbound_request_not_update_status"), ORNotUpdateStatus: getOrderValue("outbound_request_not_update_status"),
GetSupplierOrders: getOrderValue("get_supplier_orders"), GetSupplierOrders: getOrderValue("get_supplier_orders"),
GetSupplierCash: getOrderValue("get_supplier_cash"),
} }

13
subject/withdraw.go Normal file
View File

@ -0,0 +1,13 @@
package subject
import "fmt"
func getWithdrawValue(val string) string {
return fmt.Sprintf("%s.%s", prefixes.Withdraw, val)
}
var Withdraw = struct {
GetSupplierCash string
}{
GetSupplierCash: getWithdrawValue("get_supplier_cash"),
}