141 lines
3.4 KiB
Go
141 lines
3.4 KiB
Go
package domain
|
|
|
|
import "time"
|
|
|
|
const (
|
|
FreightSourceShunyunbao = "SHUNYUNBAO"
|
|
FreightSyncOrderNumber = "ORDER_NUMBER"
|
|
)
|
|
|
|
type FreightSyncStatus string
|
|
|
|
const (
|
|
FreightSyncPending FreightSyncStatus = "PENDING"
|
|
FreightSyncRunning FreightSyncStatus = "RUNNING"
|
|
FreightSyncSucceeded FreightSyncStatus = "SUCCEEDED"
|
|
FreightSyncFailed FreightSyncStatus = "FAILED"
|
|
)
|
|
|
|
type FreightSyncRun struct {
|
|
ID string
|
|
CreatorSubject string
|
|
CreatedByUserID string
|
|
Mode string
|
|
OrderNumber string
|
|
QuerySHA256 string
|
|
Status FreightSyncStatus
|
|
ErrorCode *string
|
|
OrderCount int
|
|
ItemCount int
|
|
CreatedAt time.Time
|
|
StartedAt *time.Time
|
|
FinishedAt *time.Time
|
|
}
|
|
|
|
type FreightOrder struct {
|
|
ID string
|
|
CreatorSubject string
|
|
SourceSystem string
|
|
ExternalStockID string
|
|
SourceCode string
|
|
PlatformOrderNo *string
|
|
ShopName *string
|
|
SourceCreatedAt *time.Time
|
|
OrderStatus *string
|
|
PurchaseStatus *string
|
|
IsCanceled *bool
|
|
CanonicalSHA256 string
|
|
Revision int
|
|
FirstSyncRunID string
|
|
LastSyncRunID string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
ItemCount int
|
|
}
|
|
|
|
type FreightOrderItem struct {
|
|
ID string
|
|
FreightOrderID string
|
|
ExternalItemID string
|
|
Title string
|
|
ProductSpec string
|
|
SKU string
|
|
Quantity *int
|
|
ProductThumbRef *string
|
|
PurchaseStatus *string
|
|
CanonicalSHA256 string
|
|
Revision int
|
|
IsPresent bool
|
|
FirstSyncRunID string
|
|
LastSyncRunID string
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
type FreightOrderDetail struct {
|
|
Order FreightOrder
|
|
Items []FreightOrderItem
|
|
}
|
|
|
|
type FreightSourceBatch struct {
|
|
SchemaVersion int `json:"schema_version"`
|
|
Query FreightSourceQuery `json:"query"`
|
|
Orders []FreightSourceOrder `json:"orders"`
|
|
}
|
|
|
|
type FreightSourceQuery struct {
|
|
Mode string `json:"mode"`
|
|
}
|
|
|
|
type FreightSourceOrder struct {
|
|
ExternalStockID string `json:"external_stock_id"`
|
|
SourceCode string `json:"source_code"`
|
|
PlatformOrderNo *string `json:"platform_order_no"`
|
|
ShopName *string `json:"shop_name"`
|
|
SourceCreatedAt *string `json:"source_created_at"`
|
|
OrderStatus *string `json:"order_status"`
|
|
PurchaseStatus *string `json:"purchase_status"`
|
|
IsCanceled *bool `json:"is_canceled"`
|
|
Items []FreightSourceItem `json:"items"`
|
|
}
|
|
|
|
type FreightSourceItem struct {
|
|
ExternalItemID string `json:"external_item_id"`
|
|
Title string `json:"title"`
|
|
ProductSpec string `json:"product_spec"`
|
|
SKU string `json:"sku"`
|
|
Quantity *int `json:"quantity"`
|
|
ProductThumbRef *string `json:"product_thumb_ref"`
|
|
PurchaseStatus *string `json:"purchase_status"`
|
|
}
|
|
|
|
type FreightImportBatch struct {
|
|
Orders []FreightImportOrder
|
|
}
|
|
|
|
type FreightImportOrder struct {
|
|
ID string
|
|
ExternalStockID string
|
|
SourceCode string
|
|
PlatformOrderNo *string
|
|
ShopName *string
|
|
SourceCreatedAt *time.Time
|
|
OrderStatus *string
|
|
PurchaseStatus *string
|
|
IsCanceled *bool
|
|
CanonicalSHA256 string
|
|
Items []FreightImportItem
|
|
}
|
|
|
|
type FreightImportItem struct {
|
|
ID string
|
|
ExternalItemID string
|
|
Title string
|
|
ProductSpec string
|
|
SKU string
|
|
Quantity *int
|
|
ProductThumbRef *string
|
|
PurchaseStatus *string
|
|
CanonicalSHA256 string
|
|
}
|