66 lines
4.0 KiB
Go
66 lines
4.0 KiB
Go
package model
|
|
|
|
import "time"
|
|
|
|
// FirstRechargeRewardConfig stores first recharge reward config per system.
|
|
type FirstRechargeRewardConfig struct {
|
|
ID int64 `gorm:"column:id;primaryKey"`
|
|
SysOrigin string `gorm:"column:sys_origin;size:32;uniqueIndex:uk_first_recharge_reward_sys_origin"`
|
|
Enabled bool `gorm:"column:enabled;index:idx_first_recharge_reward_enabled"`
|
|
CreateTime time.Time `gorm:"column:create_time"`
|
|
UpdateTime time.Time `gorm:"column:update_time"`
|
|
}
|
|
|
|
func (FirstRechargeRewardConfig) TableName() string { return "first_recharge_reward_config" }
|
|
|
|
// FirstRechargeRewardLevel stores a recharge threshold and reward resource group.
|
|
type FirstRechargeRewardLevel struct {
|
|
ID int64 `gorm:"column:id;primaryKey"`
|
|
ConfigID int64 `gorm:"column:config_id;uniqueIndex:uk_first_recharge_reward_level,priority:1;uniqueIndex:uk_first_recharge_reward_amount,priority:1;index:idx_first_recharge_reward_level_config"`
|
|
Level int `gorm:"column:level;uniqueIndex:uk_first_recharge_reward_level,priority:2"`
|
|
RechargeAmountCents int64 `gorm:"column:recharge_amount_cents;uniqueIndex:uk_first_recharge_reward_amount,priority:2"`
|
|
RewardGroupID int64 `gorm:"column:reward_group_id"`
|
|
RewardGroupName string `gorm:"column:reward_group_name;size:255"`
|
|
Enabled bool `gorm:"column:enabled"`
|
|
CreateTime time.Time `gorm:"column:create_time"`
|
|
UpdateTime time.Time `gorm:"column:update_time"`
|
|
}
|
|
|
|
func (FirstRechargeRewardLevel) TableName() string { return "first_recharge_reward_level" }
|
|
|
|
// FirstRechargeRewardGrantRecord stores the actual first recharge reward grant result.
|
|
type FirstRechargeRewardGrantRecord struct {
|
|
ID int64 `gorm:"column:id;primaryKey"`
|
|
EventID string `gorm:"column:event_id;size:128;uniqueIndex:uk_first_recharge_reward_event"`
|
|
ConfigID int64 `gorm:"column:config_id"`
|
|
LevelID int64 `gorm:"column:level_id"`
|
|
SysOrigin string `gorm:"column:sys_origin;size:32;uniqueIndex:uk_first_recharge_reward_user,priority:1;index:idx_first_recharge_reward_status,priority:1"`
|
|
UserID int64 `gorm:"column:user_id;uniqueIndex:uk_first_recharge_reward_user,priority:2;index:idx_first_recharge_reward_status,priority:2"`
|
|
Account string `gorm:"column:account;size:64"`
|
|
UserAvatar string `gorm:"column:user_avatar;size:1024"`
|
|
UserNickname string `gorm:"column:user_nickname;size:255"`
|
|
CountryCode string `gorm:"column:country_code;size:32"`
|
|
CountryName string `gorm:"column:country_name;size:128"`
|
|
RechargeAmountCents int64 `gorm:"column:recharge_amount_cents"`
|
|
RechargeThresholdCents int64 `gorm:"column:recharge_threshold_cents"`
|
|
Level int `gorm:"column:level"`
|
|
PayPlatform string `gorm:"column:pay_platform;size:64"`
|
|
PaymentMethod string `gorm:"column:payment_method;size:32"`
|
|
SourceOrderID string `gorm:"column:source_order_id;size:128;index:idx_first_recharge_reward_order"`
|
|
RewardGroupID int64 `gorm:"column:reward_group_id"`
|
|
RewardGroupName string `gorm:"column:reward_group_name;size:255"`
|
|
RewardGroupTrackID int64 `gorm:"column:reward_group_track_id"`
|
|
Status string `gorm:"column:status;size:32;index:idx_first_recharge_reward_status,priority:3"`
|
|
RewardGroupStatus string `gorm:"column:reward_group_status;size:32"`
|
|
RetryCount int `gorm:"column:retry_count"`
|
|
LastError string `gorm:"column:last_error;size:1024"`
|
|
EventTime time.Time `gorm:"column:event_time"`
|
|
SentAt *time.Time `gorm:"column:sent_at"`
|
|
CreateTime time.Time `gorm:"column:create_time"`
|
|
UpdateTime time.Time `gorm:"column:update_time"`
|
|
}
|
|
|
|
func (FirstRechargeRewardGrantRecord) TableName() string {
|
|
return "first_recharge_reward_grant_record"
|
|
}
|