Service - Stock Location Manager
Revision as of 09:49, 4 May 2023 by Sven the Barbarian (talk | contribs)
Overview
Each Sell Offer (Standard) record points to a Stock Loctation record which is handled by a Service - Stock Location (handlers) service, with Service - Stock Location Standard handling simple quantities remaining in stock per stock location record.
The Stock Location Manager service handles shared orchestration of Stock Location Handler services.
Repository
https://bitbucket.org/izara-market-products/izara-market-products-stock-location-manager
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configKey: "ProductGraphServiceName"
configTag: "ProductGraphServiceName"
configValue: xxx // eg: "ProductGraph"
}
{
configKey: "StockLocationHandlerService"
configTag: xxx // stockLocationHandlerServiceNameTag, eg: "StockLocationStandard"
configValue: {
serviceName: xxx // eg: "StockLocationStandard", this is the actual deployed service name
}
}
StockLocationRecord
Records which Handler manages each stock location
{
stockLocationId
stockLocationHandlerServiceNameTag
}
- partition key: stockLocationId
- sort key: (none)
Service - Products Graph
Nodes
{
nodeLabel: "{stockLocationSharedLib.consts.STOCKLOCATION_GRAPH_NODE_LABEL}", // "stockLocation"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
stockLocationId: {
identifier: true, // create unique id from translation
},
stockLocationHandlerServiceNameTag: {
immutable: true,
},
},
}
}
Versioned data
stockLocationSettings
{
properties: {
locationName: xx, // user defined name for stock location
},
}
Basic node schemas (?)
{
nodeLabel: "{StockLocationManagerLib.STOCKLOCATION_GRAPH_NODE_LABEL}"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
stockLocationId: {
identifier: true,
},
stockLocationHandlerServiceNameTag: {
immutable: true,
},
},
}
}
Relationships
{
relationshipType: "{stockLocationSharedLib.atStockLocationGraphRelationshipType()}", // "at_StockLocation"
schema: {
immutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
- connects sellOffer to stockLocation
Translate Ids - stockLocation to sellOffer
- from stockLocationId to sellOfferIds
Complex Filter requests
- Not yet used at the Manager level, would send requests to all handlers, could perhaps setup to automatically pass on processLogical requests to all handlers, and not have a processLogical function in the Manager service