Add CEO company branding endpoint

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta
2026-03-18 21:03:41 -05:00
parent 87b17de0bd
commit 7b4a4f45ed
8 changed files with 264 additions and 2 deletions

View File

@@ -288,8 +288,10 @@ export {
export {
createCompanySchema,
updateCompanySchema,
updateCompanyBrandingSchema,
type CreateCompany,
type UpdateCompany,
type UpdateCompanyBranding,
agentSkillStateSchema,
agentSkillSyncModeSchema,
agentSkillEntrySchema,

View File

@@ -2,6 +2,7 @@ import { z } from "zod";
import { COMPANY_STATUSES } from "../constants.js";
const logoAssetIdSchema = z.string().uuid().nullable().optional();
const brandColorSchema = z.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional();
export const createCompanySchema = z.object({
name: z.string().min(1),
@@ -17,8 +18,21 @@ export const updateCompanySchema = createCompanySchema
status: z.enum(COMPANY_STATUSES).optional(),
spentMonthlyCents: z.number().int().nonnegative().optional(),
requireBoardApprovalForNewAgents: z.boolean().optional(),
brandColor: z.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),
brandColor: brandColorSchema,
logoAssetId: logoAssetIdSchema,
});
export type UpdateCompany = z.infer<typeof updateCompanySchema>;
export const updateCompanyBrandingSchema = z
.object({
brandColor: brandColorSchema,
logoAssetId: logoAssetIdSchema,
})
.strict()
.refine(
(value) => value.brandColor !== undefined || value.logoAssetId !== undefined,
"At least one branding field must be provided",
);
export type UpdateCompanyBranding = z.infer<typeof updateCompanyBrandingSchema>;

View File

@@ -15,8 +15,10 @@ export {
export {
createCompanySchema,
updateCompanySchema,
updateCompanyBrandingSchema,
type CreateCompany,
type UpdateCompany,
type UpdateCompanyBranding,
} from "./company.js";
export {
companySkillSourceTypeSchema,