Skip to content

Commit

Permalink
fix: use BaseComplaint usage from nrs-ce-common-types (#720)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorylavery authored Oct 30, 2024
1 parent d1b2f89 commit 8c3d91e
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 58 deletions.
12 changes: 12 additions & 0 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"linq-to-typescript": "^11.0.0",
"nest-winston": "^1.9.2",
"npm-check-updates": "^17.1.3",
"nrs-ce-common-types": "^1.0.10",
"passport": "^0.6.0",
"passport-jwt": "^4.0.1",
"path-to-regexp": "^8.0.0",
Expand Down
3 changes: 2 additions & 1 deletion backend/src/types/models/complaints/allegation-complaint.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { UUID } from "crypto";
import { ComplaintDto } from "./complaint";
import { BaseComplaint } from "nrs-ce-common-types";

export interface AllegationComplaintDto extends ComplaintDto {
export interface AllegationComplaintDto extends ComplaintDto, BaseComplaint {
ersId: UUID;
violation: string;
isInProgress: boolean;
Expand Down
28 changes: 2 additions & 26 deletions backend/src/types/models/complaints/complaint.ts
Original file line number Diff line number Diff line change
@@ -1,36 +1,12 @@
import { DelegateDto } from "../people/delegate";
import { BaseComplaint } from "nrs-ce-common-types";

export interface ComplaintDto {
id: string;
details: string;
name: string;
address: string;
email: string;
phone1: string;
phone2: string;
phone3: string;
// contacts: Array<ContactTypeDto> //-- for future use
location: { type: string; coordinates: Array<number> };
locationSummary: string;
locationDetail: string;
status: string;
reportedBy: string;
ownedBy: string;
reportedByOther: string;
incidentDateTime: Date;
reportedOn: Date;
updatedOn: Date;
createdBy: string;
updatedBy: string;
export interface ComplaintDto extends BaseComplaint {
organization: {
area: string;
zone: string;
region: string;
officeLocation?: string;
};
delegates: Array<DelegateDto>;
webeocId: string;
referenceNumber: string;
complaintMethodReceivedCode: string;
isPrivacyRequested: string;
}
3 changes: 2 additions & 1 deletion backend/src/types/models/complaints/gir-complaint.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { UUID } from "crypto";
import { ComplaintDto } from "./complaint";
import { BaseComplaint } from "nrs-ce-common-types";

export interface GeneralIncidentComplaintDto extends ComplaintDto {
export interface GeneralIncidentComplaintDto extends ComplaintDto, BaseComplaint {
girId: UUID;
girType: string;
}
3 changes: 2 additions & 1 deletion backend/src/types/models/complaints/wildlife-complaint.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { UUID } from "crypto";
import { ComplaintDto } from "./complaint";
import { AttractantXrefDto } from "./attractant-ref";
import { BaseComplaint } from "nrs-ce-common-types";

export interface WildlifeComplaintDto extends ComplaintDto {
export interface WildlifeComplaintDto extends ComplaintDto, BaseComplaint {
hwcrId: UUID;
species: string;
natureOfComplaint: string;
Expand Down
7 changes: 7 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
"make-fetch-happen": "11.0.3",
"node": "^21.6.1",
"npm": "^9.8.1",
"nrs-ce-common-types": "^1.0.10",
"omggif": "^1.0.10",
"os-browserify": "^0.3.0",
"path-browserify": "^1.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ export const CreateComplaint: FC = () => {

let assignableOfficers: Option[] = officerList
? officerList.map((officer: Officer) => ({
value: officer.person_guid.person_guid,
label: `${officer.person_guid.last_name}, ${officer.person_guid.first_name}`,
}))
value: officer.person_guid.person_guid,
label: `${officer.person_guid.last_name}, ${officer.person_guid.first_name}`,
}))
: [];

const yesNoOptions: Option[] = [
Expand Down Expand Up @@ -175,7 +175,7 @@ export const CreateComplaint: FC = () => {
createdBy: userid,
updatedBy: userid,
complaintMethodReceivedCode: "",
isPrivacyRequested: "U",
isPrivacyRequested: "U"
};

applyComplaintData(model);
Expand Down
27 changes: 2 additions & 25 deletions frontend/src/app/types/app/complaints/complaint.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
import { Delegate } from "../people/delegate";
import { BaseComplaint } from "nrs-ce-common-types";

export interface Complaint {
id: string;
details: string;
name: string;
address: string;
email: string;
phone1: string;
phone2: string;
phone3: string;
location: { type: string; coordinates: Array<number> };
locationSummary: string;
locationDetail: string;
status: string;
reportedBy?: string;
ownedBy: string;
reportedByOther: string;
incidentDateTime?: Date;
reportedOn: Date;
updatedOn: Date;
createdBy: string;
updatedBy: string;
export interface Complaint extends BaseComplaint {
organization: {
area: string;
areaName?: string;
Expand All @@ -29,8 +10,4 @@ export interface Complaint {
officeLocation?: string;
};
delegates: Array<Delegate>;
webeocId: string;
referenceNumber: string;
complaintMethodReceivedCode: string;
isPrivacyRequested: string;
}

0 comments on commit 8c3d91e

Please sign in to comment.