Service - Currency Table Standard: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
Created page with "= Overview = Handler service for standard currencyTables that include historical changes. = Repository = ... = Schemas = ==ObjectSchemas== === currencyTableStandard === <syntaxhighlight lang="JavaScript"> { "objectType": "currencyTableStandard", "extendObjType": { "serviceTag": "CurrencyTableManager", "objectType": "currencyTable" }, "storageResources": {}, "addOnDataStructure": [], "fieldNames": { // from currencyTable objType }, "generatedBy": "use..."
 
Jammy (talk | contribs)
 
(7 intermediate revisions by 3 users not shown)
Line 23: Line 23:
"addOnDataStructure": [],
"addOnDataStructure": [],
"fieldNames": {
"fieldNames": {
// from currencyTable objType
"baseCurrencyId":{
type: "currency",
requiredOnCreate: true,
},
},
},
"generatedBy": "userGenerated"
"generatedBy": "userGenerated"
Line 34: Line 37:
{
{
"objectType": "currencyTableRate",
"objectType": "currencyTableRate",
    "belongTo": {
      serviceTag: "CurrencyTableStandard",
      objectType: "currencyTableStandard"
    },
"storageResources": {
"storageResources": {
graph: {
graph: {
Line 43: Line 50:
{
{
type:"versionedData",
type:"versionedData",
versionedDataLabel: "currencyTableRateValue",
versionedDataLabel: "Value",
storageResourceTag : "graph",
storageResourceTag : "graph",
fieldNames: {
fieldNames: {
Line 55: Line 62:
],
],
"fieldNames": {
"fieldNames": {
        // none, identifier comes from hash or concat of currencyTableID and currencyId
currencyId: {
fromRequiredOnCreate: { // will use data from requiredOnCreateLink that have same relType to use this value, and then
relType: {
serviceTag:"CurrencyTableStandard",
relationshipTag:"isCurrency"
},
fieldName:"" // optional default=same field name eg: now default == currencyId if not defined(use fieldname of object inside link when create)
}
},
currencyTableId: {
currencyTableId: {
type: "string",
fromRequiredOnCreate: {
randomOnCreate: true,
    belongToObjType: true,
storageResourceTags: ['graph']
fieldName:"" // optional default= same field name eg: now default == currencyTableId if not defined(use fieldname of object inside link when create)
    fromObjType:{
}
serviceTag: "xxx",
}
objectType: "xxx"
},
},
},
},
identifiers: [
identifiers: [
{
{
type: "identifier",
type: "identifier",
fieldNames: ["xx","yy"], // waiting confirm how to hash currencyTableID and currencyId
fieldNames: ["currencyId","currencyTableId"], // from required on create object identifiers
name: "zz", // name of field in database
name: "currencyTableRateId", // name of field in database
},
},
]
]
Line 78: Line 92:
== RelationshipSchemas ==
== RelationshipSchemas ==


=== isCurrency ===
=== baseCurrency ===


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
Line 97: Line 111:
       "from": {
       "from": {
         "objType": {
         "objType": {
           "serviceTag": "CurrencyTableRate",
           "serviceTag": "CurrencyTableStandard",
           "objectType": "currencyTableRate"
           "objectType": "currencyTableStandard"
         },
         },
         "linkType": "many",
         "linkType": "many",
Line 120: Line 134:
</syntaxhighlight>
</syntaxhighlight>


=== hasCurrencyRate ===
=== isCurrency ===


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
Line 139: Line 153:
       "from": {
       "from": {
         "objType": {
         "objType": {
           "serviceTag": "CurrencyTableStandard",
           "serviceTag": "CurrencyTableRate",
           "objectType": "currencyTableStandard"
           "objectType": "currencyTableRate"
         },
         },
         "linkType": "one",
         "linkType": "many",
         "handler": true,
         "handler": true,
         "requiredOnCreate": false
         "requiredOnCreate": true
       },
       },
       "to": {
       "to": {
         "objType": {
         "objType": {
           "serviceTag": "CurrencyTableStandard",
           "serviceTag": "Currency",
           "objectType": "currencyTableRate"
           "objectType": "currency"
         },
         },
         "linkType": "many",
         "linkType": "one",
         "requiredOnCreate": true,
         "requiredOnCreate": false,
         "handler": true,
         "handler": true,
       },
       },

Latest revision as of 05:44, 3 June 2026

Overview

Handler service for standard currencyTables that include historical changes.

Repository

...

Schemas

ObjectSchemas

currencyTableStandard

{
	"objectType": "currencyTableStandard",
	"extendObjType": {
		"serviceTag": "CurrencyTableManager",
		"objectType": "currencyTable"
	},
	"storageResources": {},
	"addOnDataStructure": [],
	"fieldNames": {
		"baseCurrencyId":{
			type: "currency",
			requiredOnCreate: true,
		},
	},
	"generatedBy": "userGenerated"
}

currencyTableRate

{
	"objectType": "currencyTableRate",
    "belongTo": {
       serviceTag: "CurrencyTableStandard",
       objectType: "currencyTableStandard"
    },
	"storageResources": {
		graph: {
			storageType: "graph",
			graphServerTag: "GraphHandler",
		}
	},
	"addOnDataStructure": [
		{
			type:"versionedData",
			versionedDataLabel: "Value",
			storageResourceTag : "graph",
			fieldNames: {
				"exchangeRate":{
					type: "number",
					requiredOnCreate: true,
					validation: {},
				},
			}
		},
	],
	"fieldNames": {
         // none, identifier comes from hash or concat of currencyTableID and currencyId
		currencyId: {
			fromRequiredOnCreate: { // will use data from requiredOnCreateLink that have same relType to use this value, and then 
				relType: {
					serviceTag:"CurrencyTableStandard",
					relationshipTag:"isCurrency"
				},
				fieldName:"" // optional default=same field name eg: now default == currencyId if not defined(use fieldname of object inside link when create)
			}
		},
		currencyTableId: {
			fromRequiredOnCreate: {
			    belongToObjType: true,
				fieldName:"" // optional default= same field name eg: now default == currencyTableId if not defined(use fieldname of object inside link when create)
			}
		}
	},
	identifiers: [
		{
			type: "identifier",
			fieldNames: ["currencyId","currencyTableId"], // from required on create object identifiers
			name: "currencyTableRateId", // name of field in database
		},
	]
	"generatedBy": "userGenerated"
}

RelationshipSchemas

baseCurrency

{
  "relationshipServiceTag": "CurrencyTableStandard",
  "fieldNames": {},
  "storageResources": {
    "graph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "links": [
    {
      "storageResourceTags": [
        "graph"
      ],
      "from": {
        "objType": {
          "serviceTag": "CurrencyTableStandard",
          "objectType": "currencyTableStandard"
        },
        "linkType": "many",
        "handler": true,
        "requiredOnCreate": true
      },
      "to": {
        "objType": {
          "serviceTag": "Currency",
          "objectType": "currency"
        },
        "linkType": "one",
        "requiredOnCreate": false,
        "handler": true,
      },
      "canDelete": false
    }
  ],
  "canMove": false
}

isCurrency

{
  "relationshipServiceTag": "CurrencyTableStandard",
  "fieldNames": {},
  "storageResources": {
    "graph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "links": [
    {
      "storageResourceTags": [
        "graph"
      ],
      "from": {
        "objType": {
          "serviceTag": "CurrencyTableRate",
          "objectType": "currencyTableRate"
        },
        "linkType": "many",
        "handler": true,
        "requiredOnCreate": true
      },
      "to": {
        "objType": {
          "serviceTag": "Currency",
          "objectType": "currency"
        },
        "linkType": "one",
        "requiredOnCreate": false,
        "handler": true,
      },
      "canDelete": false
    }
  ],
  "canMove": false
}

Working documents

Currency Table Standard