@@ -59,21 +59,6 @@ func (s Status) Extendable() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Demo : modèle GORM d'une démo.
|
||||
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" }
|
||||
|
||||
// ResourceStatus : état d'un slot de pool.
|
||||
type ResourceStatus string
|
||||
|
||||
@@ -81,16 +66,3 @@ const (
|
||||
ResourceFree ResourceStatus = "free"
|
||||
ResourceBorrowed ResourceStatus = "borrowed"
|
||||
)
|
||||
|
||||
// ExternalResource : slot pré-provisionné (table external_pool).
|
||||
// On stocke une *référence* au secret (SecretRef), jamais le secret en clair.
|
||||
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" }
|
||||
|
||||
Reference in New Issue
Block a user