feat: complete cmpp platform phases 0-5

This commit is contained in:
hectorzhao
2026-07-01 13:22:04 +08:00
parent 824a8b334f
commit ee926fea04
86 changed files with 10490 additions and 14 deletions
+34
View File
@@ -0,0 +1,34 @@
import { Injectable } from '@nestjs/common';
import { PrismaService } from '../prisma/prisma.service';
export interface CreateTenantDto {
name: string;
code: string;
status?: string;
}
@Injectable()
export class TenantsService {
constructor(private readonly prisma: PrismaService) {}
list() {
return this.prisma.tenant.findMany({
orderBy: { createdAt: 'desc' },
take: 100,
});
}
get(id: string) {
return this.prisma.tenant.findUnique({ where: { id } });
}
create(data: CreateTenantDto) {
return this.prisma.tenant.create({
data: {
name: data.name,
code: data.code,
status: data.status ?? 'active',
},
});
}
}