Align rent payment dialog validation (#55)

This commit is contained in:
nessar committed 2026-08-17 14:18:16 +02:00
1 parent cd32d05466
commit 96bd02e3a6
23 files changed
+723 -87

No files matched your search

@@ -1,9 +1,20 @@
import { RentPayment } from '../services/rent-payment.service';
export const RENT_PAYMENT_DATA_STALE = 'RENT_PAYMENT_DATA_STALE';
const CONCURRENT_CHANGE = 'concurrent_change';
export type RentPaymentDialogResult = RentPayment | typeof RENT_PAYMENT_DATA_STALE;
export function isRentPaymentDataStale(error: unknown): boolean {
return typeof error === 'object' && error !== null && 'status' in error && error.status === 409;
return (
typeof error === 'object' &&
error !== null &&
'status' in error &&
error.status === 409 &&
'error' in error &&
typeof error.error === 'object' &&
error.error !== null &&
'code' in error.error &&
error.error.code === CONCURRENT_CHANGE
);
}