From f72ab316250d4cd9ee0cec73fa78348c31753fe2 Mon Sep 17 00:00:00 2001 From: Daniel Haselhan Date: Wed, 6 Mar 2024 11:47:32 -0800 Subject: [PATCH] Code Review Feedback --- .../src/app/features/board/board.component.ts | 3 ++- .../alcs/card/card-type/card-type.entity.ts | 4 +--- .../planning-referral.entity.ts | 5 ++++- .../planning-review/planning-review.entity.ts | 4 +++- .../1709754346579-add_table_comments_to_pr.ts | 18 ++++++++++++++++++ 5 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 services/apps/alcs/src/providers/typeorm/migrations/1709754346579-add_table_comments_to_pr.ts diff --git a/alcs-frontend/src/app/features/board/board.component.ts b/alcs-frontend/src/app/features/board/board.component.ts index f79667dc02..e0b80970e8 100644 --- a/alcs-frontend/src/app/features/board/board.component.ts +++ b/alcs-frontend/src/app/features/board/board.component.ts @@ -384,7 +384,7 @@ export class BoardComponent implements OnInit, OnDestroy { private mapPlanningReferralToCard(referral: PlanningReferralDto): CardData { return { status: referral.card.status.code, - typeLabel: 'Non-Application', + typeLabel: 'Planning Review', title: `${referral.planningReview.fileNumber} (${referral.planningReview.documentName})`, titleTooltip: referral.planningReview.type.label, assignee: referral.card.assignee, @@ -395,6 +395,7 @@ export class BoardComponent implements OnInit, OnDestroy { highPriority: referral.card.highPriority, cardUuid: referral.card.uuid, dateReceived: referral.card.createdAt, + dueDate: referral.dueDate ? new Date(referral.dueDate) : undefined, }; } diff --git a/services/apps/alcs/src/alcs/card/card-type/card-type.entity.ts b/services/apps/alcs/src/alcs/card/card-type/card-type.entity.ts index 84ccd30d68..78330ac6aa 100644 --- a/services/apps/alcs/src/alcs/card/card-type/card-type.entity.ts +++ b/services/apps/alcs/src/alcs/card/card-type/card-type.entity.ts @@ -13,9 +13,7 @@ export enum CARD_TYPE { NOTIFICATION = 'NOTI', } -@Entity({ - comment: '', -}) +@Entity() export class CardType extends BaseCodeEntity { constructor(data?: Partial) { super(); diff --git a/services/apps/alcs/src/alcs/planning-review/planning-referral/planning-referral.entity.ts b/services/apps/alcs/src/alcs/planning-review/planning-referral/planning-referral.entity.ts index 27c603e937..e126888a8f 100644 --- a/services/apps/alcs/src/alcs/planning-review/planning-referral/planning-referral.entity.ts +++ b/services/apps/alcs/src/alcs/planning-review/planning-referral/planning-referral.entity.ts @@ -5,7 +5,10 @@ import { Base } from '../../../common/entities/base.entity'; import { Card } from '../../card/card.entity'; import { PlanningReview } from '../planning-review.entity'; -@Entity() +@Entity({ + comment: + 'Planning Referrals represent each pass of a Planning Review with their own cards', +}) export class PlanningReferral extends Base { constructor(data?: Partial) { super(); diff --git a/services/apps/alcs/src/alcs/planning-review/planning-review.entity.ts b/services/apps/alcs/src/alcs/planning-review/planning-review.entity.ts index 82c76d9756..9fa30d217e 100644 --- a/services/apps/alcs/src/alcs/planning-review/planning-review.entity.ts +++ b/services/apps/alcs/src/alcs/planning-review/planning-review.entity.ts @@ -5,7 +5,9 @@ import { ApplicationRegion } from '../code/application-code/application-region/a import { LocalGovernment } from '../local-government/local-government.entity'; import { PlanningReviewType } from './planning-review-type.entity'; -@Entity() +@Entity({ + comment: 'A review of a local government or municipalities plan', +}) export class PlanningReview extends Base { constructor(data?: Partial) { super(); diff --git a/services/apps/alcs/src/providers/typeorm/migrations/1709754346579-add_table_comments_to_pr.ts b/services/apps/alcs/src/providers/typeorm/migrations/1709754346579-add_table_comments_to_pr.ts new file mode 100644 index 0000000000..98bc58f880 --- /dev/null +++ b/services/apps/alcs/src/providers/typeorm/migrations/1709754346579-add_table_comments_to_pr.ts @@ -0,0 +1,18 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class AddTableCommentsToPr1709754346579 implements MigrationInterface { + name = 'AddTableCommentsToPr1709754346579'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `COMMENT ON TABLE "alcs"."planning_review" IS 'A review of a local government or municipalities plan'`, + ); + await queryRunner.query( + `COMMENT ON TABLE "alcs"."planning_referral" IS 'Planning Referrals represent each pass of a Planning Review with their own cards'`, + ); + } + + public async down(): Promise { + //No + } +}