Updated reports.

This commit is contained in:
Mike Cao 2025-06-08 22:21:28 -07:00
parent 28e872f219
commit 01bd21c5b4
75 changed files with 1373 additions and 980 deletions

View file

@ -654,3 +654,56 @@ export const ISO_COUNTRIES = {
ZWE: 'ZW',
XKX: 'XK',
};
export const CURRENCIES = [
{ id: 'USD', name: 'US Dollar' },
{ id: 'EUR', name: 'Euro' },
{ id: 'GBP', name: 'British Pound' },
{ id: 'JPY', name: 'Japanese Yen' },
{ id: 'CNY', name: 'Chinese Renminbi (Yuan)' },
{ id: 'CAD', name: 'Canadian Dollar' },
{ id: 'HKD', name: 'Hong Kong Dollar' },
{ id: 'AUD', name: 'Australian Dollar' },
{ id: 'SGD', name: 'Singapore Dollar' },
{ id: 'CHF', name: 'Swiss Franc' },
{ id: 'SEK', name: 'Swedish Krona' },
{ id: 'PLN', name: 'Polish Złoty' },
{ id: 'NOK', name: 'Norwegian Krone' },
{ id: 'DKK', name: 'Danish Krone' },
{ id: 'NZD', name: 'New Zealand Dollar' },
{ id: 'ZAR', name: 'South African Rand' },
{ id: 'MXN', name: 'Mexican Peso' },
{ id: 'THB', name: 'Thai Baht' },
{ id: 'HUF', name: 'Hungarian Forint' },
{ id: 'MYR', name: 'Malaysian Ringgit' },
{ id: 'INR', name: 'Indian Rupee' },
{ id: 'KRW', name: 'South Korean Won' },
{ id: 'BRL', name: 'Brazilian Real' },
{ id: 'TRY', name: 'Turkish Lira' },
{ id: 'CZK', name: 'Czech Koruna' },
{ id: 'ILS', name: 'Israeli New Shekel' },
{ id: 'RUB', name: 'Russian Ruble' },
{ id: 'AED', name: 'United Arab Emirates Dirham' },
{ id: 'IDR', name: 'Indonesian Rupiah' },
{ id: 'PHP', name: 'Philippine Peso' },
{ id: 'RON', name: 'Romanian Leu' },
{ id: 'COP', name: 'Colombian Peso' },
{ id: 'SAR', name: 'Saudi Riyal' },
{ id: 'ARS', name: 'Argentine Peso' },
{ id: 'VND', name: 'Vietnamese Dong' },
{ id: 'CLP', name: 'Chilean Peso' },
{ id: 'EGP', name: 'Egyptian Pound' },
{ id: 'KWD', name: 'Kuwaiti Dinar' },
{ id: 'PKR', name: 'Pakistani Rupee' },
{ id: 'QAR', name: 'Qatari Riyal' },
{ id: 'BHD', name: 'Bahraini Dinar' },
{ id: 'UAH', name: 'Ukrainian Hryvnia' },
{ id: 'PEN', name: 'Peruvian Sol' },
{ id: 'BDT', name: 'Bangladeshi Taka' },
{ id: 'MAD', name: 'Moroccan Dirham' },
{ id: 'KES', name: 'Kenyan Shilling' },
{ id: 'NGN', name: 'Nigerian Naira' },
{ id: 'TND', name: 'Tunisian Dinar' },
{ id: 'OMR', name: 'Omani Rial' },
{ id: 'GHS', name: 'Ghanaian Cedi' },
];

View file

@ -119,6 +119,26 @@ export const journeyReportSchema = z.object({
}),
});
export const retentionReportSchema = z.object({
type: z.literal('retention'),
});
export const utmReportSchema = z.object({
type: z.literal('utm'),
});
export const revenueReportSchema = z.object({
type: z.literal('revenue'),
});
export const attributionReportSchema = z.object({
type: z.literal('attribution'),
});
export const insightsReportSchema = z.object({
type: z.literal('insights'),
});
export const reportBaseSchema = z.object({
websiteId: z.string().uuid(),
type: reportTypeParam,
@ -130,6 +150,11 @@ export const reportTypeSchema = z.discriminatedUnion('type', [
goalReportSchema,
funnelReportSchema,
journeyReportSchema,
retentionReportSchema,
utmReportSchema,
revenueReportSchema,
attributionReportSchema,
insightsReportSchema,
]);
export const reportSchema = z.intersection(reportBaseSchema, reportTypeSchema);