-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Florian BOUILLON <[email protected]>
- Loading branch information
1 parent
56ea7a6
commit 6a1b683
Showing
6 changed files
with
126 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,106 @@ | ||
export const config = [ | ||
export const general = [ | ||
{ | ||
allMk: "560", | ||
allTop:"682", | ||
allAirsal:"596", | ||
allAirsalAlu:"736", | ||
allTopRose:"926", | ||
} | ||
]; | ||
export const general =[ | ||
roulement: 14, | ||
embrayage: 44, | ||
pipe: 14, | ||
carbu: 105, | ||
pot: 212, | ||
embrayageMost: 50, | ||
lamelleFibre: 10, | ||
carbu24: 110, | ||
potVoca: 279, | ||
clapetVl6: 33, | ||
}, | ||
]; | ||
|
||
export const all50Mk = [ | ||
{ | ||
roulement:"14", | ||
embrayage:"44", | ||
pipe:"14", | ||
carbu:"105", | ||
pot:"212", | ||
embrayageMost:"50", | ||
lamelleFibre:"10", | ||
carbu24:"110", | ||
potVoca:"279", | ||
} | ||
] | ||
export const all50Mk =[ | ||
cylindre: 230, | ||
carbu: 118, | ||
}, | ||
]; | ||
|
||
export const all70top = [ | ||
{ | ||
cylindre:"230", | ||
carbu:"118", | ||
} | ||
] | ||
export const all70top =[ | ||
cylindre: 188, | ||
vilo: 105, | ||
}, | ||
]; | ||
|
||
export const all70airsal = [ | ||
{ | ||
cylindre:"188", | ||
vilo:"105", | ||
} | ||
] | ||
export const all70airsal =[ | ||
cylindre: 131, | ||
vilo: 77, | ||
}, | ||
]; | ||
|
||
export const all70airsalAlu = [ | ||
{ | ||
cylindre:"131", | ||
vilo:"77", | ||
} | ||
] | ||
export const all70airsalAlu =[ | ||
cylindre: 132, | ||
vilo: 128, | ||
}, | ||
]; | ||
|
||
export const all75TopRose = [ | ||
{ | ||
cylindre:"132", | ||
vilo:"128", | ||
cylindre: 289, | ||
vilo: 129, | ||
}, | ||
]; | ||
|
||
const calculateTotalPrice = (specificParts: any, generalParts: any, additionalParts: string[] = []) => { | ||
let total = 0; | ||
// Additionner les valeurs spécifiques | ||
for (const part of Object.values(specificParts)) { | ||
total += part; | ||
} | ||
] | ||
export const all75TopRose =[ | ||
{ | ||
cylindre:"289", | ||
vilo:"129", | ||
// Additionner les valeurs générales | ||
for (const part of additionalParts) { | ||
total += generalParts[part]; | ||
} | ||
] | ||
return total; | ||
}; | ||
|
||
const PrixAllMk = () => { | ||
const specific = all50Mk[0]; | ||
const generalParts = general[0]; | ||
|
||
return calculateTotalPrice(specific, generalParts, ['pot']); | ||
}; | ||
|
||
const PrixAllTop = () => { | ||
const specific = all70top[0]; | ||
const generalParts = general[0]; | ||
|
||
return calculateTotalPrice(specific, generalParts, ['pot', 'roulement', 'embrayage', 'pipe', 'carbu']); | ||
}; | ||
|
||
const PrixAllAirsal = () => { | ||
const specific = all70airsal[0]; | ||
const generalParts = general[0]; | ||
|
||
return calculateTotalPrice(specific, generalParts, ['pot', 'roulement', 'embrayage', 'pipe', 'carbu']); | ||
}; | ||
|
||
const PrixAllAirsalAlu = () => { | ||
const specific = all70airsalAlu[0]; | ||
const generalParts = general[0]; | ||
|
||
return calculateTotalPrice(specific, generalParts, ['potVoca', 'roulement', 'embrayageMost', 'lamelleFibre', 'pipe', 'carbu24']); | ||
}; | ||
|
||
const PrixAllTopRose = () => { | ||
const specific = all75TopRose[0]; | ||
const generalParts = general[0]; | ||
|
||
return calculateTotalPrice(specific, generalParts, ['potVoca', 'roulement', 'embrayageMost', 'clapetVl6', 'pipe', 'carbu24']); | ||
}; | ||
export const config = [ | ||
{ | ||
allMk: PrixAllMk(), | ||
allTop: PrixAllTop(), | ||
allAirsal: PrixAllAirsal(), | ||
allAirsalAlu: PrixAllAirsalAlu(), | ||
allTopRose: PrixAllTopRose(), | ||
}, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters