Grade Data Api

Introduction

The grade data API was conceived to more conveniently interface with a large amount of available data available for a specific grade/body type. Previously, this data was spread out across the page in different data attributes. However, this initial setup proved to be insufficient once the number of properties that needed to interact exceeded two. For this reason, all data checking operations can now be done via this API which can be included as a requirejs dependency.

Getting Started

To use this API in a component, you can require it with its internal name t1-api-gradedata. Example:

T1.define(
    't1-my-component',
    ['T1-site-dependencies', 't1-api-gradedata'],
    function (plugins, gradeDataApi) {
        'use strict';

        /* Your component here*/

    }
)

Usage

Once the API has been required by your component (as gradeDataApi as in the example above), you can use it as follows: gradeDataApi.method()

As of now, the following methods are available:

getAllGradeData

params

returns

gradeComboExists

params

returns

If no wheelbase or carrosserievariant is passed, this will be ignored and it will look directly at car id and colour.

getTotalPrice

params

returns

If no wheelbase or carrosserievariant is passed, this will be ignored and it will look directly at car id and colour.