diff --git a/veza-backend-api/internal/core/marketplace/models.go b/veza-backend-api/internal/core/marketplace/models.go index 7c5e0446f..2c097a6ce 100644 --- a/veza-backend-api/internal/core/marketplace/models.go +++ b/veza-backend-api/internal/core/marketplace/models.go @@ -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 +}