- ใส่คำอธิบายแบบ commit message ได้ทุก flow ที่สร้าง version (Save & Version / Start Versioning / generate จากเว็บ) + แสดงใน version history ทุกหน้า - backend: DocumentVersion.Message (varchar 2048) + migration AddVersionMessage + BadRequest ตรวจความยาวก่อนแตะ MinIO (กัน 500 + orphan object) - add-in: ConfirmVersionDialog เพิ่ม textarea (Start Versioning ใช้ dialog ด้วย) + แสดง message ใน VersionHistoryPanel - web: ฟอร์มสร้างเอกสาร + หน้า detail แสดง message (desktop truncate + tooltip, mobile เต็มบรรทัด) - sync เอกสารทั้งหมด: spec v5 (FR-13/AC-16) + plan Phase 9 + acceptance-review 1–16 + README + CLAUDE.md + web/README - tests: backend 52 / addin 50 / web 36 — เขียวทั้งชุด Co-Authored-By: Claude <noreply@anthropic.com>
31 lines
1.4 KiB
C#
31 lines
1.4 KiB
C#
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; }
|
|
|
|
/// <summary>คำอธิบาย version จากผู้ใช้ แบบ git commit message (FR-13) — optional ยาวสูงสุด 2048</summary>
|
|
public string? Message { get; set; }
|
|
}
|