feat(cv): redesign document editing with revision-safe letters and writing tools

This commit is contained in:
cesnimda
2026-10-25 22:44:14 +01:00
parent 01e10996c5
commit 2bfaf6c14b
57 changed files with 2859 additions and 118 deletions
+7 -1
View File
@@ -37,6 +37,7 @@ public interface ICvVariantService
// Render a saved variant against the current master profile.
Task<ThemedCvRenderResult?> RenderAsync(string ownerUserId, int id, CvRenderPerson person, CancellationToken ct);
Task<ThemedCvRenderResult?> RenderAsync(string ownerUserId, int id, CvRenderPerson person, CancellationToken ct, int? expectedVersion);
// Render arbitrary (unsaved) settings against the current master profile — live preview.
Task<ThemedCvRenderResult> RenderSettingsAsync(string ownerUserId, CvVariantSettings settings, CvRenderPerson person, CancellationToken ct);
// The master profile resolved to sections+entries (with ItemKeys) for the Content tab to edit.
@@ -176,10 +177,15 @@ public sealed class CvVariantService : ICvVariantService
return await SaveAsync(ownerUserId, id, null, settings, $"restore:v{version}", expectedVersion, ct);
}
public async Task<ThemedCvRenderResult?> RenderAsync(string ownerUserId, int id, CvRenderPerson person, CancellationToken ct)
public Task<ThemedCvRenderResult?> RenderAsync(string ownerUserId, int id, CvRenderPerson person, CancellationToken ct) =>
RenderAsync(ownerUserId, id, person, ct, null);
public async Task<ThemedCvRenderResult?> RenderAsync(string ownerUserId, int id, CvRenderPerson person, CancellationToken ct, int? expectedVersion)
{
var variant = await GetAsync(ownerUserId, id, ct);
if (variant is null) return null;
if (expectedVersion is not null && (expectedVersion < 1 || variant.Version != expectedVersion))
throw new DbUpdateConcurrencyException("The CV changed after it was loaded.");
var settings = CvVariantSettingsJson.Deserialize(variant.SettingsJson);
var profile = await _career.LoadStructuredAsync(ownerUserId, ct);
return RenderInternal(profile, settings, person);