Refactor layerInfo to communicate what differentiates underlying variants, instead of being defined on every variant itself
This commit is contained in:
1 parent
67e459d1b0
commit
d1b83d19b5
3 files changed
+128
-353
No files matched your search
@@ -421,12 +421,20 @@ paths:
|
||||
All details (that the calling touchpoint is allowed to see) for the 20% Discount product.\
|
||||
Even though this product has sellingPeriods for multiple touchpoints (3 and 4), only the currently active sellingPeriod and price for touchpointId 4 are returned.
|
||||
|
||||
This product has two `productVariants`: a single month variant and a subscription variant.
|
||||
This product has two `productVariants`: a single month variant and a subscription variant.\
|
||||
The top-level parent contains `LayerInfo` to communicate what differentiates
|
||||
the underlying product-variants.\
|
||||
When no `LayerInfo` is present, the touchpoint can conclude that the product is a final fulfillable product.
|
||||
value:
|
||||
{
|
||||
"productId": 126,
|
||||
"parentProductId": null,
|
||||
"layerInfo": null,
|
||||
"layerInfo": {
|
||||
"layerInfoId": 1,
|
||||
"choiceKey": "isRenewable",
|
||||
"choiceLabel": "Kies voor een doorlopend abonnement of een enkele termijn",
|
||||
"isCustomChoice": false,
|
||||
},
|
||||
"fikoArticleNumber": "1234",
|
||||
"gboPackageTemplateId": "30001",
|
||||
"tapConnectProductCode": null,
|
||||
@@ -529,12 +537,7 @@ paths:
|
||||
{
|
||||
"productId": 119,
|
||||
"parentProductId": 126,
|
||||
"layerInfo": {
|
||||
"layerInfoId": 1,
|
||||
"choiceKey": "isRenewable",
|
||||
"choiceLabel": "Kies voor een doorlopend abonnement of een enkele termijn",
|
||||
"isCustomChoice": false,
|
||||
},
|
||||
"layerInfo": null,
|
||||
"fikoArticleNumber": "1234",
|
||||
"gboPackageTemplateId": "30001",
|
||||
"tapConnectProductCode": null,
|
||||
@@ -649,12 +652,7 @@ paths:
|
||||
{
|
||||
"productId": 120,
|
||||
"parentProductId": 126,
|
||||
"layerInfo": {
|
||||
"layerInfoId": 1,
|
||||
"choiceKey": "isRenewable",
|
||||
"choiceLabel": "Kies voor een doorlopend abonnement of een enkele termijn",
|
||||
"isCustomChoice": false,
|
||||
},
|
||||
"layerInfo": null,
|
||||
"fikoArticleNumber": "1234",
|
||||
"gboPackageTemplateId": "30001",
|
||||
"tapConnectProductCode": null,
|
||||
@@ -774,12 +772,19 @@ paths:
|
||||
All details (that the calling touchpoint is allowed to see) for the parent Regio Vrij product
|
||||
and (7 out of 84 of) its productVariants; the full tree would be too huge to be useful as an example.
|
||||
|
||||
The full depth of the tree is included in the example for the HL62 Reduced Fare Variant.
|
||||
The full depth of the tree is included in the example for the HL62 Reduced Fare Variant.\
|
||||
Each non-leaf-node product contains `LayerInfo` to communicate what differentiates the underlying product-variants.\
|
||||
When no `LayerInfo` is present, the touchpoint can conclude that the product is a final fulfillable product.
|
||||
value:
|
||||
{
|
||||
"productId": 49,
|
||||
"parentProductId": null,
|
||||
"layerInfo": null,
|
||||
"layerInfo": {
|
||||
"layerInfoId": 2,
|
||||
"choiceKey": "regio",
|
||||
"choiceLabel": "Kies de gewenste regio",
|
||||
"isCustomChoice": true,
|
||||
},
|
||||
"fikoArticleNumber": "1234",
|
||||
"gboPackageTemplateId": null,
|
||||
"tapConnectProductCode": null,
|
||||
@@ -922,10 +927,10 @@ paths:
|
||||
"productId": 109,
|
||||
"parentProductId": 49,
|
||||
"layerInfo": {
|
||||
"layerInfoId": 2,
|
||||
"choiceKey": "regio",
|
||||
"choiceLabel": "Kies de gewenste regio",
|
||||
"isCustomChoice": true,
|
||||
"layerInfoId": 3,
|
||||
"choiceKey": "allowedGboAgeProfiles",
|
||||
"choiceLabel": "Wat is uw geboortedatum?",
|
||||
"isCustomChoice": false,
|
||||
},
|
||||
"fikoArticleNumber": "1234",
|
||||
"gboPackageTemplateId": "33615",
|
||||
@@ -1072,9 +1077,9 @@ paths:
|
||||
"productId": 114,
|
||||
"parentProductId": 109,
|
||||
"layerInfo": {
|
||||
"layerInfoId": 3,
|
||||
"choiceKey": "allowedGboAgeProfiles",
|
||||
"choiceLabel": "Wat is uw geboortedatum?",
|
||||
"layerInfoId": 1,
|
||||
"choiceKey": "isRenewable",
|
||||
"choiceLabel": "Kies voor een doorlopend abonnement of een enkele termijn",
|
||||
"isCustomChoice": false,
|
||||
},
|
||||
"fikoArticleNumber": "1234",
|
||||
@@ -1222,9 +1227,9 @@ paths:
|
||||
"productId": 115,
|
||||
"parentProductId": 109,
|
||||
"layerInfo": {
|
||||
"layerInfoId": 3,
|
||||
"choiceKey": "allowedGboAgeProfiles",
|
||||
"choiceLabel": "Wat is uw geboortedatum?",
|
||||
"layerInfoId": 1,
|
||||
"choiceKey": "isRenewable",
|
||||
"choiceLabel": "Kies voor een doorlopend abonnement of een enkele termijn",
|
||||
"isCustomChoice": false,
|
||||
},
|
||||
"fikoArticleNumber": "1234",
|
||||
@@ -1372,12 +1377,7 @@ paths:
|
||||
{
|
||||
"productId": 116,
|
||||
"parentProductId": 115,
|
||||
"layerInfo": {
|
||||
"layerInfoId": 1,
|
||||
"choiceKey": "isRenewable",
|
||||
"choiceLabel": "Kies voor een doorlopend abonnement of een enkele termijn",
|
||||
"isCustomChoice": false,
|
||||
},
|
||||
"layerInfo": null,
|
||||
"fikoArticleNumber": "1234",
|
||||
"gboPackageTemplateId": "33615",
|
||||
"tapConnectProductCode": null,
|
||||
@@ -1526,12 +1526,7 @@ paths:
|
||||
{
|
||||
"productId": 117,
|
||||
"parentProductId": 115,
|
||||
"layerInfo": {
|
||||
"layerInfoId": 1,
|
||||
"choiceKey": "isRenewable",
|
||||
"choiceLabel": "Kies voor een doorlopend abonnement of een enkele termijn",
|
||||
"isCustomChoice": false,
|
||||
},
|
||||
"layerInfo": null,
|
||||
"fikoArticleNumber": "1234",
|
||||
"gboPackageTemplateId": "33615",
|
||||
"tapConnectProductCode": null,
|
||||
@@ -1685,10 +1680,10 @@ paths:
|
||||
"productId": 112,
|
||||
"parentProductId": 49,
|
||||
"layerInfo": {
|
||||
"layerInfoId": 2,
|
||||
"choiceKey": "regio",
|
||||
"choiceLabel": "Kies de gewenste regio",
|
||||
"isCustomChoice": true,
|
||||
"layerInfoId": 3,
|
||||
"choiceKey": "allowedGboAgeProfiles",
|
||||
"choiceLabel": "Wat is uw geboortedatum?",
|
||||
"isCustomChoice": false,
|
||||
},
|
||||
"fikoArticleNumber": "1234",
|
||||
"gboPackageTemplateId": "33618",
|
||||
@@ -1858,10 +1853,11 @@ components:
|
||||
description: >-
|
||||
Gives information on the choice that the customer has to make, to enable the touchpoint
|
||||
to proceed further "down the product-tree" by selecting (PATCH-ing) the correct product-variant.
|
||||
LayerInfo is not a mandatory product-attribute, but it should always be present on all product for which
|
||||
`parentProductId != null`. (LayerInfo makes no sense for top-level parents as there is always a single starting point). \
|
||||
LayerInfo is not a mandatory product-attribute, but it should always be present on all products for which
|
||||
there are underlying products, i.e. for which `GET /products?parentProductId=...` returns a non-empty list.
|
||||
When no LayerInfo is present, the touchpoint can conclude that the product is a final fulfillable product. \
|
||||
|
||||
**PMT should ensure that all products in the same "product-branch" (same `parentProductId`) have the same `layerInfoId`
|
||||
**PMT should ensure that all non-leaf-node products (i.e. products that have underlying products) have a `layerInfoId`
|
||||
referenced. If a product is found to be in violation of this rule, its attribtue `isValid` should be set to `false`.**
|
||||
required:
|
||||
- layerInfoId
|
||||
@@ -1877,12 +1873,12 @@ components:
|
||||
type: string
|
||||
description: >-
|
||||
Contains the JSON Key of the product-attribute that the customer has to make some
|
||||
choice on (determined by PMT), so that te correct product-variant can be selected by the touchpoint. For some
|
||||
decisions (like region), there is no product attribute, and thus `isCustomChoice` will be set
|
||||
to `true`, and `choiceKey` can then be set to any string on which touchpoints can also trigger
|
||||
behaviour if desired (think "region picker tool"). Therefore, reuse of choiceKeys should be
|
||||
choice on (determined by PMT), so that te correct product-variant (one of the direct child-products) can be
|
||||
selected by the touchpoint. For some decisions (like region), there is no product attribute, and thus
|
||||
`isCustomChoice` will be set to `true`, and `choiceKey` can then be set to any string on which touchpoints
|
||||
can also trigger behaviour if desired (think "region picker tool"). Therefore, reuse of `choiceKeys` should be
|
||||
the goal, so touchoints can keep their triggers simple and prevent duplication of
|
||||
similar choiceKeys to trigger the same behaviour.
|
||||
similar `choiceKeys` to trigger the same behaviour.
|
||||
choiceLabel:
|
||||
example: Kies voor een doorlopend abonnement of een enkele termijn
|
||||
type: string
|
||||
@@ -1894,12 +1890,10 @@ components:
|
||||
example: false
|
||||
type: boolean
|
||||
description: >-
|
||||
Indicates if the choice is a custom choice. If `false`, the PMT should fill `choiceKey` with the
|
||||
"differing attribute for this product-layer" and the user should not be able to override this. When
|
||||
no single attribute can be pinpointed by PMT, the product will become invalid (`isValid == false`) until either
|
||||
a situation with a single differing attribute is created, or if `isCustomChoice` is set to `true` - this would,
|
||||
however, also mean that touchpoints should be notified of this, especially if the configured LayerInfo contains
|
||||
a new, not previously used, `choiceKey`.
|
||||
Indicates if the choice is a custom choice. If `false`, the PMT should validate that the `choiceKey` is a
|
||||
differentiating attribute for the underlying product-variants. When the attribute denoted by the `choiceKey` is
|
||||
the same for all underlying variants, PMT validation will fail and the product will become invalid (`isValid == false`)
|
||||
until either the underlying products are updated, or a `LayerInfo` with `isCustomChoice == true` is configured.
|
||||
GboAgeProfileResponse:
|
||||
type: object
|
||||
required:
|
||||
|
||||
Reference in new issue
Block a user