feat: add website social link, fix herkunft origin display, GUI backup schedule, and format-based batch numbering
- SiteSettings gains websiteUrl (e.g. online shop link) alongside the
existing social links, editable in Verwaltung > Automatisierung.
- /herkunft/[lot] now shows the apiary's Standort instead of its internal
Name (so multiple apiaries at one location read as one origin), adds
small icons per social link, and surfaces previously-fetched-but-unused
data (Honigsorte, Abfülldatum, stat cards) to make the page a richer
customer-facing info page.
- Backup schedule (path/cron/retention) is now also configurable via the
GUI (Verwaltung > Backup), stored in a new BackupSettings singleton;
an env var always wins over the GUI value per field, and the scheduler
reloads its cron job live when GUI settings change.
- New Automatisierung rules let an admin define a format (e.g.
"WH-{YYYY}-{SEQ:4}") that auto-generates HoneyBatch.batchNumber and
BottlingBatch.lotNumber on creation, with an atomic per-rule sequence
counter and a manual reset. Manual entry still works when the rule is
inactive.
This commit is contained in:
1 parent
7b23862a41
commit
412d033d8d
42 files changed
+1045
-119
No files matched your search
@@ -25,4 +25,11 @@ export class UpdateSiteSettingsDto {
|
||||
@IsUrl({ require_protocol: true })
|
||||
@MaxLength(300)
|
||||
tiktokUrl?: string;
|
||||
|
||||
@ApiPropertyOptional({ description: 'Leerer String löscht den Link' })
|
||||
@IsOptional()
|
||||
@ValidateIf((_, value: string) => value !== '')
|
||||
@IsUrl({ require_protocol: true })
|
||||
@MaxLength(300)
|
||||
websiteUrl?: string;
|
||||
}
|
||||
@@ -18,6 +18,7 @@ describe('SiteSettingsService', () => {
|
||||
youtubeUrl: 'https://youtube.com/@wabenhain',
|
||||
instagramUrl: null as string | null,
|
||||
tiktokUrl: null as string | null,
|
||||
websiteUrl: null as string | null,
|
||||
updatedAt: new Date('2026-01-01'),
|
||||
};
|
||||
|
||||
@@ -84,6 +85,7 @@ describe('SiteSettingsService', () => {
|
||||
youtubeUrl: undefined,
|
||||
instagramUrl: 'https://instagram.com/wabenhain',
|
||||
tiktokUrl: undefined,
|
||||
websiteUrl: undefined,
|
||||
},
|
||||
});
|
||||
expect(result.instagramUrl).toBe('https://instagram.com/wabenhain');
|
||||
@@ -111,6 +113,7 @@ describe('SiteSettingsService', () => {
|
||||
youtubeUrl: null,
|
||||
instagramUrl: undefined,
|
||||
tiktokUrl: undefined,
|
||||
websiteUrl: undefined,
|
||||
},
|
||||
});
|
||||
});
|
||||
@@ -127,6 +130,7 @@ describe('SiteSettingsService', () => {
|
||||
youtubeUrl: undefined,
|
||||
instagramUrl: undefined,
|
||||
tiktokUrl: undefined,
|
||||
websiteUrl: undefined,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -48,6 +48,10 @@ export class SiteSettingsService {
|
||||
: undefined,
|
||||
tiktokUrl:
|
||||
dto.tiktokUrl !== undefined ? emptyToNull(dto.tiktokUrl) : undefined,
|
||||
websiteUrl:
|
||||
dto.websiteUrl !== undefined
|
||||
? emptyToNull(dto.websiteUrl)
|
||||
: undefined,
|
||||
},
|
||||
});
|
||||
await this.auditLog.record({
|
||||
|
||||
Reference in new issue
Block a user