Skip to content

Commit

Permalink
CE-14-Add Offset to incident datetime (#165)
Browse files Browse the repository at this point in the history
Co-authored-by: afwilcox <[email protected]>
  • Loading branch information
barrfalk and afwilcox authored Oct 23, 2023
1 parent 5b91cb2 commit dd97f08
Show file tree
Hide file tree
Showing 28 changed files with 15,557 additions and 15,453 deletions.
172 changes: 86 additions & 86 deletions backend/db/migrations/R__Create-Test-Data.sql

Large diffs are not rendered by default.

4,513 changes: 1 addition & 4,512 deletions backend/db/migrations/R__WebEOC-July-ERS-complaints.sql

Large diffs are not rendered by default.

10,344 changes: 1 addition & 10,343 deletions backend/db/migrations/R__WebEOC-July-HWCR-complaints.sql

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/db/migrations/V0.9.3__CE-14.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alter table public.complaint rename column incident_datetime to incident_utc_datetime;
14,864 changes: 14,864 additions & 0 deletions backend/db/migrations/V0.9.4__CE-14-DML-NOT-FOR-PROD.sql

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ async function bootstrap() {
type: VersioningType.URI,
});
app.enableCors();
process.env.TZ='UTC';
const config = new DocumentBuilder()
.setTitle("Compliance and Enforcement API")
.setDescription("The Complicance and Enforcement API")
Expand Down
10 changes: 10 additions & 0 deletions backend/src/types/complaints/allegation_search_options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export interface AllegationSearchOptions {
community: string;
zone: string;
region: string;
officerAssigned: string;
violationCode: string;
incidentReportedStart: string;
incidentReportedEnd: string;
status: string;
}
11 changes: 11 additions & 0 deletions backend/src/types/complaints/hwcr_search_options.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface HWCRSearchOptions {
community: string;
zone: string;
region: string;
officerAssigned: string;
natureOfComplaint: string;
speciesCode: string;
incidentReportedStart: Date;
incidentReportedEnd: Date;
status: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { ApiTags } from "@nestjs/swagger";
import { Roles } from "../../auth/decorators/roles.decorator";
import { Role } from "../../enum/role.enum";
import { UUID } from "crypto";
import { AllegationSearchOptions } from "../../types/complaints/allegation_search_options";

@UseGuards(JwtRoleGuard)
@ApiTags("allegation-complaint")
Expand Down Expand Up @@ -60,17 +61,22 @@ export class AllegationComplaintController {
@Query("status") status,
@Query('page') page: number,
@Query('pageSize') pageSize: number) {

const options: AllegationSearchOptions = {
community: community,
zone: zone,
region: region,
officerAssigned: officerAssigned,
violationCode: violationCode,
incidentReportedStart: incidentReportedStart,
incidentReportedEnd: incidentReportedEnd,
status: status,
};

return this.allegationComplaintService.search(
sortColumn,
sortOrder,
community,
zone,
region,
officerAssigned,
violationCode,
incidentReportedStart,
incidentReportedEnd,
status,
options,
page,
pageSize,
);
Expand All @@ -90,17 +96,22 @@ export class AllegationComplaintController {
@Query("incidentReportedEnd") incidentReportedEnd: string,
@Query("status") status
) {

const options: AllegationSearchOptions = {
community: community,
zone: zone,
region: region,
officerAssigned: officerAssigned,
violationCode: violationCode,
incidentReportedStart: incidentReportedStart,
incidentReportedEnd: incidentReportedEnd,
status: status,
};

return this.allegationComplaintService.searchMap(
sortColumn,
sortOrder,
community,
zone,
region,
officerAssigned,
violationCode,
incidentReportedStart,
incidentReportedEnd,
status,
options,
);
}

Expand Down
Loading

0 comments on commit dd97f08

Please sign in to comment.