Assignment Policy
What It Models
The assignment policy defines the customer’s geographic coverage and which address supplies each placement decision. It combines automatic assignment, participating record kinds, address sources and ordered rules. Saving it changes coverage for future decisions; staff use recalculation to apply it across existing records.
Identity and Attributes
The workspace identifies its single policy. Rules are owned children with stable identifiers and ordered positions. Postal, state and country rules carry their corresponding criteria; fallback rules carry no geographic list. Disabled rules remain stored but do not match. The generation counts policy writes, and the read computes whether a completed run covers that generation.
Relationships
Rules refer to catalogue regions. Typed address choices refer to Entities’ address types, preventing their deletion while selected. Placements read the policy, and recalculation runs remember the generation under which they began.
Invariants
Persistence coordinates writers through an existing policy row. The database checks reference integrity, unique positive positions and selected criterion shapes. Service normalization and validation supply additional rules, including dense final ordering and required postal coverage. An absent settings row does not provide a lock for competing first saves.
How It Is Stored and Shared
Regions persists settings, rules and postal child ranges. Export packages a saved policy with its ordered rules and omits the private generation. Regional imports load definitions only. Workspace cleanup removes policy before its referenced address types.
Open Design Questions
Whole-policy replacement recreates retained rules at version one, which weakens concurrent individual editing. Policy reads do not request the available read lock, so settings and criteria may come from different saves. Optional settings versions, unchanged saves and reversed postal intervals also need resolution.