public async Task <Guid> CreateDebtAsync(CreateDebtRequest model) { var parameters = model .ToDictionary() .SetDynamicsActionAuditParameters(_auditContext); var result = await _client.ExecuteActionAsSingleAsync("ntt_BSSDebtCreate", parameters); var debtId = result["DebtId"].ToString(); var contentDict = model.ToDictionary(); parameters.Add("ntt_BSSDebtCreate", true); await _auditService.PerformAuditing(_auditContext.ToAuditDetail(contentDict)); return(new Guid(debtId)); }
public async Task <ProposeDebtResponse> ProposeADebt(ProposeDebtRequest model) { var parameters = model .ToDictionary() .SetDynamicsActionAuditParameters(_auditContext); var result = await _client.ExecuteActionAsSingleAsync("ntt_BSSDebtCreate", parameters); var debtId = result["DebtId"].ToString(); var createdOn = result["CreatedOn"].ToString().ToDateTimeOffset(Constants.UkDateTimeFormat); var contentDict = model.ToDictionary(); contentDict.Add("ntt_BSSDebtCreate", true); await _auditService.PerformAuditing(_auditContext.ToAuditDetail(contentDict)); return(new ProposeDebtResponse { DebtId = new Guid(debtId), CreatedOn = createdOn, }); }