2026-03-07 11:25:11 +03:30
|
|
|
import { Body, Controller, Delete, Get, Param, Post, Put } from '@nestjs/common'
|
2026-03-11 20:42:34 +03:30
|
|
|
import { CreatePartnerLicenseDto, UpdateLicenseDto } from './dto/license.dto'
|
2026-03-07 11:25:11 +03:30
|
|
|
import { PartnerLicensesService } from './licenses.service'
|
|
|
|
|
|
|
|
|
|
@Controller('admin/partners/:partnerId/licenses')
|
|
|
|
|
export class PartnerLicensesController {
|
|
|
|
|
constructor(private readonly licensesService: PartnerLicensesService) {}
|
|
|
|
|
|
|
|
|
|
@Get()
|
|
|
|
|
async findAll(@Param('partnerId') partnerId: string) {
|
|
|
|
|
return this.licensesService.findAll(partnerId)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Get(':id')
|
|
|
|
|
async findOne(@Param('partnerId') partnerId: string, @Param('id') id: string) {
|
|
|
|
|
return this.licensesService.findOne(partnerId, id)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Post()
|
2026-03-11 20:42:34 +03:30
|
|
|
async create(
|
|
|
|
|
@Param('partnerId') partnerId: string,
|
|
|
|
|
@Body() data: CreatePartnerLicenseDto,
|
|
|
|
|
) {
|
2026-03-07 11:25:11 +03:30
|
|
|
return this.licensesService.create(partnerId, data)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Put(':id')
|
|
|
|
|
async update(
|
|
|
|
|
@Param('partnerId') partnerId: string,
|
|
|
|
|
@Param('id') id: string,
|
|
|
|
|
@Body() data: UpdateLicenseDto,
|
|
|
|
|
) {
|
|
|
|
|
return this.licensesService.update(partnerId, id, data)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Delete(':id')
|
|
|
|
|
async delete(@Param('partnerId') partnerId: string, @Param('id') id: string) {
|
|
|
|
|
return this.licensesService.delete(partnerId, id)
|
|
|
|
|
}
|
|
|
|
|
}
|