Service - Payment Method Generic: Difference between revisions
Jump to navigation
Jump to search
(Created page with "= Overview = Handler service for any otherwise un-handled payment methods. = Repository = https://bitbucket.org/izara-market-products/izara-market-products-payment-method-g...") |
|||
| (22 intermediate revisions by 2 users not shown) | |||
| Line 1: | Line 1: | ||
= Overview = | = Overview = | ||
Handler service for | Handler service for generic payment methods that give text instruction to buyer at completion of sale. userPaymentMethod is also handled by each Payment Method Handler because there will be unique settings depending on the Payment Method. | ||
= Repository = | = Repository = | ||
https://bitbucket.org/izara-market-products/izara-market-products-payment-method-generic/src/master/ | https://bitbucket.org/izara-market-products/izara-market-products-payment-method-generic/src/master/ | ||
= Schemas = | |||
==ObjectSchemas== | |||
===paymentMethodGeneric=== | |||
*ExtendObjType:paymentMethod | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "paymentMethodGeneric", | |||
"extendObjType": { | |||
"serviceTag": "PaymentMethodManager", | |||
"objectType": "paymentMethod" | |||
}, | |||
"addOnDataStructure": [ | |||
{ | |||
"type": "propertyValue" | |||
} | |||
], | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
}, | |||
"dynamoDB": { | |||
"storageType": "dynamoDB", | |||
"tableName": "PaymentMethodRecords", | |||
"serviceTag": "PaymentMethodManager" | |||
} | |||
}, | |||
"fieldNames": {}, | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
=== userPaymentMethodGeneric === | |||
*ExtendObjType:userPaymentMethod | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "userPaymentMethodGeneric", | |||
"extendObjType": { | |||
"serviceTag": "PaymentMethodManager", | |||
"objectType": "userPaymentMethod" | |||
}, | |||
"addOnDataStructure": [ | |||
{ | |||
"type": "propertyValue" | |||
} | |||
], | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
}, | |||
"dynamoDB": { | |||
"storageType": "dynamoDB", | |||
"tableName": "UserPaymentMethodsRecords", | |||
"serviceTag": "PaymentMethodManager" | |||
} | |||
}, | |||
"fieldNames": {}, | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
=== userPaymentMethodGenericSalePropertyValue === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "userPaymentMethodGenericSalePropertyValue", | |||
"addOnDataStructure": [ | |||
{ | |||
"type": "translation" | |||
} | |||
], | |||
"canDelete": true, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"userPaymentMethodGenericSalePropertyValueId": { | |||
"type": "string", | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"randomOnCreate": true, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9-_]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"graph" | |||
] | |||
} | |||
}, | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "userPaymentMethodGenericSalePropertyValueId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
=== userPaymentMethodGenericSalePropertyLabel === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "userPaymentMethodGenericSalePropertyLabel", | |||
"addOnDataStructure": [ | |||
{ | |||
"type": "translation" | |||
} | |||
], | |||
"canDelete": true, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"userPaymentMethodGenericSalePropertyLabelId": { | |||
"type": "string", | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"randomOnCreate": true, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9-_]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"graph" | |||
] | |||
} | |||
}, | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "userPaymentMethodGenericSalePropertyLabelId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
'''property''' | |||
=== paymentMethodGenericPropertyLabel === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "paymentMethodGenericPropertyLabel", | |||
"addOnDataStructure": [ | |||
{ | |||
"type": "translation" | |||
} | |||
], | |||
"canDelete": true, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"paymentMethodGenericPropertyLabelId": { | |||
"type": "string", | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"randomOnCreate": true, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9-_]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"graph" | |||
] | |||
} | |||
}, | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "paymentMethodGenericPropertyLabelId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
=== paymentMethodGenericPropertyValue === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "paymentMethodGenericPropertyValue", | |||
"addOnDataStructure": [ | |||
{ | |||
"type": "translation" | |||
} | |||
], | |||
"canDelete": true, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"paymentMethodGenericPropertyValueId": { | |||
"type": "string", | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"randomOnCreate": true, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9-_]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"graph" | |||
] | |||
} | |||
}, | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "paymentMethodGenericPropertyValueId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
=== userPaymentMethodGenericPropertyLabel === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "userPaymentMethodGenericPropertyLabel", | |||
"addOnDataStructure": [ | |||
{ | |||
"type": "translation" | |||
} | |||
], | |||
"canDelete": true, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"userPaymentMethodGenericPropertyLabelId": { | |||
"type": "string", | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"randomOnCreate": true, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9-_]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"graph" | |||
] | |||
} | |||
}, | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "userPaymentMethodGenericPropertyLabelId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
=== userPaymentMethodGenericPropertyValue === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"objectType": "userPaymentMethodGenericPropertyValue", | |||
"addOnDataStructure": [ | |||
{ | |||
"type": "translation" | |||
} | |||
], | |||
"canDelete": true, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"fieldNames": { | |||
"userPaymentMethodGenericPropertyValueId": { | |||
"type": "string", | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"randomOnCreate": true, | |||
"validation": { | |||
"pattern": "^[a-zA-Z0-9-_]+$" | |||
}, | |||
"storageResourceTags": [ | |||
"graph" | |||
] | |||
} | |||
}, | |||
"identifiers": [ | |||
{ | |||
"type": "identifier", | |||
"fieldName": "userPaymentMethodGenericPropertyValueId" | |||
} | |||
], | |||
"generatedBy": "userGenerated" | |||
} | |||
</syntaxhighlight> | |||
==RelationshipSchemas== | |||
=== disabledPaymentMethodGenericPropertyValue === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"relationshipServiceTag": "PaymentMethodGeneric", | |||
"fieldNames": { | |||
"relId": { | |||
"type": "string", | |||
"generatedField": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
} | |||
} | |||
}, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"links": [ | |||
{ | |||
"storageResourceTags": [ | |||
"graph" | |||
], | |||
"from": { | |||
"objType": { | |||
"objectType": "paymentMethodGeneric", | |||
"serviceTag": "PaymentMethodGeneric" | |||
}, | |||
"linkType": "one", | |||
"direction": "from", | |||
"requiredOnCreate": false, | |||
"handler": false | |||
}, | |||
"to": { | |||
"objType": { | |||
"objectType": "paymentMethodGenericPropertyValue", | |||
"serviceTag": "PaymentMethodGeneric" | |||
}, | |||
"linkType": "many", | |||
"direction": "to", | |||
"requiredOnCreate": false, | |||
"handler": false | |||
}, | |||
"canDelete": false | |||
} | |||
], | |||
"canMove": true | |||
"canChangeToRelTypes": [ | |||
{ | |||
serviceTag:"PaymentMethodGeneric", | |||
relationshipTag: "hasPaymentMethodGenericPropertyValue" | |||
}, | |||
] | |||
} | |||
</syntaxhighlight> | |||
=== disabledUserPaymentMethodGenericPropertyValue === | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
"relationshipServiceTag": "PaymentMethodGeneric", | |||
"fieldNames": { | |||
"relId": { | |||
"type": "string", | |||
"generatedField": true, | |||
"requiredOnCreate": false, | |||
"optionalOnCreate": false, | |||
"canUpdate": false, | |||
"validation": { | |||
} | |||
} | |||
}, | |||
"storageResources": { | |||
"graph": { | |||
"storageType": "graph", | |||
"graphServerTag": "GraphHandler" | |||
} | |||
}, | |||
"links": [ | |||
{ | |||
"storageResourceTags": [ | |||
"graph" | |||
], | |||
"from": { | |||
"objType": { | |||
"objectType": "userPaymentMethodGeneric", | |||
"serviceTag": "PaymentMethodGeneric" | |||
}, | |||
"linkType": "one", | |||
"direction": "from", | |||
"requiredOnCreate": false, | |||
"handler": false | |||
}, | |||
"to": { | |||
"objType": { | |||
"objectType": "userPaymentMethodGenericPropertyValue", | |||
"serviceTag": "PaymentMethodGeneric" | |||
}, | |||
"linkType": "many", | |||
"direction": "to", | |||
"requiredOnCreate": false, | |||
"handler": false | |||
}, | |||
"canDelete": false | |||
} | |||
], | |||
"canMove": true | |||
} | |||
</syntaxhighlight> | |||
=== === | |||
<syntaxhighlight lang="JavaScript"> | |||
</syntaxhighlight> | |||
=== === | |||
<syntaxhighlight lang="JavaScript"> | |||
</syntaxhighlight> | |||
=== === | |||
<syntaxhighlight lang="JavaScript"> | |||
</syntaxhighlight> | |||
=== === | |||
<syntaxhighlight lang="JavaScript"> | |||
</syntaxhighlight> | |||
=== === | |||
<syntaxhighlight lang="JavaScript"> | |||
</syntaxhighlight> | |||
=== === | |||
<syntaxhighlight lang="JavaScript"> | |||
</syntaxhighlight> | |||
= DynamoDB tables = | = DynamoDB tables = | ||
| Line 45: | Line 493: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
nodeLabel: " | nodeLabel: "paymentMethodGeneric", | ||
schema: { | schema: { | ||
identifier: true, | identifier: true, | ||
| Line 53: | Line 501: | ||
paymentMethodId: { | paymentMethodId: { | ||
identifier: true, // create unique id from translation | identifier: true, // create unique id from translation | ||
} | } | ||
}, | }, | ||
} | } | ||
| Line 64: | Line 509: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
nodeLabel: "{ | nodeLabel: "{PaymentMethodManagerLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}", // "userPaymentMethod" | ||
schema: { | schema: { | ||
identifier: true, | identifier: true, | ||
| Line 73: | Line 518: | ||
identifier: true, // create unique id from user and uniqueMessageId | identifier: true, // create unique id from user and uniqueMessageId | ||
}, | }, | ||
paymentMethodId: { // stored here to reduce queries finding matching methods, eg sellOffers | |||
immutable: true, | immutable: true, | ||
}, | }, | ||
userPaymentMethodTag: { // users reference name for this userPaymentMethod | |||
}, | }, | ||
}, | }, | ||
| Line 84: | Line 528: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* adds a node between a user and a payment method | * adds a node between a user and a payment method | ||
* this is the node linked to by | * this is the node linked to by sellOfferPlans | ||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel", | |||
} | |||
{ | |||
nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}Property", | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel", | |||
} | |||
{ | |||
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}Property", | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}PropertyLabel", // userPaymentMethodSalePropertyLabel | |||
} | |||
{ | |||
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}Property", | |||
} | |||
</syntaxhighlight> | |||
* see [[NPM module - Izara Core - Property Node|DataSchemaLib]] | |||
* two sets of property nodes for userPaymentMethod, one for presentation properties (when browsing), paymentMethodSale for after sale, properties that get sent to the buyer, eg bank account number | |||
=== Relationships === | === Relationships === | ||
| Line 90: | Line 562: | ||
<syntaxhighlight lang="JavaScript"> | <syntaxhighlight lang="JavaScript"> | ||
{ | { | ||
relationshipType: "{ | relationshipType: "{PaymentMethodManagerLib.createIsPaymentMethodGraphRelationshipType()}", // "is_paymentMethod" | ||
schema: { | |||
elementCanBeRemoved: false, | |||
allPropertiesImmutable: true, | |||
restrictProperties: true, | |||
properties: { | |||
originTimestamp: //timestamp the request to create/change this relationship was sent | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "{PaymentMethodManagerLib.createIsUserPaymentMethodGraphRelationshipType()}", // "is_userPaymentMethod" | |||
schema: { | schema: { | ||
elementCanBeRemoved: false, | elementCanBeRemoved: false, | ||
| Line 101: | Line 586: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
* not setup logic to disable userPaymentMethods at this time | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "has_{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}Property", | |||
} | |||
{ | |||
relationshipType: "disabled_{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}Property", | |||
} | |||
{ | |||
relationshipType: "is_{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel", | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "has_{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}Property", | |||
} | |||
{ | |||
relationshipType: "disabled_{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}Property", | |||
} | |||
{ | |||
relationshipType: "is_{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel", | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
relationshipType: "has_{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}Property", | |||
} | |||
{ | |||
relationshipType: "disabled_{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}Property", | |||
} | |||
{ | |||
relationshipType: "is_{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}PropertyLabel", | |||
} | |||
</syntaxhighlight> | |||
* see [[NPM module - Izara Core - Property Node|DataSchemaLib]] | |||
== Basic node schemas == | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}", // "paymentMethod" | |||
schema: { | |||
identifier: true, | |||
restrictProperties: true, | |||
restrictRelationships: true, | |||
properties: { | |||
paymentMethodId: { | |||
identifier: true, | |||
}, | |||
paymentMethodHandlerServiceNameTag: { | |||
immutable: true, | |||
}, | |||
}, | |||
} | |||
} | |||
</syntaxhighlight> | |||
* [[Service - Translations Graph]] | |||
* [[Service - Orders Graph]] | |||
=== Schema comes from [[NPM module - Izara Core - Property Node|BasicNodeSchemaLib]] === | |||
# paymentMethodPropertyLabel | |||
#* [[Service - Translations Graph]] | |||
# paymentMethodProperty | |||
#* [[Service - Translations Graph]] | |||
# paymentMethodSalePropertyLabel | |||
#* [[Service - Translations Graph]] | |||
# paymentMethodSaleProperty | |||
#* [[Service - Translations Graph]] | |||
= Complex Filter requests = | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
filterType: "handlerPaymentMethod" //unique id is paymentMethodId | |||
type: "group", | |||
elements: | |||
[ | |||
{ | |||
type: "logical", | |||
logicalTag: "currencyId", | |||
comparison: "equals", | |||
value: "xx" | |||
}, | |||
{ | |||
type: "complexFilter", | |||
complexFilter: { | |||
filterType: "paymentMethodProperty", | |||
// see [[NPM module - Izara Core - Property Node|Complex Filter requests]] | |||
} | |||
}, | |||
{ | |||
type: "complexFilter", | |||
complexFilter: { | |||
filterType: "paymentMethodNameTranslation" //unique id is paymentMethodId | |||
type: "group", | |||
elements: | |||
[ | |||
{ | |||
// see [[Service - Translations|Complex Filter requests]] | |||
type: "logical", | |||
logicalTag: "textTag_languageId_text", | |||
resultType: "paymentMethod", | |||
textTag: "paymentMethodName", | |||
languageId: "en", | |||
text: "Is a great term", | |||
subjectIdentifierPropertyName: "paymentMethodId", | |||
caseSensitive: true | |||
}, | |||
] | |||
} | |||
}, | |||
... | |||
] | |||
} | |||
</syntaxhighlight> | |||
<syntaxhighlight lang="JavaScript"> | |||
{ | |||
filterType: "handlerUserPaymentMethod" //unique id is userPaymentMethodId | |||
type: "group", | |||
elements: | |||
[ | |||
{ | |||
type: "logical", | |||
logicalTag: "paymentMethodId", | |||
comparison: "equals", | |||
value: "xx" | |||
}, | |||
{ | |||
type: "complexFilter", | |||
complexFilter: { | |||
filterType: "paymentMethod", | |||
// see above | |||
} | |||
}, | |||
{ | |||
type: "complexFilter", | |||
complexFilter: { | |||
filterType: "userPaymentMethodProperty", | |||
// see [[NPM module - Izara Core - Property Node|Complex Filter requests]] | |||
} | |||
}, | |||
{ | |||
type: "complexFilter", | |||
complexFilter: { | |||
filterType: "userPaymentMethodSaleProperty", | |||
// see [[NPM module - Izara Core - Property Node|Complex Filter requests]] | |||
} | |||
}, | |||
... | |||
] | |||
} | |||
</syntaxhighlight> | |||
= Data structure notes = | |||
* Users can create new paymentMethods which are uniquely identified by their translation | |||
* Users can create userPaymentMethod nodes for their account which connect to paymentMethods, one user can have multiple userPaymentMethod links to the same paymentMethod, eg different Bank Transfer nodes for different bank accounts, which can be applied to sell offers in any combination | |||
= Working documents = | = Working documents = | ||
Latest revision as of 07:11, 24 November 2025
Overview
Handler service for generic payment methods that give text instruction to buyer at completion of sale. userPaymentMethod is also handled by each Payment Method Handler because there will be unique settings depending on the Payment Method.
Repository
https://bitbucket.org/izara-market-products/izara-market-products-payment-method-generic/src/master/
Schemas
ObjectSchemas
paymentMethodGeneric
- ExtendObjType:paymentMethod
{
"objectType": "paymentMethodGeneric",
"extendObjType": {
"serviceTag": "PaymentMethodManager",
"objectType": "paymentMethod"
},
"addOnDataStructure": [
{
"type": "propertyValue"
}
],
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
},
"dynamoDB": {
"storageType": "dynamoDB",
"tableName": "PaymentMethodRecords",
"serviceTag": "PaymentMethodManager"
}
},
"fieldNames": {},
"generatedBy": "userGenerated"
}
userPaymentMethodGeneric
- ExtendObjType:userPaymentMethod
{
"objectType": "userPaymentMethodGeneric",
"extendObjType": {
"serviceTag": "PaymentMethodManager",
"objectType": "userPaymentMethod"
},
"addOnDataStructure": [
{
"type": "propertyValue"
}
],
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
},
"dynamoDB": {
"storageType": "dynamoDB",
"tableName": "UserPaymentMethodsRecords",
"serviceTag": "PaymentMethodManager"
}
},
"fieldNames": {},
"generatedBy": "userGenerated"
}
userPaymentMethodGenericSalePropertyValue
{
"objectType": "userPaymentMethodGenericSalePropertyValue",
"addOnDataStructure": [
{
"type": "translation"
}
],
"canDelete": true,
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"userPaymentMethodGenericSalePropertyValueId": {
"type": "string",
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"randomOnCreate": true,
"validation": {
"pattern": "^[a-zA-Z0-9-_]+$"
},
"storageResourceTags": [
"graph"
]
}
},
"identifiers": [
{
"type": "identifier",
"fieldName": "userPaymentMethodGenericSalePropertyValueId"
}
],
"generatedBy": "userGenerated"
}
userPaymentMethodGenericSalePropertyLabel
{
"objectType": "userPaymentMethodGenericSalePropertyLabel",
"addOnDataStructure": [
{
"type": "translation"
}
],
"canDelete": true,
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"userPaymentMethodGenericSalePropertyLabelId": {
"type": "string",
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"randomOnCreate": true,
"validation": {
"pattern": "^[a-zA-Z0-9-_]+$"
},
"storageResourceTags": [
"graph"
]
}
},
"identifiers": [
{
"type": "identifier",
"fieldName": "userPaymentMethodGenericSalePropertyLabelId"
}
],
"generatedBy": "userGenerated"
}
property
paymentMethodGenericPropertyLabel
{
"objectType": "paymentMethodGenericPropertyLabel",
"addOnDataStructure": [
{
"type": "translation"
}
],
"canDelete": true,
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"paymentMethodGenericPropertyLabelId": {
"type": "string",
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"randomOnCreate": true,
"validation": {
"pattern": "^[a-zA-Z0-9-_]+$"
},
"storageResourceTags": [
"graph"
]
}
},
"identifiers": [
{
"type": "identifier",
"fieldName": "paymentMethodGenericPropertyLabelId"
}
],
"generatedBy": "userGenerated"
}
paymentMethodGenericPropertyValue
{
"objectType": "paymentMethodGenericPropertyValue",
"addOnDataStructure": [
{
"type": "translation"
}
],
"canDelete": true,
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"paymentMethodGenericPropertyValueId": {
"type": "string",
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"randomOnCreate": true,
"validation": {
"pattern": "^[a-zA-Z0-9-_]+$"
},
"storageResourceTags": [
"graph"
]
}
},
"identifiers": [
{
"type": "identifier",
"fieldName": "paymentMethodGenericPropertyValueId"
}
],
"generatedBy": "userGenerated"
}
userPaymentMethodGenericPropertyLabel
{
"objectType": "userPaymentMethodGenericPropertyLabel",
"addOnDataStructure": [
{
"type": "translation"
}
],
"canDelete": true,
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"userPaymentMethodGenericPropertyLabelId": {
"type": "string",
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"randomOnCreate": true,
"validation": {
"pattern": "^[a-zA-Z0-9-_]+$"
},
"storageResourceTags": [
"graph"
]
}
},
"identifiers": [
{
"type": "identifier",
"fieldName": "userPaymentMethodGenericPropertyLabelId"
}
],
"generatedBy": "userGenerated"
}
userPaymentMethodGenericPropertyValue
{
"objectType": "userPaymentMethodGenericPropertyValue",
"addOnDataStructure": [
{
"type": "translation"
}
],
"canDelete": true,
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"fieldNames": {
"userPaymentMethodGenericPropertyValueId": {
"type": "string",
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"randomOnCreate": true,
"validation": {
"pattern": "^[a-zA-Z0-9-_]+$"
},
"storageResourceTags": [
"graph"
]
}
},
"identifiers": [
{
"type": "identifier",
"fieldName": "userPaymentMethodGenericPropertyValueId"
}
],
"generatedBy": "userGenerated"
}
RelationshipSchemas
disabledPaymentMethodGenericPropertyValue
{
"relationshipServiceTag": "PaymentMethodGeneric",
"fieldNames": {
"relId": {
"type": "string",
"generatedField": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
}
}
},
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"links": [
{
"storageResourceTags": [
"graph"
],
"from": {
"objType": {
"objectType": "paymentMethodGeneric",
"serviceTag": "PaymentMethodGeneric"
},
"linkType": "one",
"direction": "from",
"requiredOnCreate": false,
"handler": false
},
"to": {
"objType": {
"objectType": "paymentMethodGenericPropertyValue",
"serviceTag": "PaymentMethodGeneric"
},
"linkType": "many",
"direction": "to",
"requiredOnCreate": false,
"handler": false
},
"canDelete": false
}
],
"canMove": true
"canChangeToRelTypes": [
{
serviceTag:"PaymentMethodGeneric",
relationshipTag: "hasPaymentMethodGenericPropertyValue"
},
]
}
disabledUserPaymentMethodGenericPropertyValue
{
"relationshipServiceTag": "PaymentMethodGeneric",
"fieldNames": {
"relId": {
"type": "string",
"generatedField": true,
"requiredOnCreate": false,
"optionalOnCreate": false,
"canUpdate": false,
"validation": {
}
}
},
"storageResources": {
"graph": {
"storageType": "graph",
"graphServerTag": "GraphHandler"
}
},
"links": [
{
"storageResourceTags": [
"graph"
],
"from": {
"objType": {
"objectType": "userPaymentMethodGeneric",
"serviceTag": "PaymentMethodGeneric"
},
"linkType": "one",
"direction": "from",
"requiredOnCreate": false,
"handler": false
},
"to": {
"objType": {
"objectType": "userPaymentMethodGenericPropertyValue",
"serviceTag": "PaymentMethodGeneric"
},
"linkType": "many",
"direction": "to",
"requiredOnCreate": false,
"handler": false
},
"canDelete": false
}
],
"canMove": true
}
DynamoDB tables
Standard Config Table Per Service
Configuration tags
{
configTag: "PaymentMethodHandlerServiceNameTag"
configKey: "PaymentMethodHandlerServiceNameTag"
configValue: xxx // this own services ServiceNameTag, eg "PaymentMethodGeneric"
}
{
configTag: "ProductGraphServiceName"
configKey: "ProductGraphServiceName"
configValue: xxx // eg: "ProductGraph"
}
{
configTag: "PaymentMethodManagerServiceName"
configKey: "PaymentMethodManagerServiceName"
configValue: xxx // eg: "PaymentMethodManager"
}
Graph database
Service - Products Graph
Nodes
{
nodeLabel: "paymentMethodGeneric",
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
paymentMethodId: {
identifier: true, // create unique id from translation
}
},
}
}
{
nodeLabel: "{PaymentMethodManagerLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}", // "userPaymentMethod"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
userPaymentMethodId: {
identifier: true, // create unique id from user and uniqueMessageId
},
paymentMethodId: { // stored here to reduce queries finding matching methods, eg sellOffers
immutable: true,
},
userPaymentMethodTag: { // users reference name for this userPaymentMethod
},
},
}
}
- adds a node between a user and a payment method
- this is the node linked to by sellOfferPlans
{
nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel",
}
{
nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}
{
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel",
}
{
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}
{
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}PropertyLabel", // userPaymentMethodSalePropertyLabel
}
{
nodeLabel: "{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}Property",
}
- see DataSchemaLib
- two sets of property nodes for userPaymentMethod, one for presentation properties (when browsing), paymentMethodSale for after sale, properties that get sent to the buyer, eg bank account number
Relationships
{
relationshipType: "{PaymentMethodManagerLib.createIsPaymentMethodGraphRelationshipType()}", // "is_paymentMethod"
schema: {
elementCanBeRemoved: false,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
{
relationshipType: "{PaymentMethodManagerLib.createIsUserPaymentMethodGraphRelationshipType()}", // "is_userPaymentMethod"
schema: {
elementCanBeRemoved: false,
allPropertiesImmutable: true,
restrictProperties: true,
properties: {
originTimestamp: //timestamp the request to create/change this relationship was sent
},
}
}
- not setup logic to disable userPaymentMethods at this time
{
relationshipType: "has_{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}
{
relationshipType: "disabled_{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}
{
relationshipType: "is_{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel",
}
{
relationshipType: "has_{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}
{
relationshipType: "disabled_{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}Property",
}
{
relationshipType: "is_{PaymentMethodGenericLib.USERPAYMENTMETHOD_GRAPH_NODE_LABEL}PropertyLabel",
}
{
relationshipType: "has_{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}Property",
}
{
relationshipType: "disabled_{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}Property",
}
{
relationshipType: "is_{PaymentMethodGenericLib.USERPAYMENTMETHOD_SALE_PROPERTIES_GRAPH_TAG}PropertyLabel",
}
- see DataSchemaLib
Basic node schemas
{
nodeLabel: "{PaymentMethodGenericLib.PAYMENTMETHOD_GRAPH_NODE_LABEL}", // "paymentMethod"
schema: {
identifier: true,
restrictProperties: true,
restrictRelationships: true,
properties: {
paymentMethodId: {
identifier: true,
},
paymentMethodHandlerServiceNameTag: {
immutable: true,
},
},
}
}
Schema comes from BasicNodeSchemaLib
- paymentMethodPropertyLabel
- paymentMethodProperty
- paymentMethodSalePropertyLabel
- paymentMethodSaleProperty
Complex Filter requests
{
filterType: "handlerPaymentMethod" //unique id is paymentMethodId
type: "group",
elements:
[
{
type: "logical",
logicalTag: "currencyId",
comparison: "equals",
value: "xx"
},
{
type: "complexFilter",
complexFilter: {
filterType: "paymentMethodProperty",
// see [[NPM module - Izara Core - Property Node|Complex Filter requests]]
}
},
{
type: "complexFilter",
complexFilter: {
filterType: "paymentMethodNameTranslation" //unique id is paymentMethodId
type: "group",
elements:
[
{
// see [[Service - Translations|Complex Filter requests]]
type: "logical",
logicalTag: "textTag_languageId_text",
resultType: "paymentMethod",
textTag: "paymentMethodName",
languageId: "en",
text: "Is a great term",
subjectIdentifierPropertyName: "paymentMethodId",
caseSensitive: true
},
]
}
},
...
]
}
{
filterType: "handlerUserPaymentMethod" //unique id is userPaymentMethodId
type: "group",
elements:
[
{
type: "logical",
logicalTag: "paymentMethodId",
comparison: "equals",
value: "xx"
},
{
type: "complexFilter",
complexFilter: {
filterType: "paymentMethod",
// see above
}
},
{
type: "complexFilter",
complexFilter: {
filterType: "userPaymentMethodProperty",
// see [[NPM module - Izara Core - Property Node|Complex Filter requests]]
}
},
{
type: "complexFilter",
complexFilter: {
filterType: "userPaymentMethodSaleProperty",
// see [[NPM module - Izara Core - Property Node|Complex Filter requests]]
}
},
...
]
}
Data structure notes
- Users can create new paymentMethods which are uniquely identified by their translation
- Users can create userPaymentMethod nodes for their account which connect to paymentMethods, one user can have multiple userPaymentMethod links to the same paymentMethod, eg different Bank Transfer nodes for different bank accounts, which can be applied to sell offers in any combination