diff --git a/Models/Rating.cs b/Models/Rating.cs index 34338b9..dc96258 100644 --- a/Models/Rating.cs +++ b/Models/Rating.cs @@ -9,6 +9,16 @@ public class Rating { [Required] public required int Stars { get; set; } + + [Required] + public required int ItemQualityRating { get; set; } + + [Required] + public required int CommunicationRating { get; set; } + + [Required] + public required decimal ShippingSpeedRating { get; set; } + [Required] public required string Comment { get; set; } [BsonRepresentation(BsonType.ObjectId)] diff --git a/Models/User.cs b/Models/User.cs index ffe67c3..aa13680 100644 --- a/Models/User.cs +++ b/Models/User.cs @@ -41,4 +41,6 @@ public class User public DateTime DateCreated { get; set; } = DateTime.UtcNow; // Applicable for vendors only public List? VendorRatings { get; set; } = null; + public string? ShopName {get;set;} + public string? ShopDescription {get;set;} } diff --git a/Services/Impl/AdminService.cs b/Services/Impl/AdminService.cs index 4069adb..4bf54cc 100644 --- a/Services/Impl/AdminService.cs +++ b/Services/Impl/AdminService.cs @@ -91,6 +91,10 @@ public async Task CreateUser(CreateUserDto createUserDto) var newUser = _mapper.Map(createUserDto); // Auto activate account when admin creates users newUser.IsApproved = true; + newUser.Status= Models.Enums.Status.ACTIVE; + // Hash the new password + var newPasswordHash = HashPassword.CreatePasswordHash(createUserDto.Password); + newUser.PasswordHash = newPasswordHash; newUser.Status = Models.Enums.Status.ACTIVE; await _adminRepository.CreateNewUser(newUser);