feat(rental): add inventory and condition reports (#7)

This commit is contained in:
nessar authored and Nessar committed 2026-08-17 14:18:16 +02:00
1 parent 92d8a3e351
commit e4be5cd05f
193 files changed
+9697 -483

No files matched your search

@@ -138,6 +138,8 @@
[timeZone]="timeZone"
[showAgreement]="canRecordAgreement()"
[showClosure]="canClose()"
[keysReturnedOn]="exitReportDate()"
[closureEnabled]="closureReady()"
[agreementPending]="operationPending('agreement')"
[closurePending]="operationPending('closure')"
[agreementOperationError]="operationError('agreement')"
@@ -23,6 +23,10 @@ describe('LeaseEndPage', () => {
agreedEarlyEnds: [],
agreedEarlyEnd: null,
closure: null,
exitConditionReport: {
occurredOn: '2026-07-31',
finalized: true,
},
notices: [
{
id: 'notice-1',
@@ -247,7 +251,6 @@ describe('LeaseEndPage', () => {
fixture.componentInstance.closeLease({
timeZone: 'Europe/Paris',
keysReturnedOn: '2026-08-19',
confirmed: true,
});
fixture.detectChanges();
@@ -84,6 +84,11 @@ export class LeaseEndPage {
(state.phase === 'AWAITING_CLOSURE' || state.phase === 'UNAUTHORIZED_OCCUPANCY')
);
});
readonly exitReportDate = computed(() => {
const report = this.state()?.exitConditionReport;
return report?.finalized ? report.occurredOn : null;
});
readonly closureReady = computed(() => this.canClose() && !!this.exitReportDate());
readonly civilDate = formatFrenchCivilDate;
readonly civilMonth = formatFrenchCivilMonth;