Fix Commit
This commit is contained in:
@@ -45,18 +45,18 @@ const (
|
||||
)
|
||||
|
||||
type Campaign struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
Name string `gorm:"type:varchar(150);not null" json:"name"`
|
||||
Description *string `gorm:"type:text" json:"description,omitempty"`
|
||||
Type CampaignType `gorm:"type:varchar(50);not null" json:"type"`
|
||||
StartDate time.Time `gorm:"type:timestamp;not null" json:"start_date"`
|
||||
EndDate time.Time `gorm:"type:timestamp;not null" json:"end_date"`
|
||||
IsActive bool `gorm:"type:boolean;default:true" json:"is_active"`
|
||||
ShowOnApp bool `gorm:"type:boolean;default:true" json:"show_on_app"`
|
||||
Position int `gorm:"type:int;default:0" json:"position"`
|
||||
Metadata *map[string]interface{} `gorm:"type:jsonb" json:"metadata,omitempty"`
|
||||
CreatedAt time.Time `gorm:"type:timestamp;default:now()" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"type:timestamp;default:now()" json:"updated_at"`
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
Name string `gorm:"type:varchar(150);not null" json:"name"`
|
||||
Description *string `gorm:"type:text" json:"description,omitempty"`
|
||||
Type CampaignType `gorm:"type:varchar(50);not null" json:"type"`
|
||||
StartDate time.Time `gorm:"type:timestamp;not null" json:"start_date"`
|
||||
EndDate time.Time `gorm:"type:timestamp;not null" json:"end_date"`
|
||||
IsActive bool `gorm:"type:boolean;default:true" json:"is_active"`
|
||||
ShowOnApp bool `gorm:"type:boolean;default:true" json:"show_on_app"`
|
||||
Position int `gorm:"type:int;default:0" json:"position"`
|
||||
Metadata *Metadata `gorm:"type:jsonb" json:"metadata,omitempty"`
|
||||
CreatedAt time.Time `gorm:"type:timestamp;default:now()" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"type:timestamp;default:now()" json:"updated_at"`
|
||||
|
||||
// Relations
|
||||
Rules []CampaignRule `gorm:"foreignKey:CampaignID;constraint:OnDelete:CASCADE" json:"rules,omitempty"`
|
||||
@@ -79,17 +79,17 @@ func (c *Campaign) BeforeUpdate(tx *gorm.DB) error {
|
||||
}
|
||||
|
||||
type CampaignRule struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
CampaignID uuid.UUID `gorm:"type:uuid;not null" json:"campaign_id"`
|
||||
RuleType RuleType `gorm:"type:varchar(50);not null" json:"rule_type"`
|
||||
ConditionValue *string `gorm:"type:varchar(255)" json:"condition_value,omitempty"`
|
||||
RewardType CampaignRewardType `gorm:"type:varchar(50);not null" json:"reward_type"`
|
||||
RewardValue *int64 `gorm:"type:bigint" json:"reward_value,omitempty"`
|
||||
RewardSubtype *RewardSubtype `gorm:"type:varchar(50)" json:"reward_subtype,omitempty"`
|
||||
RewardRefID *uuid.UUID `gorm:"type:uuid" json:"reward_ref_id,omitempty"`
|
||||
Metadata *map[string]interface{} `gorm:"type:jsonb" json:"metadata,omitempty"`
|
||||
CreatedAt time.Time `gorm:"type:timestamp;default:now()" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"type:timestamp;default:now()" json:"updated_at"`
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
|
||||
CampaignID uuid.UUID `gorm:"type:uuid;not null" json:"campaign_id"`
|
||||
RuleType RuleType `gorm:"type:varchar(50);not null" json:"rule_type"`
|
||||
ConditionValue *string `gorm:"type:varchar(255)" json:"condition_value,omitempty"`
|
||||
RewardType CampaignRewardType `gorm:"type:varchar(50);not null" json:"reward_type"`
|
||||
RewardValue *int64 `gorm:"type:bigint" json:"reward_value,omitempty"`
|
||||
RewardSubtype *RewardSubtype `gorm:"type:varchar(50)" json:"reward_subtype,omitempty"`
|
||||
RewardRefID *uuid.UUID `gorm:"type:uuid" json:"reward_ref_id,omitempty"`
|
||||
Metadata *Metadata `gorm:"type:jsonb" json:"metadata,omitempty"`
|
||||
CreatedAt time.Time `gorm:"type:timestamp;default:now()" json:"created_at"`
|
||||
UpdatedAt time.Time `gorm:"type:timestamp;default:now()" json:"updated_at"`
|
||||
|
||||
// Relations
|
||||
Campaign Campaign `gorm:"foreignKey:CampaignID" json:"campaign,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user