diff --git a/prisma/models/account.prisma b/prisma/models/account.prisma index 1999ced..c2c1d3a 100644 --- a/prisma/models/account.prisma +++ b/prisma/models/account.prisma @@ -20,7 +20,7 @@ model account { email String? @db.VarChar(255) 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 + contact String @db.Text //name of the contact at the company or account contact 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) @@ -74,60 +74,18 @@ model account_group { group_name String? @db.VarChar(64) //group name } +// this table could be ignored ? see comment on memo column model account_memo { id BigInt @id @default(autoincrement()) date_orig BigInt? last_updated BigInt @default(0) @db.UnsignedBigInt - staff_id BigInt? + staff_id BigInt? account_id BigInt? - memo String? @db.VarChar(1024) - color String @default(dbgenerated("(000000)")) @db.VarChar(6) - bcolor String @default(dbgenerated("(E0E0E0)")) @db.VarChar(6) - border String @default(dbgenerated("(000000)")) @db.VarChar(6) + memo String? @db.VarChar(1024) //comment, seems to be a copy paste of a form, giving a bunch of infos on the account, should be queried instead of copied + color String @default(dbgenerated("(000000)")) @db.VarChar(6) //CSS + bcolor String @default(dbgenerated("(E0E0E0)")) @db.VarChar(6) //CSS + border String @default(dbgenerated("(000000)")) @db.VarChar(6) //CSS @@index([account_id], map: "account_id") @@index([staff_id], map: "staff_id") } - -model notes { - id Int @id @default(autoincrement()) - account_id Int @db.UnsignedInt - notes String @db.MediumText -} - -model email { - id Int @id @default(autoincrement()) - account_id BigInt? - email String? @db.VarChar(128) - password String? @db.VarChar(128) -} - -model client_pwd { - id Int @id @default(autoincrement()) @db.UnsignedInt - account_id Int @db.UnsignedInt - date BigInt @db.UnsignedBigInt - uid String @db.VarChar(32) - used Boolean @default(false) -} - -model deposit_slip { - id Int @id @default(autoincrement()) - customer_id String? @db.VarChar(32) - name String? @db.VarChar(512) - amount Float @default(0) - type String @db.VarChar(32) - 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 a5f722b..112f2de 100644 --- a/prisma/models/deprecated.prisma +++ b/prisma/models/deprecated.prisma @@ -92,7 +92,56 @@ model account_memo_template { bcolor String @db.VarChar(6) border String @default(dbgenerated("(000000)")) @db.VarChar(6) } -//this table display suspended account NOT USED + +//not used +model notes { + id Int @id @default(autoincrement()) + account_id Int @db.UnsignedInt + notes String @db.MediumText +} + +//NOT USED +model email { + id Int @id @default(autoincrement()) + account_id BigInt? + email String? @db.VarChar(128) + password String? @db.VarChar(128) +} + +//not relevant to ticket module +model client_pwd { + id Int @id @default(autoincrement()) @db.UnsignedInt + account_id Int @db.UnsignedInt + date BigInt @db.UnsignedBigInt + uid String @db.VarChar(32) + used Boolean @default(false) +} + + +//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) +} + + +//not relevant to ticket module +model deposit_slip { + id Int @id @default(autoincrement()) + customer_id String? @db.VarChar(32) + name String? @db.VarChar(512) + amount Float @default(0) + type String @db.VarChar(32) + desc String? @db.VarChar(255) + date BigInt? @db.UnsignedBigInt +} + +//this table display suspended account model account_suspension { id Int @id @default(autoincrement()) @db.UnsignedInt account_id Int @unique(map: "account_id") @db.UnsignedInt diff --git a/src/accounts/account.dto.ts b/src/accounts/account.dto.ts index 3b5ec50..ddf43d8 100644 --- a/src/accounts/account.dto.ts +++ b/src/accounts/account.dto.ts @@ -1,33 +1,28 @@ export class AccountDto { - id:number; - customer_id: string; + 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; + username?: string; + password?: string; + group_id: GroupName; + status?: number; //link to be made with AccountSuspension, somehow + first_name?: string; + last_name?: string; + mandataire?: string; //sometimes the first_name and last_name are found here, sometimes its the name of someone who manage the account + title?: Title; + email?: string[]; company?: string; contact: string; - address1: string; - address2?: string; - city: string; - state: string; - zip: string; + address?: string[]; //string of country, city, state, zip, road, number, apt concat. tel_home?: string; tel_office?: string; tel_office_ext?: string; cell?: string; fax?: string; - land_owner: string; - commercial: string; - vip: string; - notes_client?: string; + land_owner: boolean; + commercial: boolean; + vip: boolean; + notes_client?: string[]; terminate_reason?: string; terminate_cie?: string; terminate_note?: string; @@ -35,47 +30,39 @@ export class AccountDto { mauvais_payeur: boolean; }; - export class AccountMemo { last_updated: number; - memo?: string; + staff_id: number; + memo?: string[]; }; -export class AccountSuspension { - account_id: number; - date_start: number; - date_end: number; - note: string; +//represents the account_group table +class GroupName { + Admin: number = 1; + Comptabilite: number = 2; + Facturation: number = 3; + Staff: number = 4; + Client: number = 5; + Prospect: number = 6; + Fournisseur: number = 7; + Relais: number = 8; + Cabinet: number = 9; + ÉquipementMotorisé: number = 10; }; -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é", -// ]; +//represents the country table +class Country { + canada: number = 120; + madagascar: number = 450; + virginIsland: number = 840; +}; - -// export type AccountStatus = [ -// 1 = "Actif", -// 2 = "suspension", -// 3 = "non paiement", -// 4 = "terminé", -// 5 = "recouvr", -// 6 = "creance" -// ]; \ No newline at end of file +// enum placeholder to avoid direct entries to the DB +class Title { + m: string = 'M'; + mDot: string = 'M.'; + mr: string = 'Mr'; + mrs: string = 'Mrs'; + mme: string = 'Mme'; +};