| POST | /v1/OnlineShowroom/Stock | Search for Online Showroom Stock | Calls Vehicle Data API online showroom stock endpoint and searches for vehicles given a list of retailers. The results are used to populate the Online Showroom Stock datatable grid in OneAdmin |
|---|
#![allow(
dead_code,
non_camel_case_types,
non_snake_case,
clippy::upper_case_acronyms
)]
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct StockDataRow {
#[serde(rename = "commissionNumber")]
pub commission_number: String,
pub description: String,
#[serde(rename = "salesDescriptionLong")]
pub sales_description_long: String,
pub model: String,
pub colour: String,
#[serde(rename = "colourGroup")]
pub colour_group: String,
#[serde(rename = "fuelType")]
pub fuel_type: String,
pub transmission: String,
#[serde(rename = "transmissionType")]
pub transmission_type: String,
pub packages: String,
pub lines: String,
pub upholstery: String,
#[serde(rename = "upholsteryCode")]
pub upholstery_code: String,
#[serde(rename = "displayStockAgent")]
pub display_stock_agent: String,
pub location: String,
pub vin: String,
pub vid: String,
#[serde(rename = "vehicleType")]
pub vehicle_type: String,
#[serde(rename = "vehicleClass")]
pub vehicle_class: String,
#[serde(rename = "creationDate")]
pub creation_date: String,
#[serde(rename = "lastUpdated")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub last_updated: Option<String>,
#[serde(rename = "portArrivalDate")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub port_arrival_date: Option<String>,
#[serde(rename = "combinedGrossOfferValue")]
pub combined_gross_offer_value: f64,
#[serde(rename = "currentLocation")]
pub current_location: String,
#[serde(rename = "notVisibleOnlineShowroom")]
pub not_visible_online_showroom: bool,
#[serde(rename = "nvosReason")]
pub nvos_reason: String,
#[serde(rename = "nvosReasonOneAdminExcluded")]
pub nvos_reason_one_admin_excluded: bool,
#[serde(rename = "nvosReasonLinkedToBackOrder")]
pub nvos_reason_linked_to_back_order: bool,
#[serde(rename = "includedAfterDeduplication")]
pub included_after_deduplication: bool,
pub unique: bool,
pub duplicate: bool,
#[serde(rename = "duplicateGroup")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub duplicate_group: Option<i32>,
#[serde(rename = "lowestComm")]
pub lowest_comm: bool,
pub rule: String,
pub fin: String,
#[serde(rename = "chassisNumber")]
pub chassis_number: String,
#[serde(rename = "modelYear")]
pub model_year: String,
#[serde(rename = "modelYearCode")]
pub model_year_code: String,
#[serde(rename = "halfModelYearCode")]
pub half_model_year_code: String,
#[serde(rename = "fullModelYearCode")]
pub full_model_year_code: String,
#[serde(rename = "bodyStyle")]
pub body_style: String,
pub engine: String,
#[serde(rename = "cesarIdShipToParty")]
pub cesar_id_ship_to_party: String,
#[serde(rename = "vehicleUsageCode")]
pub vehicle_usage_code: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub acceleration: Option<f64>,
#[serde(rename = "bootCapacity")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub boot_capacity: Option<i32>,
#[serde(rename = "topSpeed")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub top_speed: Option<f64>,
#[serde(rename = "driveConcept")]
pub drive_concept: String,
#[serde(rename = "combustionPowerHp")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub combustion_power_hp: Option<f64>,
#[serde(rename = "electricPowerKw")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub electric_power_kw: Option<f64>,
#[serde(rename = "electricPowerHp")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub electric_power_hp: Option<f64>,
#[serde(rename = "combinedPowerKw")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub combined_power_kw: Option<f64>,
#[serde(rename = "combinedPowerHP")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub combined_power_h_p: Option<f64>,
#[serde(rename = "underOffer")]
pub under_offer: bool,
#[serde(rename = "isSellable")]
pub is_sellable: bool,
#[serde(rename = "mbukSecured")]
pub mbuk_secured: bool,
#[serde(rename = "isDisplayStock")]
pub is_display_stock: bool,
#[serde(rename = "isSpecialistCar")]
pub is_specialist_car: bool,
pub account: String,
#[serde(rename = "productRange")]
pub product_range: String,
#[serde(rename = "isAMG")]
pub is_a_m_g: bool,
#[serde(rename = "actualPrice")]
pub actual_price: f64,
#[serde(rename = "retailPrice_ExVAT")]
pub retail_price__ex_v_a_t: f64,
#[serde(rename = "retailPrice_IncVAT")]
pub retail_price__inc_v_a_t: f64,
pub otr: f64,
pub nst: String,
#[serde(rename = "bm7NST")]
pub bm7_n_s_t: String,
#[serde(rename = "electricRange")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub electric_range: Option<f64>,
#[serde(rename = "electricConsumption")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub electric_consumption: Option<f64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub emission: Option<f64>,
#[serde(rename = "emissionDirective")]
pub emission_directive: String,
#[serde(rename = "emissionCombined")]
pub emission_combined: String,
#[serde(rename = "emissionExtraUrban")]
pub emission_extra_urban: String,
#[serde(rename = "emissionUrban")]
pub emission_urban: String,
#[serde(rename = "energyEfficiencyClass")]
pub energy_efficiency_class: String,
#[serde(rename = "wltpEmissionCombined")]
pub wltp_emission_combined: String,
#[serde(rename = "wltpCombined")]
pub wltp_combined: String,
#[serde(rename = "wltpLow")]
pub wltp_low: String,
#[serde(rename = "wltpMedium")]
pub wltp_medium: String,
#[serde(rename = "wltpHigh")]
pub wltp_high: String,
#[serde(rename = "wltpExtraHigh")]
pub wltp_extra_high: String,
#[serde(rename = "totalMoneyOffersExclDiscretionary")]
pub total_money_offers_excl_discretionary: f64,
#[serde(rename = "discretionaryMoneyOffer")]
pub discretionary_money_offer: f64,
#[serde(rename = "totalMoneyOffersInclDiscretionary")]
pub total_money_offers_incl_discretionary: f64,
#[serde(rename = "nonDiscretionaryNMOCount")]
pub non_discretionary_n_m_o_count: i32,
#[serde(rename = "nonDiscretionaryMOCount")]
pub non_discretionary_m_o_count: i32,
#[serde(rename = "discretionaryNMOCount")]
pub discretionary_n_m_o_count: i32,
#[serde(rename = "discretionaryMOCount")]
pub discretionary_m_o_count: i32,
#[serde(rename = "totalOfferVIPAmount")]
pub total_offer_v_i_p_amount: f64,
#[serde(rename = "stockLevelIndicator")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub stock_level_indicator: Option<String>,
#[serde(rename = "confirmedProductionDate")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub confirmed_production_date: Option<String>,
#[serde(rename = "forecastedArrivalDate")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub forecasted_arrival_date: Option<String>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct OnlineShowroomStockResponse {
#[serde(rename = "totalVehicles")]
pub total_vehicles: i32,
pub vehicles: Vec<StockDataRow>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct OnlineShowroomStockRequest {
pub gssns: Vec<String>,
}
Rust OnlineShowroomStockRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/OnlineShowroom/Stock HTTP/1.1
Host: uat-api-vehicle-mgt-mb-dhc.rapp-customers.co.uk
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
gssns:
[
String
]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
totalVehicles: 0,
vehicles:
[
{
commissionNumber: String,
description: String,
salesDescriptionLong: String,
model: String,
colour: String,
colourGroup: String,
fuelType: String,
transmission: String,
transmissionType: String,
packages: String,
lines: String,
upholstery: String,
upholsteryCode: String,
displayStockAgent: String,
location: String,
vin: String,
vid: String,
vehicleType: String,
vehicleClass: String,
creationDate: 0001-01-01,
lastUpdated: 0001-01-01,
portArrivalDate: 0001-01-01,
combinedGrossOfferValue: 0,
currentLocation: String,
notVisibleOnlineShowroom: False,
nvosReason: String,
nvosReasonOneAdminExcluded: False,
nvosReasonLinkedToBackOrder: False,
includedAfterDeduplication: False,
unique: False,
duplicate: False,
duplicateGroup: 0,
lowestComm: False,
rule: String,
fin: String,
chassisNumber: String,
modelYear: String,
modelYearCode: String,
halfModelYearCode: String,
fullModelYearCode: String,
bodyStyle: String,
engine: String,
cesarIdShipToParty: String,
vehicleUsageCode: String,
acceleration: 0,
bootCapacity: 0,
topSpeed: 0,
driveConcept: String,
combustionPowerHp: 0,
electricPowerKw: 0,
electricPowerHp: 0,
combinedPowerKw: 0,
combinedPowerHP: 0,
underOffer: False,
isSellable: False,
mbukSecured: False,
isDisplayStock: False,
isSpecialistCar: False,
account: String,
productRange: String,
isAMG: False,
actualPrice: 0,
retailPrice_ExVAT: 0,
retailPrice_IncVAT: 0,
otr: 0,
nst: String,
bm7NST: String,
electricRange: 0,
electricConsumption: 0,
emission: 0,
emissionDirective: String,
emissionCombined: String,
emissionExtraUrban: String,
emissionUrban: String,
energyEfficiencyClass: String,
wltpEmissionCombined: String,
wltpCombined: String,
wltpLow: String,
wltpMedium: String,
wltpHigh: String,
wltpExtraHigh: String,
totalMoneyOffersExclDiscretionary: 0,
discretionaryMoneyOffer: 0,
totalMoneyOffersInclDiscretionary: 0,
nonDiscretionaryNMOCount: 0,
nonDiscretionaryMOCount: 0,
discretionaryNMOCount: 0,
discretionaryMOCount: 0,
totalOfferVIPAmount: 0,
stockLevelIndicator: String,
confirmedProductionDate: 0001-01-01,
forecastedArrivalDate: 0001-01-01
}
]
}