feat(tickets): a few more basic setup to match frontend needs
This commit is contained in:
parent
dccb249b15
commit
502f92188d
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
13
src/customer-support/dtos/account.dto.ts
Normal file
13
src/customer-support/dtos/account.dto.ts
Normal file
|
|
@ -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;
|
||||
}
|
||||
16
src/customer-support/dtos/address.dto.ts
Normal file
16
src/customer-support/dtos/address.dto.ts
Normal file
|
|
@ -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;
|
||||
}
|
||||
8
src/customer-support/dtos/customer.dto.ts
Normal file
8
src/customer-support/dtos/customer.dto.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
export class Customer {
|
||||
id:string;
|
||||
first_name:string;
|
||||
last_name:string;
|
||||
email:string;
|
||||
phone:string;
|
||||
primary_contact:boolean;
|
||||
}
|
||||
|
|
@ -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
|
||||
17
src/customer-support/dtos/device.dto.ts
Normal file
17
src/customer-support/dtos/device.dto.ts
Normal file
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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;
|
||||
24
src/customer-support/dtos/services.dto.ts
Normal file
24
src/customer-support/dtos/services.dto.ts
Normal file
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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
|
||||
21
src/customer-support/dtos/ticket.dto.ts
Normal file
21
src/customer-support/dtos/ticket.dto.ts
Normal file
|
|
@ -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[];
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -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[];
|
||||
}
|
||||
|
|
@ -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<boolean> => {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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 {
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user