summaryrefslogtreecommitdiff
path: root/src/models/mod.rs
blob: a252f5194e61c902759e2e78a7244158581afd1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
pub struct Part {
    pub key: u64,
    pub number: String,
    pub name: String,
    pub sources: Vec<u64>,
    pub categories: Vec<u64>,
    pub fits_cars: Vec<u64>,
}

#[derive(Serialize, Deserialize)]
pub struct Car {
    pub key: u64,
    pub doors: u8,
    //pub engine: Engine,
    pub make: String,
    pub model: String,
    //pub transmission: Transmission,
    pub trim: String,
    pub year: u16,
}

#[derive(Serialize, Deserialize)]
pub enum Source {
    Web(String),
}

#[derive(Serialize, Deserialize)]
pub struct Engine {
    cylinders: u8,
    displacement: u16,
    layout: Layout,
}

#[derive(Serialize, Deserialize)]
pub enum Layout {
    I,
    V,
}

#[derive(Serialize, Deserialize)]
pub struct Transmission(String);

#[derive(Serialize, Deserialize)]
pub struct Category(String);