postit: persist settings save and apply ApiUrl changes without restart #51

Merged
notazof merged 25 commits from feat/estimate into main 2026-09-06 21:05:58 +01:00
3 changed files with 118 additions and 1 deletions
Showing only changes of commit 369a8eb3c8 - Show all commits

Release 1.0.8-rc13
All checks were successful
Dotnet build and test / build (pull_request) Successful in 15m13s
Forgejo Release / release (push) Successful in 13m14s

Paul Schneider 2026-09-06 18:02:30 +01:00
Signed by: notazof
GPG key ID: 1DD5D838E5343B06

View file

@ -1,5 +1,33 @@
# Changelog # Changelog
## [1.0.8-rc13] - unstable
### Added
* [PostIt] Integration d'un selecteur de lieu RDV base sur Mapsui (carte interactive dans le formulaire `Rdv`).
* [PostIt] Ajout d'un marqueur de position et d'une action de recentrage sur la carte RDV.
* [PostIt] Ajout d'un service de reverse geocoding pour suggerer une adresse a partir des coordonnees carte.
* [PostIt] Cache et debounce des resolutions d'adresse RDV pour limiter les appels reseau et lisser l'UX.
* [PostIt.Tests] Nouvelles non-regressions sur le panneau d'adresse suggeree RDV et le comportement de la carte.
* [Yavsc.Abstract] Activation de `#nullable enable annotations` sur les fichiers legacy avec annotations nullable.
* [Yavsc.Server] Activation de `#nullable enable annotations` sur les fichiers legacy avec annotations nullable.
### Changed
* [PostIt] Generalisation de la barre de statut d'action (severite explicite) sur pages principales, dialogues et formulaires billing.
* [PostIt] Harmonisation des messages de statut utilisateur en francais.
* [PostIt] Renforcement des gardes de navigation dans les flux de gestion des membres de cercle.
* [PostIt] Le flux RDV conserve l'adresse saisie manuellement et propose l'adresse resolue comme suggestion explicite.
* [PostIt] Le flux de geolocalisation RDV tolere les positions proches dans le cache de suggestion d'adresse.
### Fixed
* [PostIt.Desktop] Correction d'un crash au demarrage OIDC (`No authority specified`) via durcissement des valeurs par defaut de configuration d'authentification.
* [PostIt] Correction de la persistance des settings: l'etat runtime de statut n'est plus serialize dans le JSON utilisateur.
* [PostIt.Tests] Ajout d'un verrou de non-regression sur le premier chargement des settings.
* [PostIt] Correction du binding de la date RDV: `DatePicker.SelectedDate` est aligne sur un proxy `DateTimeOffset?` (`EventDateSelection`).
## [1.0.8-rc12] - unstable ## [1.0.8-rc12] - unstable
### Added ### Added

View file

@ -0,0 +1,61 @@
using System.Net;
using System.Net.Http.Headers;
using Microsoft.Extensions.DependencyInjection;
using Yavsc.Api.Test.Fixtures;
using Yavsc.Helpers;
using Yavsc.Models;
using Yavsc.Tests.Shared;
namespace Yavsc.Api.Test;
[Collection("Yavsc Api")]
public sealed class FrontOfficeApiControllerTests : IClassFixture<ApiWebServerFixture>
{
private readonly ApiWebServerFixture _fixture;
public FrontOfficeApiControllerTests(ApiWebServerFixture fixture)
{
_fixture = fixture;
}
private HttpClient NewClient(string subject = "alice", string scope = "api")
{
var handler = new HttpClientHandler
{
ServerCertificateCustomValidationCallback = (_, _, _, _) => true
};
var http = new HttpClient(handler)
{
BaseAddress = new Uri(_fixture.BaseAddress)
};
http.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue("Bearer", TestTokenIssuer.Issue(subject, scope));
return http;
}
[Fact]
public async Task Front_accept_query_updates_status_without_server_error()
{
WorkflowHelpers.ConfigureBillingService();
_fixture.ResetAndSeedRdvQueryGraph();
long queryId;
using (var scope = _fixture.Services.CreateScope())
{
var db = scope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
queryId = db.RdvQueries.Select(q => q.Id).Single();
}
using var http = NewClient();
var response = await http.PostAsync($"/api/v1/front/query/accept?billingCode=Rdv&queryId={queryId}", content: null, TestContext.Current.CancellationToken);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
using var assertScope = _fixture.Services.CreateScope();
var assertDb = assertScope.ServiceProvider.GetRequiredService<ApplicationDbContext>();
var updated = assertDb.RdvQueries.Single(q => q.Id == queryId);
Assert.Equal(QueryStatus.Accepted, updated.Status);
}
}

View file

@ -1,6 +1,7 @@
using System.Reflection; using System.Reflection;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Yavsc.Abstract.Workflow; using Yavsc.Abstract.Workflow;
using Yavsc.Helpers;
using Yavsc.Models; using Yavsc.Models;
namespace Yavsc.Services namespace Yavsc.Services
@ -35,7 +36,34 @@ namespace Yavsc.Services
public static IQuery GetBillable(ApplicationDbContext context, string billingCode, long queryId) public static IQuery GetBillable(ApplicationDbContext context, string billingCode, long queryId)
{ {
throw new NotImplementedException(); if (context is null) throw new ArgumentNullException(nameof(context));
if (string.IsNullOrWhiteSpace(billingCode) || queryId <= 0)
{
return null;
}
if (Billing.Count == 0)
{
WorkflowHelpers.ConfigureBillingService();
}
var getter = Billing
.FirstOrDefault(kvp => string.Equals(kvp.Key, billingCode.Trim(), StringComparison.OrdinalIgnoreCase))
.Value;
if (getter is null)
{
return null;
}
try
{
return getter(context, queryId);
}
catch (InvalidOperationException)
{
return null;
}
} }