Service - Currency Table Standard: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
Seagame (talk | contribs)
Jammy (talk | contribs)
No edit summary
Line 70: Line 70:
currencyTableId: {
currencyTableId: {
fromRequiredOnCreate: {
fromRequiredOnCreate: {
relType: {
    belongToObjType: true,
serviceTag:"CurrencyTableStandard",
relationshipTag:"hasCurrencyRate"
},
fieldName:"" // optional default= same field name eg: now default == currencyTableId if not defined(use fieldname of object inside link when create)
fieldName:"" // optional default= same field name eg: now default == currencyTableId if not defined(use fieldname of object inside link when create)
}
}
Line 166: Line 163:
         "linkType": "one",
         "linkType": "one",
         "requiredOnCreate": false,
         "requiredOnCreate": false,
        "handler": true,
      },
      "canDelete": false
    }
  ],
  "canMove": false
}
</syntaxhighlight>
=== hasCurrencyRate ===
<syntaxhighlight lang="JavaScript">
{
  "relationshipServiceTag": "CurrencyTableStandard",
  "fieldNames": {},
  "storageResources": {
    "graph": {
      "storageType": "graph",
      "graphServerTag": "GraphHandler"
    }
  },
  "links": [
    {
      "storageResourceTags": [
        "graph"
      ],
      "from": {
        "objType": {
          "serviceTag": "CurrencyTableStandard",
          "objectType": "currencyTableStandard"
        },
        "linkType": "one",
        "handler": true,
        "requiredOnCreate": false
      },
      "to": {
        "objType": {
          "serviceTag": "CurrencyTableStandard",
          "objectType": "currencyTableRate"
        },
        "linkType": "many",
        "requiredOnCreate": true,
         "handler": true,
         "handler": true,
       },
       },

Revision as of 04:15, 28 May 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",
	"storageResources": {
		graph: {
			storageType: "graph",
			graphServerTag: "GraphHandler",
		}
	},
	"addOnDataStructure": [
		{
			type:"versionedData",
			versionedDataLabel: "currencyTableRateValue",
			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