hitting the performer

This commit is contained in:
Paul Schneider 2026-08-31 04:15:10 +01:00
commit 62a6236865
Signed by: notazof
GPG key ID: 1DD5D838E5343B06
27 changed files with 1603 additions and 35 deletions

View file

@ -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();
}