NESTS - Named Entities in Simple Tiered Spaces

Basic entity operations

NB: This is a temporary working document under continual revision as coding progresses. The documents and the initial implementation are co-evolving continually, so expect to find some duplications and occasional inconsistencies (all of which will be removed over time). (See page footer for most recent revision.)


entity creation CSV format


operation actions
create namespace
  • Create directory for new namespace name within the specified parent namespace.
  • Assign the specified initial steward.
  • Assign the specified initial default entity creation policies.
  • Assign the specified initial default currency.
delete empty namespace
  • If the specified namespace does not exist, abort the operation.
  • If this namespace is not empty, abort the operation.
  • For each of this namespace's stewards (primid), remove this namespace from its stewardships.
  • Delete this namespace's directory and its contents.
create currency
  • Create directory for new currency name within the specified parent namespace.
  • Assign the specified initial steward.
  • Assign the specified initial default account creation policies.
  • Assign the specified initial default account name.
delete unused currency
  • If the specified currency does not exist, abort the operation.
  • If any accounts exist in this currency, abort operation.
  • For each of this currency's stewards (primid), remove this currency from its stewardships.
  • Archive this currency's transaction history.
  • Delete this currency's directory and its contents.
create account
  • If the specified parent namespace does not exist, abort the operation.
  • If the specified currency does not exist, abort the operation.
  • Create a directory for new account within the specified parent namespace and assign it the default name of the specified currency unless overriden with a specified name.
  • Assign this account to the specified owner (primid or secid).
archive account
  • If the specified account does not exist, abort the operation.
  • If account has type money and is not 0, abort this operation.
  • Remove this account from its owner's list of account.
  • Archive this account (tarball) and add it to its owner's list of archived accounts.
  • Remove this account from its parent namespace.
  • Delete this account's directory and its contents.
create primid
  • If the specified parent namespace does not exist, abort the operation.
  • If the currency specified for the initial account does not exist, abort the operation.
  • If a recovery email address is provided but is invalid in its format, abort the operation. Otherwise store its hash.
  • Create a directory for the new primid within the specified parent namespace and assign it the specified primid name.
  • Store the hashed password and PIN.
  • Create the primid's initial account in the specified currency with the primid itself as the parent. Unless otherwise specified, the name of this account is that of the currency. This account is now added to this primid's list of accounts.
delete obsolete primid
  • If the specified primid does not exist, abort the operation.
  • If this primid has any accounts, abort the operation.
  • If this primid has any sole stewardships1, abort the operation.
  • If this primid has any secids, abort the operation.
  • Remove this primid's stewardships.
  • Remove this primid from its parent namespace.
  • Delete this primid's directory and its contents.
create secid
  • If the specified parent namespace does not exist, abort the operation.
  • If the currency specified for the initial account does not exist, abort the operation.
  • If the specified primid does not exist, abort the operation.
  • Create a directory for the new secid within the specified parent namespace and assign it the specified secid name.
  • Create the secid's initial account in the specified currency with the secid itself as the parent. Unless otherwise specified, the name of this account is that of the currency. This account is now added to this secid's list of accounts.
delete obsolete secid
  • If the specified secid does not exist, abort the operation.
  • If this secid has any accounts, abort the operation.
  • Remove this secid from its primid's list of secids.
  • Remove this secid from its parent namespace.
  • Delete this secid's directory and its contents.
namespace add steward
  • If the specified namespace does not exist, abort the operation.
  • If the specified steward (primid) does not exist, abort the operation.
  • Add the specified primid to the namespace's list of stewards.
  • Add the specified namespace to the primid's list of stewardships.
namespace remove steward
  • If the specified namespace does not exist, abort the operation.
  • If the specified steward (primid) does not exist, abort the operation.
  • If the specified primid is the sole steward of this namespace, abort the operation.
  • Remove the specified primid from the namespace's list of stewards.
  • Remove the specified namespace from the primid's list of stewardships.
currency add steward
  • If the specified currency does not exist, abort the operation.
  • If the specified steward (primid) does not exist, abort the operation.
  • Add the specified primid to the currency's list of stewards.
  • Add the specified currency to the primid's list of stewardships.
currency remove steward
  • If the specified currency does not exist, abort the operation.
  • If the specified steward (primid) does not exist, abort the operation.
  • If the specified primid is the sole steward of this currency, abort the operation.
  • Remove the specified primid from the currency's list of stewards.
  • Remove the specified currency from the primid's list of stewardships.
account add reader
  • If the specified account does not exist, abort the operation.
  • If the specified reader (primid or secid) does not exist, abort the operation.
  • Add the specified account to the reader's (primid or secid) list of readerships.
  • Add the specified reader (primid or secid) to the account's list of readers.
account remove reader
  • If the specified account does not exist, abort the operation.
  • If the specified reader (primid or secid) does not exist, abort the operation.
  • Remove the specified account from the reader's (primid or secid) list of readerships.
  • Remove the specified reader (primid or secid) from the account's list of readers.
freeze entity
(all entity types)
  • If the specified entity does not exist, abort the operation.
  • Change the state of the entity's .enabled state to False.
enable entity
(all entity types)
  • If the specified entity does not exist, abort the operation.
  • Change the state of the entity's .enabled state to that of its parent.
move namespace
  • If the specified namespace does not exist, abort the operation.
  • If the specified new parent namespace does not exist, abort the operation.
  • If the name of the specified namespace already exists in the new parent namespace, abort the operation.
  • If the specified namespace does not exist in the same tree as its new parent namespace, abort the operation.
  • Create a new namespace with the same name as the specified namespace within the new parent namespace.
  • For each entity within the specified namespace and its children
    • Create a counterpart within the new parent namespace and add its FPH to the FPH>FIP map.
    • Add the original FPH of the entity (FPH') to the FPH'>FPH map (enabling each entity to be identified by either its original FPH or its new FPH).
    • Archive the specified namespace (original - as a tarball) and remove its FPH from the FPH>FIP map.

Notes:

[1] Stewardship

Every namespace or currency must have at least one steward (a primid). Therefore a primid cannot be deleted if it will leave any namespace or currency unstewarded.



Version 0.1 - 2023-08-05 17.25 - Copyright © 2023, 2022, 2021 John Waters


home