aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared/storageQuota.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/shared/storageQuota.ts')
-rw-r--r--packages/shared/storageQuota.ts19
1 files changed, 19 insertions, 0 deletions
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);
+ }
+}