rework orgs. Add various properties to orgs. Make all org functions return success boolean as well as error/success string message.

This commit is contained in:
MisterE123
2021-03-01 19:11:20 -05:00
parent 4f53e801c4
commit d646a4a8dd
4 changed files with 414 additions and 33 deletions
+50
View File
@@ -0,0 +1,50 @@
Ledger
**************************
a legder is a table of records that holds the history of an org, and of modpol itself.
its structure is a table of legder entries.
Every org has one, starting with the entry recording its creation.
Ledger Entry
**************************
a legder entry is a table with the following properties:
timestamp = nil,
entrytype = nil,
action_msg = '',
the timestamp will hold the output of os.time at the moment the entry was created.
the entrytype is optional; it can hold an identifier of the kind of entry it is (e.g. 'org_init', 'new_user', etc etc.)
action_msg is the record output itself.
Entrytypes
**************************
These are the entrytypes that modpol uses. Each additional module should document whatever entrytypes it adds.
'org_init'
type used when an org is created
'org_purge'
type used when all orgs are purged. -- will only be found in the main modpol ledger.
'org_remove'
type used when removing an individual org
'add_member'
type used when adding a member to an org
'remove_member'
type used when removing a member from an org
Old orgs
**************************
when an org is removed, its ledger is stored in modpol.old_legders = {} Note that multiple ledgers may exist here with the same org name.