recherche
This commit is contained in:
66
app/services/agentsApi.ts
Normal file
66
app/services/agentsApi.ts
Normal file
@ -0,0 +1,66 @@
|
||||
import { pb } from '@/services/pocketbase';
|
||||
|
||||
export type AgentImmobilierBody = {
|
||||
objectif?: string;
|
||||
contexte?: string;
|
||||
save?: boolean;
|
||||
};
|
||||
|
||||
export type AgentMarchandBody = {
|
||||
titre?: string;
|
||||
prix?: number;
|
||||
surface?: number;
|
||||
code_postal?: string;
|
||||
ville?: string;
|
||||
notes?: string;
|
||||
grille_json?: string;
|
||||
};
|
||||
|
||||
export type AgentDvfBody = {
|
||||
libelle: string;
|
||||
code_insee?: string;
|
||||
annee?: number;
|
||||
prix_m2_median?: number;
|
||||
nb_ventes?: number;
|
||||
detail_json?: string;
|
||||
};
|
||||
|
||||
export type AgentVeilleBody = {
|
||||
titre: string;
|
||||
url?: string;
|
||||
source?: string;
|
||||
prix?: number;
|
||||
surface?: number;
|
||||
code_postal?: string;
|
||||
ville?: string;
|
||||
};
|
||||
|
||||
export type AgentRedactionBody = {
|
||||
kind?: string;
|
||||
bullets?: string[];
|
||||
save?: boolean;
|
||||
};
|
||||
|
||||
export async function agentImmobilier(body: AgentImmobilierBody): Promise<{ brouillon: string; courrier_id?: string }> {
|
||||
return pb.send('/api/mdb/agent-immobilier', { method: 'POST', body });
|
||||
}
|
||||
|
||||
export async function agentMarchand(body: AgentMarchandBody): Promise<{ analyse: string }> {
|
||||
return pb.send('/api/mdb/agent-marchand', { method: 'POST', body });
|
||||
}
|
||||
|
||||
export async function agentDvf(body: AgentDvfBody): Promise<{ id: string; synthese: string }> {
|
||||
return pb.send('/api/mdb/agent-dvf', { method: 'POST', body });
|
||||
}
|
||||
|
||||
export async function agentVeille(body: AgentVeilleBody): Promise<{ id: string; dedupe: boolean; message?: string }> {
|
||||
return pb.send('/api/mdb/agent-veille', { method: 'POST', body });
|
||||
}
|
||||
|
||||
export async function agentRedaction(body: AgentRedactionBody): Promise<{ texte: string; courrier_id?: string }> {
|
||||
return pb.send('/api/mdb/agent-redaction', { method: 'POST', body });
|
||||
}
|
||||
|
||||
export async function agentAlertesScan(): Promise<{ processed: number; note?: string }> {
|
||||
return pb.send('/api/mdb/agent-alertes-scan', { method: 'POST', body: {} });
|
||||
}
|
||||
Reference in New Issue
Block a user