F-migration-tool/prisma/models/account.prisma
2026-02-02 15:58:13 -05:00

92 lines
4.9 KiB
Plaintext

model account {
id BigInt @id @default(autoincrement())
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 //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) //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) //second email
company String? @db.VarChar(255) //name of the company account
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)
state String? @db.VarChar(32)
zip String? @db.VarChar(16)
tel_home String? @db.VarChar(16)
tel_office String? @db.VarChar(16)
tel_office_ext String? @db.VarChar(4)
cell String? @db.VarChar(16)
fax String? @db.VarChar(16)
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)
ppa_code String? @db.VarChar(255)
ppa_branch String? @db.VarChar(255)
ppa_account String? @db.VarChar(255)
ppa_amount Decimal @default(0.00) @db.Decimal(6, 2)
ppa_amount_buffer Float @default(30.00)
ppa_all_tmp Int @default(0) @db.TinyInt
ppa_fixed Boolean @default(false)
commercial Boolean @default(false)
vip Boolean @default(false)
tax_group Int @default(1) @db.TinyInt
data_check Boolean @default(false)
created_by Int?
notes_client String? @db.VarChar(256) //comments left by customer via the "portail"
keyword String? @db.VarChar(512)
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) //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)
@@index([customer_id], map: "customer_id")
@@index([id, status], map: "id")
@@index([status], map: "status")
}
model account_group {
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
}
// 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?
account_id BigInt?
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")
}