Defines booking modes, capacity rules, and zod schemas for service scheduling, including effective capacity and timing resolution helpers for appointment slots.
// Source: https://github.com/melgarafael/DeskcommCRM | License: MIT | Copyright 2026 Rafael Melgaço
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from "zod";
import { diaLocalISO, diaDaSemanaLocal, instanteDe } from "../fuso";
import { fusoValido } from "@/lib/tempo/fusos";
export const MODOS_DE_RESERVA = ["individual", "collective_limited", "collective_unlimited"] as const;
export const REGRAS_DE_CAPACIDADE = ["inherit", "limited", "unlimited"] as const;
export type ModoDeReserva = (typeof MODOS_DE_RESERVA)[number];
export type RegraDeCapacidade = (typeof REGRAS_DE_CAPACIDADE)[number];
const uuid = z.string().uuid();
const inteiro = (min: number, max: number) => z.number().int().min(min).max(max);
export const horarioDoServicoSchema = z.object({
id: uu
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key