feat: add rent payment history and reversal dialogs

- Implemented RentPaymentHistoryServiceTest to validate payment retrieval with refunds and reversals.
- Created ReverseRentPaymentServiceTest to ensure correct handling of payment reversals and allocation releases.
- Developed rent-payment-allocation-dialog component with form for surplus allocation.
- Added rent-payment-refund-dialog component for processing refunds with validation.
- Introduced rent-payment-reversal-dialog component for reversing payments with reason input.
- Implemented utility functions for formatting Euro values and handling date formatting.
- Enhanced rent-payment-dialogs.spec.ts to cover new dialog functionalities and error handling.
This commit is contained in:
nessar committed 2026-08-17 14:18:15 +02:00
1 parent e02ad54bcb
commit b9e99348f7
76 files changed
+3141 -1531

No files matched your search

@@ -0,0 +1,41 @@
<h2 mat-dialog-title>Contrepasser le règlement</h2>
<form [formGroup]="form" (ngSubmit)="submit()">
<mat-dialog-content class="action-dialog-content">
<p>
Les affectations de ce règlement de <strong>{{ formatEuro(payment.amount) }}</strong> seront
annulées. Le règlement restera visible dans l’historique.
</p>
@if (payment.refundedAmount > 0) {
<p class="refund-warning" role="note">
Les remboursements déjà confirmés, pour {{ formatEuro(payment.refundedAmount) }}, resteront
des sorties historiques.
</p>
}
<fieldset class="dialog-fieldset" [disabled]="saving()">
<mat-form-field appearance="outline">
<mat-label>Motif de la contrepassation</mat-label>
<textarea matInput rows="4" maxlength="500" formControlName="reason" required></textarea>
@if (form.controls.reason.invalid) {
<mat-error>Le motif est obligatoire.</mat-error>
}
</mat-form-field>
</fieldset>
@if (error()) {
<p class="dialog-error" role="alert">{{ error() }}</p>
}
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-button mat-dialog-close type="button" [disabled]="saving()">Annuler</button>
<button
mat-flat-button
type="submit"
class="danger-action"
[disabled]="form.invalid || saving()"
>
@if (saving()) {
<mat-spinner diameter="18" aria-label="Contrepassation en cours" />
}
Contrepasser
</button>
</mat-dialog-actions>
</form>