GuestLog - GuestDocument fixes & improvements:

- Use GuestDocument Details page to see details.
- Added GuestDocument stays in details page.

Other minor changes:
- Updated validators to use ValueValidator base class.
- Changed Snackbar settings to show them better.
- Added Empty Debug page to test things. This page wont be updated in git, all test must be local-only.
This commit is contained in:
2026-08-15 21:23:29 +02:00
parent 6dc2d2426b
commit 3e0ef34f66
9 changed files with 127 additions and 74 deletions
@@ -8,7 +8,7 @@ namespace Somnia.GuestLog.Validators;
/// <summary>
/// Validator for GuestDocumentDTO which contains multiple rules and can be shared with the back end API
/// </summary>
public class GuestDocumentDTOValidator : AbstractValidator<GuestDocumentDTO>
public class GuestDocumentDTOValidator : ValueValidator<GuestDocumentDTO>
{
public GuestDocumentDTOValidator(IDataListService dataListService)
{
@@ -82,11 +82,4 @@ public class GuestDocumentDTOValidator : AbstractValidator<GuestDocumentDTO>
// RuleForEach(x => x.OrderDetails)
// .SetValidator(new OrderDetailsModelFluentValidator());
}
public Func<object, string, Task<IEnumerable<string>>> ValidateValue => async (model, propertyName) =>
{
var result = await ValidateAsync(ValidationContext<GuestDocumentDTO>.CreateWithOptions((GuestDocumentDTO)model, x =>
x.IncludeProperties(propertyName)));
return result.IsValid ? [] : result.Errors.Select(e => e.ErrorMessage);
};
}