Service - Product Attributes: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
 
(20 intermediate revisions by 2 users not shown)
Line 7: Line 7:
https://bitbucket.org/izara-market-products/izara-market-products-product-attributes/src/master/
https://bitbucket.org/izara-market-products/izara-market-products-product-attributes/src/master/


= DynamoDB tables =
= Schemas =
 
==ObjectSchemas==
== [[Standard Config Table Per Service]] ==
=== productAttribute ===
 
=== Configuration tags ===
 
..
 
== LogicalResults ==
 
Stores results for any requests to perform logical searches on media links
 
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
resultId: xxx // eg: filterMainId for a single logical element
  "objectType": "productAttribute",
dataId: xxx // one productAttributeLinkId
  "canDelete": true,
  "storageResources": {
    "mainGraph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "addOnDataStructure": [
    {
      "type": "translation"
    }
  ],
  "fieldNames": {
    "productAttributeId": {
      "type": "string",
      "randomOnCreate": true,
      "requiredOnCreate": false,
      "optionalOnCreate": false,
      "canUpdate": false,
      "validation": {
        "pattern": "^[a-zA-Z0-9_-]+$"
      },
      "storageResourceTags": [
        "mainGraph"
      ]
    }
  },
  "compositeKeyDeliminator": "_",
  "identifiers": [
    {
      "type": "identifier",
      "fieldName": "productAttributeId"
    }
  ],
  "generatedBy": "userGenerated"
}
}
</syntaxhighlight>
</syntaxhighlight>


* partition key: resultId
=== productAttributeLink ===
* sort key: dataId
 
= Graph database =  
 
== [[Service - Products Graph]]==
 
=== Nodes ===
 
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "productAttribute",
  "objectType": "productAttributeLink",
schema: {
  "canDelete": true,
identifier: true,
  "storageResources": {
restrictProperties: true,
    "mainGraph": {
restrictRelationships: true,
      "storageType": "graph",
properties: {
      "graphServerTag": "GraphHandler"
productAttributeId: {
    }
identifier: true, //(random uuid)
  },
},
  "fieldNames": {
},
    "productAttributeLinkId": {
}
      "type": "string",
      "randomOnCreate": true,
      "requiredOnCreate": false,
      "optionalOnCreate": false,
      "canUpdate": false,
      "validation": {
        "pattern": "^[a-zA-Z0-9_-]+$"
      },
      "storageResourceTags": [
        "mainGraph"
      ]
    }
  },
  "compositeKeyDeliminator": "_",
  "identifiers": [
    {
      "type": "identifier",
      "fieldName": "productAttributeLinkId"
    }
  ],
  "generatedBy": "userGenerated"
}
}
</syntaxhighlight>
</syntaxhighlight>


=== productAttributeLabel ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "productAttributeLink",
  "objectType": "productAttributeLabel",
schema: {
  "canDelete": true,
identifier: true,
  "storageResources": {
restrictProperties: true,
    "mainGraph": {
restrictRelationships: true,
      "storageType": "graph",
properties: {
      "graphServerTag": "GraphHandler"
productAttributeLinkId: {
    }
identifier: true, //(random uuid)
  },
},
  "addOnDataStructure": [
productId: {
    {
immutable: true,
      "type": "translation"
},
    }
productAttributeId: {
  ],
immutable: true,
  "fieldNames": {
},
    "labelId": {
},
      "type": "string",
}
      "randomOnCreate": true,
      "optionalOnCreate": false,
      "requiredOnCreate": false,
      "canUpdate": false,
      "validation": {
        "pattern": "^[a-zA-Z0-9_-]+$"
      },
      "storageResourceTags": [
        "mainGraph"
      ]
    }
  },
  "compositeKeyDeliminator": "_",
  "identifiers": [
    {
      "type": "identifier",
      "fieldName": "labelId"
    }
  ],
  "generatedBy": "userGenerated"
}
}
</syntaxhighlight>
</syntaxhighlight>


== RelationshipSchemas ==
=== isProductAttribute ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "productAttributeProperty",
  "relationshipServiceTag": "ProductAttribute",
