Skip to content

Commit

Permalink
Add report detail model
Browse files Browse the repository at this point in the history
  • Loading branch information
manelcecs authored and Pl217 committed Nov 17, 2023
1 parent 6ed6803 commit 8ca426e
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ import projectVersionHistory from './models/projectVersionHistory';
import projectVersionOrganization from './models/projectVersionOrganization';
import projectVersionPlan from './models/projectVersionPlan';
import projectVersionPlanEntity from './models/projectVersionPlanEntity';
import reportDetail from './models/reportDetail';
import reportingWindow from './models/reportingWindow';
import reportingWindowAssignment from './models/reportingWindowAssignment';
import tag from './models/tag';
Expand Down Expand Up @@ -196,6 +197,7 @@ const initializeTables = (conn: Knex) => ({
projectVersionOrganization: projectVersionOrganization(conn),
projectVersionPlan: projectVersionPlan(conn),
projectVersionPlanEntity: projectVersionPlanEntity(conn),
reportDetail: reportDetail(conn),
reportingWindow: reportingWindow(conn),
reportingWindowAssignment: reportingWindowAssignment(conn),
tag: tag(conn),
Expand Down
26 changes: 26 additions & 0 deletions src/db/models/reportDetail.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import * as t from 'io-ts';

import { defineSequelizeModel } from '../util/sequelize-model';

export default defineSequelizeModel({
tableName: 'reportDetail',
fields: {
required: {
id: { kind: 'checked', type: t.number },
flowID: { kind: 'checked', type: t.number },
versionID: { kind: 'checked', type: t.number },
verified: { kind: 'checked', type: t.boolean },
},
nonNullWithDefault: {
source: { kind: 'checked', type: t.string },
},
optional: {
contactInfo: { kind: 'checked', type: t.string },
date: { kind: 'checked', type: t.string },
sourceID: { kind: 'checked', type: t.string },
refCode: { kind: 'checked', type: t.string },
organizationID: { kind: 'checked', type: t.number },
},
},
softDeletionEnabled: false,
});

0 comments on commit 8ca426e

Please sign in to comment.