diff --git a/backend/src/place/dto/create-place-date.dto.ts b/backend/src/place/dto/create-place-date.dto.ts index a8162052e9524a76ac16db4307cdb9adef051fbe..d427c679a1b4601b29ad17a34ea8d4fef87c0e76 100644 --- a/backend/src/place/dto/create-place-date.dto.ts +++ b/backend/src/place/dto/create-place-date.dto.ts @@ -26,11 +26,14 @@ export class CreatePlaceDateTradDto { @ApiProperty({ type: 'string', format: 'binary' }) image; - @ApiProperty() - latitude: number; + @ApiProperty({ type: 'decimal' }) + latitude; + + @ApiProperty({ type: 'decimal' }) + longitude; @ApiProperty() - longitude: number; + address: string; // 24-hour format @ApiProperty({ maximum: 24, minimum: 0 }) diff --git a/backend/src/place/dto/create-place.dto.ts b/backend/src/place/dto/create-place.dto.ts index 63fd93309fc81b69bb70b91fd078e1db4ff3e160..ed87948a6d1a274e38175ad7d17518946343bd6f 100644 --- a/backend/src/place/dto/create-place.dto.ts +++ b/backend/src/place/dto/create-place.dto.ts @@ -7,8 +7,9 @@ export class CreatePlaceDto { name: string; imageName: string; town: Town; - latitude: number; - longitude: number; + latitude: 'decimal'; + longitude: 'decimal'; + address: string; openAt: number; closeAt: number; categories: Category[]; diff --git a/backend/src/place/dto/get-place.dto.ts b/backend/src/place/dto/get-place.dto.ts index ae110d5575ac2a9b2ac410263499e931f37c34c8..c42c6983c403f9d7526a0047b72911150e67bafe 100644 --- a/backend/src/place/dto/get-place.dto.ts +++ b/backend/src/place/dto/get-place.dto.ts @@ -27,4 +27,7 @@ export class GetPlaceDto { endDate: Date; @ApiProperty() categories: any[]; + + @ApiProperty() + address: string; } diff --git a/backend/src/place/entities/place.entity.ts b/backend/src/place/entities/place.entity.ts index 00412dccb1e8072b1164a397dd1870884676d481..2176b5bf6dcd4d640731ece9a5fb891a24b93fbc 100644 --- a/backend/src/place/entities/place.entity.ts +++ b/backend/src/place/entities/place.entity.ts @@ -46,11 +46,14 @@ export class Place { @Column() imageName: string; - @Column({ nullable: false }) - latitude: number; + @Column({ nullable: false, type: 'decimal', precision: 10, scale: 8 }) + latitude; + + @Column({ nullable: false, type: 'decimal', precision: 10, scale: 8 }) + longitude; @Column({ nullable: false }) - longitude: number; + address: string; @Column({ nullable: false }) openAt: number; diff --git a/backend/src/place/place.service.ts b/backend/src/place/place.service.ts index e0f8d5922b6d25d3da37d8102e3f0e71d90e2af0..904aaa4cfb8a2bead353b45d05e4fdd2016c707b 100644 --- a/backend/src/place/place.service.ts +++ b/backend/src/place/place.service.ts @@ -47,6 +47,7 @@ export class PlaceService { openAt: createPlaceDto.openAt, imageName: createPlaceDto.image.filename, categories: categories, + address: createPlaceDto.address, }; if (!town) { @@ -105,6 +106,7 @@ export class PlaceService { endDate: place.availableDates[0]?.endDate || null, categories: place.categories, description: place.placeTraduction[0].description, + address: place.address, }; }); return places; @@ -140,6 +142,7 @@ export class PlaceService { endDate: place.availableDates[0]?.endDate, categories: place.categories, description: place.placeTraduction[0].description, + address: place.address, }; return res; }