Skip to content
This repository has been archived by the owner on Mar 23, 2019. It is now read-only.

Context manager doesn't actually roll anything back #6

Open
knappador opened this issue May 9, 2018 · 1 comment · May be fixed by #8
Open

Context manager doesn't actually roll anything back #6

knappador opened this issue May 9, 2018 · 1 comment · May be fixed by #8

Comments

@knappador
Copy link
Owner

Design proposal:

  • Context management uses a context stack that is pushed on __enter__
  • All instantiated transfers are tracked and implement a kill method to explicitly mark dead a DoubleEntry with no intended destination
  • DoubleEntry is marked applied or something to that effect when used in a context
  • clone method for creating repetitive entries or reviving an entry that is dead
  • Warn / throw (configurable) if a DoubleEntry runs out of scope on__exit__ and didn't get an assigned explicit fate
  • Pop stacks on __exit__
  • DoubleEntry from outside the scope needs to start in CREATED state to be valid for admission into the current scope

Ancillary Goals

  • Double entries need to be immutable
  • GeneralLedger is kicked out of being anything like an AssetBalance to focus on transaction duties

So many great emojis... 🦊 💃 🇰🇪 💡 📚 🔬 ⏲️ 🕵️‍♂️

@knappador
Copy link
Owner Author

DoubleEntry needs an ABC for clients to make entries out of other classes for consumption by Accountant

Has to implement forward & reverse for command pattern style stacks of reversible mutations and unlimited transaction rollback.

RTTC for ABC is proven but I believe only bounds for upper boundary type is supported in 484 type hints. Would be nice to resolve.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant