<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arthur morgan</title>
    <description>The latest articles on DEV Community by Arthur morgan (@arthur_morgan_66e6bebd3d1).</description>
    <link>https://dev.to/arthur_morgan_66e6bebd3d1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4072536%2F236fed35-355f-4250-876c-49fee0a8d050.png</url>
      <title>DEV Community: Arthur morgan</title>
      <link>https://dev.to/arthur_morgan_66e6bebd3d1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arthur_morgan_66e6bebd3d1"/>
    <language>en</language>
    <item>
      <title>Why Vehicle Fitment Is a Composite-Key Problem (With TypeScript)</title>
      <dc:creator>Arthur morgan</dc:creator>
      <pubDate>Tue, 11 Aug 2026 08:06:38 +0000</pubDate>
      <link>https://dev.to/arthur_morgan_66e6bebd3d1/why-vehicle-fitment-is-a-composite-key-problem-with-typescript-2mjm</link>
      <guid>https://dev.to/arthur_morgan_66e6bebd3d1/why-vehicle-fitment-is-a-composite-key-problem-with-typescript-2mjm</guid>
      <description>&lt;p&gt;A customer enters a year, make, and model, and the system returns a compatible engine or transmission. That sounds like an ordinary lookup:&lt;/p&gt;

&lt;p&gt;2015 + Ford + Mustang = compatible components&lt;/p&gt;

&lt;p&gt;In practice, this key is incomplete. Two vehicles sharing the same year, make, and model can use different engines, transmissions, electrical systems, drivetrains, or body generations.&lt;/p&gt;

&lt;p&gt;For developers building automotive catalogs, inventory systems, or fitment tools, compatibility should be treated as a rule-based relationship—not a single text label.&lt;/p&gt;

&lt;h2&gt;
  
  
  Compatibility Is a Predicate, Not a Product Attribute
&lt;/h2&gt;

&lt;p&gt;A component should not simply contain a field like&lt;/p&gt;

&lt;p&gt;"compatible With": "Ford Mustang"&lt;/p&gt;

&lt;p&gt;That value is too broad to support a reliable fitment decision.&lt;/p&gt;

&lt;p&gt;Compatibility is better represented as a predicate:&lt;/p&gt;

&lt;p&gt;compatible(vehicle, component) -&amp;gt; match | non match | needs review&lt;/p&gt;

&lt;p&gt;The result depends on several properties:&lt;br&gt;
Model year&lt;br&gt;
Body or platform generation&lt;br&gt;
Engine family and engine code&lt;br&gt;
Transmission code&lt;br&gt;
Drivetrain configuration&lt;br&gt;
VIN qualifier&lt;br&gt;
Build date&lt;br&gt;
Emissions package&lt;br&gt;
ECU and wiring requirements&lt;/p&gt;

&lt;p&gt;Some conditions determine whether the component physically mounts in the vehicle. Others determine whether the electronics and control modules can communicate correctly.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Real-World Model-Year Edge Case
&lt;/h2&gt;

&lt;p&gt;The Chevrolet Silverado demonstrates why model year alone is unreliable.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.blueprismautomotive.com/post/chevy-silverado-1500-engine-interchange" rel="noopener noreferrer"&gt;The Silverado 1500 engine-interchange&lt;/a&gt; breakdown separates applications by generation and explains an important 2007 edge case. "That year" can refer to a classic-body truck or the redesigned body style.&lt;/p&gt;

&lt;p&gt;Both vehicles may appear in a catalog as a “2007 Chevrolet Silverado 1500,” but they should not automatically resolve to the same interchange record.&lt;/p&gt;

&lt;h2&gt;
  
  
  A fitment system therefore needs a generation or body-style field:
&lt;/h2&gt;

&lt;p&gt;type Drivetrain = "FWD" | "RWD" | "AWD" | "4WD";&lt;/p&gt;

&lt;p&gt;interface Vehicle &lt;br&gt;
make: string&lt;br&gt;
model: string&lt;br&gt;
year: number&lt;br&gt;
generation: string&lt;br&gt;
engine Code: string&lt;br&gt;
transmission Code: string&lt;br&gt;
Drivetrain: Drivetrain&lt;br&gt;
vin: string&lt;/p&gt;

&lt;p&gt;Optional fields are useful during data entry, but missing information must be handled deliberately. The application should not convert an incomplete record into a confident match.&lt;/p&gt;

&lt;h2&gt;
  
  
  Model Component Applications Separately
&lt;/h2&gt;

&lt;p&gt;A replacement component can fit more than one vehicle, and a vehicle can accept more than one component. That is a many-to-many relationship.&lt;/p&gt;

&lt;p&gt;Instead of storing vehicle information directly on the component, you should create application rules that govern this relationship:&lt;/p&gt;

&lt;p&gt;interface Application Rule&lt;br&gt;
id: string&lt;br&gt;
component: string&lt;br&gt;
make: string&lt;br&gt;
model: string&lt;br&gt;
year From: number&lt;br&gt;
year To: number&lt;br&gt;
generation: string&lt;br&gt;
engine Code: string&lt;br&gt;
transmission Code: string&lt;br&gt;
drivetrains: Drivetrain&lt;br&gt;
Vin Qualifier position: number&lt;br&gt;
allowed Values: string&lt;/p&gt;

