Service - Sell Offer Manager: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| (31 intermediate revisions by the same user not shown) | |||
| Line 9: | Line 9: | ||
https://bitbucket.org/izara-market-products/izara-market-products-sell-offer-manager/src/master/ | https://bitbucket.org/izara-market-products/izara-market-products-sell-offer-manager/src/master/ | ||
= | = Object Schemas = | ||
; Additional Information: [[Per Service Schemas]] | |||
== | == objType == | ||
=== | === sellOffer === | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
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" | |||
} | |||
] | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Object Relationships == | |||
=== hasSellOffer === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
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" | |||
} | |||
} | |||
] | |||
} | |||
} | |||
</syntaxhighlight> | |||
=== disabledSellOffer === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
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" | |||
} | |||
} | |||
] | |||
} | |||
} | |||
</syntaxhighlight> | |||
=== soldByUser === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
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" | |||
} | |||
} | |||
] | |||
} | |||
} | |||
</syntaxhighlight> | |||
=== usesSellOfferPlan === | |||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
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" | |||
} | |||
} | |||
] | |||
} | } | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== | == 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. | |||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
orderPriceId: "xx", | |||
sellOfferQuantities: {}, | |||
deliverToLocationId: "xx", | |||
//price: "xx", //removing and using findDataMain process | |||
//expiryTime: "xx", //removing and using findDataMain process | |||
status: // " | // 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", | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* partition key: | * partition key: orderPriceId | ||
* sort key: { | * 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 | |||
= Working documents = | = Working documents = | ||
Latest revision as of 23:24, 16 August 2025
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