chore: dockerize monorepo with multi-stage builds and update frontend
This commit is contained in:
@@ -3,8 +3,13 @@
|
||||
*/
|
||||
const FARSI_DIGITS = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
|
||||
|
||||
export function toFarsiDigits(val: number | string | null | undefined): string {
|
||||
export function toFarsiDigits(val: number | string | null | undefined | any): string {
|
||||
if (val === null || val === undefined) return '';
|
||||
if (typeof val === 'object' && val !== null && 'value' in val) {
|
||||
val = val.value;
|
||||
if (val === null || val === undefined) return '';
|
||||
}
|
||||
if (typeof val === 'object') return '';
|
||||
return String(val)
|
||||
.replace(/[0-9]/g, (d) => FARSI_DIGITS[+d])
|
||||
.replace(/[٠-٩]/g, (d) => FARSI_DIGITS[d.charCodeAt(0) - 1632]);
|
||||
@@ -13,8 +18,13 @@ export function toFarsiDigits(val: number | string | null | undefined): string {
|
||||
/**
|
||||
* قالببندی اعداد با جداکننده هزارگان و ارقام فارسی
|
||||
*/
|
||||
export function formatFarsiNumber(val: number | string | null | undefined): string {
|
||||
export function formatFarsiNumber(val: number | string | null | undefined | any): string {
|
||||
if (val === null || val === undefined || val === '') return '';
|
||||
if (typeof val === 'object' && val !== null && 'value' in val) {
|
||||
val = val.value;
|
||||
if (val === null || val === undefined || val === '') return '';
|
||||
}
|
||||
if (typeof val === 'object') return '';
|
||||
const num = typeof val === 'string' ? parseFloat(toEnglishDigits(val)) : val;
|
||||
if (isNaN(num)) return toFarsiDigits(val);
|
||||
const formatted = new Intl.NumberFormat('fa-IR').format(num);
|
||||
|
||||
@@ -185,6 +185,8 @@ export interface DashboardStatsDto {
|
||||
totalDistributedPrizes: number;
|
||||
consumedChances: number;
|
||||
activePrizesCount: number;
|
||||
activeCampaignsCount?: number;
|
||||
winRate?: number;
|
||||
}
|
||||
|
||||
export interface SpinsByDayDataPoint {
|
||||
|
||||
Reference in New Issue
Block a user