Service - Product Attributes: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
 
(16 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: "productAttributeLabel",
  "objectType": "productAttributeLink",
schema: {
  "canDelete": true,
identifier: true,
  "storageResources": {
restrictProperties: true,
    "mainGraph": {
restrictRelationships: true,
      "storageType": "graph",
properties: {
      "graphServerTag": "GraphHandler"
productAttributeLabelId: {
    }
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>
* groups product attributes, eg: "colour", "size", etc..


=== productAttributeLabel ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
nodeLabel: "productAttribute",
  "objectType": "productAttributeLabel",
schema: {
  "canDelete": true,
identifier: true,
  "storageResources": {
restrictProperties: true,
    "mainGraph": {
restrictRelationships: true,
      "storageType": "graph",
properties: {
      "graphServerTag": "GraphHandler"
productAttributeId: {
    }
identifier: true, //(random uuid)
  },
},
  "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"
}
}
</syntaxhighlight>
</syntaxhighlight>
* one product attributes value inside one product label, eg: "green" under the "colour" label


<syntaxhighlight lang="JavaScript">
== RelationshipSchemas ==
{
nodeLabel: "productAttributeLink",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
productAttributeLinkId: {
identifier: true, //(random uuid)
},
productId: {
immutable: true,
},
productAttributeId: {
immutable: true,
},
},
}
}
</syntaxhighlight>


=== 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,
},
},
}
}
</syntaxhighlight>
 
=== Relationships ===


<syntaxhighlight lang="JavaScript">
      }
{
    },
relationshipType: "hasProductAttributeLink",
  },
schema: {
  "storageResources": {
elementCanBeRemoved: true,
    "mainGraph": {
allPropertiesImmutable: true,
      "storageType": "graph",
restrictProperties: true,
      "graphServerTag": "GraphHandler"
properties: {
    }
originTimestamp: //timestamp the request to create/change this relationship was sent
  },
},
  "links": [
}
    {
}
      "storageResourceTags": [
</syntaxhighlight>
        "mainGraph"
<syntaxhighlight lang="JavaScript">
      ],
{
      "from": {
relationshipType: "disabledProductAttributeLink",
        "objType": {
schema: {
          "serviceTag": "ProductAttribute",
elementCanBeRemoved: true,
          "objectType": "productAttributeLink"
allPropertiesImmutable: true,
        },
restrictProperties: true,
        "linkType": "one",
properties: {
        "requiredOnCreate": true,
originTimestamp: //timestamp the request to create/change this relationship was sent
        "handler": false
},
      },
}
      "to": {
        "objType": {
          "serviceTag": "ProductAttribute",
          "objectType": "productAttribute"
        },
        "requiredOnCreate": false,
        "linkType": "one",
        "handler": true
      },
      "canDelete": false
    }
  ],
  "canMove": false
}
}
</syntaxhighlight>
</syntaxhighlight>
* creates a link in attribute tree between a Product or ProductAttributeLink, and a child ProductAttributeLink


=== isProductAttributeLabel ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "isProductAttribute",
  "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>
* links one ProductAttributeLink to one ProductAttribute


<syntaxhighlight lang="JavaScript">
      }
{
    },
relationshipType: "isProductLabel",
  },
schema: {
  "storageResources": {
elementCanBeRemoved: true,
    "mainGraph": {
allPropertiesImmutable: true,
      "storageType": "graph",
restrictProperties: true,
      "graphServerTag": "GraphHandler"
properties: {
    }
originTimestamp: //timestamp the request to create/change this relationship was sent
  },
},
  "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
}
}
</syntaxhighlight>
</syntaxhighlight>
* links one ProductAttribute to one ProductAttributeLabel


=== hasProductAttributeLink ===
<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
relationshipType: "hasProductAttributeProperty",
  "relationshipServiceTag": "ProductAttribute",
schema: {
  "fieldNames": {
elementCanBeRemoved: true,
    "originTimestamp": {
allPropertiesImmutable: true,
      "type": "number",
restrictProperties: true,
      "optionalOnCreate": true,
properties: {
      "canUpdate": true,
originTimestamp: //timestamp the request to create/change this relationship was sent
      "validation": {
},
}
}
</syntaxhighlight>
* ProductAttribute links to it's Properties
 
== [[Service - Translations Graph]]==


=== Nodes ===
      },
 
      "requiredOnCreate": false
<syntaxhighlight lang="JavaScript">
    },
{
  },
nodeLabel: "productAttributeLabel",
  "storageResources": {
schema: {
    "mainGraph": {
identifier: true,
      "storageType": "graph",
restrictProperties: true,
      "graphServerTag": "GraphHandler"
restrictRelationships: true,
    }
properties: {
  },
productAttributeId: {
  "links": [
identifier: true,
    {
},
      "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: "productAttributeValue",
  "relationshipServiceTag": "ProductAttribute",
schema: {
  "fieldNames": {
identifier: true,
    "originTimestamp": {
restrictProperties: true,
      "type": "number",
restrictRelationships: true,
      "requiredOnCreate": true,
properties: {
      "optionalOnCreate": true,
productAttributeId: {
      "canUpdate": true,
identifier: true,
      "validation": {
},
},
}
}
</syntaxhighlight>


<syntaxhighlight lang="JavaScript">
      }
{
    },
nodeLabel: "productAttributePropertyName",
  },
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>
<syntaxhighlight lang="JavaScript">
{
nodeLabel: "productAttributePropertyValue",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
propertyId: {
identifier: true,
},
},
}
}
</syntaxhighlight>
== Basic node schemas ==
=== productAttribute ===
* [[Service - Media Graph]]


= Working documents =
= Working documents =

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