Commit 69250a45 authored by Diego Iván's avatar Diego Iván
Browse files

cambiando campo coords por dos campos latitude y longitude

parent 33b51e79
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -19,8 +19,12 @@ export class CreatePlaceDateTradDto {
  @ApiProperty({ type: 'string', format: 'binary' })
  image;

  @ApiProperty({ example: '12.3456789-12.3456789' })
  coords: string;
  @ApiProperty()
  latitude: number;

  @ApiProperty()
  longitude: number;

  // 24-hour format
  @ApiProperty({ maximum: 24, minimum: 0 })
  openAt: number;
+2 −12
Original line number Diff line number Diff line
import { ApiProperty } from '@nestjs/swagger';
import { Available } from 'src/pointOfInterest/enum/available.enum';
import { Town } from 'src/town/entities/town.entity';

export class CreatePlaceDto {
  @ApiProperty({ enum: Available, enumName: 'Available' })
  available: Available;
  @ApiProperty()
  name: string;
  @ApiProperty()
  imageName: string;

  @ApiProperty({ type: 'number' })
  idTown: Town;
  @ApiProperty({ example: '12.3456789-12.3456789' })
  coords: string;
  // 24-hour format
  @ApiProperty({ maximum: 24, minimum: 0 })
  latitude: number;
  longitude: number;
  openAt: number;
  // 24-hour format
  @ApiProperty({ maximum: 24, minimum: 0 })
  closeAt: number;
}
+2 −1
Original line number Diff line number Diff line
@@ -8,7 +8,8 @@ export class GetPlaceDto {
  name: string;
  description: string;
  imageName: string;
  coords: string;
  latitude: number;
  longitude: number;
  openAt: number;
  closeAt: number;
  startDate: Date;
+4 −1
Original line number Diff line number Diff line
@@ -29,7 +29,10 @@ export class Place {
  imageName: string;

  @Column({ nullable: false })
  coords: string;
  latitude: number;

  @Column({ nullable: false })
  longitude: number;

  @Column({ nullable: false })
  openAt: number;
+10 −5
Original line number Diff line number Diff line
@@ -28,7 +28,8 @@ export class PlaceService {
    const createPlace: CreatePlaceDto = {
      available: createPlaceDto.available,
      closeAt: createPlaceDto.closeAt,
      coords: createPlaceDto.coords,
      latitude: createPlaceDto.latitude,
      longitude: createPlaceDto.longitude,
      idTown: town,
      name: createPlaceDto.name,
      openAt: createPlaceDto.openAt,
@@ -76,13 +77,14 @@ export class PlaceService {
        'place.imageName AS imageName',
        'placeTrad.language AS language',
        'placeTrad.description AS description',
        'place.coords AS coords',
        'place.openAt AS openAt',
        'place.closeAt AS closeAt',
        'availableDate.startDate AS startDate',
        'availableDate.endDate AS endDate',
        'place.available AS available',
        'place.idTown AS idTown',
        'place.latitude AS latitude',
        'place.longitude AS longitude',
      ])
      .where('place.idTown = :idTown', { idTown: idTown })
      .andWhere('placeTrad.language = :language', { language: lang })
@@ -93,7 +95,8 @@ export class PlaceService {
        idPlace: place.idPlace,
        available: place.available,
        description: place.description,
        coords: place.coords,
        latitude: place.latitude,
        longitude: place.longitude,
        imageName: `${ServerConstants.HOST}/places/${place.imageName}`,
        name: place.name,
        openAt: place.openAt,
@@ -121,7 +124,8 @@ export class PlaceService {
        'place.imageName AS imageName',
        'placeTrad.language AS language',
        'placeTrad.description AS description',
        'place.coords AS coords',
        'place.latitude AS latitude',
        'place.longitude AS longitude',
        'place.openAt AS openAt',
        'place.closeAt AS closeAt',
        'availableDate.startDate AS startDate',
@@ -137,7 +141,8 @@ export class PlaceService {
      idPlace: place.idPlace,
      available: place.available,
      description: place.description,
      coords: place.coords,
      latitude: place.latitude,
      longitude: place.longitude,
      imageName: `${ServerConstants.HOST}/places/${place.imageName}`,
      name: place.name,
      openAt: place.openAt,