mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
New logo-settings module (mirrors stamp-settings): single uploaded logo, stored via FilesService/MinIO, injected as a data URL into invoice/receipt, contract, warehouse, train-scheduling, and payment-receipt PDFs. Adds a matching backoffice settings page and settings:logo:view/manage permissions. >
22 lines
671 B
TypeScript
22 lines
671 B
TypeScript
import { Injectable } from "@nestjs/common";
|
|
import { InjectRepository } from "@nestjs/typeorm";
|
|
import { Repository } from "typeorm";
|
|
import { BaseRepository } from "@edr/api-common";
|
|
|
|
import { LogoSetting } from "./entities/logo-setting.entity";
|
|
|
|
@Injectable()
|
|
export class LogoSettingsRepository extends BaseRepository<LogoSetting> {
|
|
constructor(
|
|
@InjectRepository(LogoSetting)
|
|
repo: Repository<LogoSetting>,
|
|
) {
|
|
super(repo);
|
|
}
|
|
|
|
/** The single settings row, with its logo file joined, or null before first upload. */
|
|
findSingleton(): Promise<LogoSetting | null> {
|
|
return this.repository.findOne({ where: {}, relations: ["logoFile"] });
|
|
}
|
|
}
|