Service - Variant Standard: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
 
(7 intermediate revisions by 2 users not shown)
Line 7: Line 7:
https://bitbucket.org/izara-market-products/izara-market-products-variant-standard/src/master/
https://bitbucket.org/izara-market-products/izara-market-products-variant-standard/src/master/


= DynamoDB tables =
= Schemas =
 
==ObjectSchemas==
== [[Standard Config Table Per Service]] ==
=== variantStandard ===
 
=== Configuration tags ===
 
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
configTag: "VariantHandlerServiceNameTag"
  "objectType": "variantStandard",
configKey: "VariantHandlerServiceNameTag"
  "extendObjType": {
configValue: xxx // this own services ServiceNameTag, eg "VariantStandard"
    "serviceTag": "VariantManager",
    "objectType": "variant"
  },
  "storageResources": {
    "graph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    },
    "dynamoDB": {
      "storageType": "dynamoDB",
      "tableName": "VariantRecord",
      "serviceTag": "VariantManager"
    }
  },
  "fieldNames": {
    "variantId": {
      "storageResourceTags": [
        "graph",
        "dynamoDB"
      ]
    }
  },
  "generatedBy": "userGenerated"
}
}
</syntaxhighlight>
</syntaxhighlight>


=== variantProductLink ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
configTag: "ProductGraphServiceName"
  "objectType": "variantProductLink",
configKey: "ProductGraphServiceName"
  "canDelete": true,
configValue: xxx // eg: "ProductGraph"
  "belongTo": {
    "serviceTag": "UserAccount",
    "objectType": "user"
  },
  "addOnDataStructure": [],
  "storageResources": {
    "graph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "fieldNames": {
    "variantProductLinkId": {
      "type": "string",
      "randomOnCreate": false,
      "requiredOnCreate": false,
      "optionalOnCreate": false,
      "canUpdate": false,
      "validation": {
        "pattern": "^[a-zA-Z0-9_-]+$"
      },
      "storageResourceTags": [
        "graph"
      ],
      "hashOnCreate": [
        "variantId",
        "productId"
      ]
    },
    "variantId": {
      "type": "string",
      "randomOnCreate": false,
      "requiredOnCreate": true,
      "optionalOnCreate": false,
      "canUpdate": false,
      "validation": {
        "pattern": "^[a-zA-Z0-9_-]+$"
      },
      "storageResourceTags": [
        "graph"
      ]
    },
    "productId": {
      "type": "string",
      "randomOnCreate": false,
      "requiredOnCreate": true,
      "optionalOnCreate": false,
      "canUpdate": false,
      "validation": {
        "pattern": "^[a-zA-Z0-9_-]+$"
      },
      "storageResourceTags": [
        "graph"
      ]
    }
  },
  "compositeKeyDeliminator": "_",
  "identifiers": [
    {
      "type": "identifier",
      "fieldName": "variantProductLinkId"
    }
  ],
  "generatedBy": "userGenerated"
}
}
</syntaxhighlight>
</syntaxhighlight>


=== variantAttributeValueStandard ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
configTag: "VariantManagerServiceName"
  "objectType": "variantAttributeValueStandard",
configKey: "VariantManagerServiceName"
  "addOnDataStructure": [],
configValue: xxx // eg: "ProductManager"
  "storageResources": {
    "graph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "fieldNames": {
 
  },
  "extendObjType": {
    "objectType": "variantAttributeValue",
    "serviceTag": "VariantManager"
  },
  "generatedBy": "userGenerated"
}
}
</syntaxhighlight>
</syntaxhighlight>


== LogicalResults ==
== RelationshipSchemas ==
 
Stores results for any requests to perform logical searches on variant data


=== hasVariantProductLink ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
resultId: xxx // eg: filterMainId for a single logical element
  "relationshipServiceTag": "VariantStandard",
