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

Backport #1701

Closed
wants to merge 8 commits into from
Closed
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
2 changes: 2 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ exclude_patterns:
- "**/commands/"
- "**/import/"
- "**/*.entity.ts"
- "ora2pg/"
- "openshift/"
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export class PofoProposalComponent extends FilesStepComponent implements OnInit,
private noticeOfIntentSubmissionService: NoticeOfIntentSubmissionService,
noticeOfIntentDocumentService: NoticeOfIntentDocumentService,
dialog: MatDialog,
toastService: ToastService
toastService: ToastService,
) {
super(noticeOfIntentDocumentService, dialog, toastService);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddMissingLfngReviews1716326002959 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
const results = (await queryRunner.query(`
SELECT
file_number
FROM (
SELECT
file_number,
status_type_code,
application_submission.uuid,
alcs.get_current_status_for_application_submission_by_uuid (alcs.application_submission.uuid) ->> 'status_type_code' AS "current_status"
FROM
alcs.application_submission_to_submission_status
LEFT JOIN alcs.application_submission ON application_submission.uuid = application_submission_to_submission_status.submission_uuid
LEFT JOIN alcs.application_submission_review ON application_submission_review.application_file_number = application_submission.file_number
WHERE
status_type_code = 'REVG'
AND application_submission_review.uuid IS NULL
AND effective_date IS NOT NULL) a
WHERE
a.current_status = 'REVG';
`)) as { file_number: string }[];

for (const result of results) {
await queryRunner.query(`
INSERT INTO "alcs"."application_submission_review"
("audit_deleted_date_at", "audit_created_at", "audit_updated_at", "audit_created_by", "audit_updated_by", "uuid", "local_government_file_number", "first_name", "last_name", "position", "department", "phone_number", "email", "is_ocp_designation", "ocp_bylaw_name", "ocp_designation", "ocp_consistent", "is_subject_to_zoning", "zoning_bylaw_name", "zoning_designation", "zoning_minimum_lot_size", "is_zoning_consistent", "is_authorized", "application_file_number", "created_by_uuid") VALUES
(NULL, NOW(), NULL, 'seed-migration', NULL, DEFAULT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, ${result.file_number}, NULL);
`);
console.log(`Add Review for Application ${result.file_number}`);
}
}

public async down(): Promise<void> {
//Nope
}
}
Binary file not shown.
Loading