Files
Dhananjaya99 bffc9b1686 first commit
2026-09-28 11:44:26 +05:30

81 lines
4.7 KiB
C#

namespace Fitness_core_BE.Models.IOs
{
public record PagedResult<T>(List<T> Items, int Total, int Page, int PageSize); //commonly tabel use
// Shared OTP-send response shape -- used by the client's own contact-detail-change OTP flow
// (ClientService.SendContactOtp via AuthOtpResponseParser), not onboarding-specific despite
// originally living in that file.
public record SendOtpResult(string ReferenceNumber, int ExpiresInSeconds, int ResendAllowedInSeconds);
// ---------- Admin: client directory ----------
public record ClientSummary(Guid ClientId, string? ClientName, string? City, string? PaymentTrack, bool IsActive, DateTime CreatedAt);
public record ClientDirectoryQuery(string? Search, int Page = 1, int PageSize = 20);
// ---------- Admin: access-device pairing & status ----------
public record PairingCodeResult(string Code, DateTime ExpiresAt);
// IsOnline is inferred from the client's on-prem bridge agent's last heartbeat — the cloud
// never talks to a device directly. AccessDevice isn't tied to a specific agent, so every
// device under a client shares the same IsOnline signal (see AdminClientDirectoryService).
public record AdminAgentDto(Guid AgentId, string Name, bool IsActive, DateTime? LastSeenAt, bool IsOnline, DateTime CreatedAt);
public record AdminDeviceDto(
Guid DeviceId,
string DeviceName,
bool IsActive,
DateTime? LastSeenAt,
bool IsOnline,
DateTime? PresenceExpiresAt,
bool IsClaimed,
DateTime CreatedAt);
public record AdminClientDevicesResult(List<AdminAgentDto> Agents, List<AdminDeviceDto> Devices);
// ---------- Client's own customers / staff ----------
public record CreateCustomerWithPlansRequest(
string Fullname, string UserName, string Email, string MobileNumber, string? Nic, string Gender, string? Birthday,
List<Guid>? WorkoutPlanIds, List<Guid>? MealPlanIds, Guid? CustomerPlanId,
DateTime? OnboardDate, bool ChargePayment = true,
// Set true only on the resubmit after staff has confirmed "yes, link this existing
// platform customer to my gym" -- see ClientService.CreateCustomerWithPlans.
bool ConfirmLink = false,
string? DiscountType = null, decimal? DiscountValue = null);
// MobileNumber (not PhoneNumber) -- must match the frontend's MemberInput.mobileNumber
// JSON key, same convention CreateCustomerWithPlansRequest above already uses. A prior
// mismatch here (PhoneNumber) silently bound to null on every edit, since ASP.NET Core's
// JSON binder does not fuzzy-match differently-named keys -- every customer phone edit was
// wiping the number instead of changing it.
public record UpdateCustomerByClientRequest(
string Fullname, string UserName, string Email, string? Nic, string? Gender, string? Birthday,
string? MobileNumber);
// "Parent" path: starts a brand new subscription for a customer who was created without
// a plan, with them as the primary member.
public record AssignCustomerPlanRequest(
Guid CustomerPlanId, DateTime? ExpiryDate, DateTime? OnboardDate, bool ChargePayment = true,
string? DiscountType = null, decimal? DiscountValue = null);
// Switches an existing Individual-scope subscription to a different Individual-scope plan.
public record ChangeMembershipPlanRequest(Guid CustomerPlanId);
// ---------- Client's own gym profile (post-activation) ----------
public record EquipmentCountDto(string Name, int Count);
public record UpdateGymProfileRequest(
string? BusinessName, string? Address, string? City, string? Description,
bool? HasAc, List<EquipmentCountDto>? Equipment);
// ---------- Gym-specific Terms & Conditions authoring ----------
public record PublishGymTermsRequest(string Content);
// ---------- Client's own contact detail change (OTP-verified) ----------
public record SendContactOtpRequest(string Type, string Identifier);
public record VerifyContactOtpRequest(string Type, string Identifier, string ReferenceNumber, string OtpCode);
// ---------- Member medical details unlock ----------
public record MedicalUnlockRequest(string Password);
// GymRoleId optional -- must belong to the caller's own client (validated in StaffService).
// Left null, the new staff member has no dashboard access until a role is assigned later.
public record CreateStaffRequest(string UserName, string Email, string PhoneNumber, string? StaffPosition, string? Department, DateTime? HireDate, Guid? GymRoleId = null);
public record UpdateStaffRequest(string? UserName, string? Email, string? PhoneNumber, string? StaffPosition, string? Department);
}