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

remove unused files #43

Merged
merged 2 commits into from
Feb 20, 2025
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public async Task<ActionResult<DispatcherReviewDto>> CreateAsync(
[FromRoute] int dispatcherId,
[FromBody] CreateDispatcherReviewDto review)
{
if (review.DispatcherId != dispatcherId)
if (review.ReviewerId != dispatcherId)
{
return BadRequest($"Route id: {dispatcherId} does not match with body id: {review.DispatcherId}.");
return BadRequest($"Route id: {dispatcherId} does not match with body id: {review.ReviewerId}.");
}

var createdReview = await reviewService.CreateAsync(review);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public async Task<ActionResult<DoctorReviewDto>> CreateReview(
[FromRoute] int doctorId,
[FromBody] CreateDoctorReviewDto review)
{
if (doctorId != review.DoctorId)
if (doctorId != review.ReviewerId)
{
return BadRequest($"Route id: {doctorId} does not match with body id: {review.DoctorId}.");
return BadRequest($"Route id: {doctorId} does not match with body id: {review.ReviewerId}.");
}

var createdReview = await reviewService.CreateAsync(review);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public async Task<ActionResult<MechanicAcceptanceReviewDto>> CreateAcceptanceRev
[FromRoute] int mechanicId,
[FromBody] CreateMechanicAcceptanceReviewDto review)
{
if (review.MechanicId != mechanicId)
if (review.ReviewerId != mechanicId)
{
return BadRequest($"Route id: {mechanicId} does not match with body id: {review.MechanicId}.");
return BadRequest($"Route id: {mechanicId} does not match with body id: {review.ReviewerId}.");
}

var createdReview = await reviewService.CreateAsync(review);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public async Task<ActionResult<MechanicHandoverReviewDto>> CreateHandoverReviewA
[FromRoute] int mechanicId,
[FromBody] CreateMechanicHandoverReviewDto review)
{
if (review.MechanicId != mechanicId)
if (review.ReviewerId != mechanicId)
{
return BadRequest($"Route id: {mechanicId} does not match with body id: {review.MechanicId}.");
return BadRequest($"Route id: {mechanicId} does not match with body id: {review.ReviewerId}.");
}

var createdReview = await reviewService.CreateAsync(review);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public async Task<ActionResult<OperatorReviewDto>> CreateAsync(
[FromRoute] int operatorId,
[FromBody] CreateOperatorReviewDto review)
{
if (review.OperatorId != operatorId)
if (review.ReviewerId != operatorId)
{
return BadRequest($"Route id: {operatorId} does not match with body id: {review.OperatorId}.");
return BadRequest($"Route id: {operatorId} does not match with body id: {review.ReviewerId}.");
}

var createdReview = await reviewService.CreateAsync(review);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
namespace CheckDrive.Application.DTOs.DispatcherReview;
using CheckDrive.Application.DTOs.Review;

namespace CheckDrive.Application.DTOs.DispatcherReview;

public sealed record CreateDispatcherReviewDto(
int CheckPointId,
int DispatcherId,
int ReviewerId,
string? Notes,
int FinalMileage,
decimal FuelConsumptionAmount,
decimal RemainingFuelAmount);
decimal RemainingFuelAmount)
: CreateReviewDtoBase(ReviewerId, Notes);
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
namespace CheckDrive.Application.DTOs.DoctorReview;
using CheckDrive.Application.DTOs.Review;

namespace CheckDrive.Application.DTOs.DoctorReview;

public sealed record CreateDoctorReviewDto(
int DriverId,
int DoctorId,
int ReviewerId,
string? Notes,
bool IsHealthy);
bool IsHealthy)
: CreateReviewDtoBase(ReviewerId, Notes);
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,4 @@ public sealed record CreateManagerReviewDto(
decimal FuelConsumption,
decimal RemainingFuelAmount,
decimal DebtAmount)
: CreateReviewDtoBase(
ReviewerId: ReviewerId,
Notes: Notes);
: CreateReviewDtoBase(ReviewerId, Notes);
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
namespace CheckDrive.Application.DTOs.MechanicAcceptance;
using CheckDrive.Application.DTOs.Review;

namespace CheckDrive.Application.DTOs.MechanicAcceptance;

public sealed record CreateMechanicAcceptanceReviewDto(
int CheckPointId,
int MechanicId,
int ReviewerId,
string? Notes,
int FinalMileage,
bool IsCarInGoodCondition);
bool IsCarInGoodCondition)
: CreateReviewDtoBase(ReviewerId, Notes);
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
namespace CheckDrive.Application.DTOs.MechanicHandover;
using CheckDrive.Application.DTOs.Review;

namespace CheckDrive.Application.DTOs.MechanicHandover;

public sealed record CreateMechanicHandoverReviewDto(
int CheckPointId,
int ReviewerId,
int CarId,
int MechanicId,
string? Notes,
int InitialMileage);
int InitialMileage)
: CreateReviewDtoBase(ReviewerId, Notes);
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
namespace CheckDrive.Application.DTOs.OperatorReview;
using CheckDrive.Application.DTOs.Review;

namespace CheckDrive.Application.DTOs.OperatorReview;

