File tree 2 files changed +17
-0
lines changed
2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ import projectVersionAttachment from './models/projectVersionAttachment';
29
29
import projectVersionPlan from './models/projectVersionPlan' ;
30
30
import reportingWindow from './models/reportingWindow' ;
31
31
import reportingWindowAssignment from './models/reportingWindowAssignment' ;
32
+ import usageYear from './models/usageYear' ;
32
33
import workflowStatusOption from './models/workflowStatusOption' ;
33
34
34
35
export default ( conn : Knex ) => ( {
@@ -62,5 +63,6 @@ export default (conn: Knex) => ({
62
63
projectVersionPlan : projectVersionPlan ( conn ) ,
63
64
reportingWindow : reportingWindow ( conn ) ,
64
65
reportingWindowAssignment : reportingWindowAssignment ( conn ) ,
66
+ usageYear : usageYear ( conn ) ,
65
67
workflowStatusOption : workflowStatusOption ( conn ) ,
66
68
} ) ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import * as t from 'io-ts';
2
2
3
3
import { brandedType } from '../../util/io-ts' ;
4
4
import type { Brand } from '../../util/types' ;
5
+ import { defineIDModel } from '../util/id-model' ;
5
6
6
7
export type UsageYearId = Brand <
7
8
number ,
@@ -10,3 +11,17 @@ export type UsageYearId = Brand<
10
11
> ;
11
12
12
13
export const USAGE_YEAR_ID = brandedType < number , UsageYearId > ( t . number ) ;
14
+
15
+ export default defineIDModel ( {
16
+ tableName : 'usageYear' ,
17
+ fields : {
18
+ generated : {
19
+ id : { kind : 'branded-integer' , brand : USAGE_YEAR_ID } ,
20
+ } ,
21
+ required : {
22
+ year : { kind : 'checked' , type : t . string } ,
23
+ } ,
24
+ } ,
25
+ idField : 'id' ,
26
+ softDeletionEnabled : false ,
27
+ } ) ;
You can’t perform that action at this time.
0 commit comments