-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: LawrenceLau2020 <68400651+LawrenceLau2020@users.noreply.github.com>
- Loading branch information
1 parent
e95d9b8
commit 2aad8e2
Showing
11 changed files
with
201 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
import { Roles } from '@/constants/roles'; | ||
import controllers from '@/controllers'; | ||
import { getJurisdictionRollNumberByPid } from '@/controllers/tools/toolsController'; | ||
import userAuthCheck from '@/middleware/userAuthCheck'; | ||
import catchErrors from '@/utilities/controllerErrorWrapper'; | ||
import express from 'express'; | ||
|
||
const router = express.Router(); | ||
|
||
const { searchGeocoderAddresses } = controllers; | ||
|
||
router.route(`/geocoder/addresses`).get(catchErrors(searchGeocoderAddresses)); | ||
router.route(`/geocoder/addresses`).get(userAuthCheck(), catchErrors(searchGeocoderAddresses)); | ||
router | ||
.route(`/jur-roll-xref`) | ||
.get( | ||
userAuthCheck({ requiredRoles: [Roles.ADMIN] }), | ||
catchErrors(getJurisdictionRollNumberByPid), | ||
); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { Entity, PrimaryColumn } from 'typeorm'; | ||
|
||
/** | ||
* Used to cross reference the records from BC Assessment and find one that matches a PID. | ||
*/ | ||
@Entity() | ||
export class JurRollPidXref { | ||
@PrimaryColumn({ type: 'int', name: 'pid' }) | ||
PID: number; | ||
|
||
@PrimaryColumn({ type: 'character varying', length: 3, name: 'jurisdiction_code' }) | ||
JurisdictionCode: string; | ||
|
||
@PrimaryColumn({ type: 'character varying', length: 15, name: 'roll_number' }) | ||
RollNumber: string; | ||
} |
15 changes: 15 additions & 0 deletions
15
express-api/src/typeorm/Migrations/1729627184522-CreateXrefTable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { MigrationInterface, QueryRunner } from 'typeorm'; | ||
|
||
export class CreateXrefTable1729627184522 implements MigrationInterface { | ||
name = 'CreateXrefTable1729627184522'; | ||
|
||
public async up(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query( | ||
`CREATE TABLE "jur_roll_pid_xref" ("pid" integer NOT NULL, "jurisdiction_code" character varying(3) NOT NULL, "roll_number" character varying(15) NOT NULL, CONSTRAINT "PK_68f4d54ea088bb438e6100af993" PRIMARY KEY ("pid", "jurisdiction_code", "roll_number"))`, | ||
); | ||
} | ||
|
||
public async down(queryRunner: QueryRunner): Promise<void> { | ||
await queryRunner.query(`DROP TABLE "jur_roll_pid_xref"`); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters