Skip to content

Commit

Permalink
feat: extraFields for emergency vehicle value
Browse files Browse the repository at this point in the history
  • Loading branch information
casperiv0 committed Nov 10, 2023
1 parent 715b5f5 commit b8b23d8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "EmergencyVehicleValue" ADD COLUMN "extraFields" JSONB;
1 change: 1 addition & 0 deletions apps/api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,7 @@ model EmergencyVehicleValue {
valueId String
departments DepartmentValue[]
divisions DivisionValue[]
extraFields Json?
Officers Officer[] @relation("activeEmergencyVehicle_leo")
EmsFdDeputies EmsFdDeputy[] @relation("activeEmergencyVehicle_emsfd")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ export const typeHandlers = {
...makePrismaData(ValueType.EMERGENCY_VEHICLE, {
value: item.value,
isDisabled: item.isDisabled,
extraFields: item.extraFields || undefined,
}),
include: valueInclude,
});
Expand Down
1 change: 1 addition & 0 deletions packages/schemas/src/admin/values/import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export const CALL_TYPE_ARR = z.array(CALL_TYPE_SCHEMA).min(1);
export const EMERGENCY_VEHICLE_SCHEMA = BASE_VALUE_SCHEMA.extend({
departments: z.array(z.string()).min(1),
divisions: z.array(z.string()).nullish(),
extraFields: z.any().nullish(),
});

export const EMERGENCY_VEHICLE_ARR = z.array(EMERGENCY_VEHICLE_SCHEMA).min(1);

0 comments on commit b8b23d8

Please sign in to comment.