IF Commons GitHub

userAccount

conceptpersonal data

A person's way in: who signs in, and where it stands

Model identity. Written in commons/data/models/identity/concepts.ts:64. Identified by principal.

Governance: attributes

createdViacode of createdViarequired

How the account came to be

Becomes the column created_via of user_account.

Written at commons/data/models/identity/concepts.ts:68

lastAuthenticatedAtinstantoptional

When the user last proved who they are

Becomes the column last_authenticated_at of user_account.

Written at commons/data/models/identity/concepts.ts:70

localetextoptional

The language the user wants to be spoken to in

Becomes the column locale of user_account.

Written at commons/data/models/identity/concepts.ts:71

lockedUntilinstantoptional

Until when the account is locked, where it is

Becomes the column locked_until of user_account.

Written at commons/data/models/identity/concepts.ts:69

loginIdentifiertextrequiredpersonal data

What the user signs in by, unique within its home tenant

Becomes the column login_identifier of user_account.

Annotations: privacy.personal={"category":"Username","purposes":["let the user sign in"]}

Written at commons/data/models/identity/concepts.ts:67

timeZonetextoptional

The time zone the user's times are shown in

Becomes the column time_zone of user_account.

Written at commons/data/models/identity/concepts.ts:72

Governance: relationships

homeTenantoptional

The tenant whose pool of users it is in; empty for a user who joins tenants by membership To tenant. Written at commons/data/models/identity/concepts.ts:78

personone

The person the account is for To person. Written at commons/data/models/identity/concepts.ts:77

primaryEmailoptional

The address the user is written to To electronicContact. Written at commons/data/models/identity/concepts.ts:79

principalone

The principal the account is To principal. Written at commons/data/models/identity/concepts.ts:76

Logical: the table

Projects to the table user_account with the primary key principal_id.

ColumnTypeNullRoleFrom
created_viatextfalseattributeuserAccount.createdVia
home_tenant_tenant_idtexttruereferenceuserAccount.homeTenant
last_authenticated_attimestamptrueattributeuserAccount.lastAuthenticatedAt
localetexttrueattributeuserAccount.locale
locked_untiltimestamptrueattributeuserAccount.lockedUntil
login_identifiertextfalseattributeuserAccount.loginIdentifier
person_party_idtextfalsereferenceuserAccount.person
primary_email_electronic_contact_idtexttruereferenceuserAccount.primaryEmail
principal_idtextfalsereferenceuserAccount.principal
time_zonetexttrueattributeuserAccount.timeZone

Physical: SQL

CREATE TABLE IF NOT EXISTS "user_account" (
    "principal_id" VARCHAR NOT NULL PRIMARY KEY,
    "login_identifier" VARCHAR NOT NULL,
    "created_via" VARCHAR NOT NULL,
    "locked_until" TIMESTAMPTZ,
    "last_authenticated_at" TIMESTAMPTZ,
    "locale" VARCHAR,
    "time_zone" VARCHAR,
    "person_party_id" VARCHAR NOT NULL,
    "home_tenant_tenant_id" VARCHAR,
    "primary_email_electronic_contact_id" VARCHAR,
    CONSTRAINT "user_account_principal_id_fk" FOREIGN KEY ("principal_id") REFERENCES "principal" ("principal_id"),
    CONSTRAINT "user_account_person_party_id_fk" FOREIGN KEY ("person_party_id") REFERENCES "person" ("party_id"),
    CONSTRAINT "user_account_home_tenant_tenant_id_fk" FOREIGN KEY ("home_tenant_tenant_id") REFERENCES "tenant" ("tenant_id"),
    CONSTRAINT "user_account_primary_email_electronic_contact_id_fk" FOREIGN KEY ("primary_email_electronic_contact_id") REFERENCES "electronic_contact" ("electronic_contact_id"),
    CONSTRAINT "user_account_home_tenant_tenant_id_login_identifier_uq" UNIQUE ("home_tenant_tenant_id", "login_identifier"),
    CONSTRAINT "user_account_created_via_ck" CHECK ("created_via" IN ('invited', 'self_signup', 'directory', 'federated', 'admin'))
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { userAccount } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/identity.auto.ts: do not edit.

import { from } from "@intellectual-frontiers/data/sql/typed";
import { userAccount } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(userAccount).select((s) => ({ principalId: s.userAccount.principalId, loginIdentifier: s.userAccount.loginIdentifier })).run(runner);

Titles, headings, exports, tables, columns and requirements. Esc closes.