fix(rental): harden inventory and condition reports (#7)
This commit is contained in:
1 parent
e4be5cd05f
commit
b030ac579a
55 files changed
+1969
-217
No files matched your search
@@ -10,6 +10,7 @@ export type ReportPartyRole = 'LANDLORD' | 'TENANT';
|
||||
export type ParticipantAttendance = 'PRESENT' | 'REPRESENTED';
|
||||
export type ZoneEquipment = 'NONE' | 'CLIMATISATION' | 'OTHER';
|
||||
export type MeterType = 'ELECTRICITE' | 'GAZ' | 'EAU_FROIDE' | 'EAU_CHAUDE' | 'OTHER';
|
||||
export type MeterReadingState = 'RECORDED' | 'INACCESSIBLE';
|
||||
export type AccessMeansType = 'CLE' | 'BADGE' | 'TELECOMMANDE' | 'OTHER';
|
||||
export type FurniturePresence = 'PRESENT' | 'ABSENT';
|
||||
export type FurnitureCategory =
|
||||
@@ -54,7 +55,8 @@ export interface ConditionObservation {
|
||||
export interface MeterReading {
|
||||
id: string;
|
||||
type: MeterType;
|
||||
index: number;
|
||||
state: MeterReadingState;
|
||||
index: number | null;
|
||||
unit: string;
|
||||
label: string;
|
||||
photoId: string;
|
||||
@@ -108,15 +110,28 @@ export interface EntryPhotoDisposition {
|
||||
|
||||
export interface PropertyConditionReportSupplement {
|
||||
id: string;
|
||||
type: 'GENERAL' | 'HEATING';
|
||||
signedPdf: { reference: string; sha256: string };
|
||||
photos: { reference: string; sha256: string }[];
|
||||
photos: ConditionPhoto[];
|
||||
uploadedBy: string;
|
||||
uploadedAt: string;
|
||||
requestedOn: string;
|
||||
heatingPeriodStartedOn: string | null;
|
||||
acceptedAdditions: string;
|
||||
audit: unknown;
|
||||
audit: SupplementAudit;
|
||||
}
|
||||
|
||||
export type SupplementAudit =
|
||||
| { status: 'ON_TIME'; deadlineOn: string }
|
||||
| {
|
||||
status: 'LATE';
|
||||
deadlineOn: string;
|
||||
ruleVersion: string;
|
||||
reason: string;
|
||||
auditedBy: string;
|
||||
auditedAt: string;
|
||||
};
|
||||
|
||||
export interface PropertyConditionReportDeliveryAttestation {
|
||||
partyId: string;
|
||||
attestedBy: string;
|
||||
@@ -195,6 +210,7 @@ export interface FurnitureInventoryLine {
|
||||
id: string;
|
||||
category: FurnitureCategory | null;
|
||||
presence: FurniturePresence | null;
|
||||
equipmentKind: 'NONE' | 'CLIMATISATION' | 'OTHER';
|
||||
privateAreaId: string;
|
||||
designation: string;
|
||||
quantity: number;
|
||||
@@ -233,10 +249,12 @@ export interface ReportFinalizationRequest {
|
||||
|
||||
export interface AppendConditionReportSupplementRequest {
|
||||
signedPdf: File;
|
||||
photos: File[];
|
||||
photos: { file: File; zoneId: string }[];
|
||||
requestedOn: string;
|
||||
acceptedAdditions: string;
|
||||
supplementType: 'GENERAL' | 'HEATING';
|
||||
heatingPeriodStartedOn?: string;
|
||||
lateWarningConfirmed: boolean;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
@@ -378,9 +396,14 @@ export class ConditionReportService {
|
||||
): Observable<PropertyConditionReport> {
|
||||
const formData = new FormData();
|
||||
formData.append('signedPdf', request.signedPdf);
|
||||
request.photos.forEach((photo) => formData.append('photos', photo));
|
||||
request.photos.forEach((photo) => {
|
||||
formData.append('photos', photo.file);
|
||||
formData.append('photoZoneIds', photo.zoneId);
|
||||
});
|
||||
formData.append('requestedOn', request.requestedOn);
|
||||
formData.append('acceptedAdditions', request.acceptedAdditions);
|
||||
formData.append('supplementType', request.supplementType);
|
||||
formData.append('lateWarningConfirmed', String(request.lateWarningConfirmed));
|
||||
if (request.heatingPeriodStartedOn) {
|
||||
formData.append('heatingPeriodStartedOn', request.heatingPeriodStartedOn);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user