SHA256
- 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.
28 lines
1.0 KiB
C#
28 lines
1.0 KiB
C#
using Somnia.GuestLog.Models.DTOs;
|
|
|
|
namespace Somnia.GuestLog.Services.Entity;
|
|
|
|
public interface IGuestDocumentEntityService
|
|
{
|
|
public Task<Result> CreateDocumentAsync(GuestDocumentDTO dto);
|
|
public Task<Result> UpdateDocumentAsync(GuestDocumentDTO dto);
|
|
|
|
/// <summary>
|
|
/// Same behavior as <see cref="DeleteDocumentAsync(long)"/>
|
|
/// </summary>
|
|
public Task<Result> DeleteDocumentAsync(GuestDocumentDTO dto);
|
|
|
|
/// <summary>
|
|
/// Delete documents by ID.
|
|
/// This operation will delete all versions of a document.
|
|
/// </summary>
|
|
/// <param name="id">ID of the document to Delete</param>
|
|
public Task<Result> DeleteDocumentAsync(long id);
|
|
|
|
public Task<GuestDocumentDTO?> GetLastVersionDtoByIdAsync(long id);
|
|
public Task<GuestDocumentDTO?> GetLastVersionDtoByDocumentAsync(string docType, string docNum);
|
|
|
|
public Task<IEnumerable<GuestDocumentDTO>> GetDtoListAsync(bool onlyLastVersion);
|
|
public Task<IEnumerable<GuestDocumentDTO>> GetDtoListByFilterAsync(GuestDocFilterDTO filter, int limit = 0);
|
|
|
|
} |