electronicContact concept personal data
A way to reach a party over a network: an email address, a telephone number, a web address
Model arcaParty . Written in commons/data/models/arca/party.ts:213 . Identified by electronicContactId.
# Governance: attributesaddresstext required personal data The address or number itself
Becomes the column address of electronic_contact.
Annotations: privacy.personal={"category":"Contact","purposes":["reach the party"]}
Written at commons/data/models/arca/party.ts:218
Whether this is the first way to try for its medium
Becomes the column is_primary of electronic_contact.
Annotations: quality.default=false
Written at commons/data/models/arca/party.ts:219
mediumcode of contactMedium required Whether this is an email address, a telephone number or a web address
Becomes the column medium of electronic_contact.
Written at commons/data/models/arca/party.ts:217
# Governance: relationshipsThe party reached this way To party . Written at commons/data/models/arca/party.ts:213
# Logical: the tableProjects to the table electronic_contact with the primary key electronic_contact_id.
# Physical: SQLduckdb postgres sqlite
CREATE TABLE IF NOT EXISTS "electronic_contact" (
"electronic_contact_id" VARCHAR NOT NULL PRIMARY KEY ,
"medium" VARCHAR NOT NULL ,
"address" VARCHAR NOT NULL ,
"is_primary" BOOLEAN NOT NULL DEFAULT FALSE ,
"party_id" VARCHAR NOT NULL ,
CONSTRAINT "electronic_contact_party_id_fk" FOREIGN KEY ("party_id") REFERENCES "party" ("party_id"),
CONSTRAINT "electronic_contact_medium_ck" CHECK ("medium" IN ('email' , 'telephone' , 'web' ))
);CREATE TABLE IF NOT EXISTS "electronic_contact" (
"electronic_contact_id" TEXT NOT NULL PRIMARY KEY ,
"medium" TEXT NOT NULL ,
"address" TEXT NOT NULL ,
"is_primary" BOOLEAN NOT NULL DEFAULT FALSE ,
"party_id" TEXT NOT NULL ,
CONSTRAINT "electronic_contact_party_id_fk" FOREIGN KEY ("party_id") REFERENCES "party" ("party_id"),
CONSTRAINT "electronic_contact_medium_ck" CHECK ("medium" IN ('email' , 'telephone' , 'web' ))
);CREATE TABLE IF NOT EXISTS "electronic_contact" (
"electronic_contact_id" TEXT NOT NULL PRIMARY KEY ,
"medium" TEXT NOT NULL ,
"address" TEXT NOT NULL ,
"is_primary" INTEGER NOT NULL DEFAULT FALSE ,
"party_id" TEXT NOT NULL ,
CONSTRAINT "electronic_contact_party_id_fk" FOREIGN KEY ("party_id") REFERENCES "party" ("party_id"),
CONSTRAINT "electronic_contact_medium_ck" CHECK ("medium" IN ('email' , 'telephone' , 'web' ))
);# Physical: the typed tableRead and written from TypeScript with the types the model gives: import { electronicContact } 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 { electronicContact } from "@intellectual-frontiers/data/sql/typed/models" ;
const rows = await from (electronicContact).select ((s ) => ({ electronicContactId: s.electronicContact.electronicContactId, medium: s.electronicContact.medium })).run (runner);