To handle different user plans in Misakey, we need to limit what the user can do in every plan and we have two notions for this: storage used and max authorized storage.
Storage quota are stored in
Users can have several
storage_quotum linked to their identityId.
The amount of storage available for a user is computed by retrieving all the
storage_quotum object linked to the identity and sum all the
The amount of space consumed by a user is defined by:
- the total size of text and file events contained in their own boxes (user is the creator of the box)
- the total size of files contained in their vault
#Box used space
The used space consumed by a box is depicted by
The value of this objet is updated for every boxes each time a
create_event of type
msg.delete is performed.
#Vault used space
The used space consumed by the vault is depicted by
The total space used by a user is obtained by summing all
box_used_space values of boxes belonging to user, and adding