Files
vitfit-r2/V2/app/core/schemas/org.js
T
2026-06-30 08:46:12 -04:00

38 lines
1.3 KiB
JavaScript

'use strict';
const { z } = require('zod');
const hexColor = z.string().regex(/^#[0-9A-Fa-f]{6}$/, 'Must be a valid hex color (e.g. #00FF88)');
const updateOrg = z.object({
name: z.string().min(1).max(200).optional(),
timezone: z.string().max(100).optional(),
licenseOwner: z.string().max(200).optional(),
licenseEmail: z.string().email().optional(),
}).strict();
const updateBranding = z.object({
appName: z.string().min(1).max(200).optional(),
primaryColor: hexColor.optional(),
secondaryColor: hexColor.optional(),
workColor: hexColor.optional(),
restColor: hexColor.optional(),
moveColor: hexColor.optional(),
btnPrimaryBg: hexColor.optional(),
btnSecondaryBg: hexColor.optional(),
pageBg: hexColor.optional(),
popupBg: hexColor.optional(),
overlayColor: hexColor.optional(),
tabStyle: z.enum(['underline', 'pill']).optional(),
bannerBg: hexColor.optional(),
drawerBg: hexColor.optional(),
textPrimary: hexColor.optional(),
textSecondary: hexColor.optional(),
cardBg: hexColor.optional(),
inputBg: hexColor.optional(),
hoverBg: hexColor.optional(),
borderColor: hexColor.optional(),
}).strict();
module.exports = { updateOrg, updateBranding };