Skip to main content

Sample input examples demonstrating validation scenarios for aggregate rating distribution rules

Distribution Intervals

BestRatingDoesNotMatchExpectedInterval

Scenario One

Pass ScenarioFailure Scenario
Sample Input
{
"aggregateRatingDetails": {
"starRatings": [
{
"category": "OVERALL",
"bestRating": 4, /* value */
"worstRating": 2,
"ratingValue": 4.0,
"ratingCount": 504,
"reviewCount": 249,
"distribution": [
{ "key": "1", "value": 7},
{ "key": "2", "value": 19},
{ "key": "3", "value": 25},
{ "key": "4", "value": 358},
{ "key": "5", "value": 95} /* expected match */
]
}
],
"pricing": {
"indicator": "4"
}
}
}

IntervalMustHaveExactlyOneKey

Scenario One

Pass ScenarioFailure Scenario
Sample Input
{
"aggregateRatingDetails": {
"starRatings": [
{
"category": "OVERALL",
"bestRating": 4, /* value */
"worstRating": 2,
"ratingValue": 4.0,
"ratingCount": 504,
"reviewCount": 249,
"distribution": [
{}
]
}
],
"pricing": {
"indicator": "4"
}
}
}

Scenario Two

Pass ScenarioFailure Scenario
Sample Input
{
"aggregateRatingDetails": {
"starRatings": [
{
"category": "OVERALL",
"bestRating": 4, /* value */
"worstRating": 2,
"ratingValue": 4.0,
"ratingCount": 504,
"reviewCount": 249,
"distribution": [
{ "value": 7},
{ "key": "2", "value": 19},
{ "key": "3", "value": 25},
{ "key": "4", "value": 358},
{ "key": "5", "value": 95}
]
}
],
"pricing": {
"indicator": "4"
}
}
}

Scenario Two

Pass ScenarioFailure Scenario
Sample Input
{
"aggregateRatingDetails": {
"starRatings": [
{
"category": "OVERALL",
"bestRating": 4, /* value */
"worstRating": 2,
"ratingValue": 4.0,
"ratingCount": 504,
"reviewCount": 249,
"distribution": [
{ "key": "2", "value": 19, "key": "3", "value": 25},
{ "key": "5", "value": 95}
]
}
],
"pricing": {
"indicator": "4"
}
}
}

IntervalMustHaveExactlyOneValue

Scenario One

Pass ScenarioFailure Scenario
Sample Input
{
"aggregateRatingDetails": {
"starRatings": [
{
"category": "OVERALL",
"bestRating": 4, /* value */
"worstRating": 2,
"ratingValue": 4.0,
"ratingCount": 504,
"reviewCount": 249,
"distribution": [
{}
]
}
],
"pricing": {
"indicator": "4"
}
}
}

Scenario Two

Pass ScenarioFailure Scenario
Sample Input
{
"aggregateRatingDetails": {
"starRatings": [
{
"category": "OVERALL",
"bestRating": 4, /* value */
"worstRating": 2,
"ratingValue": 4.0,
"ratingCount": 504,
"reviewCount": 249,
"distribution": [
{ "key": 1 },
{ "key": "2", "value": 19},
{ "key": "3", "value": 25},
{ "key": "4", "value": 358},
{ "key": "5", "value": 95}
]
}
],
"pricing": {
"indicator": "4"
}
}
}

Scenario Two

Pass ScenarioFailure Scenario
Sample Input
{
"aggregateRatingDetails": {
"starRatings": [
{
"category": "OVERALL",
"bestRating": 4, /* value */
"worstRating": 2,
"ratingValue": 4.0,
"ratingCount": 504,
"reviewCount": 249,
"distribution": [
{ "key": "2", "value": 19, "key": "3", "value": 25},
{ "key": "5", "value": 95}
]
}
],
"pricing": {
"indicator": "4"
}
}
}

StarRatingsDistributionKeyValueMustContainNumber

Scenario Two

Pass ScenarioFailure Scenario
Sample Input
{
"aggregateRatingDetails": {
"starRatings": [
{
"category": "OVERALL",
"bestRating": 5,
"worstRating": 1,
"ratingValue": 4.0,
"ratingCount": 504,
"reviewCount": 249,
"distribution": [
{ "key": "1", "value": 7},
{ "key": "2", "value": 19},
{ "key": "Medium", "value": 25},
{ "key": "4", "value": 358},
{ "key": "5", "value": 95}
]
}
],
"pricing": {
"indicator": "4"
}
}
}

WorstRatingDoesNotMatchExpectedInterval

Scenario One

Pass ScenarioFailure Scenario
Sample Input
{
"aggregateRatingDetails": {
"starRatings": [
{
"category": "OVERALL",
"bestRating": 5,
"worstRating": 2, /* value */
"ratingValue": 4.0,
"ratingCount": 504,
"reviewCount": 249,
"distribution": [
{ "key": "1", "value": 7}, /* expected match */
{ "key": "2", "value": 19},
{ "key": "3", "value": 25},
{ "key": "4", "value": 358},
{ "key": "5", "value": 95}
]
}
],
"pricing": {
"indicator": "4"
}
}
}