Estimate validation polish + PDF/TeX generation in Yavsc.Api
- List removal: GetOngoingEstimatesAsProvider filters on ProviderValidationDate so a provider's signed estimate leaves their list; PostIt refreshes the list on navigation pop-back. - Title renames: "Devis en attente de signature fournisseur/client" on both the provider and client sides (HomePage, VM, tests). - Move the estimate/bill TeX+PDF generation flow from Yavsc.Org into Yavsc.Api (TeXHelpers, PdfGenerationViewModel, BillViewComponent, Bill/Estimate templates, _ViewImports). Program.cs wires AddControllersWithViews + SiteSettings; FrontOfficeApiController injects IRazorViewEngine (cast to IViewEngine) with optional deps and exposes estimate.tex/estimate.pdf endpoints keyed by query id. - PDF generation drives through the Estimate_pdf view (side-effect render) and compiles via the system lualatex, fed TeX on stdin (no intermediate .tex), PDF to the bills dir, aux artifacts cleaned so only the .pdf persists. Resolve the bills dir to an absolute path so lualatex's -output-directory and working directory agree regardless of the host cwd (fixes "I can't write on file estimate-1.log"). - PostIt: DownloadAsync on the client + GetEstimateTex/PdfAsync; Télécharger PDF/TeX buttons on the validation and command-detail pages via a StorageProvider save helper. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
parent
70a123b840
commit
97d0584292
41 changed files with 1036 additions and 290 deletions
|
|
@ -284,11 +284,14 @@ public sealed class EstimateApiControllerTests : IClassFixture<ApiWebServerFixtu
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetOngoingEstimatesAsProvider_returns_only_ongoing_estimates_established_by_the_provider()
|
||||
public async Task GetOngoingEstimatesAsProvider_returns_estimates_the_provider_has_not_yet_signed()
|
||||
{
|
||||
_fixture.ResetAndSeedActivityGraph();
|
||||
var ongoingId = SeedEstimate(clientId: "bob", clientValidated: false);
|
||||
SeedEstimate(clientId: "bob", clientValidated: true); // already validated: excluded
|
||||
// Not yet provider-signed: visible in the provider's "awaiting
|
||||
// provider signature" list.
|
||||
var pendingId = SeedEstimate(clientId: "bob", clientValidated: false, providerValidated: false);
|
||||
// Provider already signed: must leave the list immediately.
|
||||
SeedEstimate(clientId: "bob", clientValidated: false, providerValidated: true);
|
||||
|
||||
using var http = NewClient("alice");
|
||||
|
||||
|
|
@ -300,7 +303,7 @@ public sealed class EstimateApiControllerTests : IClassFixture<ApiWebServerFixtu
|
|||
using var doc = JsonDocument.Parse(body);
|
||||
var items = doc.RootElement.EnumerateArray().ToArray();
|
||||
var item = Assert.Single(items);
|
||||
Assert.Equal(ongoingId, item.GetProperty("id").GetInt64());
|
||||
Assert.Equal(pendingId, item.GetProperty("id").GetInt64());
|
||||
Assert.Equal("alice", item.GetProperty("ownerId").GetString());
|
||||
Assert.Single(item.GetProperty("bill").EnumerateArray());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue