frontend: add car handling

This commit is contained in:
Alex
2025-03-15 00:12:00 +01:00
parent 380fee09c1
commit c9d5a88dbf
5 changed files with 330 additions and 60 deletions

44
frontend/src/app.d.ts vendored
View File

@@ -68,12 +68,52 @@ interface User {
notes: string | '';
}
interface Car {
id: number | -1;
name: string | '';
status: number | 0;
brand: string | '';
model: string | '';
price: number | 0;
rate: number | 0;
start_date: string | '';
end_date: string | '';
color: string | '';
licence_plate: string | '';
location: Location;
damages: Damage[] | [];
insurances: Insurance[] | [];
notes: string | '';
}
interface Location {
latitude: number | 0;
longitude: number | 0;
}
interface Damage {
id: number | -1;
opponent: User;
insurance: Insurance | null;
notes: string | '';
}
interface Insurance {
id: number | -1;
company: string | '';
reference: string | '';
start_date: string | '';
end_date: string | '';
notes: string | '';
}
declare global {
namespace App {
// interface Error {}
interface Locals {
user: User;
users: User[];
cars: Cars[];
subscriptions: Subscription[];
licence_categories: LicenceCategory[];
}
@@ -84,6 +124,10 @@ declare global {
licence: Licence;
licenceCategory: LicenceCategory;
bankAccount: BankAccount;
car: Car;
insurance: Insurance;
location: Location;
damage: Damage;
}
// interface PageData {}
// interface Platform {}