1use super::semantic_ids;
2
3#[derive(Debug, Clone, PartialEq)]
5pub struct SubmodelTemplate {
6 pub sector_key: &'static str,
8 pub semantic_id: &'static str,
10 pub version: &'static str,
12 pub is_placeholder: bool,
16}
17
18static SUBMODEL_TEMPLATES: &[SubmodelTemplate] = &[
19 SubmodelTemplate {
20 sector_key: "battery",
21 semantic_id: semantic_ids::BATTERY_TECHNICAL_DATA,
22 version: "6.0.0",
23 is_placeholder: false,
24 },
25 SubmodelTemplate {
26 sector_key: "textile",
27 semantic_id: semantic_ids::TEXTILE_MATERIAL,
28 version: "1.0",
29 is_placeholder: true,
30 },
31 SubmodelTemplate {
32 sector_key: "electronics",
33 semantic_id: semantic_ids::ELECTRONICS_PRODUCT_DATA,
34 version: "1.0",
35 is_placeholder: true,
36 },
37 SubmodelTemplate {
38 sector_key: "steel",
39 semantic_id: semantic_ids::STEEL_PRODUCT_DATA,
40 version: "1.0",
41 is_placeholder: true,
42 },
43 SubmodelTemplate {
44 sector_key: "construction",
45 semantic_id: semantic_ids::CONSTRUCTION_PRODUCT_DATA,
46 version: "1.0",
47 is_placeholder: true,
48 },
49 SubmodelTemplate {
50 sector_key: "tyre",
51 semantic_id: semantic_ids::TYRE_PRODUCT_DATA,
52 version: "1.0",
53 is_placeholder: true,
54 },
55 SubmodelTemplate {
56 sector_key: "toy",
57 semantic_id: semantic_ids::TOY_PRODUCT_DATA,
58 version: "1.0",
59 is_placeholder: true,
60 },
61 SubmodelTemplate {
62 sector_key: "aluminium",
63 semantic_id: semantic_ids::ALUMINIUM_PRODUCT_DATA,
64 version: "1.0",
65 is_placeholder: true,
66 },
67 SubmodelTemplate {
68 sector_key: "furniture",
69 semantic_id: semantic_ids::FURNITURE_PRODUCT_DATA,
70 version: "1.0",
71 is_placeholder: true,
72 },
73 SubmodelTemplate {
74 sector_key: "detergent",
75 semantic_id: semantic_ids::DETERGENT_PRODUCT_DATA,
76 version: "1.0",
77 is_placeholder: true,
78 },
79 SubmodelTemplate {
80 sector_key: "unsold-goods",
81 semantic_id: semantic_ids::UNSOLD_GOODS_REPORT,
82 version: "1.0",
83 is_placeholder: true,
84 },
85];
86
87pub fn sector_submodel_template(sector_key: &str) -> Option<&'static SubmodelTemplate> {
93 SUBMODEL_TEMPLATES
94 .iter()
95 .find(|t| t.sector_key == sector_key)
96}
97
98pub fn placeholder_templates() -> impl Iterator<Item = &'static SubmodelTemplate> {
102 SUBMODEL_TEMPLATES.iter().filter(|t| t.is_placeholder)
103}