using Bit.Core.AdminConsole.Entities; using Bit.Core.AdminConsole.Entities.Provider; using Bit.Core.AdminConsole.Enums.Provider; using Bit.Core.Billing.Entities; using Bit.Core.Billing.Enums; using Bit.Core.Billing.Services.Contracts; using Bit.Core.Models.Business; using Stripe; namespace Bit.Core.Billing.Services; public interface IProviderBillingService { /// /// Assigns a specified number of to a client on behalf of /// its . Seat adjustments for the client organization may autoscale the provider's Stripe /// depending on the provider's seat minimum for the client 's /// . /// /// The that manages the client . /// The client whose you want to update. /// The number of seats to assign to the client organization. Task AssignSeatsToClientOrganization( Provider provider, Organization organization, int seats); /// /// Create a Stripe for the provided client utilizing /// the address and tax information of its . /// /// The MSP that owns the client organization. /// The client organization to create a Stripe for. Task CreateCustomerForClientOrganization( Provider provider, Organization organization); /// /// Generate a provider's client invoice report in CSV format for the specified . Utilizes the /// records saved for the as part of our webhook processing for the "invoice.created" and "invoice.finalized" Stripe events. /// /// The ID of the Stripe to generate the report for. /// The provider's client invoice report as a byte array. Task GenerateClientInvoiceReport( string invoiceId); /// /// Retrieves the number of seats an MSP has assigned to its client organizations with a specified . /// /// The ID of the MSP to retrieve the assigned seat total for. /// The type of plan to retrieve the assigned seat total for. /// An representing the number of seats the provider has assigned to its client organizations with the specified . /// Thrown when the provider represented by the is . /// Thrown when the provider represented by the has . Task GetAssignedSeatTotalForPlanOrThrow( Guid providerId, PlanType planType); /// /// Scales the 's seats for the specified using the provided . /// This operation may autoscale the provider's Stripe depending on the 's seat minimum for the /// specified . /// /// The to scale seats for. /// The to scale seats for. /// The change in the number of seats you'd like to apply to the . Task ScaleSeats( Provider provider, PlanType planType, int seatAdjustment); /// /// For use during the provider setup process, this method creates a Stripe for the specified utilizing the provided . /// /// The to create a Stripe customer for. /// The to use for calculating the customer's automatic tax. /// The newly created for the . Task SetupCustomer( Provider provider, TaxInfo taxInfo); /// /// For use during the provider setup process, this method starts a Stripe for the given . /// subscriptions will always be started with a for both the /// and plan, and the quantity for each item will be equal the provider's seat minimum for each respective plan. /// /// The provider to create the for. /// The newly created for the . /// This method requires the to already have a linked Stripe via its field. Task SetupSubscription( Provider provider); /// /// Changes the assigned provider plan for the provider. /// /// The command to change the provider plan. /// Task ChangePlan(ChangeProviderPlanCommand command); Task UpdateSeatMinimums(UpdateProviderSeatMinimumsCommand command); }