Service - Addresses: Difference between revisions
Jump to navigation
Jump to search
(Created page with "= Overview = Addresses linking to LocationIds, including optional address templates. = Repository = https://bitbucket.org/izara-core-locations/izara-core-addresses-addresse...") |
No edit summary |
||
Line 17: | Line 17: | ||
configKey: "LocationsGraphServiceName" | configKey: "LocationsGraphServiceName" | ||
configTag: "LocationsGraphServiceName" | configTag: "LocationsGraphServiceName" | ||
configValue: xxx // eg: "Locations" | configValue: "xxx" // eg: "Locations" | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 25: | Line 25: | ||
configKey: "TranslationGraphServiceName" | configKey: "TranslationGraphServiceName" | ||
configTag: "TranslationGraphServiceName" | configTag: "TranslationGraphServiceName" | ||
configValue: xxx // eg: "TranslationGraph" | configValue: "xxx" // eg: "TranslationGraph" | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== AddressTemplates == | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
rootlocationNodeId: "xx", | |||
addressTemplateTag: "xx", // user defined string | |||
elements: [ // use Dynamo List as want to preserve order of elements | |||
"customText", | |||
"newLine", | |||
"customText", | |||
"newLine", | |||
23, | |||
"newLine", | |||
6988, | |||
"space", | |||
"6465", | |||
"newLine", | |||
"rootlocationNodeId", | |||
] | |||
} | |||
</syntaxhighlight> | |||
* partition key: rootlocationNodeId | |||
* sort key: addressTemplateTag | |||
* integer elements point to locationType nodes | |||
= Graph database = | = Graph database = | ||
Line 36: | Line 62: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
nodeLabel: "{AddressesSharedLib. | nodeLabel: "{AddressesSharedLib.ADDRESSNODE_GRAPH_NODE_LABEL}", // "addressNode" | ||
schema: { | schema: { | ||
immutable: true, | |||
restrictProperties: true, | restrictProperties: true, | ||
restrictRelationships: true, | restrictRelationships: true, | ||
properties: { | properties: { | ||
addressId: { | |||
identifier: true, // create unique id from request details | identifier: true, // create unique id from request details including uniqueMessageId | ||
}, | }, | ||
addressTag: { | |||
immutable: true, | immutable: true, | ||
}, | }, | ||
addressText: { | |||
immutable: true, | immutable: true, // full text of the address | ||
}, | |||
addressTemplateTag: { | |||
immutable: true, // optional, if created from addressTemplate | |||
}, | |||
template: { | |||
immutable: true, // is the structure submitted for the address, same format as addressTemplateTag.elements (but might be custom made/no addressTemplateTag used) | |||
}, | |||
languageId: { | |||
immutable: true, // will determine the translation used by each locationTypeId | |||
}, | }, | ||
}, | }, | ||
Line 61: | Line 96: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
relationshipType: "{ | relationshipType: "{AddressesSharedLib.addressNodeHasRelType()}", // "has_addressNode" | ||
schema: { | |||
elementCanBeRemoved: true, | |||
allPropertiesImmutable: true, | |||
restrictProperties: true, | |||
properties: { | |||
originTimestamp: //timestamp the request to create/change this relationship was sent | |||
}, | |||
} | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "{AddressesSharedLib.addressNodeDisabledRelType()}", // "disabled_addressNode" | |||
schema: { | |||
elementCanBeRemoved: true, | |||
allPropertiesImmutable: true, | |||
restrictProperties: true, | |||
properties: { | |||
originTimestamp: //timestamp the request to create/change this relationship was sent | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "{AddressesSharedLib.addressNodeDefaultRelType()}", // "default_addressNode" | |||
schema: { | |||
elementCanBeRemoved: true, | |||
allPropertiesImmutable: true, | |||
restrictProperties: true, | |||
properties: { | |||
originTimestamp: //timestamp the request to create/change this relationship was sent | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "{AddressesSharedLib.addressNodeLocationNodeHasRelType()}", // "has_addressNodeLocationNode" | |||
schema: { | |||
elementCanBeRemoved: false, | |||
allPropertiesImmutable: true, | |||
restrictProperties: true, | |||
properties: { | |||
originTimestamp: //timestamp the request to create/change this relationship was sent | |||
order: 1 // the order within the template/addressText where this locationNode is | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
= Notes = | |||
* storing the addressText directly into the address node means the address text is fixed and will not be adjusted by for example translation changes in locationNodes | |||
* addressText is already translated and stores it's languageId, so no confusion when viewing an address what parts are what language (eg customText elements are fixed text but locationNodeIds could change if their translated text is calculated on the fly) | |||
= Working documents = | = Working documents = |
Revision as of 14:02, 18 October 2021
Overview
Addresses linking to LocationIds, including optional address templates.
Repository
https://bitbucket.org/izara-core-locations/izara-core-addresses-addresses/src/master/
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configKey: "LocationsGraphServiceName"
configTag: "LocationsGraphServiceName"
configValue: "xxx" // eg: "Locations"
}
{
configKey: "TranslationGraphServiceName"
configTag: "TranslationGraphServiceName"
configValue: "xxx" // eg: "TranslationGraph"
}
AddressTemplates
{
rootlocationNodeId: "xx",
addressTemplateTag: "xx", // user defined string
elements: [ // use Dynamo List as want to preserve order of elements
"customText",
"newLine",
"customText",
"newLine",
23,
"newLine",
6988,
"space",
"6465",
"newLine",
"rootlocationNodeId",
]
}
- partition key: rootlocationNodeId
- sort key: addressTemplateTag
- integer elements point to locationType nodes
Graph database
Service - Locations Graph
Nodes
{
nodeLabel: "{AddressesSharedLib.ADDRESSNODE_GRAPH_NODE_LABEL}", // "addressNode"
schema: {
immutable: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
addressId: {
identifier: true, // create unique id from request details including uniqueMessageId
},
addressTag: {
immutable: true,
},
addressText: {
immutable: true, // full text of the address
},
addressTemplateTag: {
immutable: true, // optional, if created from addressTemplate
},
template: {
immutable: true, // is the structure submitted for the address, same format as addressTemplateTag.elements (but might be custom made/no addressTemplateTag used)
},
languageId: {
immutable: true, // will determine the translation used by each locationTypeId
},
},
}
}
Relationships
{
relationshipType: "{AddressesSharedLib.addressNodeHasRelType()}", // "has_addressNode"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{AddressesSharedLib.addressNodeDisabledRelType()}", // "disabled_addressNode"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{AddressesSharedLib.addressNodeDefaultRelType()}", // "default_addressNode"
schema: {
elementCanBeRemoved: true,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{AddressesSharedLib.addressNodeLocationNodeHasRelType()}", // "has_addressNodeLocationNode"
schema: {
elementCanBeRemoved: false,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
order: 1 // the order within the template/addressText where this locationNode is
},
}
}
Notes
- storing the addressText directly into the address node means the address text is fixed and will not be adjusted by for example translation changes in locationNodes
- addressText is already translated and stores it's languageId, so no confusion when viewing an address what parts are what language (eg customText elements are fixed text but locationNodeIds could change if their translated text is calculated on the fly)