feat(commerce): add SellerTransfer model
This commit is contained in:
parent
553bd87d85
commit
6a468e5ffb
1 changed files with 22 additions and 0 deletions
|
|
@ -225,3 +225,25 @@ func (pr *ProductReview) BeforeCreate(tx *gorm.DB) (err error) {
|
|||
}
|
||||
return
|
||||
}
|
||||
|
||||
// SellerTransfer tracks a Stripe Connect transfer for a completed order (v0.603)
|
||||
type SellerTransfer struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
|
||||
SellerID uuid.UUID `gorm:"type:uuid;not null" json:"seller_id"`
|
||||
OrderID uuid.UUID `gorm:"type:uuid;not null" json:"order_id"`
|
||||
StripeTransferID string `gorm:"size:255" json:"stripe_transfer_id,omitempty"`
|
||||
AmountCents int64 `gorm:"not null" json:"amount_cents"`
|
||||
PlatformFeeCents int64 `gorm:"not null" json:"platform_fee_cents"`
|
||||
Currency string `gorm:"size:3;default:'EUR'" json:"currency"`
|
||||
Status string `gorm:"size:50;default:'pending'" json:"status"`
|
||||
ErrorMessage string `gorm:"type:text" json:"error_message,omitempty"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`
|
||||
}
|
||||
|
||||
func (st *SellerTransfer) BeforeCreate(tx *gorm.DB) (err error) {
|
||||
if st.ID == uuid.Nil {
|
||||
st.ID = uuid.New()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue