Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
1513d5f
🧹cleanup: Remove all Bus references
IseduardoRezende Oct 4, 2025
274ef1e
📦build: Update nuget packages
IseduardoRezende Oct 4, 2025
120932c
♻️refactor: Update Entities
IseduardoRezende Oct 4, 2025
0601e7f
♻️refactor: Update Entities Mapping
IseduardoRezende Oct 4, 2025
8ac25db
✨feat: Add Migration
IseduardoRezende Oct 4, 2025
c4c1198
♻️refactor: Update vehicle DTOs
IseduardoRezende Oct 4, 2025
4f7b924
♻️refactor: Update Vehicle Service
IseduardoRezende Oct 4, 2025
1ebd153
♻️refactor: Update Vehicle Enums
IseduardoRezende Oct 5, 2025
29499f4
♻️refactor: Update Vehicle entity
IseduardoRezende Oct 5, 2025
f1fdf69
♻️refactor: Update Vehicle DTOs
IseduardoRezende Oct 5, 2025
5512d8e
✨feat: Add Migration
IseduardoRezende Oct 5, 2025
e98f9b1
♻️refactor: Update Vehicle Service
IseduardoRezende Oct 5, 2025
6972bfd
♻️refactor: Update Vehicle Controller
IseduardoRezende Oct 5, 2025
4c98eb8
♻️refactor: Update Status DTOs
IseduardoRezende Oct 5, 2025
d054598
♻️refactor: Update Services
IseduardoRezende Oct 5, 2025
ad98f9f
📚docs: Update User Controller
IseduardoRezende Oct 5, 2025
2bd199f
♻️refactor: Update Vehicle Controller
IseduardoRezende Oct 5, 2025
db820fe
✨feat: Add Localization to Vehicle data
IseduardoRezende Oct 5, 2025
628811b
♻️refactor: Update Vehicle DTOs
IseduardoRezende Oct 5, 2025
9f03716
♻️refactor: Add validators to Vehicle
IseduardoRezende Oct 5, 2025
5311170
♻️refactor: Add validators Service
IseduardoRezende Oct 5, 2025
44c8a23
✨feat: Add VehicleFilter
IseduardoRezende Oct 5, 2025
1133e49
♻️refactor: Update Vehicle classes
IseduardoRezende Oct 5, 2025
1bc9036
♻️refactor: Update Vehicle Repository
IseduardoRezende Oct 5, 2025
59535d0
♻️refactor: Update Vehicle Validators
IseduardoRezende Oct 5, 2025
7ee72f4
♻️refactor: Update Vehicle field
IseduardoRezende Oct 5, 2025
56cadc1
♻️refactor: Update Vehicle Mapping
IseduardoRezende Oct 5, 2025
ebb1b07
✨feat: Add Migration
IseduardoRezende Oct 5, 2025
f1e97a8
♻️refactor: Update Vehicle Repository
IseduardoRezende Oct 5, 2025
030e708
♻️refactor: Update Vehicle DTOs
IseduardoRezende Oct 5, 2025
8f7447c
♻️refactor: Update Vehicle Service
IseduardoRezende Oct 5, 2025
2531d48
♻️refactor: Update Vehicle Validators
IseduardoRezende Oct 5, 2025
89ed130
♻️refactor: Update Vehicle Create Validator
IseduardoRezende Oct 5, 2025
5e46cef
🐛fix: Update Vehicle Service
IseduardoRezende Oct 5, 2025
3560028
Merge pull request #8 from OneBus/dev-eduardo
IseduardoRezende Oct 5, 2025
1e45ac6
♻️refactor: Update Vehicle Type DTO
IseduardoRezende Oct 5, 2025
2511c93
♻️refactor: Update Utils class references
IseduardoRezende Oct 5, 2025
1b3ec00
♻️refactor: Update BusServiceType
IseduardoRezende Oct 7, 2025
d4a60ff
🐛fix: Update Validators
IseduardoRezende Oct 7, 2025
bf9b52e
♻️refactor: Update Enums
IseduardoRezende Oct 7, 2025
6422c1b
♻️refactor: Update Line
IseduardoRezende Oct 8, 2025
b757b7c
✨feat: Add LineFilter
IseduardoRezende Oct 8, 2025
9ef5572
♻️refactor: Update DirectionType enum
IseduardoRezende Oct 8, 2025
fc62f9b
✨feat: Add Migration
IseduardoRezende Oct 8, 2025
fb7e3e0
♻️refactor: Update Line Repository
IseduardoRezende Oct 8, 2025
73f7978
♻️refactor: Update Line DTOs
IseduardoRezende Oct 8, 2025
2924879
♻️refactor: Update Line Service
IseduardoRezende Oct 8, 2025
039f3a3
♻️refactor: Update Line Validators
IseduardoRezende Oct 8, 2025
233f7db
♻️refactor: Update Line Controller
IseduardoRezende Oct 8, 2025
7f0dc5f
Merge pull request #9 from OneBus/dev-eduardo
IseduardoRezende Oct 8, 2025
434a24c
♻️refactor: Update projects packages
IseduardoRezende Oct 23, 2025
29382f8
♻️refactor: Update Line Validators
IseduardoRezende Oct 24, 2025
94fb294
✨feat: Add LineTimeFilter
IseduardoRezende Oct 24, 2025
77b9136
♻️refactor: Update LineTime Entity
IseduardoRezende Oct 24, 2025
07c0da3
✨feat: Add Migration
IseduardoRezende Oct 24, 2025
956b87e
♻️refactor: Update LineTime Repository
IseduardoRezende Oct 24, 2025
ad12ab4
♻️refactor: Update LineTime DTOs
IseduardoRezende Oct 24, 2025
77ebf27
♻️refactor: Update LineTime Validators
IseduardoRezende Oct 24, 2025
565509c
♻️refactor: Update LineTime Service
IseduardoRezende Oct 24, 2025
d40d449
♻️refactor: Update Service classes
IseduardoRezende Oct 24, 2025
62d9ba2
♻️refactor: Update LineTime Controller
IseduardoRezende Oct 24, 2025
9407d4c
♻️refactor: Update Sector enum
IseduardoRezende Oct 24, 2025
c457fe5
✨feat: Add Maintenance Filter
IseduardoRezende Oct 24, 2025
98270c1
♻️refactor: Update Maintenance Repository
IseduardoRezende Oct 24, 2025
1c365a8
♻️refactor: Update Maintenance DTOs
IseduardoRezende Oct 24, 2025
7ca6cff
♻️refactor: Update Maintenance Validators
IseduardoRezende Oct 24, 2025
94836ee
♻️refactor: Update Maintenance Service
IseduardoRezende Oct 24, 2025
a2d734c
♻️refactor: Update Maintenance Controller
IseduardoRezende Oct 24, 2025
c9cf5cf
Merge pull request #10 from OneBus/dev-eduardo
IseduardoRezende Oct 24, 2025
02d652a
✨feat: Add new field into ReadEmployeeWorkday DTO
IseduardoRezende Nov 1, 2025
1a78d70
♻️refactor: Update time validations
IseduardoRezende Nov 1, 2025
57b8df9
♻️refactor: Update Vehicle Operation entity
IseduardoRezende Nov 1, 2025
0d86917
✨feat: Add Migration
IseduardoRezende Nov 1, 2025
c3fa055
✨feat: Add Vehicle Operation filter
IseduardoRezende Nov 1, 2025
56306ca
♻️refactor: Update Vehicle Operation Repository
IseduardoRezende Nov 1, 2025
c009bcf
♻️refactor: Update Vehicle Operation DTOs
IseduardoRezende Nov 1, 2025
a1e7ce1
♻️refactor: Update Vehicle Operation Validators
IseduardoRezende Nov 1, 2025
c14c16b
♻️refactor: Update Vehicle Operation Service
IseduardoRezende Nov 1, 2025
2f0a9da
♻️refactor: Update Vehicle Operation Controller
IseduardoRezende Nov 1, 2025
abe3730
Merge pull request #11 from OneBus/dev-eduardo
IseduardoRezende Nov 1, 2025
915185f
♻️refactor: Update project package
IseduardoRezende Nov 4, 2025
33b7cef
♻️refactor: Update LineTime
IseduardoRezende Nov 4, 2025
98faecc
✨feat: Add Migration
IseduardoRezende Nov 4, 2025
c6f69a9
♻️refactor: Update project package
IseduardoRezende Nov 4, 2025
df0b10a
♻️refactor: Update VehicleOperation Filter
IseduardoRezende Nov 4, 2025
1e11e79
♻️refactor: Update Repositories
IseduardoRezende Nov 4, 2025
29eb917
♻️refactor: Update LineTime DTOs
IseduardoRezende Nov 4, 2025
0c4b631
♻️refactor: Update LineTime Service
IseduardoRezende Nov 4, 2025
7bcbfb6
♻️refactor: Update LineTime Validators
IseduardoRezende Nov 4, 2025
cbcc87f
✨feat: Add Dashboard DTOs
IseduardoRezende Nov 5, 2025
b9874d3
♻️refactor: Fixing Pagination
IseduardoRezende Nov 5, 2025
63f2cf9
♻️refactor: Updating VehicleOperation Service
IseduardoRezende Nov 5, 2025
f713bd1
✨feat: Add Dashboard Service
IseduardoRezende Nov 5, 2025
7a744f5
♻️refactor: Updating Dependency Injection
IseduardoRezende Nov 5, 2025
5b343c4
✨feat: Add Dashboard Controller
IseduardoRezende Nov 5, 2025
3e3ada6
♻️refactor: Update project package
IseduardoRezende Nov 5, 2025
9a09cc3
♻️refactor: Update \ReadVehicleOperation DTO
IseduardoRezende Nov 5, 2025
38b4afa
♻️refactor: Updating VehicleOperation Service
IseduardoRezende Nov 5, 2025
1233e98
✨feat: Add VehicleRepository new method
IseduardoRezende Nov 5, 2025
0ccc02f
✨feat: Add ehicleOperation Worker
IseduardoRezende Nov 5, 2025
ab325b7
♻️refactor: Updating Dependency Injection
IseduardoRezende Nov 5, 2025
b8ff8a5
Merge pull request #12 from OneBus/dev-eduardo
IseduardoRezende Nov 5, 2025
e64c2f3
♻️refactor: Updating Maintenance Service
IseduardoRezende Nov 5, 2025
2e5c818
Merge pull request #13 from OneBus/dev-eduardo
IseduardoRezende Nov 5, 2025
ae5d545
♻️refactor: Updating Line Validators
IseduardoRezende Nov 5, 2025
19c2197
Merge pull request #14 from OneBus/dev-eduardo
IseduardoRezende Nov 5, 2025
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
57 changes: 57 additions & 0 deletions OneBus.API/Controllers/DashboardController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using OneBus.API.Extensions;
using OneBus.Application.DTOs.Dashboard;
using OneBus.Application.Interfaces.Services;
using OneBus.Domain.Commons.Result;
using Swashbuckle.AspNetCore.Annotations;

