Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPC-9189: Remove PLAN_TAG_REVISION_STATE from planTag #126

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/db/models/plan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ export type PlanId = Brand<number, { readonly s: unique symbol }, 'plan.id'>;

export const PLAN_ID = brandedType<number, PlanId>(t.number);

const PLAN_REVISION_STATE = t.keyof({
projectsOnly: null,
export const PLAN_REVISION_STATE = t.keyof({
none: null,
planDataAndProjects: null,
planDataOnly: null,
projectsOnly: null,
});

export default defineIDModel({
Expand Down
11 changes: 2 additions & 9 deletions src/db/models/planTag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as t from 'io-ts';
import { brandedType } from '../../util/io-ts';
import type { Brand } from '../../util/types';
import { defineIDModel } from '../util/id-model';
import { PLAN_ID } from './plan';
import { PLAN_ID, PLAN_REVISION_STATE } from './plan';

export type PlanTagId = Brand<
number,
Expand All @@ -19,13 +19,6 @@ const PLAN_TAG_PUBLISH_TYPE = t.keyof({
custom: null,
});

export const PLAN_TAG_REVISION_STATE = t.keyof({
none: null,
planDataAndProjects: null,
planDataOnly: null,
projectsOnly: null,
});

export default defineIDModel({
tableName: 'planTag',
fields: {
Expand All @@ -42,7 +35,7 @@ export default defineIDModel({
},
optional: {
comment: { kind: 'checked', type: t.string },
revisionState: { kind: 'checked', type: PLAN_TAG_REVISION_STATE },
revisionState: { kind: 'checked', type: PLAN_REVISION_STATE },
type: { kind: 'checked', type: PLAN_TAG_PUBLISH_TYPE },
},
},
Expand Down