284cac18f3
Frontend CI Pipeline / ci-frontend-8-steps (push) Failing after 1m16s
Validators (Pushes and Pull Requests) / UI & Storage Validation (push) Failing after 12s
Validators (Pushes and Pull Requests) / Database & Schema Validation (push) Successful in 9s
Validators (Pushes and Pull Requests) / Security & Secrets (push) Successful in 8s
Validators (Pushes and Pull Requests) / CI Workflow Lint (push) Failing after 8s
Validators (Pushes and Pull Requests) / Core Validators & Database Setup (push) Failing after 22s
Validators (Pushes and Pull Requests) / .NET Contracts (push) Has been skipped
Validators (Pushes and Pull Requests) / WBS & Audit Validations (push) Has been skipped
Validators (Pushes and Pull Requests) / Calibration & Performance (push) Has been skipped
Validators (Pushes and Pull Requests) / Operational Report & Decision Packet (push) Has been skipped
Workflow Lint & Validation / Validate Secrets Contract (push) Successful in 7s
Validators (Pushes and Pull Requests) / Notify PR Results (push) Has been skipped
Workflow Lint & Validation / Lint All Workflow Files (push) Failing after 14s
Workflow Lint & Validation / Notify Lint Results (push) Failing after 1s
53 lines
1.6 KiB
TypeScript
53 lines
1.6 KiB
TypeScript
/**
|
|
* Phase 10 NFR & Phase 11 Migration Governance
|
|
*
|
|
* Governance: docs/ENTERPRISE_CRUD_DESIGN_SPECIFICATION.md
|
|
* WBS: Phase 10 (NFR) & Phase 11 (MIG-01 ~ MIG-04)
|
|
*/
|
|
|
|
export interface PerformanceMetric {
|
|
inputLatencyMs: number; // Target < 100ms
|
|
barcodeParseMs: number; // Target < 100ms
|
|
searchP95Ms: number; // Target < 1000ms
|
|
saveP95Ms: number; // Target < 2000ms
|
|
}
|
|
|
|
export interface ReconciliationReport {
|
|
reconciliationId: string;
|
|
comparedAt: string;
|
|
legacyTotalAmount: number;
|
|
newTotalAmount: number;
|
|
discrepancyCount: number;
|
|
status: 'BALANCED' | 'MISMATCH';
|
|
}
|
|
|
|
/** Sanitize input strings against XSS and control characters (OWASP) */
|
|
export function sanitizeInputString(input: string): string {
|
|
if (!input) return '';
|
|
return input
|
|
.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '')
|
|
.replace(/[<>'"]/g, '')
|
|
.trim();
|
|
}
|
|
|
|
/** Run Daily Reconciliation Check between Legacy and New Engine (MIG-02) */
|
|
export function runReconciliationCheck(legacyTotal: number, newTotal: number): ReconciliationReport {
|
|
const diff = Math.abs(legacyTotal - newTotal);
|
|
return {
|
|
reconciliationId: `REC-${Date.now()}`,
|
|
comparedAt: new Date().toISOString(),
|
|
legacyTotalAmount: legacyTotal,
|
|
newTotalAmount: newTotal,
|
|
discrepancyCount: diff === 0 ? 0 : 1,
|
|
status: diff === 0 ? 'BALANCED' : 'MISMATCH'
|
|
};
|
|
}
|
|
|
|
/** Feature Flag Helper for Strangler Migration (MIG-01) */
|
|
export function isNewFeatureEnabled(flagKey: string, userGroup: string): boolean {
|
|
if (userGroup === 'ADMIN' || userGroup === 'POWER_USER') {
|
|
return true;
|
|
}
|
|
return flagKey.startsWith('ENABLE_');
|
|
}
|