linagora / tmail-backend

GNU Affero General Public License v3.0
39 stars 21 forks source link

Implement Quota for PublicAssets #1044

Closed vttranlina closed 4 months ago

vttranlina commented 4 months ago

Why

Control resource when the user uploads PublicAsset Epic: https://github.com/linagora/tmail-backend/issues/1027

How

case class TmailPublicAssetAddedEvent(eventId: EventId, username: Username, id: PublicAssetId, size: Size) extends TmailContactUserEvent {}

case class TmailPublicAssetDeletedEvent(eventId: EventId, username: Username, id: PublicAssetId, size: Size) extends TmailContactUserEvent {}

Dod

Write PublicAssetEventListenerIntegrationTest

quantranhong1999 commented 4 months ago

How about updating the quota synchronously?

Arsnael commented 4 months ago

I believe yes, I would expect something similar to upload quota in design, where we seem to update the quota right after the upload in the reactive pipeline, no need to dispatch events

chibenwa commented 4 months ago

How about updating the quota synchronously?

+1

We are purely in the jmap stack, not event for this!

Arsnael commented 4 months ago
hungphan227 commented 4 months ago

pr https://github.com/linagora/tmail-backend/pull/1071