Skip to content

Commit 1d574e8

Browse files
committed
update bootstrap module
1 parent deaf897 commit 1d574e8

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

apps/backend-services/src/bootstrap/bootstrap.service.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import {
55
Injectable,
66
} from "@nestjs/common";
77
import { ConfigService } from "@nestjs/config";
8+
import { PrismaService } from "@/database/prisma.service";
89
import { AuditService } from "../audit/audit.service";
9-
import { DatabaseService } from "../database/database.service";
1010
import { AppLoggerService } from "../logging/app-logger.service";
1111

1212
interface BootstrapStatusResponse {
@@ -22,7 +22,7 @@ interface BootstrapResult {
2222
@Injectable()
2323
export class BootstrapService {
2424
constructor(
25-
private readonly databaseService: DatabaseService,
25+
private readonly prismaService: PrismaService,
2626
private readonly configService: ConfigService,
2727
private readonly logger: AppLoggerService,
2828
private readonly auditService: AuditService,
@@ -84,13 +84,13 @@ export class BootstrapService {
8484
}
8585

8686
// Promote user to system admin
87-
await this.databaseService.prisma.user.update({
87+
await this.prismaService.prisma.user.update({
8888
where: { id: userId },
8989
data: { is_system_admin: true },
9090
});
9191

9292
// Create "Default" group
93-
const group = await this.databaseService.prisma.group.create({
93+
const group = await this.prismaService.prisma.group.create({
9494
data: {
9595
name: "Default",
9696
description: "Initial group created during system setup",
@@ -99,7 +99,7 @@ export class BootstrapService {
9999
});
100100

101101
// Assign user as group admin
102-
await this.databaseService.prisma.userGroup.create({
102+
await this.prismaService.prisma.userGroup.create({
103103
data: {
104104
user_id: userId,
105105
group_id: group.id,
@@ -130,7 +130,7 @@ export class BootstrapService {
130130
}
131131

132132
private async isBootstrapNeeded(): Promise<boolean> {
133-
const adminCount = await this.databaseService.prisma.user.count({
133+
const adminCount = await this.prismaService.prisma.user.count({
134134
where: { is_system_admin: true },
135135
});
136136
return adminCount === 0;

0 commit comments

Comments
 (0)