示例#1
0
 public LanguageCandidate(Guid id, Guid candidateId, Guid languageId, FluencyLevel fluencyLevel)
 {
     Id           = id;
     CandidateId  = candidateId;
     LanguageId   = languageId;
     FluencyLevel = fluencyLevel;
 }
示例#2
0
 public UpdateLanguageFluencyLevelCommand(Guid languageCandidateId, Guid candidateId, FluencyLevel fluencyLevel)
 {
     AggregateId         = candidateId;
     LanguageCandidateId = languageCandidateId;
     CandidateId         = candidateId;
     FluencyLevel        = fluencyLevel;
 }
示例#3
0
 public static bool Validate(this FluencyLevel enumValue)
 {
     if (Enum.IsDefined(typeof(FluencyLevel), enumValue))
     {
         return(true);
     }
     return(false);
 }
示例#4
0
 public AddLanguageCandidateCommand(Guid id, Guid candidateId, Guid languageId, FluencyLevel fluencyLevel)
 {
     AggregateId  = candidateId;
     Id           = id;
     CandidateId  = candidateId;
     LanguageId   = languageId;
     FluencyLevel = fluencyLevel;
 }
示例#5
0
 private bool FluencyLevelValidate(FluencyLevel fluencyLevel)
 {
     return(fluencyLevel.Validate());
 }
示例#6
0
 public void UpdateFluencyLevel(FluencyLevel fluencyLevel)
 {
     FluencyLevel = fluencyLevel;
 }
示例#7
0
 public void UpdateFluencyLevel(LanguageCandidate languageCandidate, FluencyLevel fluencyLevel)
 {
     DeleteLanguageCandidate(languageCandidate);
     languageCandidate.UpdateFluencyLevel(fluencyLevel);
     AddLanguageCandidate(languageCandidate);
 }
示例#8
0
        public async Task <ActionResult> LanguageFluencyLevel(Guid languagecandidateId, [FromBody] FluencyLevel fluencyLevelRating)
        {
            if (!fluencyLevelRating.Validate())
            {
                NotifierError("Nivel de fluencia inválido.");
                return(CustomResponse());
            }
            if (languagecandidateId == Guid.Empty)
            {
                NotifierError("Id invalido.");
                return(CustomResponse());
            }

            var languageCandidate = await GetCandidateLanguageById(languagecandidateId);

            if (languageCandidate == null)
            {
                NotifierError("Idioma inválido");
                return(CustomResponse());
            }
            if (languageCandidate.CandidateId != _candidateId)
            {
                NotifierError("Esse registro não pertence ao usuário logado.");
                return(CustomResponse());
            }

            var command  = new UpdateLanguageFluencyLevelCommand(languagecandidateId, _candidateId, fluencyLevelRating);
            var response = await _mediatorHandler.SendCommand(command);

            if (!response.IsValid)
            {
                return(CustomResponse(response));
            }

            return(CustomResponse(await GetCandidateLanguageById(languagecandidateId)));
        }
示例#9
0
 public async Task LanguageLeveLanguagePerson(Guid languagePersonId, FluencyLevel fluencyLevel)
 {
     await this._personService.LanguageLeveLanguagePerson(languagePersonId, fluencyLevel);
 }