Productionize EventSphere platform

This commit is contained in:
Austin A
2026-04-25 21:02:19 +01:00
commit 1f1d30a9f5
171 changed files with 18682 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
import { Injectable } from "@nestjs/common";
import { PrismaService } from "../../prisma/prisma.service";
import type { UpdateTenantSettingsDto } from "./dto";
@Injectable()
export class SettingsService {
constructor(private readonly prisma: PrismaService) {}
async get(tenantId: string) {
const row = await this.prisma.tenantSetting.findUnique({ where: { tenantId } });
return {
appName: row?.appName ?? null,
logoUrl: row?.logoUrl ?? null,
modules: (row?.modules as any) ?? null
};
}
async update(tenantId: string, dto: UpdateTenantSettingsDto) {
const row = await this.prisma.tenantSetting.upsert({
where: { tenantId },
create: { tenantId, appName: dto.appName, modules: dto.modules ?? undefined },
update: { appName: dto.appName, modules: dto.modules ?? undefined }
});
return {
appName: row.appName ?? null,
logoUrl: row.logoUrl ?? null,
modules: (row.modules as any) ?? null
};
}
async setLogo(tenantId: string, logoUrl: string) {
const row = await this.prisma.tenantSetting.upsert({
where: { tenantId },
create: { tenantId, logoUrl },
update: { logoUrl }
});
return { logoUrl: row.logoUrl ?? null };
}
}