IF Commons GitHub

batchStage

concept

How many entities of a batch a stage confirmed: a step of the funnel from the manifest to what was accepted

Model flow. Written in commons/data/models/flow/mod.ts:176. Identified by batchStageId.

Governance: attributes

batchStageIdidentifierrequired

What identifies the count

Becomes the column batch_stage_id of batch_stage.

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

entitiesintegerrequired

How many it confirmed

Becomes the column entities of batch_stage.

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

stagecode of stagerequired

The stage

Becomes the column stage of batch_stage.

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

Governance: relationships

manifestone

The batch To manifest. Written at commons/data/models/flow/mod.ts:176

Logical: the table

Projects to the table batch_stage with the primary key batch_stage_id.

ColumnTypeNullRoleFrom
batch_stage_idtextfalseattributebatchStage.batchStageId
entitiesintegerfalseattributebatchStage.entities
manifest_idtextfalsereferencebatchStage.manifest
stagetextfalseattributebatchStage.stage

Physical: SQL

CREATE TABLE IF NOT EXISTS "batch_stage" (
    "batch_stage_id" VARCHAR NOT NULL PRIMARY KEY,
    "stage" VARCHAR NOT NULL,
    "entities" INTEGER NOT NULL,
    "manifest_id" VARCHAR NOT NULL,
    CONSTRAINT "batch_stage_manifest_id_fk" FOREIGN KEY ("manifest_id") REFERENCES "manifest" ("manifest_id"),
    CONSTRAINT "batch_stage_manifest_id_stage_uq" UNIQUE ("manifest_id", "stage"),
    CONSTRAINT "batch_stage_stage_ck" CHECK ("stage" IN ('received', 'captured', 'parsed', 'mapped', 'validated', 'forwarded', 'dest_verdict', 'usable'))
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { batchStage } 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 { batchStage } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(batchStage).select((s) => ({ batchStageId: s.batchStage.batchStageId, stage: s.batchStage.stage })).run(runner);

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