dataId: xxx // one variantId
  "fieldNames": {
}
    "originTimeStamp": {
</syntaxhighlight>
      "type": "number",
 
      "requiredOnCreate": false,
* partition key: resultId
      "canUpdate": true,
* sort key: dataId
      "validation": {
 
= Graph database =
 
== [[Service - Products Graph]]==
 
=== Nodes ===


<syntaxhighlight lang="JavaScript">
      },
{
      "optionalOnCreate": false
nodeLabel: "variant",
    },
schema: {
  },
identifier: true,
  "storageResources": {
restrictProperties: true,
    "graph": {
restrictRelationships: true,
      "storageType": "graph",
properties: {
      "graphServerTag": "GraphHandler"
variantId: {
    }
identifier: true, //(random uuid)
  },
},
  "links": [
variantHandlerServiceNameTag: {
    {
immutable: true,
      "storageResourceTags": [
},
        "graph"
},
      ],
}
      "from": {
        "objType": {
          "serviceTag": "VariantStandard",
          "objectType": "variantProductLink"
        },
        "linkType": "one",
        "requiredOnCreate": true,
        "handler": true
      },
      "to": {
        "objType": {
          "serviceTag": "VariantStandard",
          "objectType": "variantStandard"
        },
        "linkType": "one",
        "handler": true,
        "requiredOnCreate": false
      },
      "canDelete": false
    }
  ],
  "canMove": false
}
}
</syntaxhighlight>
</syntaxhighlight>


=== disabledVariantProductLink ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "variantProductLink",
  "relationshipServiceTag": "VariantStandard",
schema: {
  "fieldNames": {
identifier: true,
    "originTimeStamp": {
restrictProperties: true,
      "type": "number",
restrictRelationships: true,
      "requiredOnCreate": false,
properties: {
      "canUpdate": true,
variantId: {
      "validation": {
immutable: true,
},
variantHandlerServiceNameTag: {
immutable: true,
},
productId: {
immutable: true,
},
productHandlerServiceNameTag: {
immutable: true,
},
},
}
}
</syntaxhighlight>
* adds a node between each variant to product relationship, we do this so we can add variantProductLink specific relationships, eg to media that only relates to this link, not to other parent variants the product has


=== Relationships ===
      },
 
      "optionalOnCreate": false
<syntaxhighlight lang="JavaScript">
    },
{
  },
relationshipType: "hasVariantProductLink",
  "storageResources": {
schema: {
    "graph": {
elementCanBeRemoved: true,
      "storageType": "graph",
allPropertiesImmutable: true,
      "graphServerTag": "GraphHandler"
restrictProperties: true,
    }
properties: {
  },
originTimestamp: //timestamp the request to create/change this relationship was sent
  "links": [
},
    {
}
      "storageResourceTags": [
}
        "graph"
</syntaxhighlight>
      ],
<syntaxhighlight lang="JavaScript">
      "from": {
{
        "objType": {
relationshipType: "disabledVariantProductLink",
          "serviceTag": "VariantStandard",
schema: {
          "objectType": "variantProductLink"
elementCanBeRemoved: true,
        },
allPropertiesImmutable: true,
        "linkType": "one",
restrictProperties: true,
        "handler": true,
properties: {
        "requiredOnCreate": false
originTimestamp: //timestamp the request to create/change this relationship was sent
      },
},
      "to": {
}
        "objType": {
          "serviceTag": "VariantStandard",
          "objectType": "variantStandard"
        },
        "linkType": "one",
        "handler": true,
        "requiredOnCreate": false
      },
      "canDelete": false
    }
  ],
  "canMove": false
}
}
</syntaxhighlight>
</syntaxhighlight>
* links variant to a variantProductLink, or a variantProductLink to a product


= Working documents =
= Working documents =

Latest revision as of 08:40, 13 January 2026

Overview

Handler service for the standard variant type.

Repository

https://bitbucket.org/izara-market-products/izara-market-products-variant-standard/src/master/

Schemas

ObjectSchemas

variantStandard

