implement Phase 1-2

This commit is contained in:
Suphonchai Phoonsawat 2026-08-19 10:54:55 +07:00
parent 41573b3c4f
commit b976cf3124
23 changed files with 1291 additions and 79 deletions

View file

@ -0,0 +1,28 @@
namespace WordVersioning.Api.Models;
/// <summary>Snapshot ของเอกสารหนึ่ง version (spec ส่วน 7)</summary>
public class DocumentVersion
{
public Guid Id { get; set; }
public Guid DocumentId { get; set; }
public Document? Document { get; set; }
/// <summary>เริ่มที่ 1 — auto increment ต่อ document (unique index กัน race)</summary>
public int VersionNumber { get; set; }
/// <summary>MinIO object key: {documentId}/v{VersionNumber:D4}_{clientVersionId}.docx</summary>
public string ObjectKey { get; set; } = string.Empty;
/// <summary>SHA256 hex ของไฟล์ (ตรวจ integrity ภายหลัง)</summary>
public string ContentHash { get; set; } = string.Empty;
/// <summary>จาก claim `sub` เท่านั้น — ห้ามรับจาก client</summary>
public string CreatedByUserId { get; set; } = string.Empty;
public DateTimeOffset CreatedAt { get; set; }
/// <summary>Snapshot ค่า fields ของ version นี้ (FR-11) — map tag→text แบบ JSON</summary>
public string? FieldsSnapshotJson { get; set; }
}