postalAddress concept personal data
A place a party receives post or may be visited
Model arcaParty . Written in commons/data/models/arca/party.ts:237 . Identified by postalAddressId.
# Governance: attributescountryCodetext(max 2) required personal data The country, as its two-letter ISO 3166-1 code
Becomes the column country_code of postal_address.
Annotations: privacy.personal={"category":"Country","purposes":["address the party"]}
Written at commons/data/models/arca/party.ts:249
line1text required personal data The first line: usually the building and the street
Becomes the column line_1 of postal_address.
Annotations: privacy.personal={"category":"PhysicalAddress","purposes":["reach the party by post","find where the party is"]}
Written at commons/data/models/arca/party.ts:244
line2text optional personal data The second line, where there is one
Becomes the column line_2 of postal_address.
Annotations: privacy.personal={"category":"PhysicalAddress","purposes":["reach the party by post","find where the party is"]}
Written at commons/data/models/arca/party.ts:245
localitytext required personal data The town or city
Becomes the column locality of postal_address.
Annotations: privacy.personal={"category":"PhysicalAddress","purposes":["reach the party by post","find where the party is"]}
Written at commons/data/models/arca/party.ts:246
postalAddressIdidentifier required What identifies the address
Becomes the column postal_address_id of postal_address.
Written at commons/data/models/arca/party.ts:240
postalCodetext optional personal data The postal code, where the country uses one
Becomes the column postal_code of postal_address.
Annotations: privacy.personal={"category":"PhysicalAddress","purposes":["reach the party by post","find where the party is"]}
Written at commons/data/models/arca/party.ts:248
purposecode of addressPurpose required What the address is used for: where the party lives, is billed or receives deliveries
Becomes the column purpose of postal_address.
Written at commons/data/models/arca/party.ts:241
regiontext optional personal data The state, province or county, where the country uses one
Becomes the column region of postal_address.
Annotations: privacy.personal={"category":"PhysicalAddress","purposes":["reach the party by post","find where the party is"]}
Written at commons/data/models/arca/party.ts:247
# Governance: relationshipsThe party found at the address To party . Written at commons/data/models/arca/party.ts:237
# Logical: the tableProjects to the table postal_address with the primary key postal_address_id.
# Physical: SQLduckdb postgres sqlite
CREATE TABLE IF NOT EXISTS "postal_address" (
"postal_address_id" VARCHAR NOT NULL PRIMARY KEY ,
"purpose" VARCHAR NOT NULL ,
"line_1" VARCHAR NOT NULL ,
"line_2" VARCHAR ,
"locality" VARCHAR NOT NULL ,
"region" VARCHAR ,
"postal_code" VARCHAR ,
"country_code" VARCHAR NOT NULL ,
"party_id" VARCHAR NOT NULL ,
CONSTRAINT "postal_address_party_id_fk" FOREIGN KEY ("party_id") REFERENCES "party" ("party_id"),
CONSTRAINT "postal_address_purpose_ck" CHECK ("purpose" IN ('home' , 'work' , 'billing' , 'delivery' ))
);CREATE TABLE IF NOT EXISTS "postal_address" (
"postal_address_id" TEXT NOT NULL PRIMARY KEY ,
"purpose" TEXT NOT NULL ,
"line_1" TEXT NOT NULL ,
"line_2" TEXT ,
"locality" TEXT NOT NULL ,
"region" TEXT ,
"postal_code" TEXT ,
"country_code" VARCHAR (2 ) NOT NULL ,
"party_id" TEXT NOT NULL ,
CONSTRAINT "postal_address_party_id_fk" FOREIGN KEY ("party_id") REFERENCES "party" ("party_id"),
CONSTRAINT "postal_address_purpose_ck" CHECK ("purpose" IN ('home' , 'work' , 'billing' , 'delivery' ))
);CREATE TABLE IF NOT EXISTS "postal_address" (
"postal_address_id" TEXT NOT NULL PRIMARY KEY ,
"purpose" TEXT NOT NULL ,
"line_1" TEXT NOT NULL ,
"line_2" TEXT ,
"locality" TEXT NOT NULL ,
"region" TEXT ,
"postal_code" TEXT ,
"country_code" TEXT NOT NULL ,
"party_id" TEXT NOT NULL ,
CONSTRAINT "postal_address_party_id_fk" FOREIGN KEY ("party_id") REFERENCES "party" ("party_id"),
CONSTRAINT "postal_address_purpose_ck" CHECK ("purpose" IN ('home' , 'work' , 'billing' , 'delivery' ))
);# Physical: the typed tableRead and written from TypeScript with the types the model gives: import { postalAddress } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/arca-party.auto.ts : do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed" ;
import { postalAddress } from "@intellectual-frontiers/data/sql/typed/models" ;
const rows = await from (postalAddress).select ((s ) => ({ postalAddressId: s.postalAddress.postalAddressId, purpose: s.postalAddress.purpose })).run (runner);