diff --git a/BeReadyBackend/DTO/Groups/CreateGroupDto.cs b/BeReadyBackend/DTO/Groups/CreateGroupDto.cs index 22e5efe..2cc42e7 100644 --- a/BeReadyBackend/DTO/Groups/CreateGroupDto.cs +++ b/BeReadyBackend/DTO/Groups/CreateGroupDto.cs @@ -3,9 +3,5 @@ public class CreateGroupDto { public string? Label { get; set; } - public string? Title { get; set; } - public string? Description { get; set; } - public int Duration { get; set; } - public int? VoteDuration { get; set; } public List? UserGroups { get; set; } } \ No newline at end of file diff --git a/BeReadyBackend/DTO/Groups/GetGroupDetailsDto.cs b/BeReadyBackend/DTO/Groups/GetGroupDetailsDto.cs index 5a12732..eddb4be 100644 --- a/BeReadyBackend/DTO/Groups/GetGroupDetailsDto.cs +++ b/BeReadyBackend/DTO/Groups/GetGroupDetailsDto.cs @@ -6,10 +6,6 @@ public class GetGroupDetailsDto { public int Id { get; set; } public string? Label { get; set; } - public bool IsFinished { get; set; } - public string? Title { get; set; } - public string? Description { get; set; } - public int Duration { get; set; } public DateTime CreationDate { get; set; } public List? Messages { get; set; } diff --git a/BeReadyBackend/DTO/Groups/GetGroupDto.cs b/BeReadyBackend/DTO/Groups/GetGroupDto.cs index b1a108a..77fa716 100644 --- a/BeReadyBackend/DTO/Groups/GetGroupDto.cs +++ b/BeReadyBackend/DTO/Groups/GetGroupDto.cs @@ -4,5 +4,4 @@ public class GetGroupDto { public int Id { get; set; } public string? Label { get; set; } - public bool IsFinished { get; set; } } \ No newline at end of file diff --git a/BeReadyBackend/DTO/Groups/GetGroupRankingDto.cs b/BeReadyBackend/DTO/Groups/GetGroupRankingDto.cs deleted file mode 100644 index 289bf2b..0000000 --- a/BeReadyBackend/DTO/Groups/GetGroupRankingDto.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace BeReadyBackend.DTO.Groups; - -public class GetGroupRankingDto -{ - public int UserId { get; set; } - public string? Username { get; set; } - public int Score { get; set; } -} \ No newline at end of file diff --git a/BeReadyBackend/DTO/Groups/GetProofDto.cs b/BeReadyBackend/DTO/Groups/GetProofDto.cs deleted file mode 100644 index 31c0ad3..0000000 --- a/BeReadyBackend/DTO/Groups/GetProofDto.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace BeReadyBackend.DTO.Groups; - -public class GetProofDto -{ - public int UserId { get; set; } - public string? Username { get; set; } - public string? Proof { get; set; } - public int Score { get; set; } -} \ No newline at end of file diff --git a/BeReadyBackend/DTO/Groups/GetUserGroupDto.cs b/BeReadyBackend/DTO/Groups/GetUserGroupDto.cs index 61a9705..1114c2d 100644 --- a/BeReadyBackend/DTO/Groups/GetUserGroupDto.cs +++ b/BeReadyBackend/DTO/Groups/GetUserGroupDto.cs @@ -5,5 +5,4 @@ public class GetUserGroupDto public int Id { get; set; } public string? Username { get; set; } public string? Grade { get; set; } - public int Score { get; set; } } \ No newline at end of file diff --git a/BeReadyBackend/DTO/RandomChallenges/GetRandomChallengeDto.cs b/BeReadyBackend/DTO/RandomChallenges/GetRandomChallengeDto.cs index c2f1a09..4197bc2 100644 --- a/BeReadyBackend/DTO/RandomChallenges/GetRandomChallengeDto.cs +++ b/BeReadyBackend/DTO/RandomChallenges/GetRandomChallengeDto.cs @@ -5,7 +5,6 @@ public class GetRandomChallengeDto public int Id { get; set; } public string? Label { get; set; } public string? Libelle { get; set; } - public int Duration { get; set; } public bool IsAlreadyPast { get; set; } public DateTime? GeneratedAt { get; set; } } \ No newline at end of file diff --git a/BeReadyBackend/DTO/Users/GetUserChallengeDto.cs b/BeReadyBackend/DTO/Users/GetUserChallengeDto.cs index 102011b..caf3dec 100644 --- a/BeReadyBackend/DTO/Users/GetUserChallengeDto.cs +++ b/BeReadyBackend/DTO/Users/GetUserChallengeDto.cs @@ -4,6 +4,5 @@ public class GetUserChallengeDto { public string? ChallengeTitle { get; set; } public string? ChallengeDescription { get; set; } - public int ChallengeDuration { get; set; } public DateOnly ChallengeStartDate { get; set; } } \ No newline at end of file diff --git a/BeReadyBackend/DTO/Users/GetUserStatsDto.cs b/BeReadyBackend/DTO/Users/GetUserStatsDto.cs index 8d238a5..d5138f9 100644 --- a/BeReadyBackend/DTO/Users/GetUserStatsDto.cs +++ b/BeReadyBackend/DTO/Users/GetUserStatsDto.cs @@ -3,10 +3,7 @@ public class GetUserStatsDto { public int Id { get; set; } - public int Score { get; set; } - public int TotalWin { get; set; } + public int TotalLikes { get; set; } public int TotalChallenge { get; set; } - public int TotalPodium { get; set; } - public int TotalBonusChallenge { get; set; } public int Series { get; set; } } \ No newline at end of file diff --git a/BeReadyBackend/MappingProfiles/EntityToDtoMappings.cs b/BeReadyBackend/MappingProfiles/EntityToDtoMappings.cs index f7f0290..61eefbc 100644 --- a/BeReadyBackend/MappingProfiles/EntityToDtoMappings.cs +++ b/BeReadyBackend/MappingProfiles/EntityToDtoMappings.cs @@ -49,8 +49,7 @@ public class EntityToDtoMappings : Profile CreateMap() .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.UserId)) - .ForMember(dest => dest.Username, opt => opt.MapFrom(src => src.User!.Username)) - .ForMember(dest => dest.Score, opt => opt.MapFrom(src => src.User!.TotalLikes)); + .ForMember(dest => dest.Username, opt => opt.MapFrom(src => src.User!.Username)); CreateMap() .ForMember(dest => dest.Id, opt => opt.MapFrom(src => src.GroupId)) @@ -63,12 +62,6 @@ public class EntityToDtoMappings : Profile CreateMap() .ForMember(dest => dest.Username, opt => opt.MapFrom(src => src.User!.Username)); - CreateMap() - .ForMember(dest => dest.Username, opt => opt.MapFrom(src => src.User!.Username)); - - CreateMap() - .ForMember(dest => dest.Username, opt => opt.MapFrom(src => src.User!.Username)); - CreateMap(); CreateMap(); diff --git a/BeReadyBackend/Validators/Groups/CreateGroupDtoValidator.cs b/BeReadyBackend/Validators/Groups/CreateGroupDtoValidator.cs index 780f379..3f50b38 100644 --- a/BeReadyBackend/Validators/Groups/CreateGroupDtoValidator.cs +++ b/BeReadyBackend/Validators/Groups/CreateGroupDtoValidator.cs @@ -15,27 +15,5 @@ public class CreateGroupDtoValidator : Validator .WithMessage("Label cannot exceed 100 characters") .MinimumLength(2) .WithMessage("Label must exceed 2 characters"); - - RuleFor(x => x.Title) - .NotEmpty() - .WithMessage("Title cannot be empty") - .MaximumLength(50) - .WithMessage("Title cannot exceed 50 characters") - .MinimumLength(2) - .WithMessage("Title must exceed 2 characters"); - - RuleFor(x => x.Description) - .NotEmpty() - .WithMessage("Description cannot be empty") - .MaximumLength(200) - .WithMessage("Description cannot exceed 200 characters") - .MinimumLength(2) - .WithMessage("Description must exceed 2 characters"); - - RuleFor(x => x.Duration) - .NotEmpty() - .WithMessage("Duration cannot be empty") - .GreaterThan(0) - .WithMessage("Duration must exceed 1 hour"); } } \ No newline at end of file diff --git a/BeReadyBackend/Validators/Groups/GetGroupDetailsDtoValidator.cs b/BeReadyBackend/Validators/Groups/GetGroupDetailsDtoValidator.cs index d36c97b..3be62a4 100644 --- a/BeReadyBackend/Validators/Groups/GetGroupDetailsDtoValidator.cs +++ b/BeReadyBackend/Validators/Groups/GetGroupDetailsDtoValidator.cs @@ -22,32 +22,6 @@ public class GetGroupDetailsDtoValidator : Validator .MinimumLength(2) .WithMessage("Label must exceed 2 characters"); - RuleFor(x => x.IsFinished) - .NotEmpty() - .WithMessage("IsFinished cannot be empty"); - - RuleFor(x => x.Title) - .NotEmpty() - .WithMessage("Title cannot be empty") - .MaximumLength(50) - .WithMessage("Title cannot exceed 50 characters") - .MinimumLength(2) - .WithMessage("Title must exceed 2 characters"); - - RuleFor(x => x.Description) - .NotEmpty() - .WithMessage("Description cannot be empty") - .MaximumLength(200) - .WithMessage("Description cannot exceed 50 characters") - .MinimumLength(2) - .WithMessage("Description must exceed 2 characters"); - - RuleFor(x => x.Duration) - .NotEmpty() - .WithMessage("Duration cannot be empty") - .GreaterThan(0) - .WithMessage("Duration must exceed 1 hour"); - RuleFor(x => x.CreationDate) .NotEmpty() .WithMessage("CreationDate cannot be empty"); diff --git a/BeReadyBackend/Validators/Groups/GetGroupDtoValidator.cs b/BeReadyBackend/Validators/Groups/GetGroupDtoValidator.cs index c2d16e3..5acfd05 100644 --- a/BeReadyBackend/Validators/Groups/GetGroupDtoValidator.cs +++ b/BeReadyBackend/Validators/Groups/GetGroupDtoValidator.cs @@ -21,9 +21,5 @@ public class GetGroupDtoValidator : Validator .WithMessage("Label cannot exceed 100 characters") .MinimumLength(2) .WithMessage("Label must exceed 2 characters"); - - RuleFor(x => x.IsFinished) - .NotEmpty() - .WithMessage("IsFinished cannot be empty"); } } \ No newline at end of file diff --git a/BeReadyBackend/Validators/Groups/GetGroupRankingDtoValidator.cs b/BeReadyBackend/Validators/Groups/GetGroupRankingDtoValidator.cs deleted file mode 100644 index ed0ae21..0000000 --- a/BeReadyBackend/Validators/Groups/GetGroupRankingDtoValidator.cs +++ /dev/null @@ -1,29 +0,0 @@ -using BeReadyBackend.DTO.Groups; -using FastEndpoints; -using FluentValidation; - -namespace BeReadyBackend.Validators.Groups; - -public class GetGroupRankingDtoValidator : Validator -{ - public GetGroupRankingDtoValidator() - { - RuleFor(x => x.UserId) - .NotEmpty() - .WithMessage("Id cannot be empty") - .GreaterThan(0) - .WithMessage("Id must be greater than 0"); - - RuleFor(x => x.Username) - .NotEmpty() - .WithMessage("Username cannot be empty") - .MaximumLength(50) - .WithMessage("Username cannot exceed 50 characters") - .MinimumLength(2) - .WithMessage("Username must exceed 2 characters"); - - RuleFor(x => x.Score) - .NotEmpty() - .WithMessage("Score cannot be empty"); - } -} \ No newline at end of file diff --git a/BeReadyBackend/Validators/Groups/GetProofDtoValidator.cs b/BeReadyBackend/Validators/Groups/GetProofDtoValidator.cs deleted file mode 100644 index 2ba1155..0000000 --- a/BeReadyBackend/Validators/Groups/GetProofDtoValidator.cs +++ /dev/null @@ -1,33 +0,0 @@ -using BeReadyBackend.DTO.Groups; -using FastEndpoints; -using FluentValidation; - -namespace BeReadyBackend.Validators.Groups; - -public class GetProofDtoValidator : Validator -{ - public GetProofDtoValidator() - { - RuleFor(x => x.UserId) - .NotEmpty() - .WithMessage("Id cannot be empty") - .GreaterThan(0) - .WithMessage("Id must be greater than 0"); - - RuleFor(x => x.Username) - .NotEmpty() - .WithMessage("Username cannot be empty") - .MaximumLength(50) - .WithMessage("Username cannot exceed 50 characters") - .MinimumLength(2) - .WithMessage("Username must exceed 2 characters"); - - RuleFor(x => x.Proof) - .NotEmpty() - .WithMessage("Proof cannot be empty"); - - RuleFor(x => x.Score) - .NotEmpty() - .WithMessage("Score cannot be empty"); - } -} \ No newline at end of file diff --git a/BeReadyBackend/Validators/Groups/GetUserGroupDtoValidator.cs b/BeReadyBackend/Validators/Groups/GetUserGroupDtoValidator.cs index 0d508ae..4c1bc9c 100644 --- a/BeReadyBackend/Validators/Groups/GetUserGroupDtoValidator.cs +++ b/BeReadyBackend/Validators/Groups/GetUserGroupDtoValidator.cs @@ -25,9 +25,5 @@ public class GetUserGroupDtoValidator : Validator RuleFor(x => x.Grade) .NotEmpty() .WithMessage("Grade cannot be empty"); - - RuleFor(x => x.Score) - .NotEmpty() - .WithMessage("Score cannot be empty"); } } \ No newline at end of file diff --git a/BeReadyBackend/Validators/RandomChallenges/GetRandomChallengeDtoValidator.cs b/BeReadyBackend/Validators/RandomChallenges/GetRandomChallengeDtoValidator.cs index 0518e26..3d6ef4a 100644 --- a/BeReadyBackend/Validators/RandomChallenges/GetRandomChallengeDtoValidator.cs +++ b/BeReadyBackend/Validators/RandomChallenges/GetRandomChallengeDtoValidator.cs @@ -24,12 +24,6 @@ public class GetRandomChallengeDtoValidator : Validator .MinimumLength(2) .WithMessage("Libelle must exceed 2 characters"); - RuleFor(x => x.Duration) - .NotEmpty() - .WithMessage("Duration cannot be empty") - .GreaterThan(0) - .WithMessage("Duration must exceed 1 hour"); - RuleFor(x => x.IsAlreadyPast) .NotEmpty() .WithMessage("Isalready past is required"); diff --git a/BeReadyBackend/Validators/Users/GetUserChallengeDtoValidator.cs b/BeReadyBackend/Validators/Users/GetUserChallengeDtoValidator.cs index aaf5161..6f1f726 100644 --- a/BeReadyBackend/Validators/Users/GetUserChallengeDtoValidator.cs +++ b/BeReadyBackend/Validators/Users/GetUserChallengeDtoValidator.cs @@ -19,9 +19,5 @@ public class GetUserChallengeDtoValidator : Validator .WithMessage("Challenge Description is required") .MaximumLength(200) .WithMessage("Challenge Description cannot exceed 200 characters"); - - RuleFor(x => x.ChallengeDuration) - .NotEmpty() - .WithMessage("Challenge Duration is required"); } } \ No newline at end of file diff --git a/BeReadyBackend/Validators/Users/GetUserStatsDtoValidator.cs b/BeReadyBackend/Validators/Users/GetUserStatsDtoValidator.cs index 1f6d7e3..d4b5835 100644 --- a/BeReadyBackend/Validators/Users/GetUserStatsDtoValidator.cs +++ b/BeReadyBackend/Validators/Users/GetUserStatsDtoValidator.cs @@ -8,26 +8,14 @@ public class GetUserStatsDtoValidator : Validator { public GetUserStatsDtoValidator() { - RuleFor(x => x.Score) + RuleFor(x => x.TotalLikes) .NotEmpty() - .WithMessage("Score is required"); - - RuleFor(x => x.TotalWin) - .NotEmpty() - .WithMessage("Total win is required"); + .WithMessage("TotalLikes is required"); RuleFor(x => x.TotalChallenge) .NotEmpty() .WithMessage("Total challenge is required"); - RuleFor(x => x.TotalPodium) - .NotEmpty() - .WithMessage("Total podium is required"); - - RuleFor(x => x.TotalBonusChallenge) - .NotEmpty() - .WithMessage("Total bonus is required"); - RuleFor(x => x.Series) .NotEmpty() .WithMessage("Series is required");