54 lines
2.3 KiB
Go
54 lines
2.3 KiB
Go
|
|
package models
|
||
|
|
|
||
|
|
import (
|
||
|
|
"time"
|
||
|
|
)
|
||
|
|
|
||
|
|
type PartnerSettingsDB struct {
|
||
|
|
PartnerID int64 `gorm:"primaryKey;column:partner_id"`
|
||
|
|
TaxEnabled bool `gorm:"column:tax_enabled;default:false"`
|
||
|
|
TaxPercentage float64 `gorm:"column:tax_percentage;default:10.00"`
|
||
|
|
InvoicePrefix string `gorm:"column:invoice_prefix;default:INV"`
|
||
|
|
BusinessHours string `gorm:"column:business_hours;type:json"` // JSON string
|
||
|
|
LogoURL string `gorm:"column:logo_url"`
|
||
|
|
ThemeColor string `gorm:"column:theme_color;default:#000000"`
|
||
|
|
ReceiptFooterText string `gorm:"column:receipt_footer_text;type:text"`
|
||
|
|
ReceiptHeaderText string `gorm:"column:receipt_header_text;type:text"`
|
||
|
|
CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP"`
|
||
|
|
UpdatedAt time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP"`
|
||
|
|
}
|
||
|
|
|
||
|
|
func (PartnerSettingsDB) TableName() string {
|
||
|
|
return "partner_settings"
|
||
|
|
}
|
||
|
|
|
||
|
|
type PartnerPaymentMethodDB struct {
|
||
|
|
ID int64 `gorm:"primaryKey;column:id;autoIncrement"`
|
||
|
|
PartnerID int64 `gorm:"column:partner_id;index:idx_partner_payment"`
|
||
|
|
PaymentMethod string `gorm:"column:payment_method;index:idx_partner_payment"`
|
||
|
|
IsEnabled bool `gorm:"column:is_enabled;default:true"`
|
||
|
|
DisplayName string `gorm:"column:display_name"`
|
||
|
|
DisplayOrder int `gorm:"column:display_order;default:0"`
|
||
|
|
AdditionalInfo string `gorm:"column:additional_info;type:json"` // JSON string
|
||
|
|
CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP"`
|
||
|
|
UpdatedAt time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP"`
|
||
|
|
}
|
||
|
|
|
||
|
|
func (PartnerPaymentMethodDB) TableName() string {
|
||
|
|
return "partner_payment_methods"
|
||
|
|
}
|
||
|
|
|
||
|
|
type PartnerFeatureFlagDB struct {
|
||
|
|
ID int64 `gorm:"primaryKey;column:id;autoIncrement"`
|
||
|
|
PartnerID int64 `gorm:"column:partner_id;index:idx_partner_feature"`
|
||
|
|
FeatureKey string `gorm:"column:feature_key;index:idx_partner_feature"`
|
||
|
|
IsEnabled bool `gorm:"column:is_enabled;default:true"`
|
||
|
|
Config string `gorm:"column:config;type:json"` // JSON string
|
||
|
|
CreatedAt time.Time `gorm:"column:created_at;default:CURRENT_TIMESTAMP"`
|
||
|
|
UpdatedAt time.Time `gorm:"column:updated_at;default:CURRENT_TIMESTAMP"`
|
||
|
|
}
|
||
|
|
|
||
|
|
func (PartnerFeatureFlagDB) TableName() string {
|
||
|
|
return "partner_feature_flags"
|
||
|
|
}
|