fix: address cashbox-export whole-branch review findings
- Reject dates that are not strict YYYY-MM-DD (was accepting full ISO datetimes, which silently produced empty exports instead of a 400) and reject from > to with a 400 before touching the team/DB. - Emit the cashbox_export_download and cashbox_export_subscription_update audit log events that were declared but never fired, matching the audit trail every sibling feature already has. - Restore full type checking on the pdfkit import via `import = require()` instead of an untyped require() with an eslint-disable. - Tighten a cashbox.spec.ts assertion to check the exact dialog class instead of expect.anything(), so it can't pass with the wrong dialog wired to the Export button. - Style and announce the export dialogs' error messages using this codebase's established error-message/role=alert pattern.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { IsDateString, IsIn } from 'class-validator';
|
||||
import { IsIn, Matches } from 'class-validator';
|
||||
|
||||
export class CashboxExportQueryDto {
|
||||
@IsDateString()
|
||||
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
||||
from: string;
|
||||
|
||||
@IsDateString()
|
||||
@Matches(/^\d{4}-\d{2}-\d{2}$/)
|
||||
to: string;
|
||||
|
||||
@IsIn(['csv', 'pdf'])
|
||||
|
||||
Reference in New Issue
Block a user