feat(api): add GroupsModule with GET /groups endpoint
Implements TDD-driven GroupsService and GroupsController with full unit test coverage. GET /groups returns all groups ordered by name, selecting id, name, platform, platformId, isActive, and accountId fields. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { PrismaService } from '../../prisma/prisma.service';
|
||||
|
||||
@Injectable()
|
||||
export class GroupsService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
|
||||
list() {
|
||||
return this.prisma.group.findMany({
|
||||
orderBy: { name: 'asc' },
|
||||
select: { id: true, name: true, platform: true, platformId: true, isActive: true, accountId: true },
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user