turash/bugulma/frontend/lib/service-config.ts
Damir Mukimov 6347f42e20
Consolidate repositories: Remove nested frontend .git and merge into main repository
- Remove nested git repository from bugulma/frontend/.git
- Add all frontend files to main repository tracking
- Convert from separate frontend/backend repos to unified monorepo
- Preserve all frontend code and development history as tracked files
- Eliminate nested repository complexity for simpler development workflow

This creates a proper monorepo structure with frontend and backend
coexisting in the same repository for easier development and deployment.
2025-11-25 06:02:57 +01:00

45 lines
1.2 KiB
TypeScript

/**
* Service Configuration Utilities
* Provides reusable configuration patterns for all API services
*/
import { API_ENDPOINTS } from '@/lib/api-config';
/**
* Default service configuration
* Provides consistent settings across all services
*/
export const createServiceConfig = (endpoint: string) => ({
basePath: endpoint,
enableLogging: import.meta.env.DEV,
});
/**
* Pre-configured service configs for common endpoints
* Eliminates repetitive constructor code
*/
export const SERVICE_CONFIGS = {
ORGANIZATIONS: createServiceConfig(API_ENDPOINTS.ORGANIZATIONS),
SITES: createServiceConfig(API_ENDPOINTS.SITES),
MATCHING: createServiceConfig(API_ENDPOINTS.MATCHING),
ANALYTICS: createServiceConfig(API_ENDPOINTS.ANALYTICS),
HERITAGE: createServiceConfig(API_ENDPOINTS.HERITAGE),
AI: createServiceConfig(API_ENDPOINTS.AI),
PROPOSALS: createServiceConfig(API_ENDPOINTS.PROPOSALS),
} as const;
/**
* Type-safe service config getter
*/
export const getServiceConfig = (endpoint: keyof typeof SERVICE_CONFIGS) => SERVICE_CONFIGS[endpoint];
/**
* Common service options interface
*/
export interface ServiceOptions {
basePath: string;
enableLogging?: boolean;
defaultTimeout?: number;
retries?: number;
}