core/billing-finance-core/src/modules/tenants/tenant.controller.ts
2025-12-27 13:58:47 -03:00

31 lines
610 B
TypeScript

import { Body, Controller, Get, Post } from '@nestjs/common';
import { IsOptional, IsString } from 'class-validator';
import { TenantService } from './tenant.service';
class CreateTenantDto {
@IsString()
name: string;
@IsOptional()
@IsString()
taxId?: string;
@IsOptional()
@IsString()
status?: string;
}
@Controller('tenants')
export class TenantController {
constructor(private readonly tenantService: TenantService) {}
@Post()
create(@Body() body: CreateTenantDto) {
return this.tenantService.create(body);
}
@Get()
list() {
return this.tenantService.list();
}
}