new defaults (car)

This commit is contained in:
Alex
2025-03-15 00:10:47 +01:00
parent 7c0a6fedb5
commit 90ed0925ca

View File

@@ -117,3 +117,62 @@ export function defaultSupporter() {
supporter.membership.subscription_model.name = SUPPORTER_SUBSCRIPTION_MODEL_NAME; supporter.membership.subscription_model.name = SUPPORTER_SUBSCRIPTION_MODEL_NAME;
return supporter; return supporter;
} }
/**
* @returns {App.Types['location']}
*/
export function defaultLocation() {
return {
latitude: 0,
longitude: 0
};
}
/**
* @returns {App.Types['damage']}
*/
export function defaultDamage() {
return {
id: 0,
opponent: defaultUser(),
insurance: null,
notes: ''
};
}
/**
* @returns {App.Types['insurance']}
*/
export function defaultInsurance() {
return {
id: 0,
company: '',
reference: '',
start_date: '',
end_date: '',
notes: ''
};
}
/**
* @returns {App.Types['car']}
*/
export function defaultCar() {
return {
id: 0,
name: '',
status: '',
brand: '',
model: '',
price: 0,
rate: 0,
start_date: '',
end_date: '',
color: '',
licence_plate: '',
location: defaultLocation(),
damages: [],
insurances: [],
notes: ''
};
}