Abfüllungen hatten keine Übersichtsseite - die Navigation ging direkt auf /bottling/new, sodass eine angelegte Abfüllung danach nirgends mehr sichtbar war. Neue Seite /bottling listet alle Abfüllungen (Archiv), Klick führt zur bestehenden Detail-/Bearbeiten-Seite. Navigationslink zeigt jetzt auf die Liste statt direkt auf "Neu". Neues Modul site-settings (Singleton-Tabelle SiteSettings) für YouTube-/Instagram-/TikTok-Links, verwaltbar unter Verwaltung > Website (neue Berechtigung site-settings:read/update). Die öffentliche Herkunftsseite (/herkunft/[lot]) zeigt die konfigurierten Links jetzt zusätzlich zur Chargen-Herkunft an - PublicService liefert sie über das bereits oeffentliche /public/batches/:lotNumber mit aus, keine zusaetzliche unauthentifizierte Route noetig. Co-Authored-By: Claude Sonnet 5 <[email protected]>
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
import { ApiPropertyOptional } from '@nestjs/swagger';
|
|
import { IsOptional, IsUrl, MaxLength, ValidateIf } from 'class-validator';
|
|
|
|
// An empty string clears the link (stored as null); anything else must be a
|
|
// real URL - ValidateIf skips the @IsUrl check only for the empty-string
|
|
// "clear" case so a genuinely malformed value still fails validation.
|
|
export class UpdateSiteSettingsDto {
|
|
@ApiPropertyOptional({ description: 'Leerer String löscht den Link' })
|
|
@IsOptional()
|
|
@ValidateIf((_, value: string) => value !== '')
|
|
@IsUrl({ require_protocol: true })
|
|
@MaxLength(300)
|
|
youtubeUrl?: string;
|
|
|
|
@ApiPropertyOptional({ description: 'Leerer String löscht den Link' })
|
|
@IsOptional()
|
|
@ValidateIf((_, value: string) => value !== '')
|
|
@IsUrl({ require_protocol: true })
|
|
@MaxLength(300)
|
|
instagramUrl?: string;
|
|
|
|
@ApiPropertyOptional({ description: 'Leerer String löscht den Link' })
|
|
@IsOptional()
|
|
@ValidateIf((_, value: string) => value !== '')
|
|
@IsUrl({ require_protocol: true })
|
|
@MaxLength(300)
|
|
tiktokUrl?: string;
|
|
}
|