Skip to content

Commit

Permalink
Test GET recon
Browse files Browse the repository at this point in the history
  • Loading branch information
sahalali committed Apr 19, 2024
1 parent abaa08e commit c461c19
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions src/controller/recon/recon.controller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Body, Controller, Get, Post, Query } from "@nestjs/common";
import { ApiBody, ApiOperation, ApiQuery, ApiResponse, ApiTags } from "@nestjs/swagger";
import { ReconciliationRequest, ReconciliationResponse } from "../../dto";
import { ReconciliationQuery, ReconciliationResponse } from "../../dto";
import { ReconciliationService } from "../../service";
import { ReconciliationTypesEnum } from "../../enum";

Expand All @@ -10,37 +10,38 @@ export class ReconciliationController {
constructor(private readonly _reconciliationService: ReconciliationService) {
}

// @Get("/recon")
// @ApiOperation({ summary: "Reconcile" })
// @ApiResponse({ status: 200, type: ReconciliationResponse, isArray: true, description: "Reconciliation response" })
// @ApiResponse({ status: 500, description: "Internal server error" })
// @ApiQuery({
// name: "name",
// description: "Name of the entity to reconcile",
// required: true,
// explode: false,
// type: String
// })
// @ApiQuery({
// name: "type",
// description: "Type of the entity to reconcile",
// required: true,
// explode: false,
// enum: Object.values(ReconciliationTypesEnum)
// })
// async reconcileByQuery(
// @Query("name") name: string,
// @Query("type") type: string
// ): Promise<ReconciliationResponse[]> {
// return await this._reconciliationService.reconcileByQuery(name, type);
// }
@Get("/recon")
@ApiOperation({ summary: "Reconcile" })
@ApiResponse({ status: 200, type: ReconciliationResponse, isArray: true, description: "Reconciliation response" })
@ApiResponse({ status: 500, description: "Internal server error" })
@ApiQuery({
name: "name",
description: "Name of the entity to reconcile",
required: true,
explode: false,
type: String
})
@ApiQuery({
name: "type",
description: "Type of the entity to reconcile",
required: true,
explode: false,
enum: Object.values(ReconciliationTypesEnum)
})
async reconcileByQuery(
@Query("name") name: string,
@Query("type") type: string
): Promise<ReconciliationResponse[]> {
return await this._reconciliationService.reconcileByQuery(name, type);
}

@Post("/recon")
@ApiOperation({ summary: "Reconcile" })
@ApiResponse({ status: 200, type: ReconciliationResponse, isArray: true, description: "Reconciliation response" })
@ApiResponse({ status: 500, description: "Internal server error" })
@ApiBody({type: ReconciliationRequest, isArray: true})
async reconcileByQueries(@Body() reconciliationRequest: ReconciliationRequest[]): Promise<ReconciliationResponse[]>{
@ApiBody({type: ReconciliationQuery, isArray: true})

async reconcileByQueries(@Body() reconciliationRequest: any): Promise<ReconciliationResponse[]>{
return await this._reconciliationService.reconcileByQueries(reconciliationRequest);
}

Expand Down

0 comments on commit c461c19

Please sign in to comment.