feat: CR login, register, subscribe
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
package subsmodel
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type Subscribe struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
|
||||
SubscribePlanID uuid.UUID `gorm:"type:uuid;not null" json:"subscribe_plan_id"`
|
||||
StartDate time.Time `gorm:"default:CURRENT_TIMESTAMP"`
|
||||
EndDate time.Time `gorm:"default:null"`
|
||||
Status string `gorm:"default:'inactive'"`
|
||||
AutoRenew bool `gorm:"default:true"`
|
||||
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
|
||||
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
|
||||
|
||||
SubscribePlan SubscribePlan `gorm:"foreignKey:SubscribePlanID;constraint:OnDelete:CASCADE"`
|
||||
}
|
||||
|
||||
type SubscribePlan struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primaryKey" json:"id"`
|
||||
Code string `gorm:"not null" json:"code"`
|
||||
CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
|
||||
UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP"`
|
||||
}
|
||||
Reference in New Issue
Block a user