Replace mysql2 with prisma

also I updated packages,
and properly typed api input
a lot of time was spent, I don't remeber what really I did x3
but everything was related to replacing mysql2 with prisma
This commit is contained in:
Wroclaw 2023-11-08 05:35:48 +01:00
parent be1e3909b6
commit eebf25198d
39 changed files with 1081 additions and 1292 deletions

View file

@ -1,99 +0,0 @@
export interface client {
id: string;
name: string | null;
address: string | null;
phone: string | null;
email: string | null;
}
export interface user {
id: string;
username: string;
email: string;
display_name?: string;
}
export interface session {
id: string;
user: string;
expiry_date: string;
}
export interface imported_product {
id: string;
// order: string,
name?: string;
link: string;
price_imported: string;
price: string;
}
export interface offer {
id: string;
name: string;
description?: string;
recommended_price?: string;
}
export interface work {
id: string;
// order: string,
offer: string | offer;
price: string;
notes: string;
is_fulfilled: boolean;
}
export interface order {
imported_products: Array<{
id: string;
name: string | null;
link: string;
price: string;
price_imported: string;
}>;
work: {
id: string;
offer: offer;
price: number;
notes: string | null;
is_fulfilled: 0 | 1;
}[];
id: string;
client: string;
user: string;
is_draft: 0 | 1;
value: number;
}
export interface orderSummary {
id: string;
client: string;
user: string;
is_draft: 0 | 1;
value: string;
imported_products_count: number;
work_count: number;
}
export interface work_template {
id: string;
// order_template: string,
offer: string | offer;
price: string;
notes?: string;
}
export interface order_template {
id: string;
name: string;
description?: string;
}
// 1 is true, 0 is false
export type Dboolean =
| boolean
| 0 // false
| 1; // true
export type Dnumber = number | `${number}`;