diff --git a/prisma/migrations/20240516140110_add_capacity_and_shelter_pets/migration.sql b/prisma/migrations/20240516140110_add_capacity_and_shelter_pets/migration.sql new file mode 100644 index 00000000..de70c354 --- /dev/null +++ b/prisma/migrations/20240516140110_add_capacity_and_shelter_pets/migration.sql @@ -0,0 +1,3 @@ +-- AlterTable +ALTER TABLE "shelters" ADD COLUMN "pets_capacity" INTEGER, +ADD COLUMN "sheltered_pets" INTEGER; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 1a4b82f5..11c893a7 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -120,6 +120,8 @@ model Shelter { streetNumber String? @map("street_number") zipCode String? @map("zip_code") petFriendly Boolean? @map("pet_friendly") + shelteredPets Int? @map("sheltered_pets") + petsCapacity Int? @map("pets_capacity") shelteredPeople Int? @map("sheltered_people") capacity Int? contact String? diff --git a/src/shelter/shelter.service.ts b/src/shelter/shelter.service.ts index 9aee0f0d..e3a4a59e 100644 --- a/src/shelter/shelter.service.ts +++ b/src/shelter/shelter.service.ts @@ -86,6 +86,8 @@ export class ShelterService implements OnModuleInit { capacity: true, contact: shouldShowContact, petFriendly: true, + shelteredPets: true, + petsCapacity: true, prioritySum: true, latitude: true, longitude: true, @@ -165,6 +167,8 @@ export class ShelterService implements OnModuleInit { zipCode: true, capacity: true, petFriendly: true, + shelteredPets: true, + petsCapacity: true, shelteredPeople: true, prioritySum: true, verified: true, diff --git a/src/shelter/types/types.ts b/src/shelter/types/types.ts index c2361788..f95593f4 100644 --- a/src/shelter/types/types.ts +++ b/src/shelter/types/types.ts @@ -19,6 +19,8 @@ const ShelterSchema = z.object({ streetNumber: z.string().nullable().optional(), zipCode: z.string().nullable().optional(), petFriendly: z.boolean().nullable().optional(), + shelteredPets: z.number().min(0).nullable().optional(), + petsCapacity: z.number().min(0).nullable().optional(), shelteredPeople: z.number().min(0).nullable().optional(), latitude: z.number().nullable().optional(), longitude: z.number().nullable().optional(), @@ -39,6 +41,8 @@ const CreateShelterSchema = ShelterSchema.omit({ const UpdateShelterSchema = ShelterSchema.pick({ petFriendly: true, shelteredPeople: true, + shelteredPets: true, + petsCapacity: true, }).partial(); const FullUpdateShelterSchema = ShelterSchema.omit({