schema: {
  "fieldNames": {
identifier: true,
    "originTimestamp": {
restrictProperties: true,
      "type": "number",
restrictRelationships: true,
      "requiredOnCreate": false,
properties: {
      "optionalOnCreate": true,
propertyId: {
      "canUpdate": true,
identifier: true, //(random uuid)
      "validation": {
},
 
productAttributeId: {
      }
immutable: true,
    },
},
  },
},
  "storageResources": {
}
    "mainGraph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "links": [
    {
      "storageResourceTags": [
        "mainGraph"
      ],
      "from": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttributeLink"
        },
        "linkType": "one",
        "requiredOnCreate": true,
        "handler": false
      },
      "to": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttribute"
        },
        "requiredOnCreate": false,
        "linkType": "one",
        "handler": true
      },
      "canDelete": false
    }
  ],
  "canMove": false
}
}
</syntaxhighlight>
</syntaxhighlight>


=== Relationships ===
=== isProductAttributeLabel ===
 
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "hasProductAttribute",
  "relationshipServiceTag": "ProductAttribute",
schema: {
  "fieldNames": {
elementCanBeRemoved: true,
    "originTimestamp": {
allPropertiesImmutable: true,
      "type": "number",
restrictProperties: true,
      "requiredOnCreate": false,
properties: {
      "optionalOnCreate": true,
originTimestamp: //timestamp the request to create/change this relationship was sent
      "canUpdate": true,
},
      "validation": {
}
 
}
      }
</syntaxhighlight>
    },
<syntaxhighlight lang="JavaScript">
  },
{
  "storageResources": {
relationshipType: "disabledProductAttribute",
    "mainGraph": {
schema: {
      "storageType": "graph",
elementCanBeRemoved: true,
      "graphServerTag": "GraphHandler"
allPropertiesImmutable: true,
    }
restrictProperties: true,
  },
properties: {
  "links": [
originTimestamp: //timestamp the request to create/change this relationship was sent
    {
},
      "storageResourceTags": [
}
        "mainGraph"
      ],
      "from": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttribute"
        },
        "linkType": "many",
        "requiredOnCreate": true,
        "handler": false
      },
      "to": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttributeLabel"
        },
        "requiredOnCreate": false,
        "linkType": "one",
        "handler": true
      },
      "canDelete": false
    }
  ],
  "canMove": false
}
}
</syntaxhighlight>
</syntaxhighlight>
* creates a link in attribute tree between a Product or ProductAttribute, and a child ProductAttribute
== [[Service - Translations Graph]]==
=== Nodes ===


=== hasProductAttributeLink ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "productAttributeName",
  "relationshipServiceTag": "ProductAttribute",
schema: {
  "fieldNames": {
identifier: true,
    "originTimestamp": {
restrictProperties: true,
      "type": "number",
restrictRelationships: true,
      "optionalOnCreate": true,
properties: {
      "canUpdate": true,
productAttributeId: {
      "validation": {
identifier: true,
},
},
}
}
</syntaxhighlight>


<syntaxhighlight lang="JavaScript">
      },
{
      "requiredOnCreate": false
nodeLabel: "productAttributeValue",
    },
schema: {
  },
identifier: true,
  "storageResources": {
restrictProperties: true,
    "mainGraph": {
restrictRelationships: true,
      "storageType": "graph",
properties: {
      "graphServerTag": "GraphHandler"
productAttributeId: {
    }
identifier: true,
  },
},
  "links": [
},
    {
}
      "storageResourceTags": [
        "mainGraph"
      ],
      "from": {
        "objType": {
          "serviceTag": "ProductManager",
          "objectType": "product"
        },
        "linkType": "one",
        "requiredOnCreate": false,
        "handler": false
      },
      "to": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttributeLink"
        },
        "requiredOnCreate": true,
        "linkType": "many",
        "handler": true
      },
      "canDelete": false
    },
    {
      "storageResourceTags": [
        "mainGraph"
      ],
      "from": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttributeLink"
        },
        "linkType": "one",
        "requiredOnCreate": false,
        "handler": false
      },
      "to": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttributeLink"
        },
        "requiredOnCreate": true,
        "linkType": "many",
        "handler": true
      },
      "canDelete": false
    }
  ],
  "canChangeToRelTypes": [
    {
      "serviceTag": "ProductAttribute",
      "relationshipTag": "disabledProductAttributeLink"
    }
  ],
  "canMove": false
}
}
</syntaxhighlight>
</syntaxhighlight>


