- Implement tests for player configuration creation, update, and deletion, ensuring proper handling of free and paid user scenarios. - Add tests for referral registration, including valid and invalid referrer cases. - Create tests for referral reward flow, verifying correct reward distribution and eligibility. - Establish a test database setup with necessary schema for user, plan, payment, and notification models. - Introduce helper functions for seeding test data and loading entities from the database.
39 lines
2.4 KiB
Go
39 lines
2.4 KiB
Go
// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
// Code generated by gorm.io/gen. DO NOT EDIT.
|
|
|
|
package model
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
const TableNamePlayerConfig = "player_configs"
|
|
|
|
// PlayerConfig mapped from table <player_configs>
|
|
type PlayerConfig struct {
|
|
ID string `gorm:"column:id;type:uuid;primaryKey;default:gen_random_uuid()" json:"id"`
|
|
UserID string `gorm:"column:user_id;type:uuid;not null;uniqueIndex:idx_player_configs_one_default_per_user,priority:1;index:idx_player_configs_user_default,priority:2;index:idx_player_configs_user_id,priority:1" json:"user_id"`
|
|
Name string `gorm:"column:name;type:text;not null" json:"name"`
|
|
Description *string `gorm:"column:description;type:text" json:"description"`
|
|
Autoplay bool `gorm:"column:autoplay;type:boolean;not null" json:"autoplay"`
|
|
Loop bool `gorm:"column:loop;type:boolean;not null" json:"loop"`
|
|
Muted bool `gorm:"column:muted;type:boolean;not null" json:"muted"`
|
|
ShowControls *bool `gorm:"column:show_controls;type:boolean;not null;default:true" json:"show_controls"`
|
|
Pip *bool `gorm:"column:pip;type:boolean;not null;default:true" json:"pip"`
|
|
Airplay *bool `gorm:"column:airplay;type:boolean;not null;default:true" json:"airplay"`
|
|
Chromecast *bool `gorm:"column:chromecast;type:boolean;not null;default:true" json:"chromecast"`
|
|
IsActive *bool `gorm:"column:is_active;type:boolean;not null;default:true" json:"is_active"`
|
|
IsDefault bool `gorm:"column:is_default;type:boolean;not null;index:idx_player_configs_user_default,priority:1;index:idx_player_configs_is_default,priority:1" json:"is_default"`
|
|
CreatedAt *time.Time `gorm:"column:created_at;type:timestamp(3) without time zone;not null;default:CURRENT_TIMESTAMP" json:"created_at"`
|
|
UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp(3) without time zone;not null" json:"updated_at"`
|
|
Version *int64 `gorm:"column:version;type:bigint;not null;default:1;version" json:"-"`
|
|
EncrytionM3u8 *bool `gorm:"column:encrytion_m3u8;type:boolean;not null;default:true" json:"encrytion_m3u8"`
|
|
LogoURL *string `gorm:"column:logo_url;type:character varying(500)" json:"logo_url"`
|
|
}
|
|
|
|
// TableName PlayerConfig's table name
|
|
func (*PlayerConfig) TableName() string {
|
|
return TableNamePlayerConfig
|
|
}
|