Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add address details in shelters #80

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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