forked from Yara724/api
YARA-833
This commit is contained in:
73
src/static/outer-car-parts-catalog.ts
Normal file
73
src/static/outer-car-parts-catalog.ts
Normal file
@@ -0,0 +1,73 @@
|
||||
export enum ClaimVehicleTypeV2 {
|
||||
SEDAN = "sedan",
|
||||
SUV = "suv",
|
||||
HATCHBACK = "hatchback",
|
||||
PICKUP = "pickup",
|
||||
VAN = "van",
|
||||
}
|
||||
|
||||
export enum OuterPartSideV2 {
|
||||
LEFT = "left",
|
||||
RIGHT = "right",
|
||||
FRONT = "front",
|
||||
BACK = "back",
|
||||
TOP = "top",
|
||||
}
|
||||
|
||||
export type OuterPartCatalogItem = {
|
||||
id: number;
|
||||
key: string;
|
||||
titleFa: string;
|
||||
side: OuterPartSideV2;
|
||||
carType?: ClaimVehicleTypeV2;
|
||||
};
|
||||
|
||||
const baseFor = (offset: number): OuterPartCatalogItem[] => [
|
||||
// left
|
||||
{ id: offset + 1, key: "left_backfender", titleFa: "گلگیر عقب", side: OuterPartSideV2.LEFT },
|
||||
{ id: offset + 2, key: "left_backWheel", titleFa: "چرخ عقب", side: OuterPartSideV2.LEFT },
|
||||
{ id: offset + 3, key: "left_backDoor", titleFa: "در عقب", side: OuterPartSideV2.LEFT },
|
||||
{ id: offset + 4, key: "left_frontDoor", titleFa: "در جلو", side: OuterPartSideV2.LEFT },
|
||||
{ id: offset + 5, key: "left_mirror", titleFa: "آیینه", side: OuterPartSideV2.LEFT },
|
||||
{ id: offset + 6, key: "left_frontWheel", titleFa: "چرخ جلو", side: OuterPartSideV2.LEFT },
|
||||
{ id: offset + 7, key: "left_frontFender", titleFa: "گلگیر جلو", side: OuterPartSideV2.LEFT },
|
||||
{ id: offset + 8, key: "left_backWindow", titleFa: "شیشه عقب", side: OuterPartSideV2.LEFT },
|
||||
{ id: offset + 9, key: "left_frontWindow", titleFa: "شیشه جلو", side: OuterPartSideV2.LEFT },
|
||||
// right
|
||||
{ id: offset + 10, key: "right_backfender", titleFa: "گلگیر عقب", side: OuterPartSideV2.RIGHT },
|
||||
{ id: offset + 11, key: "right_backWheel", titleFa: "چرخ عقب", side: OuterPartSideV2.RIGHT },
|
||||
{ id: offset + 12, key: "right_backDoor", titleFa: "در عقب", side: OuterPartSideV2.RIGHT },
|
||||
{ id: offset + 13, key: "right_frontDoor", titleFa: "در جلو", side: OuterPartSideV2.RIGHT },
|
||||
{ id: offset + 14, key: "right_mirror", titleFa: "آیینه", side: OuterPartSideV2.RIGHT },
|
||||
{ id: offset + 15, key: "right_frontWheel", titleFa: "چرخ جلو", side: OuterPartSideV2.RIGHT },
|
||||
{ id: offset + 16, key: "right_frontFender", titleFa: "گلگیر جلو", side: OuterPartSideV2.RIGHT },
|
||||
{ id: offset + 17, key: "right_backWindow", titleFa: "شیشه عقب", side: OuterPartSideV2.RIGHT },
|
||||
{ id: offset + 18, key: "right_frontWindow", titleFa: "شیشه جلو", side: OuterPartSideV2.RIGHT },
|
||||
// front
|
||||
{ id: offset + 19, key: "front_frontBumper", titleFa: "سپر جلو", side: OuterPartSideV2.FRONT },
|
||||
{ id: offset + 20, key: "front_frontCarWindshield", titleFa: "شیشه جلو", side: OuterPartSideV2.FRONT },
|
||||
{ id: offset + 21, key: "front_carHood", titleFa: "کاپوت", side: OuterPartSideV2.FRONT },
|
||||
{ id: offset + 22, key: "front_leftLight", titleFa: "چراغ چپ", side: OuterPartSideV2.FRONT },
|
||||
{ id: offset + 23, key: "front_rightLight", titleFa: "چراغ راست", side: OuterPartSideV2.FRONT },
|
||||
{ id: offset + 24, key: "front_frontGrille", titleFa: "جلو پنجره", side: OuterPartSideV2.FRONT },
|
||||
// back
|
||||
{ id: offset + 25, key: "back_backBumper", titleFa: "سپر عقب", side: OuterPartSideV2.BACK },
|
||||
{ id: offset + 26, key: "back_carTrunk", titleFa: "صندوق عقب", side: OuterPartSideV2.BACK },
|
||||
{ id: offset + 27, key: "back_backCarWindshield", titleFa: "شیشه عقب", side: OuterPartSideV2.BACK },
|
||||
{ id: offset + 28, key: "back_leftLight", titleFa: "چراغ چپ", side: OuterPartSideV2.BACK },
|
||||
{ id: offset + 29, key: "back_rightLight", titleFa: "چراغ راست", side: OuterPartSideV2.BACK },
|
||||
// top
|
||||
{ id: offset + 30, key: "top_roof", titleFa: "سقف", side: OuterPartSideV2.TOP },
|
||||
];
|
||||
|
||||
export const OUTER_PARTS_BY_CAR_TYPE: Record<
|
||||
ClaimVehicleTypeV2,
|
||||
OuterPartCatalogItem[]
|
||||
> = {
|
||||
[ClaimVehicleTypeV2.SEDAN]: baseFor(0),
|
||||
[ClaimVehicleTypeV2.SUV]: baseFor(100),
|
||||
[ClaimVehicleTypeV2.HATCHBACK]: baseFor(200),
|
||||
[ClaimVehicleTypeV2.PICKUP]: baseFor(300),
|
||||
[ClaimVehicleTypeV2.VAN]: baseFor(400),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user