csa-dashboard-sementara/csa-dashboard/modules/admin/schemas.ts

72 lines
1.8 KiB
TypeScript

import { z } from "zod";
export const loginSchema = z.object({
email: z.string().email("Invalid email address"),
password: z.string().min(6, "Password must be at least 6 characters"),
});
export const registerSchema = z.object({
username: z.string().min(3, "Username must be at least 3 characters"),
email: z.string().email("Invalid email address"),
password: z.string().min(6, "Password must be at least 6 characters"),
});
export type LoginInput = z.infer<typeof loginSchema>;
export type RegisterInput = z.infer<typeof registerSchema>;
export interface ContentMatrix {
type: string;
corp: string;
count: number;
}
export interface ContentCreationTimeline {
[date: string]: {
[type: string]: number;
};
}
export interface DashboardStats {
summary: {
content: {
splash: number;
promo: number;
article: number;
banner: number;
floatingWidget: number;
total: number;
};
infra: {
buckets: number;
apiKeys: number;
users: number;
};
campaigns: number;
activities: number;
};
charts: {
contentByType: {
labels: string[];
data: number[];
};
contentByCorpType: {
labels: string[];
data: number[];
};
contentMatrix: ContentMatrix[];
contentCreationTimeline: ContentCreationTimeline;
campaignStatus: {
labels: string[];
data: number[];
};
activityTypes: {
labels: string[];
data: number[];
};
userRegistrationTrend: {
labels: string[];
data: number[];
};
};
}