Skip to content

Commit dc70616

Browse files
pedroperronefilipepacheco
authored andcommitted
Add address details in shelters
1 parent b12e063 commit dc70616

File tree

4 files changed

+21
-0
lines changed

4 files changed

+21
-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/shelter.service.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ export class ShelterService {
136136
name: true,
137137
pix: true,
138138
address: true,
139+
street: true,
140+
neighbourhood: true,
141+
city: true,
142+
streetNumber: true,
143+
zipCode: true,
139144
capacity: true,
140145
contact: true,
141146
petFriendly: true,

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).nullable().optional(),
16+
neighbourhood: z.string().transform(capitalize).nullable().optional(),
17+
street: z.string().transform(capitalize).nullable().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)