2025-04-09 11:01:35 +05:30
|
|
|
import { Body, Controller, Get, Post, Put, Query } from '@nestjs/common';
|
2025-04-07 17:10:59 +05:30
|
|
|
import { ApiTags } from '@nestjs/swagger';
|
|
|
|
|
import { SpService } from './sp.service';
|
2025-05-22 17:25:38 +05:30
|
|
|
import { InsertNewServiceProviderDTO, UpdateServiceProviderDTO } from 'src/dto/sp.dto';
|
|
|
|
|
import { SPID_DTO } from 'src/dto/property.dto';
|
2025-04-07 17:10:59 +05:30
|
|
|
|
|
|
|
|
@Controller('mssql')
|
|
|
|
|
export class SpController {
|
|
|
|
|
|
2025-04-08 17:14:24 +05:30
|
|
|
constructor(private readonly spService: SpService) { }
|
2025-04-07 17:10:59 +05:30
|
|
|
|
|
|
|
|
@ApiTags('SP - Mssql')
|
|
|
|
|
@Get('/GetAllServiceproviders')
|
|
|
|
|
getAllServiceproviders() {
|
|
|
|
|
return this.spService.getAllServiceproviders();
|
|
|
|
|
}
|
2025-04-08 17:14:24 +05:30
|
|
|
|
|
|
|
|
@ApiTags('SP - Mssql')
|
|
|
|
|
@Get('/GetSelectedServiceprovider')
|
2025-05-22 17:25:38 +05:30
|
|
|
getSelectedServiceprovider(@Query() body: SPID_DTO) {
|
2025-04-08 17:14:24 +05:30
|
|
|
return this.spService.getSpBySpid(body);
|
|
|
|
|
}
|
2025-04-09 11:01:35 +05:30
|
|
|
|
2025-04-09 11:03:56 +05:30
|
|
|
@ApiTags('SP - Mssql')
|
2025-04-09 11:01:35 +05:30
|
|
|
@Post('/InsertNewServiceProvider')
|
|
|
|
|
insertNewServiceProvider(@Body() body: InsertNewServiceProviderDTO) {
|
|
|
|
|
return this.spService.insertNewServiceProvider(body);
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-28 12:08:13 +05:30
|
|
|
@ApiTags('SP - Mssql')
|
|
|
|
|
@Put('/UpdateServiceProvider')
|
|
|
|
|
updateServiceProider(@Body() body: UpdateServiceProviderDTO) {
|
|
|
|
|
return this.spService.updateServiceProvider(body);
|
|
|
|
|
}
|
2025-04-07 17:10:59 +05:30
|
|
|
}
|