180 lines
7.4 KiB
Go
180 lines
7.4 KiB
Go
package distribution
|
|
|
|
import "time"
|
|
|
|
type SiteDTO struct {
|
|
ID uint64 `json:"id"`
|
|
SiteCode string `json:"site_code"`
|
|
SiteName string `json:"site_name"`
|
|
Domain string `json:"domain"`
|
|
Status string `json:"status"`
|
|
DisplayAccountEnabled bool `json:"display_account_enabled"`
|
|
DefaultSupportGroupID *uint64 `json:"default_support_group_id,omitempty"`
|
|
TaxEnabled bool `json:"tax_enabled"`
|
|
TaxRateBPS int64 `json:"tax_rate_bps"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type CreateSiteRequest struct {
|
|
SiteCode string `json:"site_code" binding:"required,max=64"`
|
|
SiteName string `json:"site_name" binding:"required,max=128"`
|
|
Domain string `json:"domain" binding:"required,max=255"`
|
|
DisplayAccountEnabled *bool `json:"display_account_enabled"`
|
|
DefaultSupportGroupID *uint64 `json:"default_support_group_id"`
|
|
TaxEnabled *bool `json:"tax_enabled"`
|
|
TaxRateBPS *int64 `json:"tax_rate_bps"`
|
|
}
|
|
|
|
type UpdateSiteRequest struct {
|
|
SiteName *string `json:"site_name"`
|
|
Domain *string `json:"domain"`
|
|
Status *string `json:"status"`
|
|
DisplayAccountEnabled *bool `json:"display_account_enabled"`
|
|
DefaultSupportGroupID *uint64 `json:"default_support_group_id"`
|
|
TaxEnabled *bool `json:"tax_enabled"`
|
|
TaxRateBPS *int64 `json:"tax_rate_bps"`
|
|
}
|
|
|
|
type RuleDTO struct {
|
|
ID uint64 `json:"id"`
|
|
SiteID *uint64 `json:"site_id,omitempty"`
|
|
Mode string `json:"mode"`
|
|
Version int `json:"version"`
|
|
Status string `json:"status"`
|
|
PlatformReceiveRatio float64 `json:"platform_receive_ratio"`
|
|
PlatformSellRatio float64 `json:"platform_sell_ratio"`
|
|
DistributorReceiveRatio float64 `json:"distributor_receive_ratio"`
|
|
DistributorSellRatio float64 `json:"distributor_sell_ratio"`
|
|
DistributorARatio float64 `json:"distributor_a_ratio"`
|
|
DistributorBRatio float64 `json:"distributor_b_ratio"`
|
|
ServiceFeeValue float64 `json:"service_fee_value"`
|
|
ServiceFeeUnit string `json:"service_fee_unit"`
|
|
PaymentFeeBPS int64 `json:"payment_fee_bps"`
|
|
TaxEnabled bool `json:"tax_enabled"`
|
|
TaxRateBPS int64 `json:"tax_rate_bps"`
|
|
EffectiveFrom time.Time `json:"effective_from"`
|
|
EffectiveTo *time.Time `json:"effective_to,omitempty"`
|
|
CreatedBy *uint64 `json:"created_by,omitempty"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
type CreateRuleRequest struct {
|
|
SiteID *uint64 `json:"site_id"`
|
|
Mode string `json:"mode" binding:"required"`
|
|
PlatformReceiveRatio float64 `json:"platform_receive_ratio"`
|
|
PlatformSellRatio float64 `json:"platform_sell_ratio"`
|
|
DistributorReceiveRatio float64 `json:"distributor_receive_ratio"`
|
|
DistributorSellRatio float64 `json:"distributor_sell_ratio"`
|
|
DistributorARatio float64 `json:"distributor_a_ratio"`
|
|
DistributorBRatio float64 `json:"distributor_b_ratio"`
|
|
ServiceFeeValue float64 `json:"service_fee_value"`
|
|
ServiceFeeUnit string `json:"service_fee_unit" binding:"required"`
|
|
PaymentFeeBPS int64 `json:"payment_fee_bps"`
|
|
TaxEnabled bool `json:"tax_enabled"`
|
|
TaxRateBPS int64 `json:"tax_rate_bps"`
|
|
EffectiveFrom time.Time `json:"effective_from"`
|
|
}
|
|
|
|
type UpdateRuleStatusRequest struct {
|
|
Status string `json:"status" binding:"required,oneof=draft active disabled"`
|
|
}
|
|
|
|
type DistributionOrderDTO struct {
|
|
OrderID uint64 `json:"order_id"`
|
|
OrderNo string `json:"order_no"`
|
|
SiteID uint64 `json:"site_id"`
|
|
ListingID uint64 `json:"listing_id"`
|
|
AccountID uint64 `json:"account_id"`
|
|
OwnerID uint64 `json:"owner_id"`
|
|
RenterID uint64 `json:"renter_id"`
|
|
Status string `json:"status"`
|
|
HandoffStatus string `json:"handoff_status"`
|
|
RefundStatus string `json:"refund_status"`
|
|
SettlementStatus string `json:"settlement_status"`
|
|
DistributionMode string `json:"distribution_mode"`
|
|
GrossPaidAmountCent int64 `json:"gross_paid_amount_cent"`
|
|
RefundAmountCent int64 `json:"refund_amount_cent"`
|
|
NetPaidAmountCent int64 `json:"net_paid_amount_cent"`
|
|
PaymentFeeCent int64 `json:"payment_fee_cent"`
|
|
ServiceFeeCent int64 `json:"service_fee_cent"`
|
|
MarkupAmountCent int64 `json:"markup_amount_cent"`
|
|
TaxAmountCent int64 `json:"tax_amount_cent"`
|
|
SplitBaseAmountCent int64 `json:"split_base_amount_cent"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
type DistributionOrderListQuery struct {
|
|
SiteID uint64
|
|
Kind string
|
|
Status string
|
|
Page int
|
|
Size int
|
|
}
|
|
|
|
type DistributionOrderPage struct {
|
|
Items []DistributionOrderDTO `json:"items"`
|
|
Total int64 `json:"total"`
|
|
Page int `json:"page"`
|
|
PageSize int `json:"page_size"`
|
|
}
|
|
|
|
type AccountDisplayDTO struct {
|
|
ID uint64 `json:"id"`
|
|
SiteID uint64 `json:"site_id"`
|
|
AccountID uint64 `json:"account_id"`
|
|
ListingID uint64 `json:"listing_id"`
|
|
DisplayStatus string `json:"display_status"`
|
|
}
|
|
|
|
type UpdateAccountDisplayRequest struct {
|
|
DisplayStatus string `json:"display_status" binding:"required,oneof=enabled disabled sold offline"`
|
|
}
|
|
|
|
type PaymentChannelDTO struct {
|
|
ID uint64 `json:"id"`
|
|
SiteID uint64 `json:"site_id"`
|
|
ConfigID uint64 `json:"config_id"`
|
|
Priority int `json:"priority"`
|
|
Status string `json:"status"`
|
|
}
|
|
|
|
type BindPaymentChannelRequest struct {
|
|
ConfigID uint64 `json:"config_id" binding:"required"`
|
|
Priority int `json:"priority"`
|
|
}
|
|
|
|
type SettlementBatchDTO struct {
|
|
ID uint64 `json:"id"`
|
|
SiteID uint64 `json:"site_id"`
|
|
BatchNo string `json:"batch_no"`
|
|
PeriodStart time.Time `json:"period_start"`
|
|
PeriodEnd time.Time `json:"period_end"`
|
|
TotalAmountCent int64 `json:"total_amount_cent"`
|
|
Status string `json:"status"`
|
|
}
|
|
|
|
type CreateSettlementBatchRequest struct {
|
|
SiteID uint64 `json:"site_id" binding:"required"`
|
|
PeriodStart time.Time `json:"period_start" binding:"required"`
|
|
PeriodEnd time.Time `json:"period_end" binding:"required"`
|
|
}
|
|
|
|
type SnapshotPartyRequest struct {
|
|
PartyRole string `json:"party_role" binding:"required"`
|
|
PartyType string `json:"party_type" binding:"required"`
|
|
PartyID uint64 `json:"party_id"`
|
|
Ratio float64 `json:"ratio"`
|
|
IncomeAmountCent int64 `json:"income_amount_cent"`
|
|
CostAmountCent int64 `json:"cost_amount_cent"`
|
|
}
|
|
|
|
type CreateFinancialSnapshotRequest struct {
|
|
SiteID uint64 `json:"site_id" binding:"required"`
|
|
RuleVersionID uint64 `json:"rule_version_id" binding:"required"`
|
|
GrossPaidAmountCent int64 `json:"gross_paid_amount_cent"`
|
|
RefundAmountCent int64 `json:"refund_amount_cent"`
|
|
MarkupAmountCent int64 `json:"markup_amount_cent"`
|
|
Parties []SnapshotPartyRequest `json:"parties"`
|
|
}
|