Skip to main content

Audi Ordering: Decisions

The choices the Audi implementation makes on top of AccessAudi Ordering. Only decisions new for Audi are here; the cross-OEM architecture is in the ordering platform ADRs.

1. Dry-run validation via structured rules​

AccessAudi publishes its option rules as data (modelOptionRulesBean) and has no validation call. The ordering service evaluates the collected rules against the candidate itself, in a rule engine under oem/audi/validator.py. Validating a build needs no OMS call. Pricing a build needs one. The cure calls getAdditionalCharges, a read-only OMS call (section 11).

2. Rules come from the product-data collection job​

The rule documents are read from the collected product_models snapshots. The product-data collection job gets a wider refresh window than inventory. Fetching rules during the run through getOptions remains an option if collected rules prove too stale.

3. The cure matches the OMS frontend's auto-selection​

The frontend auto-selects a member of an unsatisfied required option group. The cure does the same, so a configuration we submit matches what the same selections would produce in the OMS. Option codes missing from the model's configurator are dropped before the rules run and recorded on the cure, as the Stellantis flow drops codes its wizard cannot select. Caps on the count and the total price of auto-selected options bound the cure. A candidate over either cap is refused.

4. A dry run stops before addToPendingSubmission​

addToPendingSubmission writes to the OMS and consumes allocation, so the dry/execute boundary is before it. A stage run adds the row and stops before submitPendingSubmissions, and a person submits or discards it in the OMS. An execute run with ordering enabled is refused before it starts, because the Audi profile sets submits_orders off. A cancellation run removes the rows a stage run added through deletePendingSubmissions, which returns the allocation the rows consumed.

5. A submit is never retried​

The submission calls have no idempotency key, so a submit is never retried on an unknown outcome. AccessAudi Ordering describes how that outcome is reconciled instead.

6. Each model's allocation bounds its volume target​

The allocation is an upper bound on a run's volume. AccessAudi allocates per model code (Allocation). The run gives the volume optimization one allocation per model code, so the optimization never moves units between the models of a carline. When the optimization finds a model over-supplied, the run orders fewer units than the allocation allows, and the dealer decides what to do with the unfilled slots. The bound per model is its restriction's caculatedRemainingAllocation plus its existPendingConfiguraionQuantity in the allocation snapshot's raw_blob. The restriction's remainingAllocation already includes the pending units, so adding the pending quantity to it would count them twice. Pending units count toward the bound because the run cancels every pending submission for its models before it places anything (decision 8). The allocation snapshot table's restrictions column has no pending quantity. A model code in the allocation with no model in consolidated/models gets no target. A carline whose "NoRestriction" entry has units fails the run, since those units could go to any of its models. When a submit re-reads the remainder and finds it gone, the run ends that carline's scope and continues with the next (ADR-015).

A run with volume_optimization.fill_allocations set orders each model's full bound instead. It records the usual solve, which treats each bound as an upper limit, as its recommendation. It builds its targets from a second solve, in which each model's volume equals its bound (Filling every allocation).

7. order_id is the OMS commission number​

The submit assigns the OMS commission number, which the attempt records as order_id. The factory commission number is a different identifier and stays in the attempt's raw payload.

8. A run cancels every pending submission before it places​

When an allocation opens, Audi fills the dealer's pending submissions with pre-builds from its regional templates. Every run cancels every pending submission on the carlines the dealer holds allocation for, whatever volume the run then orders, and treats all of them as pre-builds. A run whose target filter lists models cancels for those models only. The same step removes what an earlier run staged, so a re-run replaces it. The run starts the cancellation workflow as a child (ADR-017). Each cancelled order keeps the OMS echo, including the login that added it.

9. The cure applies dealer preferences​

The cure reads the dealer's option-code rules for the candidate's model. When it fills a required option group, it skips must-not-have codes, and it refuses the candidate when every remaining member is one. A must-have code that the OMS configurator lacks is still dropped, with a warning, because the OMS cannot build it.

10. Submit sends the configurator's MSRP​

submit computes the MSRP that the configurator page shows and sends it with the pending submission:

  • The model's price comes from its consolidated/models row, which is its base trim's. A higher trim is an option of the build, priced like the other options.
  • Color and option prices come from the product_models snapshot.
  • getAdditionalCharges adds the remaining charges for the configured build.

A model whose base trim has no price is sent with msrp 0. When getAdditionalCharges fails, the order is sent with an msrp that excludes the additional charges.

11. The report takes missing prices from the warehouse​