namespace OneBus.API.Controllers
{
[Route("api/v1/dashboards")]
[ApiController]
[Produces("application/json")]
[Authorize]
[SwaggerTag("Controlador responsável por listar Dashboards")]
public class DashboardController : ControllerBase
{
private readonly IDashboardService _dashboardService;

public DashboardController(IDashboardService dashboardService)
{
_dashboardService = dashboardService;
}

/// <summary>
/// Obter status dos funcionários
/// </summary>
/// <remarks>
/// GET de status dos funcionários
/// </remarks>
/// <param name="cancellationToken"></param>
/// <returns>Status dos funcionários categorizados</returns>
/// <response code="200">Status dos funcionários categorizados com sucesso</response>
[HttpGet("employees")]
[ProducesResponseType(typeof(SuccessResult<ReadEmployeeTotalCountDTO>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetEmployeeStatusAsync(CancellationToken cancellationToken = default)
{
return (await _dashboardService.GetEmployeeStatusAsync(cancellationToken)).ToActionResult();
}

/// <summary>
/// Obter status dos veículos
/// </summary>
/// <remarks>
/// GET de status dos veículos
/// </remarks>
/// <param name="cancellationToken"></param>
/// <returns>Status dos veículos categorizados</returns>
/// <response code="200">Status dos veículos categorizados com sucesso</response>
[HttpGet("vehicles")]
[ProducesResponseType(typeof(SuccessResult<ReadVehicleTotalCountDTO>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetVehicleStatusAsync(CancellationToken cancellationToken = default)
{
return (await _dashboardService.GetVehicleStatusAsync(cancellationToken)).ToActionResult();
}
}
}
2 changes: 1 addition & 1 deletion OneBus.API/Controllers/EmployeeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public async Task<IActionResult> GetByIdAsync([FromRoute] long id, CancellationT
/// <returns>Status disponíveis</returns>
/// <response code="200">Status retornados com sucesso</response>
[HttpGet("status")]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadStatusDTO>>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadEmployeeStatusDTO>>), StatusCodes.Status200OK)]
public IActionResult GetStatus()
{
return _employeeService.GetStatus().ToActionResult();
Expand Down
33 changes: 31 additions & 2 deletions OneBus.API/Controllers/LineController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace OneBus.API.Controllers
{
[NonController]
[Route("api/v1/lines")]
[ApiController]
[Produces("application/json")]
Expand Down Expand Up @@ -102,7 +101,7 @@ public async Task<IActionResult> DeleteAsync([FromRoute] long id, CancellationTo
/// <response code="200">Linhas paginadas e filtradas com sucesso</response>
[HttpGet]
[ProducesResponseType(typeof(SuccessResult<Pagination<ReadLineDTO>>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetPaginedAsync([FromQuery] BaseFilter filter, CancellationToken cancellationToken = default)
public async Task<IActionResult> GetPaginedAsync([FromQuery] LineFilter filter, CancellationToken cancellationToken = default)
{
return (await _lineService.GetPaginedAsync(filter, cancellationToken: cancellationToken)).ToActionResult();
}
Expand All @@ -125,5 +124,35 @@ public async Task<IActionResult> GetByIdAsync([FromRoute] long id, CancellationT
{
return (await _lineService.GetByIdAsync(id, cancellationToken: cancellationToken)).ToActionResult();
}

/// <summary>
/// Listar tipos de linhas
/// </summary>
/// <remarks>
/// GET de tipos de linhas
/// </remarks>
/// <returns>Tipos de linhas disponíveis</returns>
/// <response code="200">Tipos de linhas retornadas com sucesso</response>
[HttpGet("types")]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadLineTypeDTO>>), StatusCodes.Status200OK)]
public IActionResult GetVehicleTypes()
{
return _lineService.GetLineTypes().ToActionResult();
}

/// <summary>
/// Listar tipos de direção
/// </summary>
/// <remarks>
/// GET de tipos de direção
/// </remarks>
/// <returns>Tipos de direção disponíveis</returns>
/// <response code="200">Tipos de direção retornadas com sucesso</response>
[HttpGet("directionTypes")]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadDirectionTypeDTO>>), StatusCodes.Status200OK)]
public IActionResult GetDirectionTypes()
{
return _lineService.GetDirectionTypes().ToActionResult();
}
}
}
11 changes: 7 additions & 4 deletions OneBus.API/Controllers/LineTimeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace OneBus.API.Controllers
{
[NonController]
[Route("api/v1/linesTimes")]
[ApiController]
[Produces("application/json")]
Expand Down Expand Up @@ -102,9 +101,11 @@ public async Task<IActionResult> DeleteAsync([FromRoute] long id, CancellationTo
/// <response code="200">Horários de Linha paginados e filtrados com sucesso</response>
[HttpGet]
[ProducesResponseType(typeof(SuccessResult<Pagination<ReadLineTimeDTO>>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetPaginedAsync([FromQuery] BaseFilter filter, CancellationToken cancellationToken = default)
public async Task<IActionResult> GetPaginedAsync([FromQuery] LineTimeFilter filter, CancellationToken cancellationToken = default)
{
return (await _lineTimeService.GetPaginedAsync(filter, cancellationToken: cancellationToken)).ToActionResult();
return (await _lineTimeService.GetPaginedAsync(filter,
DbQueryOptions.Create(["Line"]),
cancellationToken)).ToActionResult();
}

/// <summary>
Expand All @@ -123,7 +124,9 @@ public async Task<IActionResult> GetPaginedAsync([FromQuery] BaseFilter filter,
[ProducesResponseType(typeof(NotFoundResult<ReadLineTimeDTO>), StatusCodes.Status404NotFound)]
public async Task<IActionResult> GetByIdAsync([FromRoute] long id, CancellationToken cancellationToken = default)
{
return (await _lineTimeService.GetByIdAsync(id, cancellationToken: cancellationToken)).ToActionResult();
return (await _lineTimeService.GetByIdAsync(id,
DbQueryOptions.Create(["Line"]),
cancellationToken)).ToActionResult();
}
}
}
26 changes: 22 additions & 4 deletions OneBus.API/Controllers/MaintenanceController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace OneBus.API.Controllers
{
[NonController]
[Route("api/v1/maintenances")]
[ApiController]
[Produces("application/json")]
Expand Down Expand Up @@ -102,9 +101,11 @@ public async Task<IActionResult> DeleteAsync([FromRoute] long id, CancellationTo
/// <response code="200">Manutenções paginadas e filtradas com sucesso</response>
[HttpGet]
[ProducesResponseType(typeof(SuccessResult<Pagination<ReadMaintenanceDTO>>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetPaginedAsync([FromQuery] BaseFilter filter, CancellationToken cancellationToken = default)
public async Task<IActionResult> GetPaginedAsync([FromQuery] MaintenanceFilter filter, CancellationToken cancellationToken = default)
{
return (await _maintenanceService.GetPaginedAsync(filter, cancellationToken: cancellationToken)).ToActionResult();
return (await _maintenanceService.GetPaginedAsync(filter,
DbQueryOptions.Create(["Vehicle"]),
cancellationToken)).ToActionResult();
}

/// <summary>
Expand All @@ -123,7 +124,24 @@ public async Task<IActionResult> GetPaginedAsync([FromQuery] BaseFilter filter,
[ProducesResponseType(typeof(NotFoundResult<ReadMaintenanceDTO>), StatusCodes.Status404NotFound)]
public async Task<IActionResult> GetByIdAsync([FromRoute] long id, CancellationToken cancellationToken = default)
{
return (await _maintenanceService.GetByIdAsync(id, cancellationToken: cancellationToken)).ToActionResult();
return (await _maintenanceService.GetByIdAsync(id,
DbQueryOptions.Create(["Vehicle"]),
cancellationToken)).ToActionResult();
}

/// <summary>
/// Listar tipos de setores
/// </summary>
/// <remarks>
/// GET de tipos de setores
/// </remarks>
/// <returns>Tipos de Setores disponíveis</returns>
/// <response code="200">Setores retornados com sucesso</response>
[HttpGet("sectors")]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadSectorDTO>>), StatusCodes.Status200OK)]
public IActionResult GetSectors()
{
return _maintenanceService.GetSectors().ToActionResult();
}
}
}
4 changes: 2 additions & 2 deletions OneBus.API/Controllers/UserController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public UserController(IUserService userService)
///
/// POST /logins
/// {
/// "email": "helloworld@gmail.com",
/// "password": "dasdfsf35346353tsd"
/// "email": "onebus@admin",
/// "password": "onebus@2025"
/// }
/// </remarks>
/// <param name="login"></param>
Expand Down
123 changes: 121 additions & 2 deletions OneBus.API/Controllers/VehicleController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace OneBus.API.Controllers
{
[NonController]
[Route("api/v1/vehicles")]
[ApiController]
[Produces("application/json")]
Expand Down Expand Up @@ -102,7 +101,7 @@ public async Task<IActionResult> DeleteAsync([FromRoute] long id, CancellationTo
/// <response code="200">Veículos paginados e filtrados com sucesso</response>
[HttpGet]
[ProducesResponseType(typeof(SuccessResult<Pagination<ReadVehicleDTO>>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetPaginedAsync([FromQuery] BaseFilter filter, CancellationToken cancellationToken = default)
public async Task<IActionResult> GetPaginedAsync([FromQuery] VehicleFilter filter, CancellationToken cancellationToken = default)
{
return (await _vehicleService.GetPaginedAsync(filter, cancellationToken: cancellationToken)).ToActionResult();
}
Expand All @@ -125,5 +124,125 @@ public async Task<IActionResult> GetByIdAsync([FromRoute] long id, CancellationT
{
return (await _vehicleService.GetByIdAsync(id, cancellationToken: cancellationToken)).ToActionResult();
}

/// <summary>
/// Listar status
/// </summary>
/// <remarks>
/// GET de status
/// </remarks>
/// <returns>Status disponíveis</returns>
/// <response code="200">Status retornados com sucesso</response>
[HttpGet("status")]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadVehicleStatusDTO>>), StatusCodes.Status200OK)]
public IActionResult GetStatus()
{
return _vehicleService.GetStatus().ToActionResult();
}

/// <summary>
/// Listar marcas
/// </summary>
/// <remarks>
/// GET de marcas
/// </remarks>
/// <returns>Marcas disponíveis</returns>
/// <response code="200">Marcas retornadas com sucesso</response>
[HttpGet("brands")]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadBrandDTO>>), StatusCodes.Status200OK)]
public IActionResult GetBrands()
{
return _vehicleService.GetBrands().ToActionResult();
}

/// <summary>
/// Listar marcas de chassis
/// </summary>
/// <remarks>
/// GET de marcas de chassis
/// </remarks>
/// <returns>Marcas de chassis disponíveis</returns>
/// <response code="200">Marcas de chassis retornadas com sucesso</response>
[HttpGet("chassisBrands")]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadBusChassisBrandDTO>>), StatusCodes.Status200OK)]
public IActionResult GetBusChassisBrands()
{
return _vehicleService.GetBusChassisBrands().ToActionResult();
}

/// <summary>
/// Listar tipos de serviço
/// </summary>
/// <remarks>
/// GET de tipos de serviço
/// </remarks>
/// <returns>Tipos de serviço disponíveis</returns>
/// <response code="200">Tipos de serviço retornados com sucesso</response>
[HttpGet("serviceTypes")]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadBusServiceTypeDTO>>), StatusCodes.Status200OK)]
public IActionResult GetBusServiceTypes()
{
return _vehicleService.GetBusServiceTypes().ToActionResult();
}

/// <summary>
/// Listar cores
/// </summary>
/// <remarks>
/// GET de cores
/// </remarks>
/// <returns>Cores disponíveis</returns>
/// <response code="200">Cores retornadas com sucesso</response>
[HttpGet("colors")]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadColorDTO>>), StatusCodes.Status200OK)]
public IActionResult GetColors()
{
return _vehicleService.GetColors().ToActionResult();
}

