Locations and Party Sites
The PRM module separates the concept of a physical location from the concept of a party using that location. The prm_locations view stores addresses, while the prm_party_sites view links parties to locations and describes how each location is used.
Why locations are separate from parties
A single physical address may be shared by multiple parties — for example, several companies in the same office building, or a franchise location used by both a brand owner and a franchisee. By storing locations independently, the model avoids duplicating address data and makes it straightforward to update an address in one place when it changes.
What a location record contains
Each location stores a structured address:
- Address lines — street address fields for the physical location
- City, state, postal code — standard address components
- Country — the country where the location resides
- Geolocation — optional latitude and longitude coordinates, enabling map-based features and distance calculations
Locations also carry the standard PRM lifecycle columns: active flag, start and end dates, and audit fields.
Party sites
The prm_party_sites view links parties to locations. Each party site record captures:
- party_id — the party that uses this location
- location_id — the physical location being used
- Use code — a value describing how the party uses the location (e.g. headquarters, warehouse, branch office, billing address)
A single party can have multiple sites (a head office and several branch offices), and a single location can be associated with multiple parties (co-tenancy). The use code distinguishes the purpose of each association.
Typical use patterns
Multiple sites per party
An organisation typically has several physical locations — a headquarters, regional offices, and perhaps a warehouse. Each of these is a separate location record linked to the organisation through a party site with an appropriate use code.
Shared locations
When multiple parties occupy the same physical address, a single location record is linked to each party through separate party site rows. This keeps the address data normalised and avoids drift between copies.
Time-bounded sites
Party sites inherit the standard start and end date columns. A party that leases office space for a fixed term can have a site record with matching dates, automatically reflecting when the association is valid.