From 384432d31e7bee6bf35d8af6b7165410303ffda4 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 6 Jul 2025 15:54:49 +0000 Subject: feat: Add per user storage quota --- packages/shared/storageQuota.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 packages/shared/storageQuota.ts (limited to 'packages/shared/storageQuota.ts') diff --git a/packages/shared/storageQuota.ts b/packages/shared/storageQuota.ts new file mode 100644 index 00000000..6b7441a2 --- /dev/null +++ b/packages/shared/storageQuota.ts @@ -0,0 +1,19 @@ +/** + * A token that proves storage quota has been checked and approved. + * This class cannot be instantiated directly - it can only be created + * by the checkStorageQuota function. + */ +export class QuotaApproved { + private constructor( + public readonly userId: string, + public readonly approvedSize: number, + ) {} + + /** + * Internal method to create a QuotaApproved token. + * This should only be called by checkStorageQuota. + */ + static _create(userId: string, approvedSize: number): QuotaApproved { + return new QuotaApproved(userId, approvedSize); + } +} -- cgit v1.2.3-70-g09d2