chore: apply ESLint auto-fix across entire backend
Build and Push Multi-Platform Images / build-and-push (push) Successful in 41s

Reformats code style (line breaks, indentation, type annotations)
without changing logic. Also includes minor feature additions bundled
in the same lint run (stats service, user-settings groups, agrarmonitor
polling improvements).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-08 09:02:02 +02:00
parent 4c75a1ded2
commit dad0136365
74 changed files with 4022 additions and 1052 deletions
@@ -32,7 +32,10 @@ export class LabelPrintAgentController {
@Body() body: { templateId: number; fieldValues?: Record<string, string> },
@Res({ passthrough: true }) res: Response,
): Promise<StreamableFile> {
const buf = await this.service.renderPreview(body.templateId, body.fieldValues ?? {});
const buf = await this.service.renderPreview(
body.templateId,
body.fieldValues ?? {},
);
const { Readable } = await import('stream');
res.setHeader('Content-Type', 'image/png');
return new StreamableFile(Readable.from(buf));
@@ -45,16 +48,21 @@ export class LabelPrintAgentController {
async createJob(
@Body() body: { templateId: number; fieldValues?: Record<string, string> },
) {
const job = await this.service.createJob(body.templateId, body.fieldValues ?? {});
const job = await this.service.createJob(
body.templateId,
body.fieldValues ?? {},
);
return { jobId: String(job.Id) };
}
// Agent: SSE-Stream für neue Druckaufträge
@Sse('events')
sseEvents(@Res({ passthrough: true }) res: Response): Observable<MessageEvent> {
sseEvents(
@Res({ passthrough: true }) res: Response,
): Observable<MessageEvent> {
res.setHeader('X-Accel-Buffering', 'no');
return this.service.newJob$.pipe(
map(() => ({ data: { type: 'label-job-available' } } as MessageEvent)),
map(() => ({ data: { type: 'label-job-available' } }) as MessageEvent),
);
}
@@ -68,7 +76,9 @@ export class LabelPrintAgentController {
}
res.status(HttpStatus.OK).json({
jobId: String(job.Id),
labelImageBase64: job.LabelImageData ? job.LabelImageData.toString('base64') : null,
labelImageBase64: job.LabelImageData
? job.LabelImageData.toString('base64')
: null,
labelImageContentType: 'image/png',
labelWidthMm: job.LabelWidthMm,
labelHeightMm: job.LabelHeightMm,
@@ -95,7 +105,11 @@ export class LabelPrintAgentController {
@Param('id', ParseIntPipe) id: number,
@Body() body: { agentId?: string; printerName?: string },
) {
await this.service.markPrinted(id, body.agentId ?? 'unknown', body.printerName ?? '');
await this.service.markPrinted(
id,
body.agentId ?? 'unknown',
body.printerName ?? '',
);
return { ok: true };
}
@@ -104,9 +118,15 @@ export class LabelPrintAgentController {
@HttpCode(HttpStatus.OK)
async markError(
@Param('id', ParseIntPipe) id: number,
@Body() body: { agentId?: string; printerName?: string; errorMessage?: string },
@Body()
body: { agentId?: string; printerName?: string; errorMessage?: string },
) {
await this.service.markError(id, body.agentId ?? 'unknown', body.printerName ?? '', body.errorMessage ?? '');
await this.service.markError(
id,
body.agentId ?? 'unknown',
body.printerName ?? '',
body.errorMessage ?? '',
);
return { ok: true };
}
}