From bc9c036d1fc975effc054d72e09721c7e41afa20 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Mon, 22 Jun 2026 13:34:41 +0200 Subject: [PATCH] feat(directory) : add frontend DTOs for contacts, addresses, reports --- .../modules/directory/services/dto/address.ts | 23 ++++++++++++++++ .../services/dto/commercial-report.ts | 27 +++++++++++++++++++ .../modules/directory/services/dto/contact.ts | 23 ++++++++++++++++ .../directory/services/dto/report-document.ts | 13 +++++++++ 4 files changed, 86 insertions(+) create mode 100644 frontend/modules/directory/services/dto/address.ts create mode 100644 frontend/modules/directory/services/dto/commercial-report.ts create mode 100644 frontend/modules/directory/services/dto/contact.ts create mode 100644 frontend/modules/directory/services/dto/report-document.ts diff --git a/frontend/modules/directory/services/dto/address.ts b/frontend/modules/directory/services/dto/address.ts new file mode 100644 index 0000000..f66d3a9 --- /dev/null +++ b/frontend/modules/directory/services/dto/address.ts @@ -0,0 +1,23 @@ +export type Address = { + id: number + '@id'?: string + label: string | null + street: string | null + streetComplement: string | null + postalCode: string | null + city: string | null + country: string + client?: string | null + prospect?: string | null +} + +export type AddressWrite = { + label: string | null + street: string | null + streetComplement: string | null + postalCode: string | null + city: string | null + country: string + client?: string | null + prospect?: string | null +} diff --git a/frontend/modules/directory/services/dto/commercial-report.ts b/frontend/modules/directory/services/dto/commercial-report.ts new file mode 100644 index 0000000..bdfaccc --- /dev/null +++ b/frontend/modules/directory/services/dto/commercial-report.ts @@ -0,0 +1,27 @@ +import type { ReportDocument } from './report-document' + +export type ReportType = 'call' | 'meeting' | 'email' | 'note' + +export type CommercialReport = { + id: number + '@id'?: string + subject: string + body: string | null + occurredAt: string + type: ReportType + author?: { id: number, username: string } | null + client?: string | null + prospect?: string | null + documents?: ReportDocument[] + createdAt?: string + updatedAt?: string +} + +export type CommercialReportWrite = { + subject: string + body: string | null + occurredAt: string + type: ReportType + client?: string | null + prospect?: string | null +} diff --git a/frontend/modules/directory/services/dto/contact.ts b/frontend/modules/directory/services/dto/contact.ts new file mode 100644 index 0000000..eead371 --- /dev/null +++ b/frontend/modules/directory/services/dto/contact.ts @@ -0,0 +1,23 @@ +export type Contact = { + id: number + '@id'?: string + firstName: string | null + lastName: string | null + jobTitle: string | null + email: string | null + phonePrimary: string | null + phoneSecondary: string | null + client?: string | null + prospect?: string | null +} + +export type ContactWrite = { + firstName: string | null + lastName: string | null + jobTitle: string | null + email: string | null + phonePrimary: string | null + phoneSecondary: string | null + client?: string | null + prospect?: string | null +} diff --git a/frontend/modules/directory/services/dto/report-document.ts b/frontend/modules/directory/services/dto/report-document.ts new file mode 100644 index 0000000..c97100c --- /dev/null +++ b/frontend/modules/directory/services/dto/report-document.ts @@ -0,0 +1,13 @@ +import type { UserData } from '~/services/dto/user-data' + +export type ReportDocument = { + '@id'?: string + id: number + commercialReport: string + originalName: string + fileName?: string | null + mimeType: string + size: number + createdAt: string + uploadedBy?: UserData | null +}