using Bit.Core.AdminConsole.Entities;
using Bit.Core.AdminConsole.Entities.Provider;
using Bit.Core.AdminConsole.Enums.Provider;
using OneOf;
namespace Bit.Core.Billing.Providers.Services;
public interface IBusinessUnitConverter
{
///
/// Finalizes the process of converting the to a by
/// saving all the necessary key provided by the client and updating the 's subscription to a
/// provider subscription.
///
/// The organization to convert to a business unit.
/// The ID of the organization member who will be the provider admin.
/// The token sent to the client as part of the process.
/// The encrypted provider key used to enable the .
/// The encrypted organization key used to enable the .
/// The provider ID
Task FinalizeConversion(
Organization organization,
Guid userId,
string token,
string providerKey,
string organizationKey);
///
/// Begins the process of converting the to a by
/// creating all the necessary database entities and sending a setup invitation to the .
///
/// The organization to convert to a business unit.
/// The email address of the organization member who will be the provider admin.
/// Either the newly created provider ID or a list of validation failures.
Task>> InitiateConversion(
Organization organization,
string providerAdminEmail);
///
/// Checks if the has a business unit conversion in progress and, if it does, resends the
/// setup invitation to the provider admin.
///
/// The organization to convert to a business unit.
/// The email address of the organization member who will be the provider admin.
Task ResendConversionInvite(
Organization organization,
string providerAdminEmail);
///
/// Checks if the has a business unit conversion in progress and, if it does, resets that conversion
/// by deleting all the database entities created as part of .
///
/// The organization to convert to a business unit.
/// The email address of the organization member who will be the provider admin.
Task ResetConversion(
Organization organization,
string providerAdminEmail);
}