metis-desk/modules/companies/src/common/company-logo.ts
David 5515191eff feat: add company logo management functionality
- Implemented CompanyLogoUseCases for retrieving, saving, and removing company logos.
- Created CompanyLogoError class for error handling related to logo operations.
- Developed CompanyLogoProcessor to optimize and validate logo images.
- Added HTTP routes for logo management, including GET and POST endpoints.
- Created Sequelize-based repository for logo persistence.
- Implemented migration for adding logoVersion to companies and creating company_logos table.
- Added frontend components for displaying and managing company logos, including avatar and logo upload fields.
- Wrote tests for logo processing and avatar components to ensure functionality and correctness.
2026-10-08 18:31:46 +02:00

15 lines
482 B
TypeScript

import { z } from "zod/v4";
export const COMPANY_LOGO_LIMITS = {
inputBytes: 2 * 1024 * 1024,
inputDimension: 4096,
pixels: 4096 * 4096,
outputDimension: 128,
outputBytes: 64 * 1024,
} as const;
export const COMPANY_LOGO_TYPES = ["image/png", "image/jpeg", "image/webp"] as const;
export const CompanyLogoVersionSchema = z.string().regex(/^[a-f0-9]{64}$/);
export const CompanyLogoResponseSchema = z.strictObject({
logoVersion: CompanyLogoVersionSchema.nullable(),
});