Skip to content

Commit

Permalink
added background
Browse files Browse the repository at this point in the history
  • Loading branch information
VILLAN3LL3 committed Dec 12, 2024
1 parent b8d6766 commit 0e896e3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class MyMusicianProfileCreateDto
public IList<MyDoublingInstrumentCreateBodyDto> DoublingInstruments { get; set; } = [];
public IList<Guid> PreferredPositionsInnerIds { get; set; } = [];
public IList<byte> PreferredPartsInner { get; set; } = [];
public string BackgroundInner { get; set; }
}

public class MyMusicianProfileCreateDtoMappingProfile : Profile
Expand All @@ -26,6 +27,7 @@ public MyMusicianProfileCreateDtoMappingProfile()
_ = CreateMap<MyMusicianProfileCreateDto, CreateMusicianProfile.Command>()
.ForMember(dest => dest.LevelAssessmentInner, opt => opt.MapFrom(src => src.LevelAssessmentInner))
.ForMember(dest => dest.ProfilePreferenceInner, opt => opt.MapFrom(src => src.ProfilePreferenceInner))
.ForMember(dest => dest.BackgroundInner, opt => opt.MapFrom(src => src.BackgroundInner))

.ForMember(dest => dest.InstrumentId, opt => opt.MapFrom(src => src.InstrumentId))
.ForMember(dest => dest.InquiryStatusInner, opt => opt.MapFrom(src => src.InquiryStatusInner))
Expand Down Expand Up @@ -69,6 +71,9 @@ public MyMusicianProfileCreateDtoValidator()

_ = RuleFor(p => p.InquiryStatusInner)
.IsInEnum();

_ = RuleFor(p => p.BackgroundInner)
.RestrictedFreeText(1000);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ public class MusicianProfileCreateBodyDto
public IList<Guid> PreferredPositionsTeamIds { get; set; } = [];
public IList<byte> PreferredPartsInner { get; set; } = [];
public IList<byte> PreferredPartsTeam { get; set; } = [];
public string BackgroundInner { get; set; }
public string BackgroundTeam { get; set; }
}

public class MusicianProfileCreateDtoMappingProfile : Profile
Expand All @@ -45,6 +47,8 @@ public MusicianProfileCreateDtoMappingProfile()
.ForMember(dest => dest.QualificationId, opt => opt.MapFrom(src => src.Body.QualificationId))
.ForMember(dest => dest.InquiryStatusInner, opt => opt.MapFrom(src => src.Body.InquiryStatusInner))
.ForMember(dest => dest.InquiryStatusTeam, opt => opt.MapFrom(src => src.Body.InquiryStatusTeam))
.ForMember(dest => dest.BackgroundInner, opt => opt.MapFrom(src => src.Body.BackgroundInner))
.ForMember(dest => dest.BackgroundTeam, opt => opt.MapFrom(src => src.Body.BackgroundTeam))

.ForMember(dest => dest.PreferredPositionsInnerIds, opt => opt.MapFrom(src => src.Body.PreferredPositionsInnerIds))
.ForMember(dest => dest.PreferredPositionsTeamIds, opt => opt.MapFrom(src => src.Body.PreferredPositionsTeamIds))
Expand Down Expand Up @@ -116,6 +120,12 @@ public MusicianProfileCreateBodyDtoValidator()

_ = RuleFor(p => p.InquiryStatusTeam)
.IsInEnum();

_ = RuleFor(p => p.BackgroundInner)
.RestrictedFreeText(1000);

_ = RuleFor(p => p.BackgroundTeam)
.RestrictedFreeText(1000);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public class Command : IRequest<MusicianProfile>, IHasInstrumentRequest
public IList<Guid> PreferredPositionsTeamIds { get; set; } = [];
public IList<byte> PreferredPartsInner { get; set; } = [];
public IList<byte> PreferredPartsTeam { get; set; } = [];
public string BackgroundInner { get; set; }
public string BackgroundTeam { get; set; }
}
public class Validator : AbstractValidator<Command>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ public MusicianProfile(CreateMusicianProfile.Command command, bool isMainProfile
PreferredPositionsTeam = [.. command.PreferredPositionsTeamIds.Distinct().Select(i => new MusicianProfilePositionTeam(i, Id))];
PreferredPartsInner = [.. command.PreferredPartsInner.Distinct()];
PreferredPartsTeam = [.. command.PreferredPartsTeam.Distinct()];
BackgroundInner = command.BackgroundInner;
BackgroundTeam = command.BackgroundTeam;
}

public MusicianProfile()
Expand Down

0 comments on commit 0e896e3

Please sign in to comment.