Customer Support Case Schemas (domain/support-case.ts)

mastra · templates/template-customer-refund-agent/src/mastra/domain/support-case.ts · typescript · Apache-2.0
ai, database, crm, lang:typescript, fw:zod, tag:validation

Defines Zod schemas for customer support cases, messages, and refunds. Reuse for validating AI agent domain models and workflows.

// Source: https://github.com/mastra-ai/mastra | License: Apache-2.0 | Copyright 2025 Kepler Software, Inc
// Provided via justclaw.it.com; keep this notice with the code.
import { z } from 'zod';
import { persistedRefundCommandSchema } from './refund-command.ts';
import {
  persistedSubscriptionCreditCommandSchema,
  retainedSubscriptionCreditCommandReferenceSchema,
} from './subscription-credit-command.ts';

export const caseSourceSchema = z.enum(['mock-email', 'chat', 'intercom-conversation']);
export type CaseSource = z.infer<typeof caseSourceSchema>;

export const caseStatusSchema = z.enum(['new', 'processing', 'waiting_approval', 'resolved', 'escalated', 'failed']);
export type CaseStatus = z.infer<typeof caseStatusSchema>;

export const messageAuthorSchema = z.enum(['customer', 'age

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key