The dealer report prices each build from the sources in section 10. Where AccessAudi gives no price, the report takes one from the warehouse:

  • An option or color that the product_models snapshot prices at 0 is priced from consolidated/features. A package is priced from the package's own row. The rows of the codes the package includes are left out.
  • A trim is priced from its feature row, whose price is the trim's MSRP minus the base trim's.
  • The additional charges are the amount getAdditionalCharges returned for the build. The cure calls it for every build it does not refuse, in dry runs too. submit calls it again for the order it sends. When the call fails or returns 0, the report uses the base trim's destination_charge instead.

The msrp sent to AccessAudi is the one section 10 describes. It uses none of the warehouse prices above. validate_and_cure and submit set the cured candidate's total_price to the build's price in the report. An attempt and its run events record that total_price.

The report notes "Some option prices are estimated." when an option, color or trim is priced from the warehouse. A destination_charge alone does not add the note. When neither getAdditionalCharges nor destination_charge gives an amount, the report notes that the additional charges are excluded.

Some models have no prices in the product_models snapshot. On the MY2027 Q5 (GUBAAY), for example, every color and option is priced at 0. When the warehouse has no option prices for the model either, the report shows an asterisk in place of the MSRP, and a note below the model's option codes says why.

12. Report images come from Audi's public configurator​

Audi has no COSY renders. A build's image in the dealer report comes from OneGraph's configuredCar query, the query behind the audiusa.com configurator. The query takes:

  • the model code and model year
  • the model's model_extensions from consolidated/models, which are its base trim's, with the build's trim code in place of any trim code among them. The trim is sent as an extension, not as an option. Where the configurator has no carline for that trim, the image is requested again without it, with the trim code as an option. On the A8, WPT is the Executive Plus Package, and no carline has it.
  • the exterior and interior colors
  • the build's options, in public codes (see section 13)

A single option code that the configurator does not list fails the whole query. The client therefore reads the model's feature catalog first and sends only the listed codes.

When the configurator reports a conflict, its response has a configuration that resolves it. That configuration can have a different interior, added options and removed options. The client adopts it, at most twice. The exterior color does not change, but the render can show options that the build does not list and leave out options that it does.

The client first renders the model with its colors and no options, then adds the options. If the configurator cannot render the options, the report shows the render without them. Only a build whose colors the configurator cannot render shows the fallback silhouette. The report embeds the render as a 480-pixel PNG with a transparent background.

13. The cure orders in AccessAudi's codes​

Candidates hold the public codes that consolidated tables are keyed on. AccessAudi orders some features under other codes. On the MY2027 Q7 (G8BAYA), for example, the 21" black optic package is PFZ in the public catalog and XBO in AccessAudi. AccessAudi also orders a model's trim, such as Premium Plus (WPS), as an option on the base model code.

Before the cure, the service reads the model's codes from consolidated tables and changes the build:

  • Each option code becomes its ordering_code from consolidated/features, where one is set.
  • A code with a different ordering code for each interior becomes the code that ordering_codes_by_interior pairs with the build's interior. The MY2027 A5's Executive package, WPS, is XBL with the FW interior and XBR with NK. A candidate whose interior has no such code is refused as unmappable, because the feature's rule requires one of the interiors that have one.
  • A code that a package in the build includes is removed, because AccessAudi orders the package and not its contents. parent_package_code names the package. Only packages among the build's options count. The options are the candidate's codes on the model's order form (output/order_form_features), without the exterior and the interior. The order form lists no fixed equipment, so the codes that the interior or fixed equipment includes stay.

A higher trim is one of the candidate's options, a feature like a package, so these steps order it by its ordering_code, such as XPP, and remove the equipment it includes.

The dealer's Must Haves / Must Not Haves are converted the same way, so a package's contents count as present when the package is. A Must Not Have with a code per interior excludes every one of those codes. A Must Have with no code for the build's interior is left out, with a warning that names the interior. The pending submission sends the converted codes. Each stored build snapshot and the cured candidate keep the public codes, plus the contents of each package, so dealer preferences and the dashboard match them.

The dealer report shows AccessAudi's codes, because a dealer who changes an order in AccessAudi sees those. Its report_build records the public code of each option whose codes differ, in public_codes.

14. Sold-order options are restricted at selection​

A run never places a sold order, so it cannot order an option whose rule has soldOrder: true. Selection compares public codes, so for each model of a scope, construct_targets gives the scope a must-not-have PRODUCTION_RESTRICTION on a public code when every code AccessAudi orders it by is sold-order (section 13). Candidate selection then never picks a build with it, and the recommendation records the restriction.

A public code with a code per interior can be sold-order with one interior and not another. Such a code is not restricted, so selection keeps its stock-orderable builds. The cure checks soldOrder on the code the build's interior resolves to, and refuses the build when that code is sold-order.