All files / src/platform/provisioning provisioning.controller.ts

0% Statements 0/14
0% Branches 0/4
0% Functions 0/4
0% Lines 0/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35                                                                     
import { Controller, Get, Post, Param } from '@nestjs/common';
import { TenantProvisioningService } from './provisioning.service';
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
 
@Controller('api/v1/admin/provisioning')
@ApiTags('TenantProvisioning')
export class TenantProvisioningController {
  constructor(
    private readonly provisioningService: TenantProvisioningService,
  ) {}
 
  @Get()
  @ApiOperation({ summary: 'Get executions operation' })
  @ApiResponse({ status: 200, description: 'Operation successful' })
  async getExecutions() {
    return this.provisioningService.getExecutions();
  }
 
  @Get(':id')
  @ApiOperation({ summary: 'Get execution operation' })
  @ApiResponse({ status: 200, description: 'Operation successful' })
  async getExecution(@Param('id') id: string) {
    return this.provisioningService.getExecution(id);
  }
 
  @Post(':id/retry')
  @ApiOperation({ summary: 'Retry execution operation' })
  @ApiResponse({ status: 201, description: 'Operation successful' })
  async retryExecution(@Param('id') id: string) {
    // Saga retry starts step execution in background
    this.provisioningService.run(id);
    return { success: true, message: 'Retry initiated in background' };
  }
}