hitting the performer
This commit is contained in:
parent
9d97994e76
commit
62a6236865
27 changed files with 1603 additions and 35 deletions
|
|
@ -1,7 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Yavsc.Models.Haircut;
|
||||
|
||||
namespace Yavsc.Api.Client;
|
||||
|
||||
|
|
@ -38,5 +40,34 @@ public sealed class BillingApiClient
|
|||
ct: ct);
|
||||
}
|
||||
|
||||
public Task<List<HairPrestationDto>> GetHairPrestationsAsync(string billingCode, CancellationToken ct = default)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(billingCode))
|
||||
throw new ArgumentException("Billing code is required.", nameof(billingCode));
|
||||
|
||||
return _api.CallAsync<List<HairPrestationDto>>(
|
||||
HttpMethod.Get,
|
||||
Absolute($"{PathPrefix}/{Uri.EscapeDataString(billingCode)}/prestations"),
|
||||
ct: ct);
|
||||
}
|
||||
|
||||
public async Task<List<BillingQuerySummaryDto>> GetQuerySummariesAsync(string billingCode, CancellationToken ct = default)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(billingCode))
|
||||
throw new ArgumentException("Billing code is required.", nameof(billingCode));
|
||||
|
||||
var items = await _api.CallAsync<List<BillingQuerySummaryDto>>(
|
||||
HttpMethod.Get,
|
||||
Absolute($"{PathPrefix}/{Uri.EscapeDataString(billingCode)}"),
|
||||
ct: ct) ?? new List<BillingQuerySummaryDto>();
|
||||
|
||||
foreach (var item in items)
|
||||
{
|
||||
item.BillingCode = billingCode;
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
private string Absolute(string relativePath) => new Uri(_baseAddress, relativePath).ToString();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue