38 lines
1.6 KiB
Go
38 lines
1.6 KiB
Go
package demos
|
|
|
|
import "time"
|
|
|
|
type Demo struct {
|
|
ID string `gorm:"type:uuid;primaryKey" json:"id"`
|
|
Username string `gorm:"type:varchar(64);index" json:"username,omitempty"`
|
|
LeadID string `gorm:"type:varchar(36);index" json:"lead_id,omitempty"`
|
|
Status Status `gorm:"size:20;not null;index" json:"status"`
|
|
Namespace string `gorm:"size:63;uniqueIndex" json:"namespace"`
|
|
URL string `gorm:"size:255" json:"url"`
|
|
TypeAbo string `gorm:"type:varchar(35)" json:"type_abonnement"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
ExpiresAt time.Time `json:"expires_at"`
|
|
}
|
|
|
|
func (Demo) TableName() string { return "demos" }
|
|
|
|
type ExternalResource struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
Service string `gorm:"size:20;not null;index:idx_service_status" json:"service"`
|
|
Label string `gorm:"size:120" json:"label"` // ex. "@omnex_demo_bot_1"
|
|
SecretRef string `gorm:"size:200;not null" json:"-"` // clé dans le secret manager
|
|
Status ResourceStatus `gorm:"size:20;not null;index:idx_service_status" json:"status"`
|
|
DemoID string `gorm:"type:varchar(36);index" json:"demo_id,omitempty"` // FK optionnelle (vide si libre)
|
|
}
|
|
|
|
func (ExternalResource) TableName() string { return "external_pool" }
|
|
|
|
type ResourceState struct {
|
|
APIState string `gorm:"size:20;not null" json:"api_state"`
|
|
WebState string `gorm:"size:20;not null" json:"web_state"`
|
|
DBState string `gorm:"size:20;not null" json:"db_state"`
|
|
DBMemoryState string `gorm:"size:20;not null" json:"dbm_state"`
|
|
}
|
|
|
|
func (ResourceState) TableName() string { return "ressource_state" }
|