package database import ( "time" ) type Subscribe struct { ID string `gorm:"primaryKey" json:"id"` SubscribePlanID string `gorm:"not null" json:"subscribe_plan_id"` StartDate time.Time `gorm:"default:CURRENT_TIMESTAMP"` EndDate time.Time `gorm:"default:null"` Status int8 `gorm:"default:0"` AutoRenew bool `gorm:"default:true"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"` UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"` DeletedAt time.Time `gorm:"default:null" json:"deleted_at"` SubscribePlan SubscribePlan `gorm:"foreignKey:SubscribePlanID;constraint:OnDelete:CASCADE" json:"subscribe_plan"` } type SubscribePlan struct { ID string `gorm:"primaryKey" json:"id"` Code string `gorm:"not null;unique" json:"code"` Name string `gorm:"not null" json:"name"` Length int `gorm:"default:0" json:"length"` Price float32 `gorm:"default:0" json:"price"` Status int8 `gorm:"default:1" json:"status"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"` UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"` }