diff --git a/src/customer-support/accounts/account.dto.ts b/src/customer-support/accounts/account.dto.ts deleted file mode 100644 index 3db7634..0000000 --- a/src/customer-support/accounts/account.dto.ts +++ /dev/null @@ -1,33 +0,0 @@ -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 { - customer: Customer; - contact?: string; - username?: string; - password?: string; - radiusUsername?: string; - radiusPassword?: string; - groupId: number; - status?: number; - planName?: string; - delivery: Delivery[]; - memo?: AccountMemo[]; - termination?: TerminationStatus; -}; - -export class AccountMemo { - last_updated: number; - staff_id: number; - memo: string; -}; - -export class TerminationStatus { - terminateReason?: string; - terminateCie?: string; - terminateNote?: string; - terminateDate?: string; -} diff --git a/src/customer-support/accounts/services/account-memo.service.ts b/src/customer-support/accounts/services/account-memo.service.ts index b247408..ef110be 100644 --- a/src/customer-support/accounts/services/account-memo.service.ts +++ b/src/customer-support/accounts/services/account-memo.service.ts @@ -1,7 +1,7 @@ import { Injectable } from "@nestjs/common"; import { PrismaMariaDbService } from "prisma/mariadb/prisma-mariadb.service"; import { Result } from "src/common/errors/result-error.factory"; -import { AccountMemo } from "src/customer-support/accounts/account.dto"; +import { AccountMemo } from "src/customer-support/dtos/account.dto"; @Injectable() export class AccountMemoService { diff --git a/src/customer-support/accounts/services/account.service.ts b/src/customer-support/accounts/services/account.service.ts index 6019d26..e542de7 100644 --- a/src/customer-support/accounts/services/account.service.ts +++ b/src/customer-support/accounts/services/account.service.ts @@ -1,7 +1,7 @@ import { Injectable } from "@nestjs/common"; import { PrismaMariaDbService } from "prisma/mariadb/prisma-mariadb.service"; import { Result } from "src/common/errors/result-error.factory"; -import { Account } from "src/customer-support/accounts/account.dto"; +import { Account } from "src/customer-support/dtos/account.dto"; @Injectable() diff --git a/src/customer-support/customers/customer.dto.ts b/src/customer-support/customers/customer.dto.ts deleted file mode 100644 index d9cbedc..0000000 --- a/src/customer-support/customers/customer.dto.ts +++ /dev/null @@ -1,26 +0,0 @@ -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/devices/device.dto.ts b/src/customer-support/devices/device.dto.ts deleted file mode 100644 index 8d9e528..0000000 --- a/src/customer-support/devices/device.dto.ts +++ /dev/null @@ -1,14 +0,0 @@ -// 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/dtos/account.dto.ts b/src/customer-support/dtos/account.dto.ts new file mode 100644 index 0000000..2623910 --- /dev/null +++ b/src/customer-support/dtos/account.dto.ts @@ -0,0 +1,13 @@ +export class Account { + id: string; + account_number: string; + primary_contact_id: string; + secondary_contacts_id: string[]; + addresses: string[]; + primary_address: string; + billingRecurrence: string; + billingDayOfMonth: number; + nextBillingDate: string; + created_date: Date; + status: string; +} \ No newline at end of file diff --git a/src/customer-support/dtos/address.dto.ts b/src/customer-support/dtos/address.dto.ts new file mode 100644 index 0000000..a54ea50 --- /dev/null +++ b/src/customer-support/dtos/address.dto.ts @@ -0,0 +1,16 @@ +export class Address { + id: string; + account_id: string; + civic_number: string; + street: string; + suite: string; + city: string; + province: string; + country: string; + postal_code: string; + constacts: string[]; + devices: string[]; + services: string[]; + technicalTickets: number[]; + is_primary: boolean; +} \ No newline at end of file diff --git a/src/customer-support/dtos/customer.dto.ts b/src/customer-support/dtos/customer.dto.ts new file mode 100644 index 0000000..131bb87 --- /dev/null +++ b/src/customer-support/dtos/customer.dto.ts @@ -0,0 +1,8 @@ +export class Customer { + id:string; + first_name:string; + last_name:string; + email:string; + phone:string; + primary_contact:boolean; +} \ No newline at end of file diff --git a/src/customer-support/deliveries/delivery.dto.ts b/src/customer-support/dtos/delivery.dto.ts similarity index 68% rename from src/customer-support/deliveries/delivery.dto.ts rename to src/customer-support/dtos/delivery.dto.ts index 7bdcbe7..2312984 100644 --- a/src/customer-support/deliveries/delivery.dto.ts +++ b/src/customer-support/dtos/delivery.dto.ts @@ -1,7 +1,7 @@ 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"; +import { Account } from "src/customer-support/dtos/account.dto"; +import { Product } from "src/customer-support/dtos/product.dto"; +import { Tickets } from "src/customer-support/dtos/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 diff --git a/src/customer-support/dtos/device.dto.ts b/src/customer-support/dtos/device.dto.ts new file mode 100644 index 0000000..b47a09f --- /dev/null +++ b/src/customer-support/dtos/device.dto.ts @@ -0,0 +1,17 @@ +// 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 { + id: string; + name:string; + status:string; + address_id: string; + category:string; + model:string; + sn:string; + speed:string; + price:string; + description:string; + tag:string; + photo:string; +} \ No newline at end of file diff --git a/src/customer-support/fibre/fibre.dto.ts b/src/customer-support/dtos/fibre.dto.ts similarity index 100% rename from src/customer-support/fibre/fibre.dto.ts rename to src/customer-support/dtos/fibre.dto.ts diff --git a/src/customer-support/phones/phone.dto.ts b/src/customer-support/dtos/phone.dto.ts similarity index 100% rename from src/customer-support/phones/phone.dto.ts rename to src/customer-support/dtos/phone.dto.ts diff --git a/src/customer-support/product/product.dto.ts b/src/customer-support/dtos/product.dto.ts similarity index 79% rename from src/customer-support/product/product.dto.ts rename to src/customer-support/dtos/product.dto.ts index a65a5a5..76df9b2 100644 --- a/src/customer-support/product/product.dto.ts +++ b/src/customer-support/dtos/product.dto.ts @@ -1,7 +1,7 @@ -import { Device } from "src/customer-support/devices/device.dto"; -import { Service } from "src/customer-support/services/services.dto"; +import { Device } from "src/customer-support/dtos/device.dto"; +import { Service } from "src/customer-support/dtos/services.dto"; import { Comments } from "src/customer-support/shared/shared-class.dto"; -import { Television } from "src/customer-support/television/television.dto"; +import { Television } from "src/customer-support/dtos/television.dto"; export class Product { description: string; diff --git a/src/customer-support/dtos/services.dto.ts b/src/customer-support/dtos/services.dto.ts new file mode 100644 index 0000000..c148053 --- /dev/null +++ b/src/customer-support/dtos/services.dto.ts @@ -0,0 +1,24 @@ +//A Service is a product + +export class Service { + id: string; + accountId: string; + address_id: string; + serviceFromCatalogId: string; + name: string; + type: string; + activatedAt: string; + date_of_suspension: any[]; + date_of_reactivation: any[]; +} + +export class OfferedService { + id: string; + code: string; + name: string; + description: string; + standardPrice: number; + category:string; + status:string; + effectiveDate:string; +} \ No newline at end of file diff --git a/src/customer-support/staff/staff.dto.ts b/src/customer-support/dtos/staff.dto.ts similarity index 100% rename from src/customer-support/staff/staff.dto.ts rename to src/customer-support/dtos/staff.dto.ts diff --git a/src/customer-support/television/television.dto.ts b/src/customer-support/dtos/television.dto.ts similarity index 78% rename from src/customer-support/television/television.dto.ts rename to src/customer-support/dtos/television.dto.ts index fe654ad..ea70837 100644 --- a/src/customer-support/television/television.dto.ts +++ b/src/customer-support/dtos/television.dto.ts @@ -1,5 +1,5 @@ -import { Customer } from "src/customer-support/customers/customer.dto"; -import { Service } from "src/customer-support/services/services.dto"; +import { Customer } from "src/customer-support/dtos/customer.dto"; +import { Service } from "src/customer-support/dtos/services.dto"; import { Comments } from "src/customer-support/shared/shared-class.dto"; //Television is a product, can be "A la carte" or by package diff --git a/src/customer-support/dtos/ticket.dto.ts b/src/customer-support/dtos/ticket.dto.ts new file mode 100644 index 0000000..d88d472 --- /dev/null +++ b/src/customer-support/dtos/ticket.dto.ts @@ -0,0 +1,21 @@ +//matches frontend needs +export class Tickets { + id: number; + address_id: string; + customer_id: string; + status: string; + type: string; + short_description: string; + employee_assigned: string; + full_description: string; + assistant: string; + departement: string; + created_by: string; + creation_date: Date; + last_update: Date; + assigned_date: Date; + ticketSuperType: string; + attached: string[]; +} + + diff --git a/src/customer-support/services/services.dto.ts b/src/customer-support/services/services.dto.ts deleted file mode 100644 index 1d7d45d..0000000 --- a/src/customer-support/services/services.dto.ts +++ /dev/null @@ -1,22 +0,0 @@ -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/shared/helpers/boolean.helpers.ts b/src/customer-support/shared/helpers/boolean.helpers.ts index fdd048e..3950a56 100644 --- a/src/customer-support/shared/helpers/boolean.helpers.ts +++ b/src/customer-support/shared/helpers/boolean.helpers.ts @@ -1,6 +1,6 @@ //This file is used to store function that help translate MariaDB data to Typescript manipulation requirements for the type "boolean". -import { PhoneAddrEnhancedCapable } from "src/customer-support/phones/phone.dto"; +import { PhoneAddrEnhancedCapable } from "src/customer-support/dtos/phone.dto"; //From MariaDB to Frontend export const fromTinyIntToBoolean = async (tinyInt: number): Promise => { diff --git a/src/customer-support/tickets/ticket.dto.ts b/src/customer-support/tickets/ticket.dto.ts deleted file mode 100644 index 3a77398..0000000 --- a/src/customer-support/tickets/ticket.dto.ts +++ /dev/null @@ -1,25 +0,0 @@ -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; -} diff --git a/src/customer-support/tickets/ticket.service.ts b/src/customer-support/tickets/ticket.service.ts index 0cba27c..f32e628 100644 --- a/src/customer-support/tickets/ticket.service.ts +++ b/src/customer-support/tickets/ticket.service.ts @@ -1,8 +1,5 @@ import { Injectable } from "@nestjs/common"; import { PrismaMariaDbService } from "prisma/mariadb/prisma-mariadb.service"; -import { Result } from "src/common/errors/result-error.factory"; -import { Tickets } from "src/customer-support/tickets/ticket.dto"; - @Injectable() export class TicketService {