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

Refactor code tables into single controller/service #189

Merged
merged 24 commits into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7499002
initial commit
marqueone-ps Nov 4, 2023
7545b07
agency code implemented, service unit test started
marqueone-ps Nov 4, 2023
7dc5423
code-table controller unit tests created
marqueone-ps Nov 4, 2023
eb7b75e
added test to check for 404
marqueone-ps Nov 4, 2023
06038ea
added attractants
marqueone-ps Nov 5, 2023
4bcd3da
Merge branch 'main' into refactor/CE-208
marqueone-ps Nov 5, 2023
06d927b
added complaint-type code table
marqueone-ps Nov 5, 2023
98697cd
nature of complaints code table added
marqueone-ps Nov 5, 2023
f35dcaa
organization unit type added
marqueone-ps Nov 5, 2023
6555c49
organization unit code table added
marqueone-ps Nov 5, 2023
5cd2048
code smell removal
marqueone-ps Nov 5, 2023
f6d11a1
person complaint code table implemented
marqueone-ps Nov 6, 2023
c0af1f0
species code table implemented
marqueone-ps Nov 6, 2023
8753b6f
violation types implemented
marqueone-ps Nov 6, 2023
3d0c594
added functionality to get organization units by agency
marqueone-ps Nov 6, 2023
4d1ed35
Merge branch 'main' into refactor/CE-208
marqueone-ps Nov 7, 2023
dd89e01
backend models migrated to frontend
marqueone-ps Nov 7, 2023
7f629d5
added tests for getting organizations units by agency, refactored cod…
marqueone-ps Nov 10, 2023
cbb0040
added updated cpde tables for region, zone and communities
marqueone-ps Nov 10, 2023
e93d43d
Merge branch 'main' into refactor/CE-208
marqueone-ps Nov 10, 2023
1a29c14
wired up filters to updated code tables
marqueone-ps Nov 10, 2023
2757b06
filters, create/edit complaint updated to use new code tables
marqueone-ps Nov 10, 2023
0accac3
removed redundant code-table controllers, and controller tests
marqueone-ps Nov 10, 2023
115467c
updating attractant label to use short description over long description
marqueone-ps Nov 11, 2023
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 backend/src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { PersonComplaintXrefCodeModule } from "./v1/person_complaint_xref_code/p
import { BcGeoCoderModule } from "./external_api/bc_geo_coder/bc_geo_coder.module";
import { ConfigurationModule } from './v1/configuration/configuration.module';
import { ComplaintTypeCodeModule } from "./v1/complaint_type_code/complaint_type_code.module";
import { CodeTableModule } from './v1/code-table/code-table.module';


console.log("Var check - POSTGRESQL_HOST", process.env.POSTGRESQL_HOST);
Expand Down Expand Up @@ -78,6 +79,7 @@ if (process.env.POSTGRESQL_PASSWORD != null ){
BcGeoCoderModule,
ConfigurationModule,
ComplaintTypeCodeModule,
CodeTableModule,
],
controllers: [AppController],
providers: [AppService],
Expand Down
5 changes: 5 additions & 0 deletions backend/src/types/models/code-tables/agency.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BaseCodeTable } from "../../models/code-tables/code-table";

export interface Agency extends BaseCodeTable {
agency: string
}
5 changes: 5 additions & 0 deletions backend/src/types/models/code-tables/attractant.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BaseCodeTable } from "../../models/code-tables/code-table";

export interface Attractant extends BaseCodeTable {
attractant: string
}
6 changes: 6 additions & 0 deletions backend/src/types/models/code-tables/code-table.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface BaseCodeTable {
shortDescription: string;
longDescription: string;
displayOrder?: number;
isActive?: boolean;
}
5 changes: 5 additions & 0 deletions backend/src/types/models/code-tables/community.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Zone } from "./zone";

export interface Community extends Zone {
zone: string
}
5 changes: 5 additions & 0 deletions backend/src/types/models/code-tables/complaint-status.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BaseCodeTable } from "../../models/code-tables/code-table";

export interface ComplaintStatus extends BaseCodeTable {
complaintStatus: string
}
5 changes: 5 additions & 0 deletions backend/src/types/models/code-tables/complaint-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BaseCodeTable } from "./code-table";

