feat(DTO): dto implementations for the ticket module
This commit is contained in:
parent
c3698d4a36
commit
ee6337758e
|
|
@ -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 {
|
export class Account {
|
||||||
id: number;
|
customer: Customer;
|
||||||
customerId?: string;
|
contact?: string;
|
||||||
language: string;
|
|
||||||
username?: string;
|
username?: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
|
radiusUsername?: string;
|
||||||
|
radiusPassword?: string;
|
||||||
groupId: number;
|
groupId: number;
|
||||||
status?: number;
|
status?: number;
|
||||||
firstName?: string;
|
planName?: string;
|
||||||
lastName?: string;
|
delivery: Delivery[];
|
||||||
mandataire?: string; //sometimes the first_name and last_name are found here, sometimes its the name of someone who manage the account
|
memo?: AccountMemo[];
|
||||||
title?: string;
|
termination?: TerminationStatus;
|
||||||
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;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export class AccountMemo {
|
export class AccountMemo {
|
||||||
last_updated: number;
|
last_updated: number;
|
||||||
staff_id: number;
|
staff_id: number;
|
||||||
memo?: string;
|
memo: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export class TerminationStatus {
|
||||||
|
terminateReason?: string;
|
||||||
|
terminateCie?: string;
|
||||||
|
terminateNote?: string;
|
||||||
|
terminateDate?: string;
|
||||||
|
}
|
||||||
|
|
|
||||||
26
src/customer-support/customers/customer.dto.ts
Normal file
26
src/customer-support/customers/customer.dto.ts
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
0
src/customer-support/customers/customer.module.ts
Normal file
0
src/customer-support/customers/customer.module.ts
Normal file
0
src/customer-support/customers/customer.service.ts
Normal file
0
src/customer-support/customers/customer.service.ts
Normal file
|
|
@ -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[];
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
export class Fibre {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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 {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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?
|
||||||
|
}
|
||||||
22
src/customer-support/services/services.dto.ts
Normal file
22
src/customer-support/services/services.dto.ts
Normal file
|
|
@ -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[];
|
||||||
|
}
|
||||||
0
src/customer-support/services/services.module.ts
Normal file
0
src/customer-support/services/services.module.ts
Normal file
0
src/customer-support/services/services.service.ts
Normal file
0
src/customer-support/services/services.service.ts
Normal file
20
src/customer-support/shared/shared-class.dto.ts
Normal file
20
src/customer-support/shared/shared-class.dto.ts
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user