Service - Unit Manager: Difference between revisions

From Izara Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 55: Line 55:
[
[
   {
   {
     "unitOwnedByUser": {
     "activeUnit": {
      fieldNames: {
        originTimestamp:{}
      },
       storageResources:{
       storageResources:{
"xxx":{
"xxx":{
Line 86: Line 89:
]
]
</syntaxhighlight>
</syntaxhighlight>
* links to the user who currently owns the unit


<syntaxhighlight lang="JavaScript">
<syntaxhighlight lang="JavaScript">
[
[
   {
   {
     "unitPreviouslyOwnedByUser": {
     "inactiveUnit": {
      fieldNames: {
        originTimestamp:{}
      },
       storageResources:{
       storageResources:{
"xxx":{
"xxx":{
Line 98: Line 102:
graphServerTag: "xx",
graphServerTag: "xx",
}
}
    },
      },
fieldNames: {
      links: [
        "fromTimestamp": {
          type: "timestamp",
          requiredOnCreate: true,
        },
        "toTimestamp": {
          type: "timestamp",
          requiredOnCreate: true,
        }
    },     
    links: [
         {
         {
           storageResourceTags: ["xxx"],
           storageResourceTags: ["xxx"],
          canDelete: true,
           from: {
           from: {
             objType: {
             objType: {
Line 124: Line 119:
               objectType: "user"
               objectType: "user"
             },
             },
             linkType: "many",
             linkType: "one",
           }
           }
         }
         }
       ]
       ]
    }
  }
]
</syntaxhighlight>
* links to the user who currently owns the unit, depending on whether active or inactive
<syntaxhighlight lang="JavaScript">
[
  {
    "unitPreviouslyOwnedByUser": {
storageResources:{
"xxx":{
storageType: "graph",
graphServerTag: "xx",
}
},
fieldNames: {
"fromTimestamp": {
  type: "timestamp",
  requiredOnCreate: true,
},
"toTimestamp": {
  type: "timestamp",
  requiredOnCreate: true,
}
},     
links: [
{
  storageResourceTags: ["xxx"],
  from: {
objType: {
  serviceTag: "unitManager",
  objectType: "unit"
},
linkType: "many",
  },
  to: {
objType: {
  serviceTag: "user",
  objectType: "user"
},
linkType: "many",
  }
}
]
     }
     }
   }
   }
Line 134: Line 175:


* links to users who previously owned the unit
* links to users who previously owned the unit
* method of creating this link will be similar to versionedData, creating a new unitOwnedByUser relationship at the same time as creating a new unitPreviouslyOwnedByUser relationship
* method of creating this link will be similar to versionedData, creating a new activeUnit relationship at the same time as creating a new unitPreviouslyOwnedByUser relationship


= Ownership =
= Ownership =
Line 140: Line 181:
* Each Unit is owned by one user, who can transfer ownership to another user
* Each Unit is owned by one user, who can transfer ownership to another user
* Owner can set user level permissions for other users to manage their units, like any other user owned object
* Owner can set user level permissions for other users to manage their units, like any other user owned object
* New owner needs to accept ownership transfer for it to complete (in future could setup automatic accepatance configuration)
* New owner needs to accept ownership transfer for it to complete (in future could setup automatic acceptance configuration)
* Existing permissions can transfer across, and need to be managed by new owner
* Existing permissions can transfer across, and need to be managed by new owner



Latest revision as of 22:42, 2 September 2025

Overview

Each tracked unit is handled by a Service - Unit (handlers) service.

The Unit Manager service handles shared orchestration of the Unit Handler services and the base unit objectType.

Repository

https://bitbucket.org/izara-supply-units/izara-supply-units-unit-manager

DynamoDB tables

UnitRecord

Records which Handler manages each unit

{
	unitId
	unitHandlerServiceNameTag
}
  • partition key: unitId
  • sort key: (none)

objectSchemas

{
	objectType: "unit",
	storageResources:{
		"xxx":{
			storageType: "graph",
			graphServerTag: "xx",
		}
	},
	fieldNames: {
		unitId: {
			type: "string",
            randomOnCreate: true
		},
	},
	identifiers: [
		{
			fieldName: "unitId"
		},
	]
},

relationshipSchemas

[
  {
    "activeUnit": {
      fieldNames: {
        originTimestamp:{}
      },
      storageResources:{
		"xxx":{
			storageType: "graph",
			graphServerTag: "xx",
		}
      },
      links: [
        {
          storageResourceTags: ["xxx"],
          canDelete: true,
          from: {
            objType: {
              serviceTag: "unitManager",
              objectType: "unit"
            },
            linkType: "many",
          },
          to: {
            objType: {
              serviceTag: "user",
              objectType: "user"
            },
            linkType: "one",
          }
        }
      ]
    }
  }
]
[
  {
    "inactiveUnit": {
      fieldNames: {
        originTimestamp:{}
      },
      storageResources:{
		"xxx":{
			storageType: "graph",
			graphServerTag: "xx",
		}
      },
      links: [
        {
          storageResourceTags: ["xxx"],
          canDelete: true,
          from: {
            objType: {
              serviceTag: "unitManager",
              objectType: "unit"
            },
            linkType: "many",
          },
          to: {
            objType: {
              serviceTag: "user",
              objectType: "user"
            },
            linkType: "one",
          }
        }
      ]
    }
  }
]
  • links to the user who currently owns the unit, depending on whether active or inactive
[
  {
    "unitPreviouslyOwnedByUser": {
		storageResources:{
			"xxx":{
				storageType: "graph",
				graphServerTag: "xx",
			}
		},
		fieldNames: {
			"fromTimestamp": {
			  type: "timestamp",
			  requiredOnCreate: true,
			},
			"toTimestamp": {
			  type: "timestamp",
			  requiredOnCreate: true,
			}
		},      
		links: [
			{
			  storageResourceTags: ["xxx"],
			  from: {
				objType: {
				  serviceTag: "unitManager",
				  objectType: "unit"
				},
				linkType: "many",
			  },
			  to: {
				objType: {
				  serviceTag: "user",
				  objectType: "user"
				},
				linkType: "many",
			  }
			}
		]
    }
  }
]
  • links to users who previously owned the unit
  • method of creating this link will be similar to versionedData, creating a new activeUnit relationship at the same time as creating a new unitPreviouslyOwnedByUser relationship

Ownership

  • Each Unit is owned by one user, who can transfer ownership to another user
  • Owner can set user level permissions for other users to manage their units, like any other user owned object
  • New owner needs to accept ownership transfer for it to complete (in future could setup automatic acceptance configuration)
  • Existing permissions can transfer across, and need to be managed by new owner

Working documents

Unit Manager