- Added handling for `Statuses` property to filter by min, max, include, and ignore lists. - Deprecated single `Status` handling is now wrapped with pragma warnings for backward compatibility. - Ensures `AnyHistoryAsync` extension works correctly with enhanced query filtering.
60 lines
1.6 KiB
C#
60 lines
1.6 KiB
C#
using EnvelopeGenerator.Application.Common.Query;
|
|
using EnvelopeGenerator.Domain.Constants;
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
namespace EnvelopeGenerator.Application.Histories.Queries;
|
|
|
|
//TODO: Add sender query
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public record HistoryQueryBase
|
|
{
|
|
/// <summary>
|
|
/// Die eindeutige Kennung des Umschlags.
|
|
/// </summary>
|
|
[Obsolete("Use Envelope property")]
|
|
public int? EnvelopeId { get; set; }
|
|
|
|
/// <summary>
|
|
/// Der Include des Umschlags, der abgefragt werden soll. Kann optional angegeben werden, um die Ergebnisse zu filtern.
|
|
/// </summary>
|
|
[Obsolete("Use statuses")]
|
|
public EnvelopeStatus? Status { get; set; }
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public EnvelopeStatusQuery Statuses { get; set; } = new();
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public EnvelopeQueryBase Envelope { get; set; } = new EnvelopeQueryBase();
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
public record EnvelopeStatusQuery
|
|
{
|
|
/// <summary>
|
|
/// Der minimale Statuswert, der berücksichtigt werden.
|
|
/// </summary>
|
|
public EnvelopeStatus? Min { get; init; }
|
|
|
|
/// <summary>
|
|
/// Der maximale Statuswert, der berücksichtigt werden.
|
|
/// </summary>
|
|
public EnvelopeStatus? Max { get; init; }
|
|
|
|
/// <summary>
|
|
/// Eine Liste von Statuswerten, die einbezogen werden.
|
|
/// </summary>
|
|
public EnvelopeStatus[]? Include { get; init; }
|
|
|
|
/// <summary>
|
|
/// Eine Liste von Statuswerten, die ignoriert werden werden.
|
|
/// </summary>
|
|
public EnvelopeStatus[]? Ignore { get; init; }
|
|
} |