Service - Ledger: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
(Created page with "= Overview = A ledger can be used to generate a report such as the general ledger, each ledger specifies which Accounts are it's top level ledger accounts and which rollup in the generated report. = Repository = ... = Object Schemas = ; Additional Information: Per Service Schemas == ledger == <syntaxhighlight lang="JavaScript"> { objectType: "ledger", canDelete: false, addOnDataStructure: [ { type:"versionedData", versionedDataLabel: "ledgerDetail",...")
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 16: Line 16:
objectType: "ledger",
objectType: "ledger",
canDelete: false,
canDelete: false,
belongTo: {
serviceTag: "Organization",
objectType: "organization"
},
addOnDataStructure: [
addOnDataStructure: [
{
{
Line 22: Line 26:
storageResourceTag : "myGraph",
storageResourceTag : "myGraph",
fieldNames: {
fieldNames: {
"xxx":{
"totalOnly": {
type: "string",
type: "boolean",
requiredOnCreate: true,
requiredOnCreate: true,
canUpdate: true,
updateBy: "user"
userCanUpdate: true,
},
},
}
}
Line 56: Line 59:
== Relationships ==
== Relationships ==


=== hasOrganization ===
=== hasChildLedger ===
 
// .......


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
hasOrganization: {
hasChildLedger: {
storageResources: {
storageResources: {
myGraph: {
myGraph: {
Line 69: Line 70:
}
}
},
},
canChangeToRelTypes: [
{
serviceTag:"Organization",
relationshipTag: "removedOrganization"
},
],
links: [
links: [
{
{
storageResourceTags: ["myGraph"],
storageResourceTags: ["myGraph"],
canDelete: true,
from: {
from: {
objType: {
objType: {
serviceTag: "User",
serviceTag: "Ledger",
objectType: "user"
objectType: "ledger"
},
},
linkType: "one",
linkType: "one",
Line 87: Line 83:
to: {
to: {
objType: {
objType: {
serviceTag: "Organization",
serviceTag: "Ledger",
objectType: "organization"
objectType: "ledger"
},
},
linkType: "many"
linkType: "many"
Line 98: Line 94:
</syntaxhighlight>
</syntaxhighlight>


=== removedOrganization ===
* creates ledger hierarchy
* validate no infinite link loops
* could move this out to a link object if becomes more complex
 
=== includesAccount ===


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
{
{
removedOrganization: {
includesAccount: {
storageResources: {
storageResources: {
myGraph: {
myGraph: {
Line 109: Line 109:
}
}
},
},
canChangeToRelTypes: [
{
serviceTag:"Organization",
relationshipTag: "hasOrganization"
},
],
links: [
links: [
{
{
storageResourceTags: ["myGraph"],
storageResourceTags: ["myGraph"],
canDelete: true,
from: {
from: {
objType: {
objType: {
serviceTag: "User",
serviceTag: "Ledger",
objectType: "user"
objectType: "ledger"
},
},
linkType: "one",
linkType: "many",
},
},
to: {
to: {
objType: {
objType: {
serviceTag: "Organization",
serviceTag: "AccountManager",
objectType: "organization"
objectType: "account"
},
},
linkType: "many"
linkType: "many"
Line 138: Line 133:
</syntaxhighlight>
</syntaxhighlight>


* links a user to the organization they manage
* Accounts that are included in a ledger
* does not convey ownership, each organization is a standalone organization that has it's own RBAC
* this allows for simple transfer of ownership of data


= Working documents =
= Working documents =

Latest revision as of 11:49, 22 February 2026

Overview

A ledger can be used to generate a report such as the general ledger, each ledger specifies which Accounts are it's top level ledger accounts and which rollup in the generated report.

Repository

...

Object Schemas

Additional Information
Per Service Schemas

ledger

{
	objectType: "ledger",
	canDelete: false,
	belongTo: {
		serviceTag: "Organization",
		objectType: "organization"
	},
	addOnDataStructure: [
		{
			type:"versionedData",
			versionedDataLabel: "ledgerDetail",
			storageResourceTag : "myGraph",
			fieldNames: {
				"totalOnly": {
					type: "boolean",
					requiredOnCreate: true,
					updateBy: "user"
				},
			}
		},
	],
	storageResources: {
		myGraph: {
			storageType: "graph",
			graphServerTag: "GraphHandler"
		},
		//.. dynamo for flows
    },
    fieldNames: {
		ledgerId: {
			type: "string",
			randomOnCreate: true,
			storageResourceTags: ['myGraph']
		},
    },
    identifiers: [
		{
			type: "identifier",
			fieldName: "ledgerId"
		}
    ]
}

Relationships

hasChildLedger

{
	hasChildLedger: {
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				canDelete: true,
				from: {
					objType: {
						serviceTag: "Ledger",
						objectType: "ledger"
					},
					linkType: "one",
				},
				to: {
					objType: {
						serviceTag: "Ledger",
						objectType: "ledger"
					},
					linkType: "many"
				}
			},
		]
	}
}
  • creates ledger hierarchy
  • validate no infinite link loops
  • could move this out to a link object if becomes more complex

includesAccount

{
	includesAccount: {
		storageResources: {
			myGraph: {
				storageType: "graph",
				graphServerTag: "GraphHandler"			
			}
		},
		links: [
			{
				storageResourceTags: ["myGraph"],
				canDelete: true,
				from: {
					objType: {
						serviceTag: "Ledger",
						objectType: "ledger"
					},
					linkType: "many",
				},
				to: {
					objType: {
						serviceTag: "AccountManager",
						objectType: "account"
					},
					linkType: "many"
				}
			},
		]
	}
}
  • Accounts that are included in a ledger

Working documents

Ledger