24 lines
593 B
TypeScript
24 lines
593 B
TypeScript
import { Injectable } from '@nestjs/common';
|
|
import { PrismaService } from '../../prisma/prisma.service';
|
|
|
|
export interface GroupSummary {
|
|
id: string;
|
|
name: string;
|
|
platform: string;
|
|
platformId: string;
|
|
isActive: boolean;
|
|
accountId: string | null;
|
|
}
|
|
|
|
@Injectable()
|
|
export class GroupsService {
|
|
constructor(private readonly prisma: PrismaService) {}
|
|
|
|
list(): Promise<GroupSummary[]> {
|
|
return this.prisma.group.findMany({
|
|
orderBy: { name: 'asc' },
|
|
select: { id: true, name: true, platform: true, platformId: true, isActive: true, accountId: true },
|
|
});
|
|
}
|
|
}
|