using Fitness_core_BE.Domain; using Fitness_core_BE.DTOs.Customer; using Fitness_core_BE.DTOs.CustomerPlan; using Fitness_core_BE.DTOs.Meal; using Fitness_core_BE.DTOs.Workout; using Fitness_core_BE.Models; namespace Fitness_core_BE.Interfaces { public interface IClientRepository { Task> GetAllCustomers(); Task GetCustomerById(Guid customerId); Task> GetAllClientsAsync(CancellationToken ct = default); Task GetClientByIdAsync(Guid clientId, CancellationToken ct = default); Task> GetClientListAsync(Guid clientId, CancellationToken ct = default); Task RegisterClientAsync(Client client, CancellationToken ct = default); Task RegisterBussinessDetailAsync(ClientBusiness clientBusiness, CancellationToken ct = default); // Tracked (unlike GetClientByIdAsync) so the caller can mutate & persist via UoW. Task GetPrimaryBusinessByClientIdAsync(Guid clientId, CancellationToken ct = default); Task GetClientEntityByIdAsync(Guid clientId, CancellationToken ct = default); Task> GetFollowedWorkoutPlansAsync(Guid customerId, CancellationToken ct = default); Task> GetFollowedMealPlansAsync(Guid customerId, CancellationToken ct = default); Task GetCustomerHealthAsync(Guid customerId, CancellationToken ct = default); Task> GetCustomersByClientIdAsync(Guid clientId, CancellationToken ct = default); Task CustomerBelongsToClientAsync(Guid customerId, Guid clientId, CancellationToken ct = default); Task> GetCustomerPlansByClientIdAsync(Guid clientId, CancellationToken ct = default); // Workout Plan operations Task> GetWorkoutPlansByClientIdAsync(Guid clientId, CancellationToken ct = default); Task GetWorkoutPlanByIdForClientAsync(Guid workoutPlanId, Guid clientId, CancellationToken ct = default); // Meal Plan operations Task> GetMealPlansByClientIdAsync(Guid clientId, CancellationToken ct = default); Task GetMealPlanByIdForClientAsync(Guid mealPlanId, Guid clientId, CancellationToken ct = default); // Customer Plan operations Task GetCustomerPlanByIdForClientAsync(Guid customerPlanId, Guid clientId, CancellationToken ct = default); // Full entity (not the DTO above) — needed by CustomerSubscriptionFactory, which reads // DurationMode/ValidTo/InstallmentCount/HasOnboardingFee that the DTO doesn't carry. Task GetCustomerPlanEntityForClientAsync(Guid customerPlanId, Guid clientId, CancellationToken ct = default); // Change-membership-plan / unassign-membership operations Task GetActiveMembershipForCustomerAsync(Guid customerId, CancellationToken ct = default); // Deactivates a whole subscription and its members/subitems/installments. Task DeactivateSubscriptionAsync(Guid subscriptionId, CancellationToken ct = default); // Deactivates a single member's row within a (possibly still-active) subscription. Task DeactivateSubscriptionMemberAsync(Guid subscriptionMemberId, CancellationToken ct = default); // Any membership (assigned or not) for assign/unassign to act on. Task GetMembershipForCustomerAsync(Guid customerId, CancellationToken ct = default); // Toggles IsPlanAssigned without touching IsActive, so the member stays listed. Task SetMembershipPlanAssignedAsync( Guid subscriptionId, bool assigned, bool wholeSubscription, Guid subscriptionMemberId, CancellationToken ct = default); // Deactivates oldMembership's subscription (if primary) or just their own row (if not), // then persists newAggregate as the customer's new subscription. Task ReplaceCustomerSubscriptionAsync(SubscriptionMember? oldMembership, CustomerSubscriptionAggregate newAggregate, CancellationToken ct = default); // Client Package operations Task> GetPackageListAsync(CancellationToken ct = default); Task GetPackageByIdAsync(Guid id, CancellationToken ct = default); Task> GetActiveGymsAsync(CancellationToken ct = default); Task> GetCardsByClientIdAsync(Guid clientId, CancellationToken ct = default); Task> GetCardsByCustomerForClientAsync(Guid customerId, Guid clientId, CancellationToken ct = default); } }