droboticflow/internal/domain/acceptance_priority.go
d-robotics b7f4924110 📊 Refresh acceptance priority statistics nightly
(cherry picked from commit fb4f6715bb58c1c512284d0651024ac890e6f896)
2026-11-18 20:29:20 +08:00

37 lines
1.6 KiB
Go

package domain
// AcceptancePriority changes admission order only, never production ownership or access.
// Empty ProjectIDs means all production projects in this organization.
type AcceptancePriority struct {
ID string `json:"-" bson:"_id"`
OrganizationID string `json:"-" bson:"organizationId"`
SupplierID string `json:"supplierId" bson:"supplierId"`
Enabled bool `json:"enabled" bson:"enabled"`
ProjectIDs []string `json:"projectIds" bson:"projectIds"`
ExpiresAt string `json:"expiresAt" bson:"expiresAt"`
Version int `json:"version" bson:"version"`
UpdatedAt string `json:"updatedAt,omitempty" bson:"updatedAt"`
UpdatedBy string `json:"updatedBy,omitempty" bson:"updatedBy"`
History []AcceptancePriorityChange `json:"-" bson:"history"`
}
type AcceptancePriorityChange struct {
Enabled bool `bson:"enabled"`
ProjectIDs []string `bson:"projectIds"`
ExpiresAt string `bson:"expiresAt"`
ActorID string `bson:"actorId"`
At string `bson:"at"`
}
// Counts are partitioned by the facts, independent of mutable policy versions.
type AcceptanceCount struct {
ProjectID string `bson:"projectId"`
SupplierID string `bson:"supplierId"`
Count int `bson:"count"`
}
type AcceptanceSnapshot struct {
OrganizationID string `bson:"_id"`
CompletedAt string `bson:"completedAt"`
Counts []AcceptanceCount `bson:"counts"`
}