GuestDocument Versions - Part 1:

- Changed GuestDocument PK from `DocumentType`+`DocumentNumber` to to `ID`+`Version` for future versioning.
- Added DB field "IsLastVersion" to simplify queries where only last/current version is allowed.
- Updated GuestDocument DB fields type for `CreateTime` & `UpdateTime` to add precision.
- Updated usages of GuestDocument PK to new PK.
- Limit delete of a GuestDocument when it's currently used in a StayEntry.

Note: DB changes require recreating db tables, so all data is lost and migration "rollback" is not allowed.
This commit is contained in:
2026-09-01 15:04:38 +02:00
parent a01eed82e1
commit 887c3d787a
21 changed files with 525 additions and 93 deletions
@@ -122,6 +122,8 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="dto.GuestDocument.Id" xml:space="preserve"><value>ID</value></data>
<data name="dto.GuestDocument.Version" xml:space="preserve"><value>Version</value></data>
<data name="dto.GuestDocument.DocumentType" xml:space="preserve"><value>Document Type</value></data>
<data name="dto.GuestDocument.DocumentNum" xml:space="preserve"><value>Document Number</value></data>
<data name="dto.GuestDocument.IssueDate" xml:space="preserve"><value>Issue Date</value></data>
@@ -183,7 +185,8 @@
<data name="resultCode.FailedValidation" xml:space="preserve"><value>Failed entity validation</value></data>
<data name="resultCode.NotFound" xml:space="preserve"><value>Not found</value></data>
<!-- Specific codes -->
<data name="resultCode.GuestCurrentlyInStay" xml:space="preserve"><value>Guest ('{0}') is already in one stay during the period: {1}</value></data>
<data name="resultCode.GuestInStay" xml:space="preserve"><value>Guest (ID: '{0}') is in a stay.</value></data>
<data name="resultCode.GuestCurrentlyInStay" xml:space="preserve"><value>Guest (ID: '{0}') is already in one stay during the period: {1}</value></data>
<data name="navMenu.GuestDocumentList" xml:space="preserve"><value>Guests</value></data>