From ee6337758e2b8a8f02fca1f3ac837a6c62a4f4b9 Mon Sep 17 00:00:00 2001 From: Matthieu Haineault Date: Tue, 10 Feb 2026 08:14:44 -0500 Subject: [PATCH] feat(DTO): dto implementations for the ticket module --- src/customer-support/accounts/account.dto.ts | 48 +++++++++---------- .../customers/customer.controller.ts | 0 .../customers/customer.dto.ts | 26 ++++++++++ .../customers/customer.module.ts | 0 .../customers/customer.service.ts | 0 .../deliveries/delivery.dto.ts | 22 +++++++++ src/customer-support/devices/device.dto.ts | 14 ++++++ src/customer-support/fibre/fibre.dto.ts | 3 ++ .../account-testing.http | 0 src/customer-support/phones/phone.dto.ts | 7 +++ src/customer-support/product/product.dto.ts | 36 ++++++++++++++ .../services/services.controller.ts | 0 src/customer-support/services/services.dto.ts | 22 +++++++++ .../services/services.module.ts | 0 .../services/services.service.ts | 0 .../shared/shared-class.dto.ts | 20 ++++++++ .../television/television.dto.ts | 27 +++++++++++ src/customer-support/tickets/ticket.dto.ts | 25 ++++++++++ 18 files changed, 224 insertions(+), 26 deletions(-) create mode 100644 src/customer-support/customers/customer.controller.ts create mode 100644 src/customer-support/customers/customer.dto.ts create mode 100644 src/customer-support/customers/customer.module.ts create mode 100644 src/customer-support/customers/customer.service.ts rename src/customer-support/{ => http-test-files}/account-testing.http (100%) create mode 100644 src/customer-support/services/services.controller.ts create mode 100644 src/customer-support/services/services.dto.ts create mode 100644 src/customer-support/services/services.module.ts create mode 100644 src/customer-support/services/services.service.ts create mode 100644 src/customer-support/shared/shared-class.dto.ts diff --git a/src/customer-support/accounts/account.dto.ts b/src/customer-support/accounts/account.dto.ts index d5bba5e..3db7634 100644 --- a/src/customer-support/accounts/account.dto.ts +++ b/src/customer-support/accounts/account.dto.ts @@ -1,37 +1,33 @@ +import { Customer } from "src/customer-support/customers/customer.dto"; +import { Delivery } from "src/customer-support/deliveries/delivery.dto"; + +//an account is linked to a customer +//an account can have one or more delivery + export class Account { - id: number; - customerId?: string; - language: string; + customer: Customer; + contact?: string; username?: string; password?: string; + radiusUsername?: string; + radiusPassword?: string; groupId: number; status?: number; - firstName?: string; - lastName?: string; - mandataire?: string; //sometimes the first_name and last_name are found here, sometimes its the name of someone who manage the account - title?: string; - email?: string[]; - company?: string; - contact: string; - address?: string[]; //string of country, city, state, zip, road, number, apt concat. - telHome?: string; - telOffice?: string; - telOffice_ext?: string; - cell?: string; - fax?: string; - landOwner: boolean; - commercial: boolean; - vip: boolean; - notes_client?: string; - terminateReason?: string; - terminateCie?: string; - terminateNote?: string; - terminateDate?: string; - mauvaisPayeur: boolean; + planName?: string; + delivery: Delivery[]; + memo?: AccountMemo[]; + termination?: TerminationStatus; }; export class AccountMemo { last_updated: number; staff_id: number; - memo?: string; + memo: string; }; + +export class TerminationStatus { + terminateReason?: string; + terminateCie?: string; + terminateNote?: string; + terminateDate?: string; +} diff --git a/src/customer-support/customers/customer.controller.ts b/src/customer-support/customers/customer.controller.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/customer-support/customers/customer.dto.ts b/src/customer-support/customers/customer.dto.ts new file mode 100644 index 0000000..d9cbedc --- /dev/null +++ b/src/customer-support/customers/customer.dto.ts @@ -0,0 +1,26 @@ +import { Address } from "src/customer-support/shared/shared-class.dto"; + +//A customer is linked to an Account and Delivery + +export class Customer { + customerId?: number; + firstName?: string; + lastName?: string; + language?: string; + mandataire?: string; //sometimes the first_name and last_name are found here, sometimes its the name of someone who manage the account + contact?: string; + address?: Address; //string of country, city, state, zip, road, number, apt concat. Data is found in the Address class + email?: string[]; + company?: string; + telHome?: string; + telOffice?: string; + telOffice_ext?: string; + cell?: string; + fax?: string; + landOwner: boolean; + commercial: boolean; + title?: string; + vip: boolean; + notesClient?: string; + mauvaisPayeur: boolean; +} \ No newline at end of file diff --git a/src/customer-support/customers/customer.module.ts b/src/customer-support/customers/customer.module.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/customer-support/customers/customer.service.ts b/src/customer-support/customers/customer.service.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/customer-support/deliveries/delivery.dto.ts b/src/customer-support/deliveries/delivery.dto.ts index e69de29..7bdcbe7 100644 --- a/src/customer-support/deliveries/delivery.dto.ts +++ b/src/customer-support/deliveries/delivery.dto.ts @@ -0,0 +1,22 @@ +import { Address } from "cluster"; +import { Account } from "src/customer-support/accounts/account.dto"; +import { Product } from "src/customer-support/product/product.dto"; +import { Tickets } from "src/customer-support/tickets/ticket.dto"; + +//A delivery represent an Address where product can be delivered. +//A delivery can be linked to a single Account and a single address +//A delivery can have 1 or more Product + + +export class Delivery { + address: Address; + account: Account[]; + ticket: Tickets[]; + product: Product[]; +} + +export class AccountDeliveryJunction { + accountId: Account; + deliveryId:Delivery; + ticket:Tickets[]; +} \ No newline at end of file diff --git a/src/customer-support/devices/device.dto.ts b/src/customer-support/devices/device.dto.ts index e69de29..8d9e528 100644 --- a/src/customer-support/devices/device.dto.ts +++ b/src/customer-support/devices/device.dto.ts @@ -0,0 +1,14 @@ +// A Device is linked to a Service +// A Device can be used as a "parent" or be a "child" of an other device + +export class Device { + ip: string; + mac: string; + privateIp: string; + relayIp: string; + accessPoint: string; + techno: string; + link: string; + parentDevice?: Device; + childDevice?: Device; +} \ No newline at end of file diff --git a/src/customer-support/fibre/fibre.dto.ts b/src/customer-support/fibre/fibre.dto.ts index e69de29..5906dea 100644 --- a/src/customer-support/fibre/fibre.dto.ts +++ b/src/customer-support/fibre/fibre.dto.ts @@ -0,0 +1,3 @@ +export class Fibre { + +} \ No newline at end of file diff --git a/src/customer-support/account-testing.http b/src/customer-support/http-test-files/account-testing.http similarity index 100% rename from src/customer-support/account-testing.http rename to src/customer-support/http-test-files/account-testing.http diff --git a/src/customer-support/phones/phone.dto.ts b/src/customer-support/phones/phone.dto.ts index e69de29..fb04bff 100644 --- a/src/customer-support/phones/phone.dto.ts +++ b/src/customer-support/phones/phone.dto.ts @@ -0,0 +1,7 @@ + +//I question the need for a phone dto. Could be an enum since most columns repeat themselves in the product table. + +//A phone is a type of product, not sure what would need to be in this class. +export class Phone { + +} \ No newline at end of file diff --git a/src/customer-support/product/product.dto.ts b/src/customer-support/product/product.dto.ts index e69de29..a65a5a5 100644 --- a/src/customer-support/product/product.dto.ts +++ b/src/customer-support/product/product.dto.ts @@ -0,0 +1,36 @@ +import { Device } from "src/customer-support/devices/device.dto"; +import { Service } from "src/customer-support/services/services.dto"; +import { Comments } from "src/customer-support/shared/shared-class.dto"; +import { Television } from "src/customer-support/television/television.dto"; + +export class Product { + description: string; + downloadSpeed?: number; + uploadSpeed?: number; + dayQuota: number; + nightQuota: number; + phoneNumber: string; + inventory: Inventory; + isPortalAvailable: boolean; + isCommercial: boolean; + isComboDiscountEligible: boolean; + categoryName: string; + note: Comments; + status: boolean; + stockKeepingUnit: string; // **sku** + name: string; + price: number; + soldUnit: number; + isAvailable: boolean; + televiesion?: Television; + service?: Service; + device?: Device; +} + +export class Inventory { + followUp: boolean; + tag: string; + localisation: string; + alert: number; + listedTicketTech: boolean; //what is this for? +} diff --git a/src/customer-support/services/services.controller.ts b/src/customer-support/services/services.controller.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/customer-support/services/services.dto.ts b/src/customer-support/services/services.dto.ts new file mode 100644 index 0000000..1d7d45d --- /dev/null +++ b/src/customer-support/services/services.dto.ts @@ -0,0 +1,22 @@ +import { Device } from "src/customer-support/devices/device.dto"; +import { Comments } from "src/customer-support/shared/shared-class.dto"; + +//A Service is a product + +export class Service { + id: number; + deviceId: number; + type: string; + status: string; + paymentRecurrence: string; + createdAt: Date; + suspendedAt: Date; + lastBill: Date; + nextBill: Date; + uniqueCharge: boolean; + contractEnd: Date; + activeUntil: Date; + isHijacked: boolean; + comment: Comments; + device: Device[]; +} \ No newline at end of file diff --git a/src/customer-support/services/services.module.ts b/src/customer-support/services/services.module.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/customer-support/services/services.service.ts b/src/customer-support/services/services.service.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/customer-support/shared/shared-class.dto.ts b/src/customer-support/shared/shared-class.dto.ts new file mode 100644 index 0000000..81b9035 --- /dev/null +++ b/src/customer-support/shared/shared-class.dto.ts @@ -0,0 +1,20 @@ +export class Comments { + comment: string; + isPublic: boolean; + createdAt: Date; + createdBy: string; + updatedAt: Date; + updatedBy: string; +} + +export class Address { + door_number: number; + street: string; + city: string; + province: string; + postal_code: string; + latitude: string; + longitude: string; + createdAt: Date; + comment: Comments; +} \ No newline at end of file diff --git a/src/customer-support/television/television.dto.ts b/src/customer-support/television/television.dto.ts index e69de29..fe654ad 100644 --- a/src/customer-support/television/television.dto.ts +++ b/src/customer-support/television/television.dto.ts @@ -0,0 +1,27 @@ +import { Customer } from "src/customer-support/customers/customer.dto"; +import { Service } from "src/customer-support/services/services.dto"; +import { Comments } from "src/customer-support/shared/shared-class.dto"; + +//Television is a product, can be "A la carte" or by package + +export class Television { + service: Service; + channel?: Channels[]; + package?: ChannelPackages; +} + +export class Channels { + number: number; + name: string; + owner: string; + unitPrice: number; + unitSoldPrice: number; + bundlePrice: number; + bundleSoldPrice: number; + note: Comments; +} + +export class ChannelPackages { + price: number; + isActive: boolean; +} \ No newline at end of file diff --git a/src/customer-support/tickets/ticket.dto.ts b/src/customer-support/tickets/ticket.dto.ts index e69de29..3a77398 100644 --- a/src/customer-support/tickets/ticket.dto.ts +++ b/src/customer-support/tickets/ticket.dto.ts @@ -0,0 +1,25 @@ +import { AccountDeliveryJunction } from "src/customer-support/deliveries/delivery.dto"; +import { Comments } from "src/customer-support/shared/shared-class.dto"; + +export class Tickets { + id: number; + subject?: string; + departement: string; + status: string; + priority: string; + attachments?: string[]; + accountDelivery: AccountDeliveryJunction; + comment?: Comments[]; + followUp: FollowUp[]; +} + + +export class FollowUp { + assignedTo: string; + followedBy?: string[]; + createdAt: Date; + dueDate?: Date; + updatedAt: Date; + parentTicket?: Tickets; + childTicket?: Tickets; +}