Skip to content
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
1 change: 0 additions & 1 deletion Dentizone.Application/Interfaces/IReviewService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public interface IReviewService
Task CreateOrderReviewAsync(string userId, CreateReviewDto createReviewDto);
Task<bool> UpdateReviewAsync(string reviewId, UpdateReviewDto updateReviewDto);
Task DeleteReviewAsync(string reviewId);
Task<IEnumerable<ReviewDto>> GetSubmittedReviews(string userId);
Task<IEnumerable<ReviewDto>> GetReceivedReviews(string userId);
Task<PagedResultDto<ReviewView>> GetAllReviewsAsync(int page);
}
Expand Down
2 changes: 0 additions & 2 deletions Dentizone.Application/Interfaces/IVerificationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@

namespace Dentizone.Application.Interfaces;


public interface IVerificationService
{
Task<SessionDecisionResponse> GetVerificationStatusAsync(string sessionId);
Task<CreateSessionResponse> StartSessionAsync(string userId);
Task<UserView> UpdateUserNationalId(string userId, string nationalId);
Task<UserView> UpdateUserVerificationState(string userId, string status);
}
17 changes: 10 additions & 7 deletions Dentizone.Application/Services/Authentication/AuthService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public async Task<UserRoles> GetUserRoleAsync(string userId)
throw new NotFoundException("User does not have any roles assigned");
}

return Enum.Parse<UserRoles>(currentRoles.First() ?? UserRoles.Ghost.ToString());
return Enum.Parse<UserRoles>(currentRoles.First());
}

public async Task AlternateUserRoleAsync(UserRoles newRole, string userId)
Expand Down Expand Up @@ -71,10 +71,10 @@ public async Task<LoggedInUser> LoginWithEmailAndPassword(string email, string p

if (isLockedOut)
{
await userActivityService.CreateAsync(UserActivities.Lockdout, DateTime.Now, user.Id);
await userActivityService.CreateAsync(UserActivities.Lockedout, DateTime.Now, user.Id);
throw new
UserLockedOutException(
"User is locked out due to too many failed login attempts. Please try again later.");
"User is locked out due to too many failed login attempts. Please try again later.");
}


Expand Down Expand Up @@ -111,7 +111,7 @@ public async Task<LoggedInUser> LoginWithEmailAndPassword(string email, string p
return new LoggedInUser()
{
User = user,
Role = Enum.Parse<UserRoles>(roles.LastOrDefault())
Role = Enum.Parse<UserRoles>(roles.Last())
};
}

Expand Down Expand Up @@ -145,6 +145,7 @@ public async Task<LoggedInUser> RegisterWithEmailAndPassword(RegisterRequestDto
// 4. Send Verification Email

await SendVerificationEmail(user.Email);
await userActivityService.CreateAsync(UserActivities.Registered, DateTime.Now, user.Id);
return new LoggedInUser()
{
User = user,
Expand Down Expand Up @@ -201,7 +202,8 @@ public async Task SendVerificationEmail(string email)
var verificationLink = $"https://dentizone.vercel.app/auth/mail-verify?userId={user.Id}&token={token}";
// 3. Send Verification Email
await mailService.Send(email, "Dentizone: Verify your email",
$"Please click the following link to verify your email: <a href=\"{verificationLink}\">Verify Email</a>");
$"Please click the following link to verify your email: <a href=\"{verificationLink}\">Verify Email</a>");
await userActivityService.CreateAsync(UserActivities.EmailVerificationSent, DateTime.Now, user.Id);
}

public async Task SendForgetPasswordEmail(string email)
Expand All @@ -218,7 +220,8 @@ public async Task SendForgetPasswordEmail(string email)
var resetLink = $"https://dentizone.vercel.app/auth/forgot-password?email={user.Email}&token={token}";
// 3. Send Reset Password Email
await mailService.Send(email, "Dentizone: Reset your password",
$"Please click the following link to reset your password: <a href=\"{resetLink}\">Reset Password</a>");
$"Please click the following link to reset your password: <a href=\"{resetLink}\">Reset Password</a>");
await userActivityService.CreateAsync(UserActivities.PasswordResetRequested, DateTime.Now, user.Id);
}

