Skip to content

Commit 97830f4

Browse files
pedroperronefilipepacheco
authored andcommitted
Add address details in shelters
1 parent 375418e commit 97830f4

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
-- AlterTable
2+
ALTER TABLE "shelters" ADD COLUMN "city" TEXT,
3+
ADD COLUMN "neighbourhood" TEXT,
4+
ADD COLUMN "street" TEXT,
5+
ADD COLUMN "street_number" TEXT,
6+
ADD COLUMN "zip_code" TEXT;

prisma/schema.prisma

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ model Shelter {
8989
name String @unique
9090
pix String? @unique
9191
address String
92+
street String?
93+
neighbourhood String?
94+
city String?
95+
streetNumber String? @map("street_number")
96+
zipCode String? @map("zip_code")
9297
petFriendly Boolean? @map("pet_friendly")
9398
shelteredPeople Int? @map("sheltered_people")
9499
capacity Int?

src/shelter/types/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ const ShelterSchema = z.object({
1212
name: z.string().transform(capitalize),
1313
pix: z.string().nullable().optional(),
1414
address: z.string().transform(capitalize),
15+
city: z.string().transform(capitalize).optional(),
16+
neighbourhood: z.string().transform(capitalize).optional(),
17+
street: z.string().transform(capitalize).optional(),
18+
streetNumber: z.string().nullable().optional(),
19+
zipCode: z.string().nullable().optional(),
1520
petFriendly: z.boolean().nullable().optional(),
1621
shelteredPeople: z.number().min(0).nullable().optional(),
1722
latitude: z.number().nullable().optional(),

0 commit comments

Comments
 (0)