2025-10-08 16:31:42 +09:00
|
|
|
/**
|
|
|
|
|
* Customer Domain - Schemas
|
2025-12-15 17:29:28 +09:00
|
|
|
*
|
2025-10-08 16:31:42 +09:00
|
|
|
* Zod validation schemas for customer domain types.
|
|
|
|
|
* Pattern matches billing and subscriptions domains.
|
2025-12-15 17:29:28 +09:00
|
|
|
*
|
2025-10-08 16:31:42 +09:00
|
|
|
* Architecture:
|
|
|
|
|
* - UserAuth: Auth state from portal database (Prisma)
|
|
|
|
|
* - WhmcsClient: Full WHMCS data (raw field names, internal to providers)
|
|
|
|
|
* - User: API response type (normalized camelCase)
|
|
|
|
|
*/
|
|
|
|
|
|
2025-10-07 17:38:39 +09:00
|
|
|
import { z } from "zod";
|
|
|
|
|
|
2025-12-10 15:22:10 +09:00
|
|
|
import { countryCodeSchema } from "../common/schema.js";
|
2026-02-24 19:05:30 +09:00
|
|
|
import {
|
2026-03-02 18:00:41 +09:00
|
|
|
whmcsRequiredNumber,
|
|
|
|
|
whmcsOptionalNumber,
|
|
|
|
|
whmcsOptionalBoolean,
|
2026-02-24 19:05:30 +09:00
|
|
|
} from "../common/providers/whmcs-utils/index.js";
|
2025-12-15 17:29:28 +09:00
|
|
|
import {
|
|
|
|
|
whmcsClientSchema as whmcsRawClientSchema,
|
|
|
|
|
whmcsCustomFieldSchema,
|
|
|
|
|
} from "./providers/whmcs/raw.types.js";
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// Helper Schemas
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
2025-10-07 17:38:39 +09:00
|
|
|
const stringOrNull = z.union([z.string(), z.null()]);
|
|
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// Address Schemas
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Address schema - matches pattern from other domains (not "CustomerAddress")
|
|
|
|
|
*/
|
|
|
|
|
export const addressSchema = z.object({
|
2025-10-08 10:33:33 +09:00
|
|
|
address1: stringOrNull.optional(),
|
|
|
|
|
address2: stringOrNull.optional(),
|
|
|
|
|
city: stringOrNull.optional(),
|
|
|
|
|
state: stringOrNull.optional(),
|
|
|
|
|
postcode: stringOrNull.optional(),
|
|
|
|
|
country: stringOrNull.optional(),
|
|
|
|
|
countryCode: stringOrNull.optional(),
|
|
|
|
|
phoneNumber: stringOrNull.optional(),
|
|
|
|
|
phoneCountryCode: stringOrNull.optional(),
|
|
|
|
|
});
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
export const addressFormSchema = z.object({
|
2025-12-15 17:29:28 +09:00
|
|
|
address1: z
|
|
|
|
|
.string()
|
|
|
|
|
.min(1, "Address line 1 is required")
|
|
|
|
|
.max(200, "Address line 1 is too long")
|
|
|
|
|
.trim(),
|
2025-10-08 16:31:42 +09:00
|
|
|
address2: z.string().max(200, "Address line 2 is too long").trim().optional(),
|
|
|
|
|
city: z.string().min(1, "City is required").max(100, "City name is too long").trim(),
|
2025-12-15 17:29:28 +09:00
|
|
|
state: z
|
|
|
|
|
.string()
|
|
|
|
|
.min(1, "State/Prefecture is required")
|
|
|
|
|
.max(100, "State/Prefecture name is too long")
|
|
|
|
|
.trim(),
|
2025-10-08 16:31:42 +09:00
|
|
|
postcode: z.string().min(1, "Postcode is required").max(20, "Postcode is too long").trim(),
|
|
|
|
|
country: z.string().min(1, "Country is required").max(100, "Country name is too long").trim(),
|
|
|
|
|
countryCode: countryCodeSchema.optional(),
|
|
|
|
|
phoneNumber: z.string().optional(),
|
|
|
|
|
phoneCountryCode: z.string().optional(),
|
|
|
|
|
});
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-09 10:49:03 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// Profile Edit Schemas
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Profile edit form schema for frontend forms
|
|
|
|
|
* Contains basic editable user profile fields (WHMCS field names)
|
|
|
|
|
*/
|
|
|
|
|
export const profileEditFormSchema = z.object({
|
2025-12-15 17:29:28 +09:00
|
|
|
email: z.string().email("Enter a valid email").trim(),
|
2025-10-09 10:49:03 +09:00
|
|
|
phonenumber: z.string().optional(),
|
|
|
|
|
});
|
|
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// UserAuth Schema (Portal Database - Auth State Only)
|
|
|
|
|
// ============================================================================
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
/**
|
|
|
|
|
* UserAuth - Authentication state from portal database
|
2025-12-15 17:29:28 +09:00
|
|
|
*
|
2025-10-08 16:31:42 +09:00
|
|
|
* Source: Portal database (Prisma)
|
|
|
|
|
* Provider: customer/providers/portal/
|
2025-12-15 17:29:28 +09:00
|
|
|
*
|
2025-10-08 16:31:42 +09:00
|
|
|
* Contains ONLY auth-related fields:
|
|
|
|
|
* - User ID, email, role
|
|
|
|
|
* - Email verification status
|
|
|
|
|
* - MFA enabled status
|
|
|
|
|
* - Last login timestamp
|
|
|
|
|
*/
|
|
|
|
|
export const userAuthSchema = z.object({
|
|
|
|
|
id: z.string().uuid(),
|
|
|
|
|
email: z.string().email(),
|
|
|
|
|
role: z.enum(["USER", "ADMIN"]),
|
|
|
|
|
emailVerified: z.boolean(),
|
|
|
|
|
mfaEnabled: z.boolean(),
|
|
|
|
|
lastLoginAt: z.string().optional(),
|
|
|
|
|
createdAt: z.string(),
|
|
|
|
|
updatedAt: z.string(),
|
|
|
|
|
});
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// WHMCS-Specific Schemas (Internal to Providers)
|
|
|
|
|
// ============================================================================
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
/**
|
|
|
|
|
* Email preferences from WHMCS
|
|
|
|
|
* Internal to Providers.Whmcs namespace
|
|
|
|
|
*/
|
2026-03-02 18:00:41 +09:00
|
|
|
const emailPreferencesSchema = z.object({
|
|
|
|
|
general: whmcsOptionalBoolean,
|
|
|
|
|
invoice: whmcsOptionalBoolean,
|
|
|
|
|
support: whmcsOptionalBoolean,
|
|
|
|
|
product: whmcsOptionalBoolean,
|
|
|
|
|
domain: whmcsOptionalBoolean,
|
|
|
|
|
affiliate: whmcsOptionalBoolean,
|
|
|
|
|
});
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
/**
|
|
|
|
|
* Sub-user from WHMCS
|
|
|
|
|
* Internal to Providers.Whmcs namespace
|
|
|
|
|
*/
|
2026-03-02 18:00:41 +09:00
|
|
|
const subUserSchema = z.object({
|
|
|
|
|
id: whmcsRequiredNumber,
|
|
|
|
|
name: z.string(),
|
|
|
|
|
email: z.string(),
|
|
|
|
|
is_owner: whmcsOptionalBoolean,
|
|
|
|
|
});
|
2025-10-08 16:31:42 +09:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Billing stats from WHMCS
|
|
|
|
|
* Internal to Providers.Whmcs namespace
|
|
|
|
|
*/
|
2025-12-15 17:29:28 +09:00
|
|
|
const statsSchema = z.record(z.string(), z.union([z.string(), z.number(), z.boolean()])).optional();
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2026-02-24 19:05:30 +09:00
|
|
|
const normalizeCustomFields = (input: unknown): unknown => {
|
|
|
|
|
if (!input) return input;
|
|
|
|
|
if (Array.isArray(input)) return input;
|
|
|
|
|
if (typeof input === "object" && input !== null && "customfield" in input) {
|
|
|
|
|
const cf = (input as Record<string, unknown>)["customfield"];
|
|
|
|
|
if (Array.isArray(cf)) return cf;
|
|
|
|
|
return cf ? [cf] : input;
|
|
|
|
|
}
|
|
|
|
|
return input;
|
|
|
|
|
};
|
2025-10-20 16:26:47 +09:00
|
|
|
|
|
|
|
|
const whmcsCustomFieldsSchema = z
|
2026-02-24 19:05:30 +09:00
|
|
|
.preprocess(normalizeCustomFields, z.array(whmcsCustomFieldSchema).optional())
|
2025-10-20 16:26:47 +09:00
|
|
|
.optional();
|
|
|
|
|
|
2026-02-24 19:05:30 +09:00
|
|
|
const normalizeUsers = (input: unknown): unknown => {
|
|
|
|
|
if (!input) return input;
|
|
|
|
|
if (Array.isArray(input)) return input;
|
|
|
|
|
if (typeof input === "object" && input !== null && "user" in input) {
|
|
|
|
|
const u = (input as Record<string, unknown>)["user"];
|
|
|
|
|
if (Array.isArray(u)) return u;
|
|
|
|
|
return u ? [u] : input;
|
|
|
|
|
}
|
|
|
|
|
return input;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const whmcsUsersSchema = z.preprocess(normalizeUsers, z.array(subUserSchema).optional()).optional();
|
2025-10-20 16:26:47 +09:00
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
/**
|
|
|
|
|
* WhmcsClient - Full WHMCS client data
|
2025-12-15 17:29:28 +09:00
|
|
|
*
|
2025-10-08 16:31:42 +09:00
|
|
|
* Raw WHMCS structure with field names as they come from the API.
|
|
|
|
|
* Internal to Providers.Whmcs namespace - not exported at top level.
|
2025-12-15 17:29:28 +09:00
|
|
|
*
|
2025-10-08 16:31:42 +09:00
|
|
|
* Includes:
|
|
|
|
|
* - Profile data (firstname, lastname, companyname, etc.)
|
|
|
|
|
* - Billing info (currency_code, defaultgateway, status)
|
|
|
|
|
* - Preferences (email_preferences, allowSingleSignOn)
|
|
|
|
|
* - Relations (users, stats, customfields)
|
|
|
|
|
*/
|
2025-11-04 11:14:26 +09:00
|
|
|
const nullableProfileFields = [
|
|
|
|
|
"firstname",
|
|
|
|
|
"lastname",
|
|
|
|
|
"fullname",
|
|
|
|
|
"companyname",
|
|
|
|
|
"phonenumber",
|
|
|
|
|
"phonenumberformatted",
|
|
|
|
|
"telephoneNumber",
|
|
|
|
|
"status",
|
|
|
|
|
"language",
|
|
|
|
|
"defaultgateway",
|
|
|
|
|
"currency_code",
|
|
|
|
|
"tax_id",
|
|
|
|
|
"notes",
|
|
|
|
|
"datecreated",
|
|
|
|
|
"lastlogin",
|
|
|
|
|
] as const;
|
|
|
|
|
|
|
|
|
|
const nullableProfileOverrides = nullableProfileFields.reduce<Record<string, z.ZodTypeAny>>(
|
|
|
|
|
(acc, field) => {
|
|
|
|
|
acc[field] = z.string().nullable().optional();
|
|
|
|
|
return acc;
|
|
|
|
|
},
|
|
|
|
|
{}
|
|
|
|
|
);
|
|
|
|
|
|
2026-03-02 18:15:13 +09:00
|
|
|
export const whmcsClientSchema = whmcsRawClientSchema.extend({
|
|
|
|
|
...nullableProfileOverrides,
|
|
|
|
|
defaultpaymethodid: whmcsOptionalNumber.nullable(),
|
|
|
|
|
currency: whmcsOptionalNumber.nullable(),
|
|
|
|
|
allowSingleSignOn: whmcsOptionalBoolean.nullable(),
|
|
|
|
|
email_verified: whmcsOptionalBoolean.nullable(),
|
|
|
|
|
marketing_emails_opt_in: whmcsOptionalBoolean.nullable(),
|
|
|
|
|
address: addressSchema.nullable().optional(),
|
|
|
|
|
email_preferences: emailPreferencesSchema.nullable().optional(),
|
|
|
|
|
customfields: whmcsCustomFieldsSchema,
|
|
|
|
|
users: whmcsUsersSchema,
|
|
|
|
|
stats: statsSchema.optional(),
|
|
|
|
|
});
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// User Schema (API Response - Normalized camelCase)
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* User - Complete user profile for API responses
|
2025-12-15 17:29:28 +09:00
|
|
|
*
|
2025-10-08 16:31:42 +09:00
|
|
|
* Composition: UserAuth (portal DB) + WhmcsClient (WHMCS)
|
2025-10-09 10:49:03 +09:00
|
|
|
* Field names match WHMCS API exactly (no transformation)
|
2025-12-15 17:29:28 +09:00
|
|
|
*
|
2025-10-08 16:31:42 +09:00
|
|
|
* Use combineToUser() helper to construct from sources
|
|
|
|
|
*/
|
|
|
|
|
export const userSchema = userAuthSchema.extend({
|
2025-10-09 10:49:03 +09:00
|
|
|
// Profile fields (WHMCS field names - direct from API)
|
2025-10-08 16:31:42 +09:00
|
|
|
firstname: z.string().nullable().optional(),
|
|
|
|
|
lastname: z.string().nullable().optional(),
|
|
|
|
|
fullname: z.string().nullable().optional(),
|
|
|
|
|
companyname: z.string().nullable().optional(),
|
|
|
|
|
phonenumber: z.string().nullable().optional(),
|
|
|
|
|
language: z.string().nullable().optional(),
|
2025-10-09 10:49:03 +09:00
|
|
|
currency_code: z.string().nullable().optional(), // WHMCS uses snake_case for this
|
2025-10-08 16:31:42 +09:00
|
|
|
address: addressSchema.optional(),
|
2025-12-15 17:29:28 +09:00
|
|
|
|
|
|
|
|
// Common portal-visible identifiers/custom fields (derived in BFF)
|
|
|
|
|
sfNumber: z.string().nullable().optional(),
|
|
|
|
|
dateOfBirth: z.string().nullable().optional(),
|
|
|
|
|
gender: z.string().nullable().optional(),
|
2025-10-07 17:38:39 +09:00
|
|
|
});
|
|
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// Helper Functions
|
|
|
|
|
// ============================================================================
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
/**
|
|
|
|
|
* Convert address form data to address request format
|
|
|
|
|
* Trims strings and converts empty strings to null
|
|
|
|
|
*/
|
|
|
|
|
export function addressFormToRequest(form: AddressFormData): Address {
|
|
|
|
|
const emptyToNull = (value?: string | null) => {
|
2026-01-15 11:28:25 +09:00
|
|
|
if (value === undefined) return;
|
2025-10-08 16:31:42 +09:00
|
|
|
const trimmed = value?.trim();
|
|
|
|
|
return trimmed ? trimmed : null;
|
|
|
|
|
};
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
return addressSchema.parse({
|
2025-10-07 17:38:39 +09:00
|
|
|
address1: emptyToNull(form.address1),
|
|
|
|
|
address2: emptyToNull(form.address2 ?? null),
|
|
|
|
|
city: emptyToNull(form.city),
|
|
|
|
|
state: emptyToNull(form.state),
|
|
|
|
|
postcode: emptyToNull(form.postcode),
|
|
|
|
|
country: emptyToNull(form.country),
|
|
|
|
|
countryCode: emptyToNull(form.countryCode ?? null),
|
|
|
|
|
phoneNumber: emptyToNull(form.phoneNumber ?? null),
|
|
|
|
|
phoneCountryCode: emptyToNull(form.phoneCountryCode ?? null),
|
|
|
|
|
});
|
2025-10-08 16:31:42 +09:00
|
|
|
}
|
2025-10-07 17:38:39 +09:00
|
|
|
|
2025-10-09 10:49:03 +09:00
|
|
|
/**
|
|
|
|
|
* Convert profile form data to update request format
|
|
|
|
|
* No transformation needed - form already uses WHMCS field names
|
|
|
|
|
*/
|
|
|
|
|
export function profileFormToRequest(form: ProfileEditFormData): {
|
2025-12-15 17:29:28 +09:00
|
|
|
email: string;
|
2026-01-15 11:28:25 +09:00
|
|
|
phonenumber?: string | undefined;
|
2025-10-09 10:49:03 +09:00
|
|
|
} {
|
|
|
|
|
return {
|
2025-12-15 17:29:28 +09:00
|
|
|
email: form.email.trim(),
|
2025-10-09 10:49:03 +09:00
|
|
|
phonenumber: form.phonenumber?.trim() || undefined,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
/**
|
|
|
|
|
* Combine UserAuth and WhmcsClient into User
|
2025-12-15 17:29:28 +09:00
|
|
|
*
|
2025-10-08 16:31:42 +09:00
|
|
|
* This is the single source of truth for constructing User from its sources.
|
2025-10-09 10:49:03 +09:00
|
|
|
* No field name transformation - User schema uses WHMCS field names directly.
|
2025-12-15 17:29:28 +09:00
|
|
|
*
|
2025-10-08 16:31:42 +09:00
|
|
|
* @param userAuth - Authentication state from portal database
|
|
|
|
|
* @param whmcsClient - Full client data from WHMCS
|
2025-10-09 10:49:03 +09:00
|
|
|
* @returns User object for API responses with WHMCS field names
|
2025-10-08 16:31:42 +09:00
|
|
|
*/
|
|
|
|
|
export function combineToUser(userAuth: UserAuth, whmcsClient: WhmcsClient): User {
|
|
|
|
|
return userSchema.parse({
|
|
|
|
|
// Auth state from portal DB
|
|
|
|
|
id: userAuth.id,
|
|
|
|
|
email: userAuth.email,
|
|
|
|
|
role: userAuth.role,
|
|
|
|
|
emailVerified: userAuth.emailVerified,
|
|
|
|
|
mfaEnabled: userAuth.mfaEnabled,
|
|
|
|
|
lastLoginAt: userAuth.lastLoginAt,
|
|
|
|
|
createdAt: userAuth.createdAt,
|
|
|
|
|
updatedAt: userAuth.updatedAt,
|
2025-12-15 17:29:28 +09:00
|
|
|
|
2025-10-09 10:49:03 +09:00
|
|
|
// Profile from WHMCS (no transformation - keep field names as-is)
|
2025-10-08 16:31:42 +09:00
|
|
|
firstname: whmcsClient.firstname || null,
|
|
|
|
|
lastname: whmcsClient.lastname || null,
|
|
|
|
|
fullname: whmcsClient.fullname || null,
|
|
|
|
|
companyname: whmcsClient.companyname || null,
|
2025-12-15 17:29:28 +09:00
|
|
|
phonenumber:
|
|
|
|
|
whmcsClient.phonenumberformatted ||
|
|
|
|
|
whmcsClient.phonenumber ||
|
|
|
|
|
whmcsClient.telephoneNumber ||
|
|
|
|
|
null,
|
2025-10-08 16:31:42 +09:00
|
|
|
language: whmcsClient.language || null,
|
2025-10-09 10:49:03 +09:00
|
|
|
currency_code: whmcsClient.currency_code || null,
|
2025-10-08 16:31:42 +09:00
|
|
|
address: whmcsClient.address || undefined,
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-10-08 10:33:33 +09:00
|
|
|
|
2025-12-23 17:53:08 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// Verification (Customer-facing)
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Residence card verification status shown in the portal.
|
|
|
|
|
*
|
|
|
|
|
* Stored in Salesforce on the Account record.
|
|
|
|
|
*/
|
|
|
|
|
export const residenceCardVerificationStatusSchema = z.enum([
|
|
|
|
|
"not_submitted",
|
|
|
|
|
"pending",
|
|
|
|
|
"verified",
|
|
|
|
|
"rejected",
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
export const residenceCardVerificationSchema = z.object({
|
|
|
|
|
status: residenceCardVerificationStatusSchema,
|
|
|
|
|
submittedAt: z.string().datetime().nullable(),
|
|
|
|
|
reviewedAt: z.string().datetime().nullable(),
|
|
|
|
|
reviewerNotes: z.string().nullable(),
|
|
|
|
|
});
|
|
|
|
|
|
2025-10-08 10:33:33 +09:00
|
|
|
// ============================================================================
|
2025-10-08 16:31:42 +09:00
|
|
|
// Exported Types (Public API)
|
2025-10-08 10:33:33 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
export type User = z.infer<typeof userSchema>;
|
|
|
|
|
export type UserAuth = z.infer<typeof userAuthSchema>;
|
|
|
|
|
export type UserRole = "USER" | "ADMIN";
|
|
|
|
|
export type Address = z.infer<typeof addressSchema>;
|
2025-10-08 10:33:33 +09:00
|
|
|
export type AddressFormData = z.infer<typeof addressFormSchema>;
|
2025-10-09 10:49:03 +09:00
|
|
|
export type ProfileEditFormData = z.infer<typeof profileEditFormSchema>;
|
2025-12-23 17:53:08 +09:00
|
|
|
export type ResidenceCardVerificationStatus = z.infer<typeof residenceCardVerificationStatusSchema>;
|
|
|
|
|
export type ResidenceCardVerification = z.infer<typeof residenceCardVerificationSchema>;
|
2025-10-09 10:49:03 +09:00
|
|
|
|
|
|
|
|
// Convenience aliases
|
|
|
|
|
export type UserProfile = User; // Alias for user profile
|
|
|
|
|
export type AuthenticatedUser = User; // Alias for authenticated user context
|
2025-10-08 10:33:33 +09:00
|
|
|
|
2025-10-08 16:31:42 +09:00
|
|
|
// ============================================================================
|
|
|
|
|
// Internal Types (For Providers)
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
|
|
export type WhmcsClient = z.infer<typeof whmcsClientSchema>;
|
|
|
|
|
export type EmailPreferences = z.infer<typeof emailPreferencesSchema>;
|
|
|
|
|
export type SubUser = z.infer<typeof subUserSchema>;
|
|
|
|
|
export type Stats = z.infer<typeof statsSchema>;
|
|
|
|
|
|
|
|
|
|
// Export schemas for provider use
|
|
|
|
|
export { emailPreferencesSchema, subUserSchema, statsSchema };
|