GTIN attribute
Attribute type id | Type specific restriction parameters |
---|---|
gtin | gtinSizes: List of valid gtin types. Default sizes (number of digits) are: 8, 12, 13, 14, 17, 18. |
All restrictions are validated in provided order.
Attribute validation will fail on the first unfulfilled restriction.
Code Examples:
{
"id" : "PRIMARY_GTIN",
"name" : "Primary GTIN",
"type" : {
"id" : "gtin",
"restriction" : {
"parameters" : {
"gtinSizes" : "[8,12,13,14]"
}
}
}
}
Attribute gtinAttribute = AttributeBuilder
.gtinAttribute("PRIMARY_GTIN", "Primary GTIN")
.withAllowedGtinLengths(List.of(8, 12))
.withAllowedGtinLength(13)
.withAllowedGtinLength(14)
.build();
Updated over 1 year ago