修复平台代管订单流程
This commit is contained in:
@@ -32,6 +32,9 @@ type ListingDTO struct {
|
||||
InTransaction bool `json:"in_transaction"`
|
||||
Status string `json:"status"`
|
||||
ReviewStatus string `json:"review_status"`
|
||||
HandoffMode string `json:"handoff_mode"`
|
||||
SettlementMode string `json:"settlement_mode"`
|
||||
ManagedAdminID *uint64 `json:"managed_admin_id,omitempty"`
|
||||
ReviewReason string `json:"review_reason"`
|
||||
PublishedAt *time.Time `json:"published_at"`
|
||||
ListingGroupConversationID uint64 `json:"listing_group_conversation_id,omitempty"`
|
||||
|
||||
@@ -170,6 +170,9 @@ func (r *Repository) CreateFromExternalUpload(ctx context.Context, upload extern
|
||||
DepositAmountCent: req.DepositAmountCent,
|
||||
Status: "draft",
|
||||
ReviewStatus: "pending",
|
||||
HandoffMode: "platform",
|
||||
SettlementMode: "platform_managed",
|
||||
ManagedAdminID: &admin.ID,
|
||||
}
|
||||
if err := tx.Create(&listing).Error; err != nil {
|
||||
return err
|
||||
|
||||
@@ -127,6 +127,9 @@ func (row listingRow) toDTO() ListingDTO {
|
||||
InTransaction: row.InTransaction,
|
||||
Status: row.Status,
|
||||
ReviewStatus: reviewStatus,
|
||||
HandoffMode: row.HandoffMode,
|
||||
SettlementMode: row.SettlementMode,
|
||||
ManagedAdminID: row.ManagedAdminID,
|
||||
ReviewReason: reviewReason,
|
||||
PublishedAt: row.PublishedAt,
|
||||
CreatedAt: row.CreatedAt,
|
||||
@@ -159,6 +162,9 @@ func toDTO(account model.GameAccount, listing model.RentalListing) *ListingDTO {
|
||||
InTransaction: listing.InTransaction,
|
||||
Status: listing.Status,
|
||||
ReviewStatus: reviewStatus,
|
||||
HandoffMode: listing.HandoffMode,
|
||||
SettlementMode: listing.SettlementMode,
|
||||
ManagedAdminID: listing.ManagedAdminID,
|
||||
ReviewReason: reviewReason,
|
||||
PublishedAt: listing.PublishedAt,
|
||||
CreatedAt: listing.CreatedAt,
|
||||
|
||||
@@ -63,6 +63,9 @@ func (r *Repository) TransferOwner(ctx context.Context, adminID uint64, listingI
|
||||
|
||||
beforeOwnerID := listing.OwnerID
|
||||
listing.OwnerID = target.ID
|
||||
listing.HandoffMode = "owner"
|
||||
listing.SettlementMode = "owner_wallet"
|
||||
listing.ManagedAdminID = nil
|
||||
account.OwnerID = target.ID
|
||||
if err := tx.Save(account).Error; err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user