2026-08-19 10:54:55 +07:00
|
|
|
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; }
|
|
|
|
|
|
2026-09-08 14:01:13 +07:00
|
|
|
/// <summary>generate เริ่ม 0; add-in เริ่ม 1 — auto increment ต่อ document (unique index กัน race)</summary>
|
2026-08-19 10:54:55 +07:00
|
|
|
public int VersionNumber { get; set; }
|
|
|
|
|
|
|
|
|
|
/// <summary>MinIO object key: {documentId}/v{VersionNumber:D4}_{clientVersionId}.docx</summary>
|
|
|
|
|
public string ObjectKey { get; set; } = string.Empty;
|
|
|
|
|
|
2026-09-08 14:01:13 +07:00
|
|
|
/// <summary>FR-15: null เมื่อไม่มี PDF (v0 หรือ capture/upload ล้ม)</summary>
|
|
|
|
|
public string? PdfObjectKey { get; set; }
|
|
|
|
|
|
2026-08-19 10:54:55 +07:00
|
|
|
/// <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; }
|
2026-08-20 22:05:49 +07:00
|
|
|
|
|
|
|
|
/// <summary>คำอธิบาย version จากผู้ใช้ แบบ git commit message (FR-13) — optional ยาวสูงสุด 2048</summary>
|
|
|
|
|
public string? Message { get; set; }
|
2026-08-19 10:54:55 +07:00
|
|
|
}
|