export interface ComplaintType extends BaseCodeTable {
complaintType: string
}
52 changes: 52 additions & 0 deletions backend/src/types/models/code-tables/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { BaseCodeTable } from "./code-table";
import { Agency } from "./agency";
import { Attractant } from "./attractant";
import { ComplaintStatus } from "./complaint-status";
import { NatureOfComplaint } from "./nature-of-complaint";
import { OrganizationUnitType } from "./organization-unit-type";
import { OrganizationUnit } from "./organization-unit";
import { PersonComplaintType } from "./person-complaint-type";
import { Species } from "./species";
import { Violation } from "./violation";
import { OrganizationCodeTable } from "./organization-code-table";
import { ComplaintType } from "./complaint-type";
import { Sector } from "./sector";
import { Community } from "./community";
import { Zone } from "./zone";

export const AvailableCodeTables = [
"agency",
"attractant",
"complaint-status",
"complaint-type",
"nature-of-complaint",
"organization-unit-type",
"organization-unit",
"person-complaint",
"species",
"violation",
"cos-organization-unit",
"complaint-type",
];

export const AvailableAgencies = [
"cos"
]

export default BaseCodeTable;
export {
Agency,
Attractant,
ComplaintStatus,
NatureOfComplaint,
OrganizationUnitType,
OrganizationUnit,
PersonComplaintType,
Species,
Violation,
OrganizationCodeTable,
ComplaintType,
Sector,
Zone,
Community
};
5 changes: 5 additions & 0 deletions backend/src/types/models/code-tables/nature-of-complaint.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BaseCodeTable } from "./code-table";

export interface NatureOfComplaint extends BaseCodeTable {
natureOfComplaint: string
}
10 changes: 10 additions & 0 deletions backend/src/types/models/code-tables/organization-code-table.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export interface OrganizationCodeTable {
areaName: string;
officeLocationName: string;
regionName: string;
zoneName: string;
area: string;
officeLocation: string;
region: string;
zone: string;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BaseCodeTable } from "./code-table";

export interface OrganizationUnitType extends BaseCodeTable {
organizationUnitType: string
}
6 changes: 6 additions & 0 deletions backend/src/types/models/code-tables/organization-unit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { BaseCodeTable } from "./code-table";

export interface OrganizationUnit extends BaseCodeTable {
organizationUnit: string
organizationUnitType?: string
}
5 changes: 5 additions & 0 deletions backend/src/types/models/code-tables/person-complaint-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BaseCodeTable } from "./code-table";

export interface PersonComplaintType extends BaseCodeTable {
personComplaintType: string
}
4 changes: 4 additions & 0 deletions backend/src/types/models/code-tables/sector.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export interface Sector {
code: string
name: string
}
6 changes: 6 additions & 0 deletions backend/src/types/models/code-tables/species.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { BaseCodeTable } from "./code-table";

export interface Species extends BaseCodeTable {
species: string;
legacy: string;
}
5 changes: 5 additions & 0 deletions backend/src/types/models/code-tables/violation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { BaseCodeTable } from "./code-table";

export interface Violation extends BaseCodeTable {
violation: string
}
5 changes: 5 additions & 0 deletions backend/src/types/models/code-tables/zone.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { Sector } from "./sector";

export interface Zone extends Sector {
region: string
}
29 changes: 0 additions & 29 deletions backend/src/v1/agency_code/agency_code.controller.spec.ts

This file was deleted.

47 changes: 0 additions & 47 deletions backend/src/v1/agency_code/agency_code.controller.ts

This file was deleted.

2 changes: 0 additions & 2 deletions backend/src/v1/agency_code/agency_code.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { Module } from '@nestjs/common';
import { AgencyCodeService } from './agency_code.service';
import { AgencyCodeController } from './agency_code.controller';
import { TypeOrmModule } from "@nestjs/typeorm";
import { AgencyCode } from './entities/agency_code.entity';

@Module({
imports: [TypeOrmModule.forFeature([AgencyCode])],
controllers: [AgencyCodeController],
providers: [AgencyCodeService]
})
export class AgencyCodeModule {}
29 changes: 0 additions & 29 deletions backend/src/v1/attractant_code/attractant_code.controller.spec.ts

This file was deleted.

47 changes: 0 additions & 47 deletions backend/src/v1/attractant_code/attractant_code.controller.ts

This file was deleted.

3 changes: 1 addition & 2 deletions backend/src/v1/attractant_code/attractant_code.module.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { Module } from '@nestjs/common';
import { AttractantCodeService } from './attractant_code.service';
import { AttractantCodeController } from './attractant_code.controller';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AttractantCode } from './entities/attractant_code.entity';

@Module({
imports: [TypeOrmModule.forFeature([AttractantCode])],
controllers: [AttractantCodeController],
controllers: [],
providers: [AttractantCodeService]
})
export class AttractantCodeModule {}
Loading
Loading