=== disabledProductAttributeLink ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "productAttributePropertyName",
  "relationshipServiceTag": "ProductAttribute",
schema: {
  "fieldNames": {
identifier: true,
    "originTimestamp": {
restrictProperties: true,
      "type": "number",
restrictRelationships: true,
      "requiredOnCreate": true,
properties: {
      "optionalOnCreate": true,
propertyId: {
      "canUpdate": true,
identifier: true,
      "validation": {
},
},
}
}
</syntaxhighlight>


<syntaxhighlight lang="JavaScript">
      }
{
    },
nodeLabel: "productAttributePropertyValue",
  },
schema: {
  "storageResources": {
identifier: true,
    "mainGraph": {
restrictProperties: true,
      "storageType": "graph",
restrictRelationships: true,
      "graphServerTag": "GraphHandler"
properties: {
    }
propertyId: {
  },
identifier: true,
  "links": [
},
    {
},
      "storageResourceTags": [
}
        "mainGraph"
      ],
      "from": {
        "objType": {
          "serviceTag": "ProductManager",
          "objectType": "product"
        },
        "linkType": "one",
        "requiredOnCreate": false,
        "handler": false
      },
      "to": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttributeLink"
        },
        "requiredOnCreate": false,
        "linkType": "many",
        "handler": true
      },
      "canDelete": false
    }
  ],
  "canChangeToRelTypes": [
    {
      "serviceTag": "ProductAttribute",
      "relationshipTag": "hasProductAttributeLink"
    }
  ],
  "canMove": false
}
}
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 08:34, 13 January 2026

Overview

Manages Product Attributes and ProductAttributeLinks. Product Attributes can be shared by many Products, ProductAttributeLinks are used to create an attribute tree for one Product.

Repository

https://bitbucket.org/izara-market-products/izara-market-products-product-attributes/src/master/

Schemas

ObjectSchemas

productAttribute

{
  "objectType": "productAttribute",
  "canDelete": true,
  "storageResources": {
    "mainGraph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "addOnDataStructure": [
    {
      "type": "translation"
    }
  ],
  "fieldNames": {
    "productAttributeId": {
      "type": "string",
      "randomOnCreate": true,
      "requiredOnCreate": false,
      "optionalOnCreate": false,
      "canUpdate": false,
      "validation": {
        "pattern": "^[a-zA-Z0-9_-]+$"
      },
      "storageResourceTags": [
        "mainGraph"
      ]
    }
  },
  "compositeKeyDeliminator": "_",
  "identifiers": [
    {
      "type": "identifier",
      "fieldName": "productAttributeId"
    }
  ],
  "generatedBy": "userGenerated"
}

productAttributeLink

{
  "objectType": "productAttributeLink",
  "canDelete": true,
  "storageResources": {
    "mainGraph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "fieldNames": {
    "productAttributeLinkId": {
      "type": "string",
      "randomOnCreate": true,
      "requiredOnCreate": false,
      "optionalOnCreate": false,
      "canUpdate": false,
      "validation": {
        "pattern": "^[a-zA-Z0-9_-]+$"
      },
      "storageResourceTags": [
        "mainGraph"
      ]
    }
  },
  "compositeKeyDeliminator": "_",
  "identifiers": [
    {
      "type": "identifier",
      "fieldName": "productAttributeLinkId"
    }
  ],
  "generatedBy": "userGenerated"
}

productAttributeLabel

{
  "objectType": "productAttributeLabel",
  "canDelete": true,
  "storageResources": {
    "mainGraph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "addOnDataStructure": [
    {
      "type": "translation"
    }
  ],
  "fieldNames": {
    "labelId": {
      "type": "string",
      "randomOnCreate": true,
      "optionalOnCreate": false,
      "requiredOnCreate": false,
      "canUpdate": false,
      "validation": {
        "pattern": "^[a-zA-Z0-9_-]+$"
      },
      "storageResourceTags": [
        "mainGraph"
      ]
    }
  },
  "compositeKeyDeliminator": "_",
  "identifiers": [
    {
      "type": "identifier",
      "fieldName": "labelId"
    }
  ],
  "generatedBy": "userGenerated"
}

