Skip to content

Commit

Permalink
Merge pull request #137 from UN-OCHA/HPC-9354
Browse files Browse the repository at this point in the history
HPC-9354: Add `visibilityPreferences` to `planVersion` model
  • Loading branch information
Pl217 authored Mar 6, 2024
2 parents 85eaf74 + c944780 commit abaa2b4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@unocha/hpc-api-core",
"version": "7.3.0",
"version": "7.4.0",
"description": "Core libraries supporting HPC.Tools API Backend",
"license": "Apache-2.0",
"private": false,
Expand Down
9 changes: 9 additions & 0 deletions src/db/models/planVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ const PLAN_VERSION_CLUSTER_SELECTION_TYPE = t.keyof({
multi: null,
});

const PLAN_VISIBILITY_PREFERENCES = t.type({
isDisaggregationForCaseloads: t.boolean,
isDisaggregationForIndicators: t.boolean,
});

export default defineLegacyVersionedModel({
tableName: 'planVersion',
fields: {
Expand All @@ -28,6 +33,10 @@ export default defineLegacyVersionedModel({
},
nonNullWithDefault: {
isForHPCProjects: { kind: 'checked', type: t.boolean },
visibilityPreferences: {
kind: 'checked',
type: PLAN_VISIBILITY_PREFERENCES,
},
},
required: {
planId: { kind: 'branded-integer', brand: PLAN_ID },
Expand Down

0 comments on commit abaa2b4

Please sign in to comment.