/**
* Zod schemas for Organization endpoints
*/
import { z } from 'zod';
import { PaginationSchema, ResponseFormatSchema, SortDirectionSchema, IdSchema, NameFilterSchema } from './common.js';
/**
* List organizations input schema
*/
export const ListOrganizationsSchema = z.object({
...PaginationSchema.shape,
response_format: ResponseFormatSchema,
name: NameFilterSchema,
organization_type_id: z.number().int().positive().optional()
.describe('Filter by organization type ID'),
organization_status_id: z.number().int().positive().optional()
.describe('Filter by organization status ID'),
psa_id: z.string().optional()
.describe('Filter by PSA integration ID'),
sort: z.enum(['name', 'id', 'updated_at', 'created_at'])
.default('name')
.describe('Field to sort by'),
sort_direction: SortDirectionSchema
}).strict();
export type ListOrganizationsInput = z.infer<typeof ListOrganizationsSchema>;
/**
* Get organization by ID schema
*/
export const GetOrganizationSchema = z.object({
id: IdSchema,
response_format: ResponseFormatSchema
}).strict();
export type GetOrganizationInput = z.infer<typeof GetOrganizationSchema>;
/**
* Create organization schema
*/
export const CreateOrganizationSchema = z.object({
name: z.string().min(1).max(255)
.describe('Organization name (required)'),
organization_type_id: z.number().int().positive().optional()
.describe('Organization type ID'),
organization_status_id: z.number().int().positive().optional()
.describe('Organization status ID'),
short_name: z.string().max(50).optional()
.describe('Short name for the organization'),
description: z.string().max(5000).optional()
.describe('Organization description'),
quick_notes: z.string().max(1000).optional()
.describe('Quick notes about the organization'),
alert: z.string().max(500).optional()
.describe('Alert message to display'),
response_format: ResponseFormatSchema
}).strict();
export type CreateOrganizationInput = z.infer<typeof CreateOrganizationSchema>;
/**
* Update organization schema
*/
export const UpdateOrganizationSchema = z.object({
id: IdSchema,
name: z.string().min(1).max(255).optional()
.describe('Organization name'),
organization_type_id: z.number().int().positive().optional()
.describe('Organization type ID'),
organization_status_id: z.number().int().positive().optional()
.describe('Organization status ID'),
short_name: z.string().max(50).optional()
.describe('Short name for the organization'),
description: z.string().max(5000).optional()
.describe('Organization description'),
quick_notes: z.string().max(1000).optional()
.describe('Quick notes about the organization'),
alert: z.string().max(500).optional().nullable()
.describe('Alert message to display (set to null to clear)'),
response_format: ResponseFormatSchema
}).strict();
export type UpdateOrganizationInput = z.infer<typeof UpdateOrganizationSchema>;