From aa566ee356bcdc777efde24fdaa6d4f5cae66dae Mon Sep 17 00:00:00 2001 From: Matthieu Haineault Date: Mon, 2 Feb 2026 14:06:16 -0500 Subject: [PATCH] feat(account): commenting to build dtos --- prisma/models/account.prisma | 104 ++++++++++++++------------------ prisma/models/deprecated.prisma | 17 ++++++ src/accounts/account.dto.ts | 81 +++++++++++++++++++++++++ 3 files changed, 143 insertions(+), 59 deletions(-) diff --git a/prisma/models/account.prisma b/prisma/models/account.prisma index 1fd1a34..1999ced 100644 --- a/prisma/models/account.prisma +++ b/prisma/models/account.prisma @@ -1,28 +1,28 @@ model account { id BigInt @id @default(autoincrement()) - customer_id String? @db.VarChar(32) - date_orig BigInt? - date_last BigInt? - date_expire BigInt? - language_id String @default(dbgenerated("(francais)")) @db.VarChar(32) - country_id Int @default(124) - currency_id Int? + customer_id String? @db.VarChar(32) //variable string, composition varies a lot, used by customers to identify their account + date_orig BigInt? //timestamp + date_last BigInt? //timestamp + date_expire BigInt? //not used + language_id String @default(dbgenerated("(francais)")) @db.VarChar(32) //either "anglais", "francais" + country_id Int @default(124) //124 (canada), 450 (Madagascar) or 840 (Virgin island) + currency_id Int? //not used username String? @db.VarChar(128) password String? @db.VarChar(128) - group_id Int @default(6) @db.TinyInt - misc String? @db.VarChar(128) - status Int? + group_id Int @default(6) @db.TinyInt //refers to the account_group table + misc String? @db.VarChar(128) //comments of some sort + status Int? //1-actif, 2-suspension,3- non paiement, 4- terminé, 5- recouvre, 6-creance first_name String? @db.VarChar(128) - middle_name String? @db.VarChar(128) - last_name String? @db.VarChar(128) - mandataire String? @db.VarChar(128) - title String? @db.VarChar(128) + middle_name String? @db.VarChar(128) //not used + last_name String? @db.VarChar(128) + mandataire String? @db.VarChar(128) //sometimes the first_name and last_name are found here, sometimes its the name of someone who manage the account + title String? @db.VarChar(128) //Mme, Mrs, Mr., M., "" email String? @db.VarChar(255) - email_autre String? @db.VarChar(255) - company String? @db.VarChar(255) - contact String @db.Text - address1 String? @db.VarChar(128) - address2 String? @db.VarChar(128) + email_autre String? @db.VarChar(255) //second email + company String? @db.VarChar(255) //name of the company account + contact String @db.Text //name of the contact at the company + address1 String? @db.VarChar(128) + address2 String? @db.VarChar(128) //sometimes used to specify the unit, the suit, the camping lot or used as a note??? city String? @db.VarChar(128) state String? @db.VarChar(32) zip String? @db.VarChar(16) @@ -31,9 +31,9 @@ model account { tel_office_ext String? @db.VarChar(4) cell String? @db.VarChar(16) fax String? @db.VarChar(16) - invoice_delivery Int @default(2) - land_owner Boolean @default(false) - frais Boolean @default(false) + invoice_delivery Int @default(2) //1-email, 2-poste, 3-default + land_owner Boolean @default(false) //tinyInt boolean + frais Boolean @default(false) //tinyInt boolean ppa Boolean @default(false) ppa_all_invoice Int @default(0) @db.TinyInt ppa_name String? @db.VarChar(64) @@ -49,17 +49,17 @@ model account { tax_group Int @default(1) @db.TinyInt data_check Boolean @default(false) created_by Int? - notes_client String? @db.VarChar(256) + notes_client String? @db.VarChar(256) //comments left by customer via the "portail" keyword String? @db.VarChar(512) - terminate_reason String? @db.VarChar(32) - terminate_cie String? @db.VarChar(32) - terminate_note String? @db.MediumText + terminate_reason String? @db.VarChar(32) //install,demenage, cie, autre, NULL + terminate_cie String? @db.VarChar(32) // null, bell, autre, videotron, cogeco, deery, explirnet, sftl, haut-richelieu + terminate_note String? @db.MediumText // comment on the termination of the account terminate_date String? @db.VarChar(16) - call Boolean @default(false) - pub Boolean @default(true) - portal_client_log Boolean @default(false) - mauvais_payeur Boolean @default(false) - renew_phone Boolean @default(false) + call Boolean @default(false) //tinyInt boolean + pub Boolean @default(true) //TinyInt boolean + portal_client_log Boolean @default(false) //TinyInt boolean + mauvais_payeur Boolean @default(false) //TinyInt boolean + renew_phone Boolean @default(false) //TinyInt boolean ppa_cc Int @default(0) @db.TinyInt stripe_id String? @db.VarChar(32) @@ -69,9 +69,9 @@ model account { } model account_group { - id Int @id @default(autoincrement()) @db.TinyInt + id Int @id @default(autoincrement()) @db.TinyInt //see group_id in account table for references date_orig BigInt? - group_name String? @db.VarChar(64) + group_name String? @db.VarChar(64) //group name } model account_memo { @@ -89,32 +89,6 @@ model account_memo { @@index([staff_id], map: "staff_id") } -model account_memo_template { - id Int @id @default(autoincrement()) - name String @db.VarChar(32) - color String @db.VarChar(6) - bcolor String @db.VarChar(6) - border String @default(dbgenerated("(000000)")) @db.VarChar(6) -} - -model account_profile { - id Int @id @default(autoincrement()) @db.UnsignedInt - account_id Int @db.UnsignedInt - profile_id String @db.VarChar(64) - address_id String @db.VarChar(64) - card_id String @db.VarChar(64) - token String @db.VarChar(32) - initial_transaction String @db.VarChar(128) -} - -model account_suspension { - id Int @id @default(autoincrement()) @db.UnsignedInt - account_id Int @unique(map: "account_id") @db.UnsignedInt - date_start BigInt @db.UnsignedBigInt - date_end BigInt @db.UnsignedBigInt - note String @db.VarChar(128) -} - model notes { id Int @id @default(autoincrement()) account_id Int @db.UnsignedInt @@ -145,3 +119,15 @@ model deposit_slip { desc String? @db.VarChar(255) date BigInt? @db.UnsignedBigInt } + + +//NO USES FOR TICKETING PURPOSES +model account_profile { + id Int @id @default(autoincrement()) @db.UnsignedInt + account_id Int @db.UnsignedInt + profile_id String @db.VarChar(64) + address_id String @db.VarChar(64) + card_id String @db.VarChar(64) + token String @db.VarChar(32) + initial_transaction String @db.VarChar(128) +} \ No newline at end of file diff --git a/prisma/models/deprecated.prisma b/prisma/models/deprecated.prisma index 6490a2a..a5f722b 100644 --- a/prisma/models/deprecated.prisma +++ b/prisma/models/deprecated.prisma @@ -82,4 +82,21 @@ model test { id Int @id @default(autoincrement()) @db.UnsignedInt text String @db.Text c2 Int @default(1) +} + +//this table is for CSS class only, no other uses +model account_memo_template { + id Int @id @default(autoincrement()) + name String @db.VarChar(32) + color String @db.VarChar(6) + bcolor String @db.VarChar(6) + border String @default(dbgenerated("(000000)")) @db.VarChar(6) +} +//this table display suspended account NOT USED +model account_suspension { + id Int @id @default(autoincrement()) @db.UnsignedInt + account_id Int @unique(map: "account_id") @db.UnsignedInt + date_start BigInt @db.UnsignedBigInt + date_end BigInt @db.UnsignedBigInt + note String @db.VarChar(128) } \ No newline at end of file diff --git a/src/accounts/account.dto.ts b/src/accounts/account.dto.ts index e69de29..3b5ec50 100644 --- a/src/accounts/account.dto.ts +++ b/src/accounts/account.dto.ts @@ -0,0 +1,81 @@ +export class AccountDto { + id:number; + customer_id: string; + language_id: string; + username: string; + password: string; + group_id: number; + status: number; + first_name: string; + last_name: string; + mandataire: string; + title: string; + email: string; + email_autre?: string; + company?: string; + contact: string; + address1: string; + address2?: string; + city: string; + state: string; + zip: string; + tel_home?: string; + tel_office?: string; + tel_office_ext?: string; + cell?: string; + fax?: string; + land_owner: string; + commercial: string; + vip: string; + notes_client?: string; + terminate_reason?: string; + terminate_cie?: string; + terminate_note?: string; + terminate_date?: string; + mauvais_payeur: boolean; +}; + + +export class AccountMemo { + last_updated: number; + memo?: string; +}; + +export class AccountSuspension { + account_id: number; + date_start: number; + date_end: number; + note: string; +}; + +export type Title = [ + "Mme", + "Mrs", + "Mr.", + "M.", + "", +]; + +// export type Groupe_id = [ +// 1 = "Admin", +// 2 = "Comptabilite", +// 3 = "Facturation", +// 4 = "Staff", +// 5 = "Client", +// 6 = "Prospect", +// 7 = "Fournisseur", +// 8 = "Relais", +// 9 = "Cabinet", +// 10 = "Équipement motorisé", +// ]; + + + +// export type AccountStatus = [ +// 1 = "Actif", +// 2 = "suspension", +// 3 = "non paiement", +// 4 = "terminé", +// 5 = "recouvr", +// 6 = "creance" +// ]; \ No newline at end of file