Skip to content

Commit 4bbc818

Browse files
committed
Add address details in shelters
1 parent fca1031 commit 4bbc818

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
@@ -86,6 +86,11 @@ model Shelter {
8686
name String @unique
8787
pix String? @unique
8888
address String
89+
street String?
90+
neighbourhood String?
91+
city String?
92+
streetNumber String? @map("street_number")
93+
zipCode String? @map("zip_code")
8994
petFriendly Boolean? @map("pet_friendly")
9095
shelteredPeople Int? @map("sheltered_people")
9196
capacity Int?

src/shelter/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().nullable().optional(),
1722
latitude: z.number().nullable().optional(),

0 commit comments

Comments
 (0)