mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-14 18:10:39 +09:00
Add support for company logos, including schema adjustments, validation, assets handling, and UI display enhancements.
This commit is contained in:
parent
b155415d7d
commit
b19d0b6f3b
17 changed files with 6211 additions and 26 deletions
|
|
@ -1,10 +1,19 @@
|
|||
import { z } from "zod";
|
||||
import { COMPANY_STATUSES } from "../constants.js";
|
||||
|
||||
const logoUrlSchema = z
|
||||
.string()
|
||||
.trim()
|
||||
.max(2048)
|
||||
.regex(/^\/api\/assets\/[^\s]+$|^https?:\/\/[^\s]+$/)
|
||||
.nullable()
|
||||
.optional();
|
||||
|
||||
export const createCompanySchema = z.object({
|
||||
name: z.string().min(1),
|
||||
description: z.string().optional().nullable(),
|
||||
budgetMonthlyCents: z.number().int().nonnegative().optional().default(0),
|
||||
logoUrl: logoUrlSchema,
|
||||
});
|
||||
|
||||
export type CreateCompany = z.infer<typeof createCompanySchema>;
|
||||
|
|
@ -16,6 +25,7 @@ export const updateCompanySchema = createCompanySchema
|
|||
spentMonthlyCents: z.number().int().nonnegative().optional(),
|
||||
requireBoardApprovalForNewAgents: z.boolean().optional(),
|
||||
brandColor: z.string().regex(/^#[0-9a-fA-F]{6}$/).nullable().optional(),
|
||||
logoUrl: logoUrlSchema,
|
||||
});
|
||||
|
||||
export type UpdateCompany = z.infer<typeof updateCompanySchema>;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue