diff --git a/apps/api/prisma/migrations/20230925150249_extended_ems_fd_incidents/migration.sql b/apps/api/prisma/migrations/20230925150249_extended_ems_fd_incidents/migration.sql new file mode 100644 index 000000000..d5b660ccc --- /dev/null +++ b/apps/api/prisma/migrations/20230925150249_extended_ems_fd_incidents/migration.sql @@ -0,0 +1,4 @@ +-- AlterTable +ALTER TABLE "EmsFdIncident" ADD COLUMN "address" TEXT, +ADD COLUMN "fireType" TEXT, +ADD COLUMN "vehicleInvolved" BOOLEAN NOT NULL DEFAULT false; diff --git a/apps/api/prisma/schema.prisma b/apps/api/prisma/schema.prisma index 7469980ef..3125ba0fb 100644 --- a/apps/api/prisma/schema.prisma +++ b/apps/api/prisma/schema.prisma @@ -1588,7 +1588,9 @@ model EmsFdIncident { caseNumber Int @default(autoincrement()) description String? @db.Text descriptionData Json? + address String? postal String? + fireType String? // when null, it is the dispatcher creator EmsFdDeputy? @relation("emsFdIncidentCreator", fields: [creatorId], references: [id]) creatorId String? @@ -1596,6 +1598,7 @@ model EmsFdIncident { firearmsInvolved Boolean @default(false) injuriesOrFatalities Boolean @default(false) arrestsMade Boolean @default(false) + vehicleInvolved Boolean @default(false) isActive Boolean @default(false) createdAt DateTime @default(now()) updatedAt DateTime @default(now()) @updatedAt diff --git a/apps/client/locales/en/leo.json b/apps/client/locales/en/leo.json index bc07e903e..44fdc0087 100644 --- a/apps/client/locales/en/leo.json +++ b/apps/client/locales/en/leo.json @@ -344,7 +344,9 @@ "ACTIVE_INCIDENTS": "Active Incidents", "layoutSavedTitle": "Layout Saved", "layoutSavedMessage": "Your layout has been saved.", - "editDashboardLayout": "Edit Dashboard Layout" + "editDashboardLayout": "Edit Dashboard Layout", + "vehicleInvolved": "Vehicle Involved", + "fireType": "Fire Type" }, "Bolos": { "activeBolos": "Active Bolos", diff --git a/apps/client/src/components/leo/incidents/manage-incident-modal.tsx b/apps/client/src/components/leo/incidents/manage-incident-modal.tsx index 9cd8aec9e..0d80d5a3e 100644 --- a/apps/client/src/components/leo/incidents/manage-incident-modal.tsx +++ b/apps/client/src/components/leo/incidents/manage-incident-modal.tsx @@ -7,6 +7,7 @@ import { FormRow, Infofield, FullDate, + TextField, } from "@snailycad/ui"; import { FormField } from "components/form/FormField"; import { Modal } from "components/modal/Modal"; @@ -160,16 +161,20 @@ export function ManageIncidentModal({ } const validate = handleValidate(LEO_INCIDENT_SCHEMA); + const isEmsFdIncident = incident && "fireType" in incident; + const INITIAL_VALUES = { description: incident?.description ?? "", postal: incident?.postal ?? "", descriptionData: dataToSlate(incident), + vehicleInvolved: isEmsFdIncident ? incident.vehicleInvolved : false, firearmsInvolved: incident?.firearmsInvolved ?? false, injuriesOrFatalities: incident?.injuriesOrFatalities ?? false, arrestsMade: incident?.arrestsMade ?? false, isActive: isDispatch ? true : incident?.isActive ?? false, situationCodeId: incident?.situationCodeId ?? null, openModalAfterCreation: true, + fireType: isEmsFdIncident ? incident.fireType ?? "" : "", }; return ( @@ -205,7 +210,12 @@ export function ManageIncidentModal({ ) : null}
- +
({ > {t("arrestsMade")} - + + setFieldValue("vehicleInvolved", isSelected)} + className="w-full" + > + {t("vehicleInvolved")} + +
({ /> - - value.type === StatusValueType.SITUATION_CODE} - /> + + + value.type === StatusValueType.SITUATION_CODE} + /> + + setFieldValue("fireType", value)} + label={t("fireType")} + /> +