public sealed record CreateOperatorReviewDto(
int CheckPointId,
int OperatorId,
int ReviewerId,
int OilMarkId,
string? Notes,
decimal InitialOilAmount,
decimal OilRefillAmount);
decimal OilRefillAmount)
: CreateReviewDtoBase(ReviewerId, Notes);

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task<DispatcherReviewDto> CreateAsync(CreateDispatcherReviewDto rev
ArgumentNullException.ThrowIfNull(review);

var checkPoint = await GetAndValidateCheckPointAsync(review.CheckPointId);
var dispatcher = await GetAndValidateDispatcherAsync(review.DispatcherId);
var dispatcher = await GetAndValidateDispatcherAsync(review.ReviewerId);

checkPoint.Stage = CheckPointStage.DispatcherReview;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public async Task<DoctorReviewDto> CreateAsync(CreateDoctorReviewDto review)
{
ArgumentNullException.ThrowIfNull(review);

var doctor = await GetAndValidateDoctorAsync(review.DoctorId);
var doctor = await GetAndValidateDoctorAsync(review.ReviewerId);
var driver = await GetAndValidateDriverAsync(review.DriverId);

var reviewEntity = CreateReview(review, doctor, driver);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public async Task<MechanicAcceptanceReviewDto> CreateAsync(CreateMechanicAccepta
ArgumentNullException.ThrowIfNull(review);

var checkPoint = await GetAndValidateCheckPointAsync(review.CheckPointId);
var mechanic = await GetAndValidateMechanicAsync(review.MechanicId);
var mechanic = await GetAndValidateMechanicAsync(review.ReviewerId);

ValidateMileage(checkPoint, review);
var reviewEntity = await CreateReviewAsync(checkPoint, mechanic, review);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public async Task<MechanicHandoverReviewDto> CreateAsync(CreateMechanicHandoverR
ArgumentNullException.ThrowIfNull(review);

var checkPoint = await GetAndValidateCheckPointAsync(review.CheckPointId);
var mechanic = await GetAndValidateMechanicAsync(review.MechanicId);
var mechanic = await GetAndValidateMechanicAsync(review.ReviewerId);
var car = await GetAndValidateCarAsync(review.CarId);

ValidateMileage(car, review);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task<OperatorReviewDto> CreateAsync(CreateOperatorReviewDto review)
ArgumentNullException.ThrowIfNull(review);

var checkPoint = await GetAndValidateCheckPointAsync(review.CheckPointId);
var @operator = await GetAndValidateOperatorAsync(review.OperatorId);
var @operator = await GetAndValidateOperatorAsync(review.ReviewerId);
var oilMark = await GetAndValidateOilMarkAsync(review.OilMarkId);

ValidateOilAmount(checkPoint, review);
Expand Down
11 changes: 5 additions & 6 deletions CheckDrive.Api/CheckDrive.Domain/Enums/EmailType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
using System.Text;
using System.Threading.Tasks;

namespace CheckDrive.Domain.Enums
namespace CheckDrive.Domain.Enums;

public enum EmailType
{
public enum EmailType
{
ForgotPassword,
EmailConfirmation
}
ForgotPassword,
EmailConfirmation
}
13 changes: 6 additions & 7 deletions CheckDrive.Api/CheckDrive.Domain/Enums/SendingMessageStatus.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
namespace CheckDrive.Domain.Enums
namespace CheckDrive.Domain.Enums;

public enum SendingMessageStatus
{
public enum SendingMessageStatus
{
MechanicHandover,
OperatorReview,
MechanicAcceptance
}
MechanicHandover,
OperatorReview,
MechanicAcceptance
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task CreateAsync_ValidInput_ReturnsCreatedDoctorReviewDto()
var driver = _fixture.Create<Driver>();
var createDto = _fixture.Build<CreateDoctorReviewDto>()
.With(d => d.DriverId, driver.Id)
.With(d => d.DoctorId, doctor.Id)
.With(d => d.ReviewerId, doctor.Id)
.Create();

_mockContext.Setup(c => c.Doctors).ReturnsDbSet(new List<Doctor> { doctor });
Expand Down Expand Up @@ -72,7 +72,7 @@ public async Task CreateAsync_DriverNotFound_ThrowsEntityNotFoundException()
// Arrange
var doctor = _fixture.Create<Doctor>();
var createDto = _fixture.Build<CreateDoctorReviewDto>()
.With(d => d.DoctorId, doctor.Id)
.With(d => d.ReviewerId, doctor.Id)
.Create();

_mockContext.Setup(c => c.Doctors).ReturnsDbSet(new List<Doctor> { doctor });
Expand All @@ -97,7 +97,7 @@ public async Task CreateAsync_RejectedReview_CreatesCheckPointWithCorrectStatus(
var driver = _fixture.Create<Driver>();
var createDto = _fixture.Build<CreateDoctorReviewDto>()
.With(d => d.DriverId, driver.Id)
.With(d => d.DoctorId, doctor.Id)
.With(d => d.ReviewerId, doctor.Id)
.Create();

_mockContext.Setup(c => c.Doctors).ReturnsDbSet(new List<Doctor> { doctor });
Expand Down
Loading