feat(subscription): add resource quota management for subscription plans and update related components

This commit is contained in:
hamed
2026-08-04 19:50:47 +03:30
parent 3e7028d77a
commit 2db4c3c4b0
8 changed files with 306 additions and 14 deletions
+10
View File
@@ -14,6 +14,16 @@ export function formatNumber(n: number): string {
return new Intl.NumberFormat('fa-IR').format(n);
}
/**
* سقف منابعِ یک پلن اشتراک به زبان آدم — `-1` یعنی نامحدود.
*
* سه صفحه همین عدد را نشان می‌دهند (منابع، اشتراک، اشتراکِ ادمین)؛ یک جا نوشته می‌شود
* تا «نامحدود» در یکی از آن‌ها به «-۱» تبدیل نشود.
*/
export function formatResourceLimit(max: number): string {
return max < 0 ? 'نامحدود' : formatNumber(max);
}
// سال شمسی: رقم فارسی بدون جداکننده‌ی هزارگان («۱۴۰۴» نه «۱٬۴۰۴»).
export function formatYear(year: number): string {
return new Intl.NumberFormat('fa-IR', { useGrouping: false }).format(year);