29 lines
1.2 KiB
Go
29 lines
1.2 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
type AgentDecision struct {
|
|
ID uint64 `gorm:"primaryKey"`
|
|
DecisionType string `gorm:"size:50;index"`
|
|
BookingID *uint64 `gorm:"index"`
|
|
// TenantID scopes retrieval. Without it, similarity search would return one
|
|
// client's operational history as precedent for a decision about another —
|
|
// and because the engine feeds that precedent to the model, one tenant's
|
|
// past would shape another tenant's dispatch.
|
|
//
|
|
// Nullable because the engine does not always know the tenant (a B2C
|
|
// booking carries a nil tenantid by design). A NULL row is recallable only
|
|
// by a NULL-tenant query, never by a tenant's own — the safer default,
|
|
// given console logins are already unscoped when tenantid is NULL.
|
|
//
|
|
// Added before the table filled on purpose: adding it afterwards is a
|
|
// backfill with no way to attribute the rows already there.
|
|
TenantID *uint64 `gorm:"column:tenantid;index"`
|
|
Context string `gorm:"type:jsonb"`
|
|
Decision string `gorm:"type:jsonb"`
|
|
Reasoning string `gorm:"type:text"`
|
|
Outcome *string `gorm:"size:30;index"`
|
|
OutcomeRecordedAt *time.Time
|
|
CreatedAt time.Time
|
|
}
|