Get Operational Readiness
Get operational readiness status for the current tenant.
Checks if the tenant has all required entities configured and active:
- Principal issuer (oldest by created_at)
- Active certificate for that issuer
- Establishment (oldest by created_at)
- Emission point (oldest by created_at)
The environment is derived from the principal issuer or certificate. The tenant is considered operational if all four entities are present and active.
All database operations use async/await for non-blocking I/O.
Args: db: Async database session tenant_id: Active tenant ID from authentication context current_user: Current user context from authentication
Returns: OperationalReadinessResponse: Aggregated readiness status with entity details
Cookies
Response
Successful Response
Full operational readiness response for a tenant.
Schema for Issuer response.
{
"created_at": "2024-01-01T00:00:00Z",
"direccion_matriz": "Av. Principal 123 y Secundaria, Quito, Ecuador",
"id": "550e8400-e29b-41d4-a716-446655440000",
"is_active": true,
"legal_representative": "Jane Doe",
"nombre_comercial": "Ejemplo Corp",
"razon_social": "EMPRESA EJEMPLO S.A.",
"ruc": "1234567890001",
"sri_environment": "TEST",
"tenant_id": "660e8400-e29b-41d4-a716-446655440000",
"tipo_contribuyente": "General",
"updated_at": "2024-01-01T00:00:00Z"
}Schema for Certificate response (without sensitive data).
{
"created_at": "2024-01-01T00:00:00Z",
"id": "990e8400-e29b-41d4-a716-446655440000",
"issuer_id": "550e8400-e29b-41d4-a716-446655440000",
"serial_number": "1234567890ABCDEF",
"status": "active",
"subject_cn": "EMPRESA EJEMPLO S.A.",
"tenant_id": "660e8400-e29b-41d4-a716-446655440000",
"updated_at": "2024-01-01T00:00:00Z",
"valid_from": "2024-01-01T00:00:00Z",
"valid_until": "2026-01-01T00:00:00Z"
}Schema for Establishment response.
{
"address": "Av. Principal 123, Quito, Ecuador",
"code": "001",
"created_at": "2024-01-01T00:00:00Z",
"id": "770e8400-e29b-41d4-a716-446655440000",
"is_active": true,
"issuer_id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Matriz",
"tenant_id": "660e8400-e29b-41d4-a716-446655440000",
"updated_at": "2024-01-01T00:00:00Z"
}Schema for EmissionPoint response.
{
"code": "001",
"created_at": "2024-01-01T00:00:00Z",
"establishment_id": "770e8400-e29b-41d4-a716-446655440000",
"id": "880e8400-e29b-41d4-a716-446655440000",
"initial_sequential": 0,
"is_active": true,
"tenant_id": "660e8400-e29b-41d4-a716-446655440000",
"updated_at": "2024-01-01T00:00:00Z"
}SRI environment types.
TEST, PRODUCTION Boolean flags summarising operational readiness.
{
"has_certificate": true,
"has_emission_point": true,
"has_establishment": true,
"has_issuer": true,
"is_operational": true
}