&lt;p&gt;This lets one component have several verified application records without duplicating its price, condition, stock number, or other inventory data.&lt;/p&gt;

&lt;h2&gt;
  
  
  A normalized relational design might use these tables:
&lt;/h2&gt;

&lt;p&gt;components&lt;br&gt;
vehicles&lt;br&gt;
application rules&lt;br&gt;
interchange groups&lt;br&gt;
fitment exceptions&lt;/p&gt;

&lt;p&gt;The application rules table connects components to vehicle configurations. An interchange groups table can represent parts that share a verified interchange relationship, while fitment exceptions records known restrictions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Return Three Possible Results
&lt;/h2&gt;

&lt;p&gt;A binary true or false result is often insufficient. If the user has not entered an engine code, the component is not necessarily incompatible—the system simply lacks enough information.&lt;/p&gt;

&lt;p&gt;A safer result type is&lt;/p&gt;

&lt;p&gt;type Match Result =&lt;br&gt;
The validator can first detect missing information:&lt;/p&gt;

&lt;p&gt;function validate Required Fields(vehicle: Vehicle): Match Result |&lt;br&gt;
const missing: string&lt;/p&gt;

&lt;p&gt;Return missing items. length&lt;br&gt;
Thereafter, it can compare the supplied vehicle against candidate application rules.&lt;/p&gt;

&lt;p&gt;This distinction matters:&lt;/p&gt;

&lt;p&gt;nonmatch = the known specifications conflict&lt;br&gt;
needs review = the specifications are incomplete&lt;/p&gt;

&lt;p&gt;Presenting both outcomes as “not compatible” can cause users to abandon valid purchases. Presenting both as “compatible” can create expensive returns.&lt;/p&gt;

&lt;h2&gt;
  
  
  Engine Names Are Not Unique Identifiers
&lt;/h2&gt;

&lt;p&gt;Engine displacement should also be treated as descriptive information, not a unique key.&lt;/p&gt;

&lt;p&gt;Ford provides a positive example because its catalog spans multiple engine families and generations. A useful Ford engine-family compatibility guide must consider more than a familiar displacement label. The engine family, generation, vehicle platform, ECU requirements, transmission pairing and VIN details can influence the final decision.&lt;/p&gt;

&lt;p&gt;The normalized values could be used to create a reusable fitment key as follows:&lt;/p&gt;

&lt;p&gt;This key can improve caching and duplicate detection, but should not be a substitute for the underlying fields. Individual values are still needed for filtering, auditing, and explaining a result.&lt;/p&gt;

&lt;p&gt;Vehicle-Specific Rules Still Matter&lt;/p&gt;

&lt;p&gt;Even after building a general compatibility engine, certain platforms need more detailed rules.&lt;/p&gt;

&lt;p&gt;A Mustang 2.3L EcoBoost swap guide, for example, is more useful than a generic record that only says “2.3-liter Ford engine.” A platform-specific reference can document the fitment conditions and swap considerations that a broad engine-family table cannot express clearly.&lt;/p&gt;

&lt;p&gt;This suggests a layered approach:&lt;br&gt;
Match the basic vehicle identity.&lt;br&gt;
Resolve the body or platform generation.&lt;br&gt;
Please confirm engine and transmission codes.&lt;br&gt;
Add VIN and drivetrain qualifiers.&lt;br&gt;
Check for platform specific exceptions.&lt;br&gt;
Return the result with a human-readable explanation.&lt;br&gt;
A successful match might display the following:&lt;/p&gt;

&lt;p&gt;Match confirmed:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Model year is within the supported range.&lt;/li&gt;
&lt;li&gt;Body generation matches&lt;/li&gt;
&lt;li&gt;Engine code matches&lt;/li&gt;
&lt;li&gt;Transmission and drivetrain are supported&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;An explainable result is much more useful than a green check mark with no supporting information.&lt;/p&gt;

&lt;p&gt;Design for Corrections and New Evidence&lt;/p&gt;

&lt;p&gt;Fitment data changes as catalogs are corrected and new interchange information becomes available. Every rule should therefore include provenance and versioning fields:&lt;/p&gt;

&lt;p&gt;interface Rule Metadata {&lt;br&gt;
source: string;&lt;br&gt;
verified At: string;&lt;br&gt;
verified By?: string;&lt;br&gt;
revision: number;&lt;br&gt;
notes: string&lt;br&gt;
It is also helpful to log which rule produced each result. When a customer or technician reports an error, the team can inspect the exact decision path instead of trying to reproduce a hidden lookup.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Takeaway
&lt;/h2&gt;

&lt;p&gt;Vehicle fitment is a useful example of a broader software-design lesson: familiar labels are not always reliable identifiers.&lt;/p&gt;

&lt;p&gt;A year, make, and model may be enough to begin a search, but they are rarely enough to make a final compatibility decision. Reliable systems preserve the full application context, distinguish missing data from conflicting data, and explain why a result was returned.&lt;/p&gt;

&lt;p&gt;When compatibility is modeled as a versioned, auditable relationship, the system becomes easier to maintain—and considerably safer for the person relying on it.&lt;/p&gt;

&lt;p&gt;Disclosure: This article was drafted with AI assistance and reviewed against the linked automotive references before publication.&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>backend</category>
      <category>softwareengineering</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
