ed_journals/modules/trading/models/
commodity_category.rs

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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
use std::fmt::{Display, Formatter};

use serde::{Deserialize, Serialize};

use crate::modules::trading::Commodity;

#[derive(Debug, Serialize, Deserialize, PartialEq, Clone)]
pub enum CommodityCategory {
    #[serde(rename = "$MARKET_category_chemicals;")]
    Chemicals,

    #[serde(rename = "$MARKET_category_consumer_items;")]
    ConsumerItems,

    #[serde(rename = "$MARKET_category_legal_drugs;")]
    LegalDrugs,

    #[serde(rename = "$MARKET_category_foods;")]
    Foods,

    #[serde(rename = "$MARKET_category_industrial_materials;")]
    IndustrialMaterials,

    #[serde(rename = "$MARKET_category_machinery;")]
    Machinery,

    #[serde(rename = "$MARKET_category_medicines;")]
    Medicines,

    #[serde(rename = "$MARKET_category_metals;")]
    Metals,

    #[serde(rename = "$MARKET_category_minerals;")]
    Minerals,

    #[serde(rename = "$MARKET_category_salvage;")]
    Salvage,

    #[serde(rename = "$MARKET_category_slaves;")]
    Slaves,

    #[serde(rename = "$MARKET_category_technology;")]
    Technology,

    #[serde(rename = "$MARKET_category_textiles;")]
    Textiles,

    #[serde(rename = "$MARKET_category_waste;")]
    Waste,

    #[serde(rename = "$MARKET_category_weapons;")]
    Weapons,

    #[serde(rename = "$MARKET_category_rare;")]
    Rare,

    Powerplay,

    None,

    #[cfg(feature = "allow-unknown")]
    #[cfg_attr(docsrs, doc(cfg(feature = "allow-unknown")))]
    #[serde(untagged)]
    Unknown(String),
}

