/** * @fileoverview Shared Enums - Centralized enum definitions * @description Common enums used across all domain schemas * @version 0.18.4 */ import { z } from 'zod'; // === AUTHENTICATION ENUMS === export const RoleNameSchema = z.enum(['owner', 'admin', 'ml_developer', 'client']); export const PermissionNameSchema = z.string().min(1); export const SessionStatusSchema = z.enum(['active', 'expired', 'revoked']); export const AuthLevelSchema = z.enum(['public', 'user', 'service', 'admin']); // === ML ENUMS === export const SignalStrengthSchema = z.enum(['weak', 'moderate', 'strong']); export const SignalDirectionSchema = z.enum(['bullish', 'bearish', 'neutral']); export const SignalTypeSchema = z.enum(['entry', 'exit', 'scalping', 'swing']); export const ConsensusDecisionSchema = z.enum(['buy', 'sell', 'hold']); export const ModelTypeSchema = z.enum(['lstm', 'random_forest', 'xgboost', 'ensemble', 'transformer']); export const ModelStatusSchema = z.enum(['active', 'inactive', 'training', 'deprecated']); // === TRADING ENUMS === export const TradeSideSchema = z.enum(['BUY', 'SELL']); export const OrderTypeSchema = z.enum(['market', 'limit', 'stop', 'stop_limit']); export const OrderStatusSchema = z.enum(['pending', 'filled', 'cancelled', 'rejected', 'expired']); export const PositionStatusSchema = z.enum(['open', 'closed', 'liquidated']); // === PORTFOLIO ENUMS === export const AccountTypeSchema = z.enum(['ISA', 'SIPP', 'GIA', 'CFD', 'SPREAD_BET']); // === MARKET ENUMS === export const TimeframeSchema = z.enum(['1m', '5m', '15m', '30m', '1h', '4h', '1d', '1w', '1M']); export const DataProviderSchema = z.enum(['ig', 'hl', 'yahoo', 'alpha_vantage', 'twelve_data']); // === JOB ENUMS === export const JobStatusSchema = z.enum(['pending', 'running', 'completed', 'failed', 'cancelled']); export const JobPrioritySchema = z.enum(['low', 'normal', 'high', 'critical']); export const JobTypeSchema = z.enum(['data_ingestion', 'ml_training', 'signal_generation', 'portfolio_sync']); // === STREAMING ENUMS === export const StreamEventTypeSchema = z.enum(['position_update', 'signal_update', 'price_update', 'job_update']); // === PAGINATION ENUMS === export const SortDirectionSchema = z.enum(['asc', 'desc']); export const FilterOperatorSchema = z.enum(['eq', 'neq', 'gt', 'gte', 'lt', 'lte', 'like', 'in', 'nin']); // === DEPRECATION ENUMS === export const DeprecationStatusSchema = z.enum(['active', 'deprecated', 'removed']); export const DeprecationStatusValueSchema = z.enum(['dual_support', 'deprecation_warnings', 'legacy_removed']); // === MARKETPLACE ENUMS === export const VendorStatusSchema = z.enum(['pending', 'approved', 'suspended']); export const ModelListingStatusSchema = z.enum(['draft', 'published', 'deprecated']); export const DeploymentStatusSchema = z.enum(['deploying', 'active', 'scaling', 'stopped', 'failed']); // === COMMON ENUMS === export const HttpMethodSchema = z.enum(['GET', 'POST', 'PUT', 'DELETE', 'PATCH']); export const PerformanceSLASchema = z.enum(['fast', 'standard', 'slow', 'batch']); // Type exports for all enums export type RoleName = z.infer; export type PermissionName = z.infer; export type SessionStatus = z.infer; export type AuthLevel = z.infer; export type SignalStrength = z.infer; export type SignalDirection = z.infer; export type SignalType = z.infer; export type ConsensusDecision = z.infer; export type ModelType = z.infer; export type ModelStatus = z.infer; export type TradeSide = z.infer; export type OrderType = z.infer; export type OrderStatus = z.infer; export type PositionStatus = z.infer; export type AccountType = z.infer; export type Timeframe = z.infer; export type DataProvider = z.infer; export type JobStatus = z.infer; export type JobPriority = z.infer; export type JobType = z.infer; export type StreamEventType = z.infer; export type SortDirection = z.infer; export type FilterOperator = z.infer; export type DeprecationStatus = z.infer; export type DeprecationStatusValue = z.infer; export type VendorStatus = z.infer; export type ModelListingStatus = z.infer; export type DeploymentStatus = z.infer; export type HttpMethod = z.infer; export type PerformanceSLA = z.infer;