Additional property
Additional Properties
Additional Properties is a general HiiRetail concept, made to handle any data need, without resulting in additional development or schema changes.
There are mainly two reasons for using Additional Properties on your data:
- To fulfill the needs of the services using your data. This can be the POS, electronic shelf labels, label printing process, data warehouse and reports, stock management etc.
- To enrich the data with your custom information. If you need some additional information visualized on a web page, or you need a cashier to see some additional information about an item, it can be accomplished by using Additional Properties.
We support Additional Properties on most entities in Hii Retail.
What is it?
The Additional Properties is an array on the entity that needs to be extended with dynamic additional information. This applies whether the data is supplied directly on a specific entity or added to an entity based on calculations from internal Hii Retail processing.
Additional properties can be considered as key value pairs with some additional metadata. The Id is the identifier for the information and the Value will be stored as a string.
Additional Properties can be of several data types, and this MUST be set correctly for the data to be visualized and treated correctly.
When reading or displaying the data in the AdditionalProperty entity, the DataType must be evaluated to be able to interpret the content correctly. This means that if you need to display this information in your own app or web application, you should consider the data type of the content to display the content in the correct way.
For example, the Additional Property "MyCustomProperty.IsVisibleInUI" has a data type of "Boolean" - you should use a display control in the UI that renders a boolean value in a human readable way. I.e.
How does it work?
Additional Properties defined on an entity will be inherited to entities below it in a hierarchy, or as a result of distribution calculations.
For example Item Categories with defined Additional Properties will inherit the additional information from its parent and propagate the accumulated set of properties onto its underlying Item Category, and eventually to the Items belonging to that Item Category.
Item Categories Additional Properties Inheritance
Set = Locally set Additional Property
Acc = Accumulated Additional Properties
This allows you to have default values created on a higher level in a hierarchy (like Item Categories), and the values will be aggregated on the lower levels. For Item Categories it will also propagate these default values onto the items that are placed in a given category.
An Item associated with the lowest Item Category in the image above would automatically get the Additional Properties X, Y, E, F, G, H. If any of these were also defined in the Item itself, the Item-level definition would be kept.
Additional Property types
Data type | Description |
---|---|
BOOL | Boolean value (true, false). Should translate to a checkbox or equivalent in a UI |
INT | Signed integer (-2,147,483,648 to 2,147,483,647). Should translate to an input box limited to numeric values without decimals or equivalent in a UI |
LONG | Signed big integer (-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807). Should translate to an input box limited to numeric values without decimals or equivalent in a UI |
DECIMAL | Floating point number with ~15-17 digits. Should translate to an input box limited to numeric values with decimals or equivalent in a UI |
DOUBLE | Floating point number with 28-29 digits. Should translate to an input box limited to numeric values with decimals or equivalent in a UI |
STRING | Text input. Should translate to an input field with no character restrictions. |
DATE | Date only input. Should translate to a calendar in a UI |
DATETIME | Date and time input. Should translate to a calendar and time input in a UI |
CURRENCY | Numeric input with decimals. Should translate to an input box limited to numeric values with decimals presented with currency information. This might need additional information in the AdditionalProperty entity |
IMAGE | Text link to a picture. Will not allow other file suffixes. |
BINARY | Binary blob of data. Will be stored in Cloud Storage and replaced with a link to the data. Will probably not be possible to visualize unless possible to identify what it is on the consumer end. |
LINK | URL to any resource on the internet. Must validate to be a valid link |
ARRAY | List of strings separated by comma (,) |
KEY-VALUE | Key value list. Separator for each pair is the pipe (|) symbol and separator between key and value is comma (,) (string,string |
JSON | JSON structure. Will be validated for errors. Visualization could be a text area with formatting where language type is set to JSON. |
XML | XML structure structure. Will be validated for errors. Visualization could be a text area with formatting where language type is set to XML. |
UNKNOWN | Should not be used, but might be set if errors occur. |