first commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
namespace Fitness_core_BE.DTOs.TimeBankCard
|
||||
{
|
||||
public class TimeBankCardDto
|
||||
{
|
||||
public Guid TimeBankCardId { get; set; }
|
||||
public string RfidTagId { get; set; } = string.Empty;
|
||||
public Guid? CustomerId { get; set; }
|
||||
public int TotalMinutesPurchased { get; set; }
|
||||
public int MinutesRemaining { get; set; }
|
||||
public decimal AmountPaid { get; set; }
|
||||
public DateTime PurchasedAt { get; set; }
|
||||
public DateTime? ExpiresAt { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
|
||||
/// <summary>True right after a tap-in swipe (session open, clock running); false after
|
||||
/// tap-out or when the card has no open session.</summary>
|
||||
public bool SessionOpen { get; set; }
|
||||
public DateTime? SessionStartedAt { get; set; }
|
||||
public string? SessionFacilityName { get; set; }
|
||||
|
||||
/// <summary>Only populated in the response to a tap-out swipe.</summary>
|
||||
public int? MinutesDeductedThisSwipe { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Fitness_core_BE.DTOs.TimeBankCard
|
||||
{
|
||||
public class IssueTimeBankCardRequest
|
||||
{
|
||||
[Required]
|
||||
public string RfidTagId { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
[Range(1, int.MaxValue, ErrorMessage = "TotalMinutesPurchased must be at least 1")]
|
||||
public int TotalMinutesPurchased { get; set; }
|
||||
|
||||
[Range(0, double.MaxValue, ErrorMessage = "AmountPaid must be zero or greater")]
|
||||
public decimal AmountPaid { get; set; }
|
||||
|
||||
/// <summary>Ties the card to a member's own account; omit for a walk-in-only card.</summary>
|
||||
public Guid? CustomerId { get; set; }
|
||||
|
||||
public DateTime? ExpiresAt { get; set; }
|
||||
}
|
||||
|
||||
// No MinutesToDeduct -- the swipe itself is tap-in (first swipe, starts the clock) or
|
||||
// tap-out (second swipe, deducts the elapsed time). See TimeBankCard.ActiveSessionStartedAt.
|
||||
public class SwipeTimeBankCardRequest
|
||||
{
|
||||
[Required]
|
||||
public string RfidTagId { get; set; } = string.Empty;
|
||||
|
||||
[Required]
|
||||
public Guid FacilityId { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user