public async Task IssuePolicy(long?policyId, Result <Transaction> transaction) { await PolicyApi.MarkAsPaidWithHttpMessagesAsync(transaction.Target.Id, Jwt.CreateAuthorizationHeader(policyId)); PolicyDTO policy = await GetPolicy(policyId); if (policy.IsPolicy.GetValueOrDefault(false)) { // TODO : this has been disabled as we are having issues with RAC GIT getting secure email set up. Jamo will // TODO : query the database directly to get the report extract for the underwriters. // _emailService.SendPolicyDetails(policy); // // Send the confirmation email to the customer // await _emailService.SendPolicyConfirmation(policy); } }
public virtual MinMaxDTO GetSumInuredRange() { return(_referenceDatas.GetSumInuredRangeWithHttpMessagesAsync(Jwt.CreateAuthorizationHeader(null)).WaitForServiceCall()); }
public async Task <PolicyDTO> UpdateContactDetails(long?policyId, BicycleQuote model) { AddressDTO address = new AddressDTO() { AddressLine1 = model.PolicyDetail.Contact.Address, PostCode = model.PolicyDetail.Contact.PostCode, Suburb = model.PolicyDetail.Contact.Suburb }; PolicyContactDTO dto = new PolicyContactDTO() { Address = address, DateOfBirth = model.PolicyDetail.Contact.DateOfBirth.ToDateTime(), EmailAddress = model.PolicyDetail.Contact.ContactEmail, FirstName = model.PolicyDetail.Contact.FirstName, LastName = model.PolicyDetail.Contact.LastName, PhoneNumber = model.PolicyDetail.Contact.ContactNumber }; return(await PolicyApi.SetContactWithHttpMessagesAsync(policyId.GetValueOrDefault(), dto, Jwt.CreateAuthorizationHeader(policyId)).Data()); }
public virtual IList <ReferenceData> GetBicycleTypes() { return(_referenceDatas.GetBicycleTypesWithHttpMessagesAsync(Jwt.CreateAuthorizationHeader(null)).WaitForServiceCall()); }
public async Task <PolicyDTO> UpdatePolicy(long?policyId, BicycleQuoteQuestion bicycleQuoteQuestion) { BicyclePolicyDetailDTO details = MapToDto(bicycleQuoteQuestion); PolicyDTO policy = await BicyclePolicyApi.SetDetailsWithHttpMessagesAsync(policyId.GetValueOrDefault(), details, Jwt.CreateAuthorizationHeader(policyId)).Data(); policy = await UpdateContact(policy, bicycleQuoteQuestion.CustomerDetails.EmailAddress); return(policy); }
public async Task <PolicyDTO> CreatePolicy(BicycleQuoteQuestion bicycleQuoteQuestion) { BicyclePolicyDetailDTO details = MapToDto(bicycleQuoteQuestion); PolicyDTO policy = await BicyclePolicyApi.CreateWithHttpMessagesAsync(details, Jwt.CreateAuthorizationHeader(null)).Data(); policy = await UpdateContact(policy, bicycleQuoteQuestion.CustomerDetails.EmailAddress); return(policy); }
protected async Task <PolicyDTO> UpdateContact(PolicyDTO policy, string emailAddress) { if (policy.Contact == null) { policy.Contact = new PolicyContactDTO(); } policy.Contact.EmailAddress = emailAddress; return(await PolicyApi.SetContactWithHttpMessagesAsync(policy.Id, policy.Contact, Jwt.CreateAuthorizationHeader(policy.Id)).Data()); }
public async Task <PolicyDTO> GetPolicy(long?policyId) { PolicyDTO policy = await PolicyApi.GetPolicyWithHttpMessagesAsync(policyId.GetValueOrDefault(), Jwt.CreateAuthorizationHeader(policyId)).Data(); return(policy); }
public async Task <PolicyDTO> UpdateSumInsured(long?policyId, decimal sumInsured) { PolicyDTO policy = await GetPolicy(policyId); policy.Option.AgreedValue = sumInsured.ToString(CultureInfo.InvariantCulture); policy = await PolicyApi.SetPolicyOptionWithHttpMessagesAsync(policy.Id, policy.Option, Jwt.CreateAuthorizationHeader(policy.Id)).Data(); return(policy); }