impl From<Commodity> for CommodityCategory {
    fn from(value: Commodity) -> Self {
        match value {
            Commodity::AgronomicTreatment
            | Commodity::Explosives
            | Commodity::HydrogenFuel
            | Commodity::HydrogenPeroxide
            | Commodity::LiquidOxygen
            | Commodity::MineralOil
            | Commodity::NerveAgents
            | Commodity::Pesticides
            | Commodity::RockforthFertiliser
            | Commodity::SurfaceStabilisers
            | Commodity::SyntheticReagents
            | Commodity::Tritium
            | Commodity::Water => CommodityCategory::Chemicals,

            Commodity::Clothing
            | Commodity::ConsumerTechnology
            | Commodity::DomesticAppliances
            | Commodity::EvacuationShelter
            | Commodity::SurvivalEquipment => CommodityCategory::ConsumerItems,

            Commodity::Beer
            | Commodity::BootlegLiquor
            | Commodity::Liquor
            | Commodity::Narcotics
            | Commodity::OnionheadGammaStrain
            | Commodity::Tobacco
            | Commodity::Wine => CommodityCategory::LegalDrugs,

            Commodity::Algae
            | Commodity::AnimalMeat
            | Commodity::Coffee
            | Commodity::Fish
            | Commodity::FoodCartridges
            | Commodity::FruitAndVegetables
            | Commodity::Grain
            | Commodity::SyntheticMeat
            | Commodity::Tea => CommodityCategory::Foods,

            Commodity::CeramicComposites
            | Commodity::CMMComposite
            | Commodity::InsulatingMembrane
            | Commodity::MetaAlloys
            | Commodity::MicroWeaveCoolingHoses
            | Commodity::NeofabricInsulation
            | Commodity::Polymers
            | Commodity::Semiconductors
            | Commodity::Superconductors => CommodityCategory::IndustrialMaterials,

            Commodity::ArticulationMotors
            | Commodity::AtmosphericProcessors
            | Commodity::BuildingFabricators
            | Commodity::CropHarvesters
            | Commodity::EmergencyPowerCells
            | Commodity::EnergyGridAssembly
            | Commodity::ExhaustManifold
            | Commodity::GeologicalEquipment
            | Commodity::HeatsinkInterlink
            | Commodity::HNShockMount
            | Commodity::IonDistributor
            | Commodity::MagneticEmitterCoil
            | Commodity::MarineEquipment
            | Commodity::MicrobialFurnaces
            | Commodity::MineralExtractors
            | Commodity::ModularTerminals
            | Commodity::PowerConverter
            | Commodity::PowerGenerators
            | Commodity::PowerTransferBus
            | Commodity::RadiationBaffle
            | Commodity::ReinforcedMountingPlate
            | Commodity::SkimerComponents
            | Commodity::ThermalCoolingUnits
            | Commodity::WaterPurifiers => CommodityCategory::Machinery,

            Commodity::AdvancedMedicines
            | Commodity::AgriMedicines
            | Commodity::BasicMedicines
            | Commodity::CombatStabilisers
            | Commodity::PerformanceEnhancers
            | Commodity::ProgenitorCells => CommodityCategory::Medicines,

            Commodity::Aluminium
            | Commodity::Beryllium
            | Commodity::Bismuth
            | Commodity::Cobalt
            | Commodity::Copper
            | Commodity::Gallium
            | Commodity::Gold
            | Commodity::Hafnium178
            | Commodity::Indium
            | Commodity::Lanthanum
            | Commodity::Lithium
            | Commodity::Osmium
            | Commodity::Palladium
            | Commodity::Platinum
            | Commodity::Praseodymium
            | Commodity::Samarium
            | Commodity::Silver
            | Commodity::Tantalum
            | Commodity::Thallium
            | Commodity::Thorium
            | Commodity::Titanium
            | Commodity::Uranium => CommodityCategory::Metals,

            Commodity::Alexandrite
            | Commodity::Bauxite
            | Commodity::Benitoite
            | Commodity::Bertrandite
            | Commodity::Bromellite
            | Commodity::Coltan
            | Commodity::Cryolite
            | Commodity::Gallite
            | Commodity::Goslarite
            | Commodity::Grandidierite
            | Commodity::Indite
            | Commodity::Jadeite
            | Commodity::Lepidolite
            | Commodity::LithiumHydroxide
            | Commodity::LowTemperatureDiamonds
            | Commodity::MethaneClathrate
            | Commodity::MethanolMonohydrateCrystals
            | Commodity::Moissanite
            | Commodity::Monazite
            | Commodity::Musgravite
            | Commodity::Painite
            | Commodity::Pyrophyllite
            | Commodity::Rhodplumsite
            | Commodity::Rutile
            | Commodity::Serendibite
            | Commodity::Taaffeite
            | Commodity::Uraninite
            | Commodity::VoidOpal => CommodityCategory::Minerals,

            Commodity::AIRelics
            | Commodity::AncientArtefact
            | Commodity::AncientKey
            | Commodity::AnomalyParticles
            | Commodity::AntimatterContainmentUnit
            | Commodity::AntiqueJewellery
            | Commodity::Antiquities
            | Commodity::AssaultPlans
            | Commodity::BlackBox
            | Commodity::BoneFragments
            | Commodity::CausticTissueSample
            | Commodity::CommercialSamples
            | Commodity::CoralSap
            | Commodity::CystSpecimen
            | Commodity::DamagedEscapePod
            | Commodity::DataCore
            | Commodity::DiplomaticBag
            | Commodity::EarthRelics
            | Commodity::EncryptedCorrespondence
            | Commodity::EncryptedDataStorage
            | Commodity::ExperimentalChemicals
            | Commodity::FossilRemnants
            | Commodity::GeneBank
            | Commodity::GeologicalSamples
            | Commodity::GuardianCasket
            | Commodity::GuardianOrb
            | Commodity::GuardianRelic
            | Commodity::GuardianTablet
            | Commodity::GuardianTotem
            | Commodity::GuardianUrn
            | Commodity::Hostages
            | Commodity::ImpureSpireMineral
            | Commodity::LargeSurveyDataCache
            | Commodity::MilitaryIntelligence
            | Commodity::MilitaryPlans
            | Commodity::MolluscBrainTissue
            | Commodity::MolluscFluid
            | Commodity::MolluscMembrane
            | Commodity::MolluscMycelium
            | Commodity::MolluscSoftTissue
            | Commodity::MolluscSpores
            | Commodity::MysteriousIdol
            | Commodity::OccupiedEscapePod
            | Commodity::OrganSample
            | Commodity::PersonalEffects
            | Commodity::PodCoreTissue
            | Commodity::PodDeadTissue
            | Commodity::PodMesoglea
            | Commodity::PodOuterTissue
            | Commodity::PodShellTissue
            | Commodity::PodSurfaceTissue
            | Commodity::PodTissue
            | Commodity::PoliticalPrisoners
            | Commodity::PreciousGems
            | Commodity::ProhibitedResearchMaterials
            | Commodity::ProtectiveMembraneScrap
            | Commodity::PrototypeTech
            | Commodity::RareArtwork
            | Commodity::RebelTransmissions
            | Commodity::SAP8CoreContainer
            | Commodity::ScientificResearch
            | Commodity::ScientificSamples
            | Commodity::SemiRefinesSpireMineral
            | Commodity::SmallSurveyDataCache
            | Commodity::SpacePioneerRelics
            | Commodity::TacticalData
            | Commodity::TechnicalBlueprints
            | Commodity::ThargoidBasiliskTissueSample
            | Commodity::ThargoidBioStorageCapsule
            | Commodity::ThargoidBiologicalMatter
            | Commodity::ThargoidCyclopsTissueSample
            | Commodity::ThargoidGlaiveTissueSample
            | Commodity::ThargoidHeart
            | Commodity::ThargoidHydraTissueSample
            | Commodity::ThargoidLink
            | Commodity::ThargoidMedusaTissueSample
            | Commodity::ThargoidOrthrusTissueSample
            | Commodity::ThargoidGeneratorTissueSample
            | Commodity::ThargoidProbe
            | Commodity::ThargoidResin
            | Commodity::ThargoidScoutTissueSample
            | Commodity::ThargoidScytheTissueSample
            | Commodity::ThargoidSensor
            | Commodity::ThargoidTechnologySamples
            | Commodity::TimeCapsule
            | Commodity::TitanDeepTissueSample
            | Commodity::TitanDriveComponent
            | Commodity::TitanMawDeepTissueSample
            | Commodity::TitanMawPartialTissueSample
            | Commodity::TitanMawTissueSample
            | Commodity::TitanPartialTissueSample
            | Commodity::TitanTissueSample
            | Commodity::TradeData
            | Commodity::TrinketsOfHiddenFortune
            | Commodity::UnclassifiedRelic
            | Commodity::UnoccupiedEscapePod
            | Commodity::UnstableDataCore
            | Commodity::WreckageComponents => CommodityCategory::Salvage,

            Commodity::ImperialSlaves | Commodity::Slaves => CommodityCategory::Slaves,

            Commodity::AdvancedCatalysers
            | Commodity::AnimalMonitors
            | Commodity::AquaponicSystems
            | Commodity::AutoFabricators
            | Commodity::BioreducingLichen
            | Commodity::ComputerComponents
            | Commodity::HESuits
            | Commodity::HardwareDiagnosticSensor
            | Commodity::LandEnrichmentSystems
            | Commodity::MedicalDiagnosticEquipment
            | Commodity::MicroControllers
            | Commodity::MuonImager
            | Commodity::Nanobreakers
            | Commodity::ResonatingSeparators
            | Commodity::Robotics
            | Commodity::StructuralRegulators
            | Commodity::TelemetrySuite => CommodityCategory::Technology,

            Commodity::ConductiveFabrics
            | Commodity::Leather
            | Commodity::MilitaryGradeFabrics
            | Commodity::NaturalFabrics
            | Commodity::SyntheticFabrics => CommodityCategory::Textiles,

            Commodity::Biowaste
            | Commodity::ChemicalWaste
            | Commodity::Scrap
            | Commodity::ToxicWaste => CommodityCategory::Waste,

            Commodity::BattleWeapons
            | Commodity::Landmines
            | Commodity::NonLethalWeapons
            | Commodity::PersonalWeapons
            | Commodity::ReactiveArmour => CommodityCategory::Weapons,

            Commodity::JaquesQuinentianStill
            | Commodity::KinagoViolins
            | Commodity::ApaVietii
            | Commodity::GeawenDanceDust
            | Commodity::VanayequiCeratomorphaFur
            | Commodity::KaretiiCouture
            | Commodity::MukusubiiChitinos
            | Commodity::UltraCompactProcessorPrototypes
            | Commodity::EleuThermals
            | Commodity::KamorinHistoricWeapons
            | Commodity::CeremonialHeikeTea
            | Commodity::VidavantianLace
            | Commodity::KachiriginFilterLeeches
            | Commodity::LyraeWeed
            | Commodity::GalacticTravelGuide
            | Commodity::HarmaSilverSeaRum
            | Commodity::NgadandariFireOpals
            | Commodity::AlyaBodySoap
            | Commodity::HelvetitjPearls
            | Commodity::OchoengChillies
            | Commodity::OnionheadBetaStrain
            | Commodity::KamitraCigars
            | Commodity::NjangariSaddles
            | Commodity::HipOrganophosphates
            | Commodity::GilyaSignatureWeapons
            | Commodity::HR7221Wheat
            | Commodity::WheemeteWheatCakes
            | Commodity::RajukruMultiStoves
            | Commodity::Nanomedicines
            | Commodity::NonEuclidianExotanks
            | Commodity::NgunaModernAntiques
            | Commodity::XiheBiomorphicCompanions
            | Commodity::EsusekuCaviar
            | Commodity::OrrerianViciousBrew
            | Commodity::VHerculisBodyRub
            | Commodity::VoidExtractCoffee
            | Commodity::UszaianTreeGrub
            | Commodity::HaidenBlackBrew
            | Commodity::MotronaExperienceJelly
            | Commodity::JaradharrePuzzleBox
            | Commodity::PersonalGifts
            | Commodity::MulachiGiantFungus
            | Commodity::LTTHyperSweet
            | Commodity::MedbStarlube
            | Commodity::GiantVerrix
            | Commodity::HIP118311Swarm
            | Commodity::DisoMaCorn
            | Commodity::LavianBrandy
            | Commodity::AzureMilk
            | Commodity::LeestianEvilJuice
            | Commodity::CoquimSpongiformVictuals
            | Commodity::LeatheryEggs
            | Commodity::ShansCharisOrchid
            | Commodity::KonggaAle
            | Commodity::VegaSlimweed
            | Commodity::TiolceWaste2PasteUnits
            | Commodity::OphiuchExinoArtefacts
            | Commodity::AltairianSkin
            | Commodity::AganippeRush
            | Commodity::CD75KittenBrandCoffee
            | Commodity::HavasupaiDreamCatcher
            | Commodity::EraninPearlWhisky
            | Commodity::PavonisEarGrubs
            | Commodity::OnionheadAlphaStrain
            | Commodity::IndiBourbon
            | Commodity::BakedGreebles
            | Commodity::KarsukiLocusts
            | Commodity::MasterChefs
            | Commodity::YasoKondiLeaf
            | Commodity::BurnhamBileDistillate
            | Commodity::TheHuttonMug
            | Commodity::CentauriMegaGin
            | Commodity::UtgaroarMillennialEggs
            | Commodity::SoontillRelics
            | Commodity::ZeesszeAntGrubGlue
            | Commodity::TheWatersOfShintara
            | Commodity::BaltahsineVacuumKrill
            | Commodity::SanumaDecorativeMeat
            | Commodity::GiantIrukamaSnails
            | Commodity::AnduligaFireWorks
            | Commodity::CrystallineSpheres
            | Commodity::PantaaPrayerSticks
            | Commodity::ChiEridaniMarinePaste
            | Commodity::EthgrezeTeaBuds
            | Commodity::DeltaPhoenicisPalms
            | Commodity::TarachSpice
            | Commodity::WulpaHyperboreSystems
            | Commodity::LiveHecateSeaWorms
            | Commodity::KoroKungPellets
            | Commodity::BastSnakeGin
            | Commodity::TerraMaterBloodBores
            | Commodity::WuthieloKuFroth
            | Commodity::HonestyPills
            | Commodity::CromSilverFesh
            | Commodity::BorasetaniPathogenetics
            | Commodity::CetiRabbits
            | Commodity::AepyornisEgg
            | Commodity::UzumokuLowGWings
            | Commodity::CherbonesBloodCrystals
            | Commodity::ToxandjiVirocide
            | Commodity::Onionhead
            | Commodity::LucanOnionhead
            | Commodity::TanmarkTranquilTea
            | Commodity::ThrutisCream
            | Commodity::AlacarakmoSkinArt
            | Commodity::PlatinumAlloy
            | Commodity::MokojingBeastFeast
            | Commodity::EdenApplesOfAerial
            | Commodity::ChameleonCloth
            | Commodity::TauriChimes
            | Commodity::RusaniOldSmokey
            | Commodity::AZCancriFormula42
            | Commodity::GomanYauponCoffee
            | Commodity::GerasianGueuzeBeer
            | Commodity::JarouaRice
            | Commodity::AnyNaCoffee
            | Commodity::FujinTea
            | Commodity::HIP10175BushMeat
            | Commodity::MomusBogSpaniel
            | Commodity::WitchhaulKobeBeef
            | Commodity::SaxonWine
            | Commodity::AroucaConventualSweets
            | Commodity::AlbinoQuechuaMammothMeat
            | Commodity::Duradrives
            | Commodity::HolvaDuellingBlades
            | Commodity::RapaBaoSnakeSkins
            | Commodity::WolfFesh
            | Commodity::EshuUmbrellas
            | Commodity::NeritusBerries
            | Commodity::JotunMookah
            | Commodity::ChateauDeAegaeon
            | Commodity::BelalansRayLeather
            | Commodity::DamnaCarapaces
            | Commodity::HIPProtoSquid
            | Commodity::MechucosHighTea
            | Commodity::DeuringasTruffles
            | Commodity::BankiAmphibiousLeather
            | Commodity::SothisCrystallineGold
            | Commodity::TiegfriesSynthSilk
            | Commodity::VolkhabBeeDrones
            | Commodity::BuckyballBeerMats
            | Commodity::ClassifiedExperimentalEquipment => CommodityCategory::Rare,

            Commodity::SiriusIndustrialEquipment
            | Commodity::SiriusCommercialContracts
            | Commodity::SiriusFranchisePackage
            | Commodity::AislingMediaMaterials
            | Commodity::AislingPromotionalMaterials
            | Commodity::AislingMediaResources
            | Commodity::TorvalCommercialContracts
            | Commodity::TorvalDeeds
            | Commodity::PatreusFieldSupplies
            | Commodity::RepublicanFieldSupplies
            | Commodity::RepublicanGarisonSupplies
            | Commodity::LiberalCampaignMaterials
            | Commodity::AllianceLegaslativeContracts
            | Commodity::AllianceLegaslativeRecords
            | Commodity::FederalTradeContracts
            | Commodity::PatreusGarrisonSupplies
            | Commodity::LavignyGarrisonSupplies
            | Commodity::LavignyCorruptionDossiers
            | Commodity::LavignyFieldSupplies => CommodityCategory::Powerplay,

            Commodity::Limpet => CommodityCategory::None,

            #[cfg(feature = "allow-unknown")]
            Commodity::Unknown(value) => {
                CommodityCategory::Unknown(format!("Unknown commodity: '{}'", value))
            }
        }
    }
}

impl Display for CommodityCategory {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            "{}",
            match self {
                CommodityCategory::Chemicals => "Chemicals",
                CommodityCategory::ConsumerItems => "Consumer Items",
                CommodityCategory::LegalDrugs => "Legal Drugs",
                CommodityCategory::Foods => "Foods",
                CommodityCategory::IndustrialMaterials => "Industrial Materials",
                CommodityCategory::Machinery => "Machinery",
                CommodityCategory::Medicines => "Medicines",
                CommodityCategory::Metals => "Metals",
                CommodityCategory::Minerals => "Minerals",
                CommodityCategory::Salvage => "Salvage",
                CommodityCategory::Slaves => "Slaves",
                CommodityCategory::Technology => "Technology",
                CommodityCategory::Textiles => "Textiles",
                CommodityCategory::Waste => "Waste",
                CommodityCategory::Weapons => "Weapons",
                CommodityCategory::Rare => "Rare",
                CommodityCategory::Powerplay => "Powerplay",
                CommodityCategory::None => "None",

                #[cfg(feature = "allow-unknown")]
                CommodityCategory::Unknown(unknown) => unknown,
            }
        )
    }
}