/// <summary>
/// Listar tipos de combustíveis
/// </summary>
/// <remarks>
/// GET de tipos de combustíveis
/// </remarks>
/// <returns>Tipos de combustíveis disponíveis</returns>
/// <response code="200">Tipos de combustíveis retornados com sucesso</response>
[HttpGet("fuelTypes")]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadFuelTypeDTO>>), StatusCodes.Status200OK)]
public IActionResult GetFuelTypes()
{
return _vehicleService.GetFuelTypes().ToActionResult();
}

/// <summary>
/// Listar tipos de transmissão
/// </summary>
/// <remarks>
/// GET de tipos de transmissão
/// </remarks>
/// <returns>Tipos de transmissão disponíveis</returns>
/// <response code="200">Tipos de transmissão retornados com sucesso</response>
[HttpGet("transmissionTypes")]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadTransmissionTypeDTO>>), StatusCodes.Status200OK)]
public IActionResult GetTransmissionTypes()
{
return _vehicleService.GetTransmissionTypes().ToActionResult();
}

/// <summary>
/// Listar tipos de veículo
/// </summary>
/// <remarks>
/// GET de tipos de veículo
/// </remarks>
/// <returns>Tipos de veículo disponíveis</returns>
/// <response code="200">Tipos de veículo retornados com sucesso</response>
[HttpGet("types")]
[ProducesResponseType(typeof(SuccessResult<IEnumerable<ReadVehicleTypeDTO>>), StatusCodes.Status200OK)]
public IActionResult GetVehicleTypes()
{
return _vehicleService.GetVehicleTypes().ToActionResult();
}
}
}
11 changes: 7 additions & 4 deletions OneBus.API/Controllers/VehicleOperationController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

