Ejemplo n.º 1
0
 public LanguageCandidate(Guid id, Guid candidateId, Guid languageId, FluencyLevel fluencyLevel)
 {
     Id           = id;
     CandidateId  = candidateId;
     LanguageId   = languageId;
     FluencyLevel = fluencyLevel;
 }
Ejemplo n.º 2
0
 public UpdateLanguageFluencyLevelCommand(Guid languageCandidateId, Guid candidateId, FluencyLevel fluencyLevel)
 {
     AggregateId         = candidateId;
     LanguageCandidateId = languageCandidateId;
     CandidateId         = candidateId;
     FluencyLevel        = fluencyLevel;
 }
Ejemplo n.º 3
0
 public static bool Validate(this FluencyLevel enumValue)
 {
     if (Enum.IsDefined(typeof(FluencyLevel), enumValue))
     {
         return(true);
     }
     return(false);
 }
Ejemplo n.º 4
0
 public AddLanguageCandidateCommand(Guid id, Guid candidateId, Guid languageId, FluencyLevel fluencyLevel)
 {
     AggregateId  = candidateId;
     Id           = id;
     CandidateId  = candidateId;
     LanguageId   = languageId;
     FluencyLevel = fluencyLevel;
 }
Ejemplo n.º 5
0
 private bool FluencyLevelValidate(FluencyLevel fluencyLevel)
 {
     return(fluencyLevel.Validate());
 }
Ejemplo n.º 6
0
 public void UpdateFluencyLevel(FluencyLevel fluencyLevel)
 {
     FluencyLevel = fluencyLevel;
 }
Ejemplo n.º 7
0
 public void UpdateFluencyLevel(LanguageCandidate languageCandidate, FluencyLevel fluencyLevel)
 {
     DeleteLanguageCandidate(languageCandidate);
     languageCandidate.UpdateFluencyLevel(fluencyLevel);
     AddLanguageCandidate(languageCandidate);
 }
Ejemplo n.º 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)));
        }
Ejemplo n.º 9
0
 public async Task LanguageLeveLanguagePerson(Guid languagePersonId, FluencyLevel fluencyLevel)
 {
     await this._personService.LanguageLeveLanguagePerson(languagePersonId, fluencyLevel);
 }