using Tiku.Application.Security;

namespace Tiku.Application.Backoffice;

public interface IBackofficeService
{
    Task<BackofficeUiBootstrap> GetTenantUiBootstrapAsync(
        CurrentAccessSnapshot access,
        CancellationToken cancellationToken = default);

    Task<BackofficeUiBootstrap> GetPlatformUiBootstrapAsync(
        CurrentAccessSnapshot access,
        CancellationToken cancellationToken = default);

    Task<BackofficeBootstrap> GetTenantBootstrapAsync(
        BackofficeActor actor,
        CancellationToken cancellationToken = default);

    Task<BackofficeBootstrap> GetPlatformBootstrapAsync(
        BackofficeActor actor,
        CancellationToken cancellationToken = default);

    Task<BackofficeRoleItem> UpsertTenantRoleAsync(
        BackofficeActor actor,
        UpsertBackofficeRoleCommand command,
        CancellationToken cancellationToken = default);

    Task<BackofficeRoleItem> UpsertPlatformRoleAsync(
        BackofficeActor actor,
        UpsertBackofficeRoleCommand command,
        CancellationToken cancellationToken = default);

    Task<BackofficeRoleItem> ReplaceTenantRoleBindingsAsync(
        BackofficeActor actor,
        ReplaceRoleBindingsCommand command,
        CancellationToken cancellationToken = default);

    Task<BackofficeRoleItem> ReplacePlatformRoleBindingsAsync(
        BackofficeActor actor,
        ReplaceRoleBindingsCommand command,
        CancellationToken cancellationToken = default);

    Task ReplaceTenantUserRolesAsync(
        BackofficeActor actor,
        ReplaceUserRolesCommand command,
        CancellationToken cancellationToken = default);

    Task ReplacePlatformUserRolesAsync(
        BackofficeActor actor,
        ReplaceUserRolesCommand command,
        CancellationToken cancellationToken = default);
}

public interface IOperationAuditService
{
    Task WriteAsync(
        BackofficeOperationAuditCommand command,
        CancellationToken cancellationToken = default);
}