diff --git a/backend/src/v1/complaint/complaint.service.ts b/backend/src/v1/complaint/complaint.service.ts index e85ed41b3..98a1c3d3a 100644 --- a/backend/src/v1/complaint/complaint.service.ts +++ b/backend/src/v1/complaint/complaint.service.ts @@ -38,7 +38,7 @@ import { } from "../../middleware/maps/automapper-dto-to-entity-maps"; import { ComplaintSearchParameters } from "../../types/models/complaints/complaint-search-parameters"; -import { SearchResults } from "src/types/models/complaints/search-results"; +import { SearchResults } from "../../types/models/complaints/search-results"; import { ComplaintFilterParameters } from "../../types/models/complaints/complaint-filter-parameters"; import { REQUEST } from "@nestjs/core"; import { getIdirFromRequest } from "../../common/get-idir-from-request"; @@ -51,7 +51,7 @@ import { DelegateDto } from "../../types/models/people/delegate"; import { PersonComplaintXrefService } from "../person_complaint_xref/person_complaint_xref.service"; import { AttractantHwcrXrefService } from "../attractant_hwcr_xref/attractant_hwcr_xref.service"; import { PersonComplaintXrefTable } from "../../types/tables/person-complaint-xref.table"; -import { OfficeStats, OfficerStats, ZoneAtAGlanceStats } from "src/types/zone_at_a_glance/zone_at_a_glance_stats"; +import { OfficeStats, OfficerStats, ZoneAtAGlanceStats } from "../../types/zone_at_a_glance/zone_at_a_glance_stats"; import { CosGeoOrgUnit } from "../cos_geo_org_unit/entities/cos_geo_org_unit.entity"; import { UUID, randomUUID } from "crypto"; diff --git a/frontend/src/app/components/containers/complaints/details/call-details.tsx b/frontend/src/app/components/containers/complaints/details/call-details.tsx index 540433c5e..18ed0599e 100644 --- a/frontend/src/app/components/containers/complaints/details/call-details.tsx +++ b/frontend/src/app/components/containers/complaints/details/call-details.tsx @@ -26,6 +26,7 @@ export const CallDetails: FC = ({ complaintType }) => { attractants, violationInProgress, violationObserved, + girType, } = useAppSelector(selectComplaintDetails(complaintType)) as ComplaintDetails; return ( @@ -98,6 +99,15 @@ export const CallDetails: FC = ({ complaintType }) => { )} + {/* GIR Details */} + {complaintType === COMPLAINT_TYPES.GIR && ( + <> +
+
General Incident Type
+
{girType}
+
+ + )} {/* Location Information */} diff --git a/frontend/src/app/store/reducers/complaints.ts b/frontend/src/app/store/reducers/complaints.ts index ed8a26826..647f7f2ba 100644 --- a/frontend/src/app/store/reducers/complaints.ts +++ b/frontend/src/app/store/reducers/complaints.ts @@ -721,7 +721,7 @@ export const selectComplaintDetails = (state: RootState): ComplaintDetails => { const { complaints: { complaint }, - codeTables: { "area-codes": areaCodes, attractant: attractantCodeTable }, + codeTables: { "area-codes": areaCodes, attractant: attractantCodeTable, "gir-type": girTypeCodes }, } = state; const getAttractants = ( @@ -785,6 +785,14 @@ export const selectComplaintDetails = violationInProgress, violationObserved, }; + } else if (complaintType === "GIR") { + const { girType: girTypeCode } = complaint as GeneralIncidentComplaintDto; + const girType = getGirTypeByGirTypeCode(girTypeCode, girTypeCodes); + result = { + ...result, + girType, + girTypeCode, + }; } const org = areaCodes.find(({ area }) => area === areaCode); diff --git a/frontend/src/app/types/complaints/details/complaint-details.ts b/frontend/src/app/types/complaints/details/complaint-details.ts index 3a2e854cb..2b5cfc4e6 100644 --- a/frontend/src/app/types/complaints/details/complaint-details.ts +++ b/frontend/src/app/types/complaints/details/complaint-details.ts @@ -17,4 +17,6 @@ export interface ComplaintDetails { attractants?: Array; violationInProgress?: boolean; violationObserved?: boolean; + girType?: string; + girTypeCode?: string; }