chore: change the defaulkt bussiness quata to 10 gig

This commit is contained in:
mahyargdz
2025-08-17 09:19:45 +03:30
parent 687ee80842
commit 8642b8e8d5
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -410,7 +410,7 @@ export const enum BusinessMessage {
DOMAIN_NOT_CONNECTED = "دامنه به سرور ما متصل نشد",
DOMAIN_NOT_FOUND = "دامنه یافت نشد",
DOMAIN_VERIFICATION_TOKEN_REQUIRED = "توکن تایید دامنه مورد نیاز است",
INSUFFICIENT_QUOTA = "حجم شما برای ساخت ایمیل کافی نمی باشد",
INSUFFICIENT_QUOTA = "حجم شما برای ساخت ایمیل کافی نمی باشد، لطفا حجم را افزایش دهید",
QUOTA_DOWNGRADE_NOT_ALLOWED = "کاهش حجم ایمیل مجاز نیست، فقط می‌توانید حجم را افزایش دهید",
QUOTA_AMOUNT_REQUIRED = "مقدار حجم مورد نیاز است",
QUOTA_AMOUNT_MUST_BE_NUMBER = "مقدار حجم باید یک عدد باشد",
+1 -1
View File
@@ -9,7 +9,7 @@ export const SUBSCRIPTIONS = Object.freeze({
});
export const QUOTA_CONSTANTS = Object.freeze({
INITIAL_BUSINESS_QUOTA: 1024 * 1024 * 1024, // 1GB initial quota when purchasing dmail service (allows 1 user)
INITIAL_BUSINESS_QUOTA: 1024 * 1024 * 1024 * 10, // 10GB initial quota when purchasing dmail service (allows 1 user)
USER_QUOTA_DEDUCTION: 128 * 1024 * 1024, // 128MB deducted per user creation
DEFAULT_EMAIL_QUOTA_BYTES: 128 * 1024 * 1024, // 128MB per user in bytes
QUOTA_PRICE_PER_GB: 100_000, //TOMAN
+2 -2
View File
@@ -192,7 +192,7 @@ export class UsersService {
// Check if business has enough quota
const remainingQuota = Number(business.remainingQuota || 0);
if (remainingQuota < QUOTA_CONSTANTS.USER_QUOTA_DEDUCTION) {
throw new BadRequestException("Insufficient quota to create user. Please upgrade your plan.");
throw new BadRequestException(BusinessMessage.INSUFFICIENT_QUOTA);
}
const domain = await this.domainsService.getDomainById(domainId, businessId);
@@ -246,7 +246,7 @@ export class UsersService {
await this.userSettingsService.createUserSettings(user.id, em);
business.usedQuota = Number(business.usedQuota) + QUOTA_CONSTANTS.USER_QUOTA_DEDUCTION;
business.usedQuota = Number(business.usedQuota) + userQuota;
business.remainingQuota = Number(business.quota) - Number(business.usedQuota);
await em.persistAndFlush([user, business]);