feat(cv): redesign document editing with revision-safe letters and writing tools
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user