Add Weather module with controller, service, and DTO for fetching weather details

This commit is contained in:
faris Aljohari
2025-06-03 02:38:44 -06:00
parent 12a9272b8b
commit c39129f75b
11 changed files with 141 additions and 1 deletions

View File

@ -0,0 +1,28 @@
import { Controller, Get, Query } from '@nestjs/common';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { EnableDisableStatusEnum } from '@app/common/constants/days.enum';
import { ControllerRoute } from '@app/common/constants/controller-route'; // Assuming this is where the routes are defined
import { WeatherService } from '../services';
import { BaseResponseDto } from '@app/common/dto/base.response.dto';
import { GetWeatherDetailsDto } from '../dto/get.weather.dto';
@ApiTags('Weather Module')
@Controller({
version: EnableDisableStatusEnum.ENABLED,
path: ControllerRoute.WEATHER.ROUTE, // use the static route constant
})
export class WeatherController {
constructor(private readonly weatherService: WeatherService) {}
@Get()
@ApiOperation({
summary: ControllerRoute.WEATHER.ACTIONS.FETCH_WEATHER_DETAILS_SUMMARY,
description:
ControllerRoute.WEATHER.ACTIONS.FETCH_WEATHER_DETAILS_DESCRIPTION,
})
async fetchWeatherDetails(
@Query() query: GetWeatherDetailsDto,
): Promise<BaseResponseDto> {
return await this.weatherService.fetchWeatherDetails(query);
}
}