RelationshipSchemas

isProductAttribute

{
  "relationshipServiceTag": "ProductAttribute",
  "fieldNames": {
    "originTimestamp": {
      "type": "number",
      "requiredOnCreate": false,
      "optionalOnCreate": true,
      "canUpdate": true,
      "validation": {

      }
    },
  },
  "storageResources": {
    "mainGraph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "links": [
    {
      "storageResourceTags": [
        "mainGraph"
      ],
      "from": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttributeLink"
        },
        "linkType": "one",
        "requiredOnCreate": true,
        "handler": false
      },
      "to": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttribute"
        },
        "requiredOnCreate": false,
        "linkType": "one",
        "handler": true
      },
      "canDelete": false
    }
  ],
  "canMove": false
}

isProductAttributeLabel

{
  "relationshipServiceTag": "ProductAttribute",
  "fieldNames": {
    "originTimestamp": {
      "type": "number",
      "requiredOnCreate": false,
      "optionalOnCreate": true,
      "canUpdate": true,
      "validation": {

      }
    },
  },
  "storageResources": {
    "mainGraph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "links": [
    {
      "storageResourceTags": [
        "mainGraph"
      ],
      "from": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttribute"
        },
        "linkType": "many",
        "requiredOnCreate": true,
        "handler": false
      },
      "to": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttributeLabel"
        },
        "requiredOnCreate": false,
        "linkType": "one",
        "handler": true
      },
      "canDelete": false
    }
  ],
  "canMove": false
}

hasProductAttributeLink

{
  "relationshipServiceTag": "ProductAttribute",
  "fieldNames": {
    "originTimestamp": {
      "type": "number",
      "optionalOnCreate": true,
      "canUpdate": true,
      "validation": {

      },
      "requiredOnCreate": false
    },
  },
  "storageResources": {
    "mainGraph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "links": [
    {
      "storageResourceTags": [
        "mainGraph"
      ],
      "from": {
        "objType": {
          "serviceTag": "ProductManager",
          "objectType": "product"
        },
        "linkType": "one",
        "requiredOnCreate": false,
        "handler": false
      },
      "to": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttributeLink"
        },
        "requiredOnCreate": true,
        "linkType": "many",
        "handler": true
      },
      "canDelete": false
    },
    {
      "storageResourceTags": [
        "mainGraph"
      ],
      "from": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttributeLink"
        },
        "linkType": "one",
        "requiredOnCreate": false,
        "handler": false
      },
      "to": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttributeLink"
        },
        "requiredOnCreate": true,
        "linkType": "many",
        "handler": true
      },
      "canDelete": false
    }
  ],
  "canChangeToRelTypes": [
    {
      "serviceTag": "ProductAttribute",
      "relationshipTag": "disabledProductAttributeLink"
    }
  ],
  "canMove": false
}

disabledProductAttributeLink

{
  "relationshipServiceTag": "ProductAttribute",
  "fieldNames": {
    "originTimestamp": {
      "type": "number",
      "requiredOnCreate": true,
      "optionalOnCreate": true,
      "canUpdate": true,
      "validation": {

      }
    },
  },
  "storageResources": {
    "mainGraph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "links": [
    {
      "storageResourceTags": [
        "mainGraph"
      ],
      "from": {
        "objType": {
          "serviceTag": "ProductManager",
          "objectType": "product"
        },
        "linkType": "one",
        "requiredOnCreate": false,
        "handler": false
      },
      "to": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttributeLink"
        },
        "requiredOnCreate": false,
        "linkType": "many",
        "handler": true
      },
      "canDelete": false
    }
  ],
  "canChangeToRelTypes": [
    {
      "serviceTag": "ProductAttribute",
      "relationshipTag": "hasProductAttributeLink"
    }
  ],
  "canMove": false
}

Working documents

Product Attributes