Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,25 @@ const (
type DistanceControl struct {
bun.BaseModel `bun:"table:distance_controls,alias:dc" json:"-"`

ID pulid.ID `json:"id" bun:"id,type:VARCHAR(100),pk,notnull"`
BusinessUnitID pulid.ID `json:"businessUnitId" bun:"business_unit_id,type:VARCHAR(100),pk,notnull"`
OrganizationID pulid.ID `json:"organizationId" bun:"organization_id,type:VARCHAR(100),pk,notnull"`
StoreMileage bool `json:"storeMileage" bun:"store_mileage,type:BOOLEAN,notnull"`
StoredDistanceUnits string `json:"storedDistanceUnits" bun:"stored_distance_units,type:VARCHAR(50),notnull"`
PostalCodeFallbackToCity bool `json:"postalCodeFallbackToCity" bun:"postal_code_fallback_to_city,type:BOOLEAN,notnull"`
AutoCreateStoredMileage bool `json:"autoCreateStoredMileage" bun:"auto_create_stored_mileage,type:BOOLEAN,notnull"`
LoadedMoveDistanceProfileID pulid.ID `json:"loadedMoveDistanceProfileId" bun:"loaded_move_distance_profile_id,type:VARCHAR(100),notnull"`
EmptyMoveDistanceProfileID pulid.ID `json:"emptyMoveDistanceProfileId" bun:"empty_move_distance_profile_id,type:VARCHAR(100),notnull"`
PayDistanceProfileID pulid.ID `json:"payDistanceProfileId" bun:"pay_distance_profile_id,type:VARCHAR(100),notnull"`
BillingDistanceProfileID pulid.ID `json:"billingDistanceProfileId" bun:"billing_distance_profile_id,type:VARCHAR(100),notnull"`
FuelDistanceProfileID pulid.ID `json:"fuelDistanceProfileId" bun:"fuel_distance_profile_id,type:VARCHAR(100),notnull"`
EtaOutOfRouteDistanceProfileID pulid.ID `json:"etaOutOfRouteDistanceProfileId" bun:"eta_out_of_route_distance_profile_id,type:VARCHAR(100),notnull"`
DistanceCalculatorShortestDistanceProfileID pulid.ID `json:"distanceCalculatorShortestDistanceProfileId" bun:"distance_calculator_shortest_distance_profile_id,type:VARCHAR(100),notnull"`
ID pulid.ID `json:"id" bun:"id,type:VARCHAR(100),pk,notnull"`
BusinessUnitID pulid.ID `json:"businessUnitId" bun:"business_unit_id,type:VARCHAR(100),pk,notnull"`
OrganizationID pulid.ID `json:"organizationId" bun:"organization_id,type:VARCHAR(100),pk,notnull"`
StoreMileage bool `json:"storeMileage" bun:"store_mileage,type:BOOLEAN,notnull"`
StoredDistanceUnits string `json:"storedDistanceUnits" bun:"stored_distance_units,type:VARCHAR(50),notnull"`
PostalCodeFallbackToCity bool `json:"postalCodeFallbackToCity" bun:"postal_code_fallback_to_city,type:BOOLEAN,notnull"`
AutoCreateStoredMileage bool `json:"autoCreateStoredMileage" bun:"auto_create_stored_mileage,type:BOOLEAN,notnull"`
LoadedMoveDistanceProfileID pulid.ID `json:"loadedMoveDistanceProfileId" bun:"loaded_move_distance_profile_id,type:VARCHAR(100),notnull"`
EmptyMoveDistanceProfileID pulid.ID `json:"emptyMoveDistanceProfileId" bun:"empty_move_distance_profile_id,type:VARCHAR(100),notnull"`
PayDistanceProfileID pulid.ID `json:"payDistanceProfileId" bun:"pay_distance_profile_id,type:VARCHAR(100),notnull"`
BillingDistanceProfileID pulid.ID `json:"billingDistanceProfileId" bun:"billing_distance_profile_id,type:VARCHAR(100),notnull"`
FuelDistanceProfileID pulid.ID `json:"fuelDistanceProfileId" bun:"fuel_distance_profile_id,type:VARCHAR(100),notnull"`
EtaOutOfRouteDistanceProfileID pulid.ID `json:"etaOutOfRouteDistanceProfileId" bun:"eta_out_of_route_distance_profile_id,type:VARCHAR(100),notnull"`
DistanceCalculatorShortestDistanceProfileID pulid.ID `json:"distanceCalculatorShortestDistanceProfileId" bun:"distance_calculator_shortest_distance_profile_id,type:VARCHAR(100),notnull"`
DistanceCalculatorPracticalDistanceProfileID pulid.ID `json:"distanceCalculatorPracticalDistanceProfileId" bun:"distance_calculator_practical_distance_profile_id,type:VARCHAR(100),notnull"`
Version int64 `json:"version" bun:"version,type:BIGINT,notnull"`
CreatedAt int64 `json:"createdAt" bun:"created_at,type:BIGINT,notnull,default:extract(epoch from current_timestamp)::bigint"`
UpdatedAt int64 `json:"updatedAt" bun:"updated_at,type:BIGINT,notnull,default:extract(epoch from current_timestamp)::bigint"`
SearchVector string `json:"-" bun:"search_vector,type:TSVECTOR,scanonly"`
Version int64 `json:"version" bun:"version,type:BIGINT,notnull"`
CreatedAt int64 `json:"createdAt" bun:"created_at,type:BIGINT,notnull,default:extract(epoch from current_timestamp)::bigint"`
UpdatedAt int64 `json:"updatedAt" bun:"updated_at,type:BIGINT,notnull,default:extract(epoch from current_timestamp)::bigint"`
SearchVector string `json:"-" bun:"search_vector,type:TSVECTOR,scanonly"`

BusinessUnit *tenant.BusinessUnit `json:"-" bun:"rel:belongs-to,join:business_unit_id=id"`
Organization *tenant.Organization `json:"-" bun:"rel:belongs-to,join:organization_id=id"`
Expand Down
6 changes: 3 additions & 3 deletions services/tms/internal/core/domain/tenant/agentcontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ type AgentControl struct {
BusinessUnitID pulid.ID `json:"businessUnitId" bun:"business_unit_id,type:VARCHAR(100),pk,notnull"`
OrganizationID pulid.ID `json:"organizationId" bun:"organization_id,type:VARCHAR(100),pk,notnull"`

ShadowMode bool `json:"shadowMode" bun:"shadow_mode,type:BOOLEAN,notnull,default:true"`
BillingAgentEnabled bool `json:"billingAgentEnabled" bun:"billing_agent_enabled,type:BOOLEAN,notnull"`
ShadowMode bool `json:"shadowMode" bun:"shadow_mode,type:BOOLEAN,notnull,default:true"`
BillingAgentEnabled bool `json:"billingAgentEnabled" bun:"billing_agent_enabled,type:BOOLEAN,notnull"`
// DispatchAgentEnabled gates the auto-assign agent separately from the billing agent,
// so enabling one never enables the other.
DispatchAgentEnabled bool `json:"dispatchAgentEnabled" bun:"dispatch_agent_enabled,type:BOOLEAN,notnull"`
DispatchAgentEnabled bool `json:"dispatchAgentEnabled" bun:"dispatch_agent_enabled,type:BOOLEAN,notnull"`
// DispatchAutonomyTier is an agent.AutonomyTier. It is held as a string because the
// agent domain already depends on this package, and importing it back would cycle.
DispatchAutonomyTier string `json:"dispatchAutonomyTier" bun:"dispatch_autonomy_tier,type:agent_autonomy_tier_enum,notnull,default:'Propose'"`
Expand Down
Loading