public async Task<ApplicationUser> GetById(string userId)
Expand Down Expand Up @@ -250,7 +253,7 @@ public async Task<string> ResetPassword(string email, string token, string newPa
throw new NotFoundException("User does not have any roles assigned");
}

await userActivityService.CreateAsync(UserActivities.PasswordReset);
await userActivityService.CreateAsync(UserActivities.PasswordReset, DateTime.Now, user.Id);
// 3. Generate token
return GenerateToken(user.Id, user.Email, roles.FirstOrDefault());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,25 @@ public class Metadata
}


public class VerificationService(IDiditApi diditApi, ISecretService secretService, IAuthService authService,
IUserService userService, IMailService mailService) : IVerificationService
public class VerificationService(
IDiditApi diditApi,
ISecretService secretService,
IAuthService authService,
IUserService userService,
IUserActivityService userActivityService,
IMailService mailService) : IVerificationService
Comment on lines +19 to +25
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Unused dependency injection detected.

The IUserActivityService userActivityService is injected in the constructor but never used in any of the methods. This suggests either incomplete implementation or dead code.

Based on the PR objectives to "enhance user activity logging," this service should likely be used to log verification-related activities such as session starts, verification status checks, and national ID updates.

Consider adding user activity logging in the relevant methods:

public async Task<CreateSessionResponse> StartSessionAsync(string userId)
{
    var user = await authService.GetById(userId);
    var domainUser = await userService.GetByIdAsync(userId);
    
+   await userActivityService.LogAsync(userId, UserActivities.VerificationStarted, "KYC verification session started");
    
    // ... rest of the method
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public class VerificationService(
IDiditApi diditApi,
ISecretService secretService,
IAuthService authService,
IUserService userService,
IUserActivityService userActivityService,
IMailService mailService) : IVerificationService
public async Task<CreateSessionResponse> StartSessionAsync(string userId)
{
var user = await authService.GetById(userId);
var domainUser = await userService.GetByIdAsync(userId);
await userActivityService.LogAsync(userId, UserActivities.VerificationStarted, "KYC verification session started");
// ... rest of the method
}
🤖 Prompt for AI Agents
In Dentizone.Application/Services/Authentication/VerificationService.cs around
lines 19 to 25, the IUserActivityService is injected but not used. To fix this,
identify key verification-related methods such as session starts, verification
status checks, and national ID updates, and add calls to IUserActivityService to
log these user activities appropriately. This will ensure the injected service
is utilized as intended for enhanced user activity logging.

{
private readonly IDiditApi _diditApi = diditApi;
private readonly ISecretService _secretService = secretService;
private readonly IAuthService _authService = authService;
private readonly IUserService _userService = userService;



private static Dictionary<string, KycStatus> MapVerificationStatusToEnum()
{
return new Dictionary<string, KycStatus>
{
{ "approved", KycStatus.Approved },
{ "declined", KycStatus.Rejected },
{ "pending", KycStatus.Pending }
};
}

public async Task<CreateSessionResponse> StartSessionAsync(string userId)
{
var user = await _authService.GetById(userId);
var domainUser = await _userService.GetByIdAsync(userId);
var user = await authService.GetById(userId);
var domainUser = await userService.GetByIdAsync(userId);

if (domainUser.KycStatus.Equals(KycStatus.NotSubmitted.ToString()))

{
throw new BadActionException("KYC is not submitted yet");
}

if (domainUser.KycStatus.Equals(KycStatus.Approved.ToString()))
{
throw new BadActionException("Your account is Already Active");
Expand All @@ -54,7 +43,7 @@ public async Task<CreateSessionResponse> StartSessionAsync(string userId)

var request = new CreateSessionRequest
{
WorkflowId = _secretService.GetSecret("DiditWorkflowId"),
WorkflowId = secretService.GetSecret("DiditWorkflowId"),
VendorData = userId,
Callback = "https://dentizone.vercel.app/auth/kyc/status",
Metadata = JsonConvert.SerializeObject(new Metadata()
Expand All @@ -72,38 +61,27 @@ public async Task<CreateSessionResponse> StartSessionAsync(string userId)
}
};

var session = await _diditApi.CreateSessionAsync(request, _secretService.GetSecret("DiditApi"));
await _userService.SetKycStatusAsync(userId, KycStatus.NotSubmitted);
var session = await diditApi.CreateSessionAsync(request, secretService.GetSecret("DiditApi"));
await userService.SetKycStatusAsync(userId, KycStatus.NotSubmitted);
await mailService.Send(user.Email!, "Dentizone: Verification Started",
"Thank you for starting the email verification process." +
" You can use this url to verify your identity" +
$" <a href=\"{session.Url}\">Verify Now</a>"
);


return session;
}

public async Task<SessionDecisionResponse> GetVerificationStatusAsync(string sessionId)
{
return await _diditApi.GetSessionDecisionAsync(sessionId, _secretService.GetSecret("DiditApi"));
return await diditApi.GetSessionDecisionAsync(sessionId, secretService.GetSecret("DiditApi"));
}


public async Task<UserView> UpdateUserVerificationState(string userId, string status)
{
if (!MapVerificationStatusToEnum().TryGetValue(status.ToLower(), out var kycStatus))
{
throw new ArgumentException($"Invalid verification status: {status}");
}

var output = await _userService.SetKycStatusAsync(userId, kycStatus);

return output;
}

public async Task<UserView> UpdateUserNationalId(string userId, string nationalId)
{
var output = await _userService.SetNationalId(userId, nationalId);
var output = await userService.SetNationalId(userId, nationalId);
return output;
}
Comment on lines 82 to 86
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add user activity logging for national ID updates.

Updating a user's national ID is a significant action that should be logged for security and audit purposes.

Add activity logging after the successful update:

public async Task<UserView> UpdateUserNationalId(string userId, string nationalId)
{
    var output = await userService.SetNationalId(userId, nationalId);
+   await userActivityService.LogAsync(userId, UserActivities.NationalIdUpdated, "National ID updated");
    return output;
}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public async Task<UserView> UpdateUserNationalId(string userId, string nationalId)
{
var output = await _userService.SetNationalId(userId, nationalId);
var output = await userService.SetNationalId(userId, nationalId);
return output;
}
public async Task<UserView> UpdateUserNationalId(string userId, string nationalId)
{
var output = await userService.SetNationalId(userId, nationalId);
await userActivityService.LogAsync(userId, UserActivities.NationalIdUpdated, "National ID updated");
return output;
}
🤖 Prompt for AI Agents
In Dentizone.Application/Services/Authentication/VerificationService.cs around
lines 82 to 86, the UpdateUserNationalId method updates the user's national ID
but lacks logging of this significant action. After successfully updating the
national ID, add a call to the user activity logging service to record this
event, including relevant details such as userId and the action performed, to
ensure proper security and audit tracking.

}
Expand Down
4 changes: 4 additions & 0 deletions Dentizone.Application/Services/OrderService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ internal class OrderService(
IPaymentService paymentService,
ICartService cartService,
IHttpContextAccessor accessor,
IUserActivityService userActivityService,
AppDbContext dbContext)
: BaseService(accessor), IOrderService
{
Expand Down Expand Up @@ -84,6 +85,7 @@ await mailService.Send(seller.Email, "Order Cancelled",


var dto = mapper.Map<OrderViewDto>(order);
await userActivityService.CreateAsync(UserActivities.OrderCancelled, DateTime.UtcNow, order.BuyerId);
return dto;
}

Expand Down Expand Up @@ -188,6 +190,8 @@ await paymentService.CreateSaleTransaction(
await cartService.ClearCartAsync(buyerId);

await transaction.CommitAsync();
await userActivityService.CreateAsync(UserActivities.OrderPlaced, new DateTime(), buyerId);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix DateTime usage for user activity logging.

The new DateTime() creates a default DateTime value (01/01/0001 00:00:00) instead of the current timestamp. This should be DateTime.UtcNow or DateTime.Now to properly track when the activity occurred.

-                await userActivityService.CreateAsync(UserActivities.OrderPlaced, new DateTime(), buyerId);
+                await userActivityService.CreateAsync(UserActivities.OrderPlaced, DateTime.UtcNow, buyerId);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
await userActivityService.CreateAsync(UserActivities.OrderPlaced, new DateTime(), buyerId);
await userActivityService.CreateAsync(UserActivities.OrderPlaced, DateTime.UtcNow, buyerId);
🤖 Prompt for AI Agents
In Dentizone.Application/Services/OrderService.cs at line 193, replace the
incorrect usage of new DateTime() with DateTime.UtcNow or DateTime.Now to log
the current timestamp for user activity. This change ensures the activity time
reflects the actual order placement time instead of the default minimum DateTime
value.


return result.Id;
}
catch (Exception)
Expand Down
20 changes: 12 additions & 8 deletions Dentizone.Application/Services/QAService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ public class QaService(
IMapper mapper,
IAnswerRepository answerRepository,
IQuestionRepository questionRepository,
IBackgroundJobService _backgroundJob)
IBackgroundJobService _backgroundJob,
IUserActivityService userActivity)
: IQaService
{
public async Task<AnswerViewDto> AnswerQuestionAsync(string questionId, CreateAnswerDto dto, string responderId)
Expand Down Expand Up @@ -50,7 +51,8 @@ public async Task<AnswerViewDto> AnswerQuestionAsync(string questionId, CreateAn
await questionRepository.UpdateAsync(question);

_backgroundJob.Enqueue<IMonitorJob>(job =>
job.ReviewAnswerAsync(answer.Id, answer.Text));
job.ReviewAnswerAsync(answer.Id, answer.Text));
await userActivity.CreateAsync(UserActivities.AnsweredQuestion, DateTime.UtcNow, responderId);
Comment on lines +54 to +55
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider error handling for user activity logging.

The user activity logging is added appropriately after the core business logic, but lacks error handling. If userActivity.CreateAsync fails, it could cause the entire operation to fail even though the question was successfully answered.

Consider wrapping the activity logging in a try-catch block or making it fire-and-forget to prevent it from affecting the primary operation.

 _backgroundJob.Enqueue<IMonitorJob>(job =>
     job.ReviewAnswerAsync(answer.Id, answer.Text));
-await userActivity.CreateAsync(UserActivities.AnsweredQuestion, DateTime.UtcNow, responderId);
+try
+{
+    await userActivity.CreateAsync(UserActivities.AnsweredQuestion, DateTime.UtcNow, responderId);
+}
+catch (Exception ex)
+{
+    // Log the error but don't fail the operation
+    // Consider using ILogger to log the exception
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
job.ReviewAnswerAsync(answer.Id, answer.Text));
await userActivity.CreateAsync(UserActivities.AnsweredQuestion, DateTime.UtcNow, responderId);
_backgroundJob.Enqueue<IMonitorJob>(job =>
job.ReviewAnswerAsync(answer.Id, answer.Text));
try
{
await userActivity.CreateAsync(UserActivities.AnsweredQuestion, DateTime.UtcNow, responderId);
}
catch (Exception ex)
{
// Log the error but don't fail the operation
// Consider using ILogger to log the exception
}
🤖 Prompt for AI Agents
In Dentizone.Application/Services/QAService.cs around lines 54 to 55, the call
to userActivity.CreateAsync lacks error handling, which could cause the entire
operation to fail if logging fails. To fix this, wrap the
userActivity.CreateAsync call in a try-catch block to catch and handle any
exceptions without affecting the main operation, or alternatively, make the call
fire-and-forget by not awaiting it and handling exceptions internally.

return mapper.Map<AnswerViewDto>(answer);
}

Expand All @@ -62,7 +64,9 @@ public async Task<QuestionViewDto> AskQuestionAsync(CreateQuestionDto dto, strin
await questionRepository.CreateAsync(question);

_backgroundJob.Enqueue<IMonitorJob>(job =>
job.ReviewQuestionAsync(question.Id, question.Text));
job.ReviewQuestionAsync(question.Id, question.Text));

await userActivity.CreateAsync(UserActivities.AskedQuestion, DateTime.UtcNow, askerId);
Comment on lines +67 to +69
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Consider error handling for user activity logging.

Similar to the AnswerQuestionAsync method, the user activity logging lacks error handling and could potentially fail the entire question creation operation.

Apply the same error handling pattern as suggested for the AnswerQuestionAsync method.

 _backgroundJob.Enqueue<IMonitorJob>(job =>
     job.ReviewQuestionAsync(question.Id, question.Text));

-await userActivity.CreateAsync(UserActivities.AskedQuestion, DateTime.UtcNow, askerId);
+try
+{
+    await userActivity.CreateAsync(UserActivities.AskedQuestion, DateTime.UtcNow, askerId);
+}
+catch (Exception ex)
+{
+    // Log the error but don't fail the operation
+    // Consider using ILogger to log the exception
+}
🤖 Prompt for AI Agents
In Dentizone.Application/Services/QAService.cs around lines 67 to 69, the call
to userActivity.CreateAsync for logging the AskedQuestion activity lacks error
handling, which may cause the entire question creation to fail if logging fails.
Wrap this call in a try-catch block similar to the pattern used in
AnswerQuestionAsync, catching exceptions and handling them appropriately (e.g.,
logging the error) without interrupting the main flow.


return mapper.Map<QuestionViewDto>(question);
}
Expand Down Expand Up @@ -107,13 +111,13 @@ public async Task DeleteQuestionAsync(string questionId)
public async Task<IEnumerable<QuestionViewDto>> GetQuestionsForPostAsync(string postId)
{
var includes = new Expression<Func<Question, object>>[]
{
q => q.Answer
};
{
q => q.Answer
};

var questions = await questionRepository.FindAllBy(
q => q.PostId == postId && !q.IsDeleted,
includes);
q => q.PostId == postId && !q.IsDeleted,
includes);


return mapper.Map<IEnumerable<QuestionViewDto>>(questions);
Expand Down
9 changes: 4 additions & 5 deletions Dentizone.Application/Services/ReviewService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Dentizone.Application.DTOs.Review;
using Dentizone.Application.Interfaces;
using Dentizone.Domain.Entity;
using Dentizone.Domain.Enums;
using Dentizone.Domain.Exceptions;
using Dentizone.Domain.Interfaces;
using Dentizone.Domain.Interfaces.Repositories;
Expand All @@ -15,7 +16,8 @@ public class ReviewService(
IMapper mapper,
IReviewRepository repo,
IOrderService orderService,
IBackgroundJobService backgroundJob) : BaseService(accessor), IReviewService
IBackgroundJobService backgroundJob,
IUserActivityService userActivityService) : BaseService(accessor), IReviewService
{
public async Task CreateOrderReviewAsync(string userId, CreateReviewDto createReviewDto)
{
Expand All @@ -36,6 +38,7 @@ public async Task CreateOrderReviewAsync(string userId, CreateReviewDto createRe
await repo.CreateAsync(review);
await orderService.MarkOrderAsReviewed(order.Id);
backgroundJob.Enqueue<IMonitorJob>(job => job.ReviewReviewAsync(review.Id, review.Text));
await userActivityService.CreateAsync(UserActivities.ReviewedOrder, DateTime.UtcNow, userId);
}

public async Task DeleteReviewAsync(string reviewId)
Expand All @@ -44,10 +47,6 @@ public async Task DeleteReviewAsync(string reviewId)
await repo.DeleteAsync(reviewId);
}

public async Task<IEnumerable<ReviewDto>> GetSubmittedReviews(string userId)
{
return [];
}

public async Task<bool> UpdateReviewAsync(string reviewId, UpdateReviewDto updateReviewDto)
{
Expand Down
2 changes: 1 addition & 1 deletion Dentizone.Application/Services/UserActivityService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public async Task<CreatedUserActivityDto> CreateAsync(UserActivities activity,
{
var userActivity = new UserActivity
{
FingerprintToken = requestContextService.GetFingerprint(),
FingerprintToken = "NON",
IpAddress = requestContextService.GetIpAddress(),
UserAgent = requestContextService.GetUserAgent(),
Device = requestContextService.GetDeviceType(),
Expand Down
4 changes: 4 additions & 0 deletions Dentizone.Application/Services/WithdrawalService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class WithdrawalService(
IWalletService walletService,
IWithdrawalRequestRepository withdrawalRepo,
IMailService mailService,
IUserActivityService userActivityService,
IMapper mapper) : IWithdrawalService
{
public async Task<WithdrawalRequestView> CreateWithdrawalRequestAsync(
Expand Down Expand Up @@ -46,6 +47,9 @@ public async Task<WithdrawalRequestView> CreateWithdrawalRequestAsync(

var withdrawalView = mapper.Map<WithdrawalRequestView>(createdRequest);

await userActivityService.CreateAsync(
UserActivities.WithdrawalRequestCreated, DateTime.UtcNow, userId);

return withdrawalView;
}

Expand Down
13 changes: 9 additions & 4 deletions Dentizone.Domain/Enums/UserActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ public enum UserActivities
PasswordReset,
OrderPlaced,
OrderCancelled,
OrderCompleted,
ProfileUpdated,
AccountVerified,
Lockdout,
EmailConfirmed
Lockedout,
EmailConfirmed,
AnsweredQuestion,
AskedQuestion,
ReviewedOrder,
WithdrawalRequestCreated,
Registered,
EmailVerificationSent,
PasswordResetRequested
Comment on lines +13 to +20
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Address naming inconsistencies and potential duplicates.

The new activity additions are valuable for comprehensive user tracking, but there are some naming concerns:

  1. Potential duplicates:

    • Register (line 6) vs Registered (line 18) - these appear to represent the same user registration activity
    • PasswordReset (line 8) vs PasswordResetRequested (line 20) - these might also be duplicates
  2. Naming convention inconsistency:

    • Mix of past tense (EmailConfirmed, AnsweredQuestion), present tense (Register), and descriptive forms (WithdrawalRequestCreated)

Consider standardizing the naming convention and removing duplicates to improve API clarity.

public enum UserActivities
{
    Login,
-   Register,
    Logout,
-   PasswordReset,
    OrderPlaced,
    OrderCancelled,
    AccountVerified,
    Lockedout,
    EmailConfirmed,
    AnsweredQuestion,
    AskedQuestion,
    ReviewedOrder,
    WithdrawalRequestCreated,
    Registered,
    EmailVerificationSent,
    PasswordResetRequested
}
🤖 Prompt for AI Agents
In Dentizone.Domain/Enums/UserActivity.cs around lines 6 to 20, there are
duplicate enum entries for user registration and password reset activities, and
inconsistent naming conventions mixing past tense, present tense, and
descriptive forms. To fix this, remove the duplicate entries by choosing either
Register or Registered and either PasswordReset or PasswordResetRequested, then
standardize all enum names to use a consistent tense and style, preferably past
tense for completed actions, to improve clarity and maintainability.

}
}
15 changes: 0 additions & 15 deletions Dentizone.Presentaion/Controllers/ReviewController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,6 @@ public async Task<IActionResult> DeleteReview(string reviewId)
return Ok();
}

[HttpGet]
public async Task<IActionResult> GetSubmittedReviews()
{
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);

var reviews = await reviewService.GetSubmittedReviews(userId);
return Ok(reviews);
}

[HttpGet("received-review")]
public async Task<IActionResult> GetReceivedReviews()
{
var reviews = await reviewService.GetReceivedReviews(User.FindFirstValue(ClaimTypes.NameIdentifier));
return Ok(reviews);
}

[HttpGet("all")]
[Authorize("IsAdmin")]
Expand Down