public async Task <GetLatestAccountAgreementResponse> Handle(GetLatestAccountAgreementTemplateRequest message)
        {
            var template = await _employerAgreementRepository.GetLatestAgreementTemplate();

            return(new GetLatestAccountAgreementResponse {
                Template = template
            });
        }
Example #2
0
        public async Task <GetLatestEmployerAgreementResponse> Handle(GetLatestEmployerAgreementTemplateRequest message)
        {
            var validationResults = await _validator.ValidateAsync(message);

            if (validationResults.IsUnauthorized)
            {
                throw new UnauthorizedAccessException();
            }

            if (!validationResults.IsValid())
            {
                throw new InvalidRequestException(validationResults.ValidationDictionary);
            }

            var template = await _employerAgreementRepository.GetLatestAgreementTemplate();

            return(new GetLatestEmployerAgreementResponse {
                Template = template
            });
        }