Service - Sell Offer Manager
Jump to navigation
Jump to search
Overview
Each sell offer is handled by a Service - Sell Offer (handlers) service.
The Sell Offer Manager service handles shared orchestration of the Sell Offer Handler services.
Repository
https://bitbucket.org/izara-market-products/izara-market-products-sell-offer-manager/src/master/
Object Schemas
- Additional Information
- Per Service Schemas
objType
sellOffer
{
objectType: "sellOffer",
canDelete: false,
belongTo: {
serviceTag: "user",
objectType: "user"
},
addOnDataStructure: [ // optional, add for additional setting to objectType
{
type: "attributeTree",
attributeTreeTag: "sellOfferTerms"
},
],
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
},
fieldNames: {
sellOfferId: {
type: "string",
randomOnCreate: true,
storageResourceTags: ['myGraph']
},
},
identifiers: [
{
type: "identifier",
fieldName: "sellOfferId"
}
]
}
Object Relationships
hasSellOffer
{
hasSellOffer: {
canChangeToRelTypes: [
{
serviceTag:"sellOfferManager",
relationshipTag: "disabledSellOffer"
},
],
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
},
links: [
{
storageResourceTags: ["myGraph"],
from: {
objType: {
serviceTag: "ProductManager",
objectType: "product"
},
linkType: "one",
},
to: {
objType: {
serviceTag: "sellOfferManager",
objectType: "sellOffer"
},
linkType: "many"
}
}
]
}
}
disabledSellOffer
{
disabledSellOffer: {
canChangeToRelTypes: [
{
serviceTag:"sellOfferManager",
relationshipTag: "hasSellOffer"
},
],
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
},
links: [
{
storageResourceTags: ["myGraph"],
from: {
objType: {
serviceTag: "ProductManager",
objectType: "product"
},
linkType: "one",
},
to: {
objType: {
serviceTag: "sellOfferManager",
objectType: "sellOffer"
},
linkType: "many"
}
}
]
}
}
soldByUser
{
soldByUser: {
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
},
links: [
{
storageResourceTags: ["myGraph"],
from: {
objType: {
serviceTag: "sellOfferManager",
objectType: "sellOffer"
},
linkType: "many",
},
to: {
objType: {
serviceTag: "user",
objectType: "user"
},
linkType: "one"
}
}
]
}
}
usesSellOfferPlan
{
usesSellOfferPlan: {
storageResources: {
myGraph: {
storageType: "graph",
graphServerTag: "GraphHandler"
}
},
links: [
{
storageResourceTags: ["myGraph"],
from: {
objType: {
serviceTag: "sellOfferManager",
objectType: "sellOffer"
},
linkType: "many",
},
to: {
objType: {
serviceTag: "sellOfferPlan",
objectType: "sellOfferPlan"
},
linkType: "one"
}
}
]
}
}
OrderPrice
Cache of one total calculation for list of sellOffer quantities, and one combination of deliverToLocationId, / sellOfferPlanUserPaymentMethodLinkId / sellOfferPlanDeliveryMethodLinkId. Price includes Payment and Delivery method costs.
{
orderPriceId: "xx",
sellOfferQuantities: {},
deliverToLocationId: "xx",
//price: "xx", //removing and using findDataMain process
//expiryTime: "xx", //removing and using findDataMain process
// status: "xx", // "recalculating"|"complete"|"error", not really needed, added as a reference
// errorsFound: [], // stringSet, when recalculating, will reset to empty, once finished if any errorsFound then status will be "error"
// uniqueRequestId: "xx", (I think no longer used) used for idempotence when first process request called, in case that invocation fails and restarts, can be removed when set to complete/error
orderSubtotal: "xx",
orderQuantity: "xx",
sellOfferPrices: {}
deliveryPrice: "xx",
sellOfferPlanDeliveryMethodLinkId: "xx",
paymentPrice: "xx",
sellOfferPlanUserPaymentMethodLinkId: "xx",
}
- partition key: orderPriceId
- sort key: (none)
- orderPriceId is {hash of sellOfferQuantities / orderQuantity / deliverToLocationId / sellOfferPlanDeliveryMethodLinkId / sellOfferPlanUserPaymentMethodLinkId
- sellOfferPlanQuantities works out the combined total for multiple sellOfferPlans, all sellOfferPlans must offer the given payment and delivery Ids, if not will be status error
- values found during re-calc are stored here, and can be used to present detailed cart pricing
- total price is stored in FindData table, and price is recalculated whenever FindData expires. This will mean should always request price via FindData, cannot request directly from orderPrice table