{
  "objectType": "variantStandard",
  "extendObjType": {
    "serviceTag": "VariantManager",
    "objectType": "variant"
  },
  "storageResources": {
    "graph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    },
    "dynamoDB": {
      "storageType": "dynamoDB",
      "tableName": "VariantRecord",
      "serviceTag": "VariantManager"
    }
  },
  "fieldNames": {
    "variantId": {
      "storageResourceTags": [
        "graph",
        "dynamoDB"
      ]
    }
  },
  "generatedBy": "userGenerated"
}

variantProductLink

{
  "objectType": "variantProductLink",
  "canDelete": true,
  "belongTo": {
    "serviceTag": "UserAccount",
    "objectType": "user"
  },
  "addOnDataStructure": [],
  "storageResources": {
    "graph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "fieldNames": {
    "variantProductLinkId": {
      "type": "string",
      "randomOnCreate": false,
      "requiredOnCreate": false,
      "optionalOnCreate": false,
      "canUpdate": false,
      "validation": {
        "pattern": "^[a-zA-Z0-9_-]+$"
      },
      "storageResourceTags": [
        "graph"
      ],
      "hashOnCreate": [
        "variantId",
        "productId"
      ]
    },
    "variantId": {
      "type": "string",
      "randomOnCreate": false,
      "requiredOnCreate": true,
      "optionalOnCreate": false,
      "canUpdate": false,
      "validation": {
        "pattern": "^[a-zA-Z0-9_-]+$"
      },
      "storageResourceTags": [
        "graph"
      ]
    },
    "productId": {
      "type": "string",
      "randomOnCreate": false,
      "requiredOnCreate": true,
      "optionalOnCreate": false,
      "canUpdate": false,
      "validation": {
        "pattern": "^[a-zA-Z0-9_-]+$"
      },
      "storageResourceTags": [
        "graph"
      ]
    }
  },
  "compositeKeyDeliminator": "_",
  "identifiers": [
    {
      "type": "identifier",
      "fieldName": "variantProductLinkId"
    }
  ],
  "generatedBy": "userGenerated"
}

variantAttributeValueStandard

{
  "objectType": "variantAttributeValueStandard",
  "addOnDataStructure": [],
  "storageResources": {
    "graph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "fieldNames": {

  },
  "extendObjType": {
    "objectType": "variantAttributeValue",
    "serviceTag": "VariantManager"
  },
  "generatedBy": "userGenerated"
}

RelationshipSchemas

hasVariantProductLink

{
  "relationshipServiceTag": "VariantStandard",
  "fieldNames": {
    "originTimeStamp": {
      "type": "number",
      "requiredOnCreate": false,
      "canUpdate": true,
      "validation": {

      },
      "optionalOnCreate": false
    },
  },
  "storageResources": {
    "graph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "links": [
    {
      "storageResourceTags": [
        "graph"
      ],
      "from": {
        "objType": {
          "serviceTag": "VariantStandard",
          "objectType": "variantProductLink"
        },
        "linkType": "one",
        "requiredOnCreate": true,
        "handler": true
      },
      "to": {
        "objType": {
          "serviceTag": "VariantStandard",
          "objectType": "variantStandard"
        },
        "linkType": "one",
        "handler": true,
        "requiredOnCreate": false
      },
      "canDelete": false
    }
  ],
  "canMove": false
}

disabledVariantProductLink

{
  "relationshipServiceTag": "VariantStandard",
  "fieldNames": {
    "originTimeStamp": {
      "type": "number",
      "requiredOnCreate": false,
      "canUpdate": true,
      "validation": {

      },
      "optionalOnCreate": false
    },
  },
  "storageResources": {
    "graph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "links": [
    {
      "storageResourceTags": [
        "graph"
      ],
      "from": {
        "objType": {
          "serviceTag": "VariantStandard",
          "objectType": "variantProductLink"
        },
        "linkType": "one",
        "handler": true,
        "requiredOnCreate": false
      },
      "to": {
        "objType": {
          "serviceTag": "VariantStandard",
          "objectType": "variantStandard"
        },
        "linkType": "one",
        "handler": true,
        "requiredOnCreate": false
      },
      "canDelete": false
    }
  ],
  "canMove": false
}

Working documents

Variant Standard