Allow CEO agents to update company branding (name, description, logo, color)

- Add updateCompanyBrandingSchema restricting agent-updatable fields to name,
  description, brandColor, and logoAssetId
- Update PATCH /api/companies/:companyId to allow CEO agents with branding-only
  fields while keeping admin fields (status, budget, etc.) board-only
- Allow agents to GET /api/companies/:companyId for reading company info
- issuePrefix (company slug) remains protected — not in any update schema
- Document branding APIs in SKILL.md quick reference and api-reference.md

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
dotta
2026-03-18 16:28:40 -05:00
parent 035cb8aec2
commit 9c5a31ed45
6 changed files with 95 additions and 7 deletions

View File

@@ -253,8 +253,10 @@ export {
export {
createCompanySchema,
updateCompanySchema,
updateCompanyBrandingSchema,
type CreateCompany,
type UpdateCompany,
type UpdateCompanyBranding,
createAgentSchema,
createAgentHireSchema,
updateAgentSchema,

View File

@@ -22,3 +22,13 @@ export const updateCompanySchema = createCompanySchema
});
export type UpdateCompany = z.infer<typeof updateCompanySchema>;
/** Branding-only subset that CEO agents may update. */
export const updateCompanyBrandingSchema = z.object({
name: z.string().min(1).optional(),
description: z.string().nullable().optional(),
brandColor: z.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),
logoAssetId: logoAssetIdSchema,
});
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 {
portabilityIncludeSchema,