Skip to content

Commit

Permalink
Add address details in shelters
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroperrone authored and filipepacheco committed May 12, 2024
1 parent b12e063 commit dc70616
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
6 changes: 6 additions & 0 deletions prisma/migrations/20240512005246_/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
-- AlterTable
ALTER TABLE "shelters" ADD COLUMN "city" TEXT,
ADD COLUMN "neighbourhood" TEXT,
ADD COLUMN "street" TEXT,
ADD COLUMN "street_number" TEXT,
ADD COLUMN "zip_code" TEXT;
5 changes: 5 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ model Shelter {
name String @unique
pix String? @unique
address String
street String?
neighbourhood String?
city String?
streetNumber String? @map("street_number")
zipCode String? @map("zip_code")
petFriendly Boolean? @map("pet_friendly")
shelteredPeople Int? @map("sheltered_people")
capacity Int?
Expand Down
5 changes: 5 additions & 0 deletions src/shelter/shelter.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ export class ShelterService {
name: true,
pix: true,
address: true,
street: true,
neighbourhood: true,
city: true,
streetNumber: true,
zipCode: true,
capacity: true,
contact: true,
petFriendly: true,
Expand Down
5 changes: 5 additions & 0 deletions src/shelter/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ const ShelterSchema = z.object({
name: z.string().transform(capitalize),
pix: z.string().nullable().optional(),
address: z.string().transform(capitalize),
city: z.string().transform(capitalize).nullable().optional(),
neighbourhood: z.string().transform(capitalize).nullable().optional(),
street: z.string().transform(capitalize).nullable().optional(),
streetNumber: z.string().nullable().optional(),
zipCode: z.string().nullable().optional(),
petFriendly: z.boolean().nullable().optional(),
shelteredPeople: z.number().min(0).nullable().optional(),
latitude: z.number().nullable().optional(),
Expand Down

0 comments on commit dc70616

Please sign in to comment.