IF Commons GitHub

waiting

concept

A precondition the work waits on, from whom, since when and by when it is needed: the waiting-on ledger, whose status is computed from its dates

Model operations. Written in commons/data/models/operations/mod.ts:59. Identified by waitingId.

Governance: attributes

neededByinstantoptional

By when it is needed

Becomes the column needed_by of waiting.

Written at commons/data/models/operations/mod.ts:66

onWhomtextrequired

Who must give it

Becomes the column on_whom of waiting.

Written at commons/data/models/operations/mod.ts:64

resolvedAtinstantoptional

When it came

Becomes the column resolved_at of waiting.

Written at commons/data/models/operations/mod.ts:68

sinceinstantrequired

Since when it is waited on

Becomes the column since of waiting.

Written at commons/data/models/operations/mod.ts:65

statuscode of waitingStatusrequired

Where it is

Becomes the column status of waiting.

Written at commons/data/models/operations/mod.ts:67

waitingIdidentifierrequired

What identifies the wait

Becomes the column waiting_id of waiting.

Written at commons/data/models/operations/mod.ts:62

whattextrequired

What is waited on

Becomes the column what of waiting.

Written at commons/data/models/operations/mod.ts:63

Logical: the table

Projects to the table waiting with the primary key waiting_id.

ColumnTypeNullRoleFrom
needed_bytimestamptrueattributewaiting.neededBy
on_whomtextfalseattributewaiting.onWhom
resolved_attimestamptrueattributewaiting.resolvedAt
sincetimestampfalseattributewaiting.since
statustextfalseattributewaiting.status
waiting_idtextfalseattributewaiting.waitingId
whattextfalseattributewaiting.what

Physical: SQL

CREATE TABLE IF NOT EXISTS "waiting" (
    "waiting_id" VARCHAR NOT NULL PRIMARY KEY,
    "what" VARCHAR NOT NULL,
    "on_whom" VARCHAR NOT NULL,
    "since" TIMESTAMPTZ NOT NULL,
    "needed_by" TIMESTAMPTZ,
    "status" VARCHAR NOT NULL,
    "resolved_at" TIMESTAMPTZ,
    CONSTRAINT "waiting_status_ck" CHECK ("status" IN ('open', 'resolved', 'cancelled'))
);

Physical: the typed table

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

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

const rows = await from(waiting).select((s) => ({ waitingId: s.waiting.waitingId, what: s.waiting.what })).run(runner);

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