This commit is contained in:
Bastien COIGNOUX
2026-05-04 08:28:32 +02:00
parent 7f94f83940
commit 695d4e76d0
46 changed files with 13390 additions and 251 deletions

133
app/types/collections.ts Normal file
View File

@ -0,0 +1,133 @@
import type { RecordModel } from 'pocketbase';
export type UserRecord = RecordModel & {
email: string;
name?: string;
};
export type BienType =
| 'appartement'
| 'maison'
| 'immeuble'
| 'terrain'
| 'local_commercial'
| 'parking'
| 'cave'
| 'autre';
export type BienSource =
| 'particulier'
| 'agence'
| 'notaire'
| 'tribunal'
| 'succession'
| 'reseau'
| 'autre';
export type TypeBienFiscal = 'ancien' | 'neuf';
export type BienRecord = RecordModel & {
user: string;
etape?: string;
source_contact?: string;
titre?: string;
type_bien?: BienType;
adresse?: string;
code_postal?: string;
ville?: string;
latitude?: number;
longitude?: number;
surface_habitable?: number;
surface_totale?: number;
nb_pieces?: number;
nb_chambres?: number;
annee_construction?: number;
dpe_lettre?: string;
dpe_valeur?: number;
source?: BienSource;
url_annonce?: string;
statut?: string;
priorite?: number;
is_off_market?: boolean;
date_premiere_visite?: string;
date_offre?: string;
date_compromis?: string;
date_acte?: string;
description?: string;
points_forts?: string;
points_faibles?: string;
photo_principale?: string;
};
export type BienCreate = Partial<Omit<BienRecord, 'id' | 'created' | 'updated' | 'collectionId' | 'collectionName'>> & {
user: string;
ville: string;
code_postal: string;
type_bien: BienType;
};
export type BienUpdate = Partial<Omit<BienRecord, 'id' | 'user' | 'created' | 'updated' | 'collectionId' | 'collectionName'>>;
export type EtapePipelineRecord = RecordModel & {
user: string;
nom: string;
ordre: number;
couleur?: string;
is_terminal?: boolean;
};
export type ContactRecord = RecordModel & {
user: string;
nom: string;
prenom?: string;
societe?: string;
categorie: string;
email?: string;
telephone?: string;
};
export type AnalyseFinanciereRecord = RecordModel & {
user: string;
bien: string;
prix_achat?: number;
type_bien_fiscal?: TypeBienFiscal;
frais_notaire?: number;
frais_agence_achat?: number;
budget_travaux?: number;
reserve_imprevus_pct?: number;
duree_portage_mois?: number;
taux_credit?: number;
taxe_fonciere_annuelle?: number;
charges_copropriete_mensuelle?: number;
prix_revente_cible?: number;
frais_agence_vente_pct?: number;
taux_impot?: number;
marge_brute?: number;
marge_brute_pct?: number;
marge_nette?: number;
marge_nette_pct?: number;
notes?: string;
};
export type VisiteRecord = RecordModel & {
user: string;
bien: string;
date_visite: string;
type_visite?: string;
avis_global?: string;
notes_brutes?: string;
};
export type NoteRecord = RecordModel & {
user: string;
bien: string;
contenu: string;
type_note?: string;
};
export type DocumentRecord = RecordModel & {
user: string;
bien: string;
nom: string;
type_document?: string;
};