IF Commons GitHub

deliveryConflict

concept

A delivery that had the id of one already taken and other content: the original is kept and this is queued to be decided

Model flow. Written in commons/data/models/flow/mod.ts:153. Identified by deliveryConflictId.

Governance: attributes

deliveryConflictIdidentifierrequired

What identifies the conflict

Becomes the column delivery_conflict_id of delivery_conflict.

Written at commons/data/models/flow/mod.ts:156

incomingSha256textrequired

The SHA-256 of the content that conflicts

Becomes the column incoming_sha_256 of delivery_conflict.

Written at commons/data/models/flow/mod.ts:157

seenAtinstantrequired

When it was seen

Becomes the column seen_at of delivery_conflict.

Written at commons/data/models/flow/mod.ts:159

statuscode of conflictStatusrequired

Where it is

Becomes the column status of delivery_conflict.

Written at commons/data/models/flow/mod.ts:158

Governance: relationships

deliveryone

The message it conflicts with To delivery. Written at commons/data/models/flow/mod.ts:153

loadone

The load that brought it To load. Written at commons/data/models/flow/mod.ts:153

Logical: the table

Projects to the table delivery_conflict with the primary key delivery_conflict_id.

ColumnTypeNullRoleFrom
delivery_conflict_idtextfalseattributedeliveryConflict.deliveryConflictId
delivery_idtextfalsereferencedeliveryConflict.delivery
incoming_sha_256textfalseattributedeliveryConflict.incomingSha256
load_idtextfalsereferencedeliveryConflict.load
seen_attimestampfalseattributedeliveryConflict.seenAt
statustextfalseattributedeliveryConflict.status

Physical: SQL

CREATE TABLE IF NOT EXISTS "delivery_conflict" (
    "delivery_conflict_id" VARCHAR NOT NULL PRIMARY KEY,
    "incoming_sha_256" VARCHAR NOT NULL,
    "status" VARCHAR NOT NULL,
    "seen_at" TIMESTAMPTZ NOT NULL,
    "delivery_id" VARCHAR NOT NULL,
    "load_id" VARCHAR NOT NULL,
    CONSTRAINT "delivery_conflict_delivery_id_fk" FOREIGN KEY ("delivery_id") REFERENCES "delivery" ("delivery_id"),
    CONSTRAINT "delivery_conflict_load_id_fk" FOREIGN KEY ("load_id") REFERENCES "load" ("load_id"),
    CONSTRAINT "delivery_conflict_status_ck" CHECK ("status" IN ('open', 'kept', 'replaced'))
);

Physical: the typed table

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

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

const rows = await from(deliveryConflict).select((s) => ({ deliveryConflictId: s.deliveryConflict.deliveryConflictId, incomingSha_256: s.deliveryConflict.incomingSha_256 })).run(runner);

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