diff --git a/prisma/mariadb/schema.prisma b/prisma/mariadb/schema.prisma index 8141569..57e2335 100644 --- a/prisma/mariadb/schema.prisma +++ b/prisma/mariadb/schema.prisma @@ -100,6 +100,7 @@ model account_memo { } +//NOT USED BY THE TICKET MODULE ********************* model compta_comptes { id BigInt @id @default(autoincrement()) category String? @db.VarChar(64) @@ -107,6 +108,7 @@ model compta_comptes { desc String? @db.MediumText } +//NOT USED BY THE TICKET MODULE ********************* model compta_comptes_soldes { id BigInt @id @default(autoincrement()) num_compte Int @@ -116,6 +118,7 @@ model compta_comptes_soldes { type String @db.VarChar(3) } +//NOT USED BY THE TICKET MODULE ********************* model compta_journal_ecriture { id BigInt @id @default(autoincrement()) date_orig BigInt? @@ -132,6 +135,7 @@ model compta_journal_ecriture { @@index([num], map: "num") } +//NOT USED BY THE TICKET MODULE ********************* model compta_journal_ecriture_bk { id BigInt @id @default(autoincrement()) date_orig BigInt? @@ -148,6 +152,7 @@ model compta_journal_ecriture_bk { @@index([num], map: "num") } +//NOT USED BY THE TICKET MODULE ********************* model compta_journal_ecriture_detail { id BigInt @id @default(autoincrement()) journal_id BigInt? @@ -158,6 +163,7 @@ model compta_journal_ecriture_detail { @@index([journal_id], map: "journal_id") } +//NOT USED BY THE TICKET MODULE ********************* model compta_journal_ecriture_detail_bk { id BigInt @id @default(autoincrement()) journal_id BigInt? @@ -172,11 +178,13 @@ model compta_periode { month Int @id @default(7) } -/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments + +//NOT USED BY THE TICKET MODULE ********************* model compta_ppa_file_id { last_id Int @id @default(1) } +//NOT USED BY THE TICKET MODULE ********************* model compta_setup { setup_id Int @id @default(1) period_month Int @default(7) @@ -189,12 +197,14 @@ model compta_setup { imap_token String? @db.Text } +//NOT USED BY THE TICKET MODULE ********************* model credit_code { id Int @id @default(autoincrement()) code String @db.VarChar(16) desc String @db.VarChar(256) } +//NOT USED BY THE TICKET MODULE ********************* model tax { id Int @id @default(autoincrement()) name String? @db.VarChar(128) @@ -202,6 +212,7 @@ model tax { rate Float? } +//NOT USED BY THE TICKET MODULE ********************* model tax_group { id Int @id @default(autoincrement()) name String? @db.VarChar(128) @@ -209,6 +220,7 @@ model tax_group { tax String? @db.VarChar(128) } +//NOT USED BY THE TICKET MODULE ********************* model td_payable { id Int @id @default(autoincrement()) @db.UnsignedInt ticket_id Int @default(0) @db.UnsignedInt @@ -225,6 +237,7 @@ model td_payable { @@index([ticket_id], map: "ticket_id") } +//NOT USED BY THE TICKET MODULE ********************* model conso { id BigInt @id @default(autoincrement()) ip_id String? @db.VarChar(16) @@ -236,6 +249,7 @@ model conso { @@index([ip_id], map: "ip_id") } +//NOT USED BY THE TICKET MODULE ********************* model conso_archive { id BigInt @id @default(autoincrement()) ip_id String? @db.VarChar(16) @@ -247,6 +261,7 @@ model conso_archive { @@index([ip_id], map: "ip_id") } +//NOT USED BY THE TICKET MODULE ********************* model conso_avis { id Int @id @default(autoincrement()) @db.UnsignedInt date BigInt @@ -257,6 +272,7 @@ model conso_avis { avis String @db.VarChar(32) } +//NOT USED BY THE TICKET MODULE ********************* model conso_radius { id BigInt @id @default(autoincrement()) @db.UnsignedBigInt username String @db.VarChar(32) @@ -269,6 +285,7 @@ model conso_radius { @@index([username], map: "username") } +//NOT USED BY THE TICKET MODULE ********************* model conso_radius_daily { id Int @id @default(autoincrement()) @db.UnsignedInt username String @db.VarChar(32) @@ -282,6 +299,7 @@ model conso_radius_daily { @@index([username], map: "username") } +//NOT USED BY THE TICKET MODULE ********************* model conso_radius_daily2 { id BigInt @id @default(autoincrement()) @db.UnsignedBigInt username String @db.VarChar(32) @@ -295,6 +313,7 @@ model conso_radius_daily2 { @@index([username], map: "username") } +//NOT USED BY THE TICKET MODULE ********************* model conso_radius_hourly { id Int @id @default(autoincrement()) @db.UnsignedInt username String @db.VarChar(32) @@ -306,6 +325,7 @@ model conso_radius_hourly { @@index([username], map: "username") } +//NOT USED BY THE TICKET MODULE ********************* model conso_radius_monthly { id Int @id @default(autoincrement()) @db.UnsignedInt date String @db.VarChar(32) @@ -317,6 +337,7 @@ model conso_radius_monthly { @@index([username], map: "username") } +//NOT USED BY THE TICKET MODULE ********************* model conso_radius_monthly2 { id Int @id @default(autoincrement()) @db.UnsignedInt date String @db.VarChar(32) @@ -359,6 +380,7 @@ model delivery { @@index([placemarks_id], map: "placemarks_id") } + model delivery_history { id Int @id @default(autoincrement()) @db.UnsignedInt account_id Int @db.UnsignedInt diff --git a/src/customer-support/shared/helpers/boolean.helpers.ts b/src/customer-support/shared/helpers/boolean.helpers.ts new file mode 100644 index 0000000..fdd048e --- /dev/null +++ b/src/customer-support/shared/helpers/boolean.helpers.ts @@ -0,0 +1,38 @@ +//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"; + +//From MariaDB to Frontend +export const fromTinyIntToBoolean = async (tinyInt: number): Promise => { + let booleanValue = true; + if ((tinyInt = 0) || (tinyInt = -1)) return booleanValue = false; + return booleanValue; +} + +//From Frontend to MariaDB TinyInt boolean 1 - 0 +export const fromBooleanToTinyInt = async (boolean: boolean): Promise => { + return boolean ? 1 : 0; +} + +//From Frontend to MariaDB TinyInt boolean -1 - 1 +export const fromBooleanToTinyIntNegative = async (boolean: boolean): Promise => { + return boolean ? 1 : -1; +} + +//From MariaDB to Frontend String boolean yes - no / Y - N / etc... +export const fromStringToBoolean = async (string: string): Promise => { + let booleanValue = true; + let stringValue = string.toLowerCase(); + if ((stringValue = "n") || (stringValue = "no") || (stringValue = "non")) { + return booleanValue = false; + } + return booleanValue; +} + +export const fromBooleanToEnum = async (boolean: boolean): Promise => { + return boolean ? PhoneAddrEnhancedCapable.Y : PhoneAddrEnhancedCapable.N; +} + +export const fromEnumToBoolean = async (enumValue: PhoneAddrEnhancedCapable): Promise => { + return enumValue ? true : false; +} \ No newline at end of file diff --git a/src/customer-support/shared/helpers/number.helpers.ts b/src/customer-support/shared/helpers/number.helpers.ts new file mode 100644 index 0000000..b4b775b --- /dev/null +++ b/src/customer-support/shared/helpers/number.helpers.ts @@ -0,0 +1 @@ +//This file is used to store function that help translate MariaDB data to Typescript manipulation requirements for the type "number". \ No newline at end of file diff --git a/src/customer-support/shared/helpers/string.helpers.ts b/src/customer-support/shared/helpers/string.helpers.ts new file mode 100644 index 0000000..cd9fa5b --- /dev/null +++ b/src/customer-support/shared/helpers/string.helpers.ts @@ -0,0 +1 @@ +//This file is used to store function that help translate MariaDB data to Typescript manipulation requirements for the type "string". \ No newline at end of file diff --git a/src/customer-support/tickets/ticket.controller.ts b/src/customer-support/tickets/ticket.controller.ts index c9ca989..cba6e95 100644 --- a/src/customer-support/tickets/ticket.controller.ts +++ b/src/customer-support/tickets/ticket.controller.ts @@ -1,7 +1,11 @@ import { Controller } from "@nestjs/common"; +import { TicketService } from "src/customer-support/tickets/ticket.service"; @Controller() export class TicketController { + constructor(private readonly getService: TicketService) { } + + } \ No newline at end of file diff --git a/src/customer-support/tickets/ticket.service.ts b/src/customer-support/tickets/ticket.service.ts index 3784e0d..0cba27c 100644 --- a/src/customer-support/tickets/ticket.service.ts +++ b/src/customer-support/tickets/ticket.service.ts @@ -1,6 +1,12 @@ 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 { - + + constructor(private readonly prisma: PrismaMariaDbService) { } + + } \ No newline at end of file