initial: standalone repo from monorepo split

This commit is contained in:
kevin-asprec
2026-04-13 09:37:07 +08:00
commit 5382f3b4e5
87 changed files with 5278 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
import {
Controller,
Get,
Post,
Patch,
Delete,
Param,
Body,
Query,
} from '@nestjs/common';
import { TenantsService } from './tenants.service';
import { CreateTenantDto } from './dto/create-tenant.dto';
import { UpdateTenantDto } from './dto/update-tenant.dto';
import { TenantListQueryDto } from './dto/list-query.dto';
@Controller('tenants')
export class TenantsController {
constructor(private readonly service: TenantsService) {}
@Get()
findAll(@Query() query: TenantListQueryDto) {
return this.service.findAll(query);
}
@Get(':id')
findOne(@Param('id') id: string) {
return this.service.findOne(id);
}
@Post()
create(@Body() dto: CreateTenantDto) {
return this.service.create(dto);
}
@Patch(':id')
update(@Param('id') id: string, @Body() dto: UpdateTenantDto) {
return this.service.update(id, dto);
}
@Delete(':id')
remove(@Param('id') id: string) {
return this.service.remove(id);
}
@Patch(':id/activate')
activate(@Param('id') id: string) {
return this.service.activate(id);
}
@Patch(':id/deactivate')
deactivate(@Param('id') id: string) {
return this.service.deactivate(id);
}
@Get(':id/users')
getTenantUsers(@Param('id') tenantId: string) {
return this.service.getTenantUsers(tenantId);
}
}