namespace OneBus.API.Controllers
{
[NonController]
[Route("api/v1/vehiclesOperations")]
[ApiController]
[Produces("application/json")]
Expand Down Expand Up @@ -102,9 +101,11 @@ public async Task<IActionResult> DeleteAsync([FromRoute] long id, CancellationTo
/// <response code="200">Operações de Veículos paginadas e filtradas com sucesso</response>
[HttpGet]
[ProducesResponseType(typeof(SuccessResult<Pagination<ReadVehicleOperationDTO>>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetPaginedAsync([FromQuery] BaseFilter filter, CancellationToken cancellationToken = default)
public async Task<IActionResult> GetPaginedAsync([FromQuery] VehicleOperationFilter filter, CancellationToken cancellationToken = default)
{
return (await _vehicleOperationService.GetPaginedAsync(filter, cancellationToken: cancellationToken)).ToActionResult();
return (await _vehicleOperationService.GetPaginedAsync(filter,
DbQueryOptions.Create(["LineTime.Line", "EmployeeWorkday.Employee", "Vehicle"]),
cancellationToken)).ToActionResult();
}

/// <summary>
Expand All @@ -123,7 +124,9 @@ public async Task<IActionResult> GetPaginedAsync([FromQuery] BaseFilter filter,
[ProducesResponseType(typeof(NotFoundResult<ReadVehicleOperationDTO>), StatusCodes.Status404NotFound)]
public async Task<IActionResult> GetByIdAsync([FromRoute] long id, CancellationToken cancellationToken = default)
{
return (await _vehicleOperationService.GetByIdAsync(id, cancellationToken: cancellationToken)).ToActionResult();
return (await _vehicleOperationService.GetByIdAsync(id,
DbQueryOptions.Create(["LineTime.Line", "EmployeeWorkday.Employee", "Vehicle"]),
cancellationToken)).ToActionResult();
}
}
}
Loading