feat: Implement provisioning pipelines for subscription management

- Add ReactivatePipeline to handle subscription reactivation, including scaling Docker services, health verification, status updates, audit logging, and broadcasting status changes.
- Introduce RotateCredentialsPipeline for OAuth2 credential rotation, managing the deletion of old apps, creation of new ones, credential storage, access verification, and audit logging.
- Create StepRunner to manage job step execution, including lifecycle management and progress broadcasting via SignalR.
- Implement SuspendPipeline for subscription suspension, scaling down services, updating statuses, logging audits, and broadcasting changes.
- Add UpdateScreenLimitPipeline to update Xibo CMS screen limits and record snapshots.
- Introduce XiboFeatureManifests for hardcoded feature ACLs per role.
- Add docker-compose.dev.yml for local development with PostgreSQL setup.
This commit is contained in:
Matt Batchelder
2026-03-18 10:27:26 -04:00
parent c2e03de8bb
commit c6d46098dd
77 changed files with 9412 additions and 29 deletions

View File

@@ -0,0 +1,37 @@
using OTSSignsOrchestrator.Server.Data.Entities;
namespace OTSSignsOrchestrator.Server.Workers;
/// <summary>
/// Common interface for all provisioning pipelines (Phase1, Phase2, etc.).
/// Resolved from DI via <see cref="IEnumerable{IProvisioningPipeline}"/> and matched by
/// <see cref="HandlesJobType"/>.
/// </summary>
public interface IProvisioningPipeline
{
/// <summary>The <see cref="Job.JobType"/> this pipeline handles (e.g. "provision", "bootstrap").</summary>
string HandlesJobType { get; }
/// <summary>Execute the pipeline steps for the given job.</summary>
Task ExecuteAsync(Job job, CancellationToken ct);
}
/// <summary>
/// Shared context extracted from <see cref="Job.Parameters"/> JSON and the associated
/// <see cref="Customer"/> / <see cref="Instance"/> entities. Passed between pipeline steps.
/// </summary>
public sealed record PipelineContext
{
public required Guid JobId { get; init; }
public required Guid CustomerId { get; init; }
public required Guid InstanceId { get; init; }
public required string Abbreviation { get; init; }
public required string CompanyName { get; init; }
public required string AdminEmail { get; init; }
public required string AdminFirstName { get; init; }
public required string InstanceUrl { get; init; }
public required string DockerStackName { get; init; }
/// <summary>Raw parameters JSON from the Job entity for step-specific overrides.</summary>
public string? ParametersJson { get; init; }
}