/** * Example Mapper * * Demonstrates extending BaseMapper for a domain entity. * Uses types from @plyaz/types/examples. * * Note: Validation is handled by ExampleValidator, not here. */ import { BaseMapper } from '../../base'; import type { ExampleEntity, ExampleResponseDTO, ExampleStoreItem, CreateExampleDTO, UpdateExampleDTO, PatchExampleDTO, QueryExampleDTO } from '@plyaz/types/examples'; /** * Example Mapper implementation * * Supports: * - toDomain: API response → Domain * - toCreateDTO: Domain → POST body * - toPatchDTO: Domain → PATCH body * - toStoreState: Domain → Zustand store */ declare class ExampleMapperClass extends BaseMapper { /** * API DTO → Domain Model * Handles both snake_case (DTO) and camelCase (Entity) input formats */ toDomain(dto: ExampleResponseDTO | ExampleEntity): ExampleEntity; /** * Domain data → Create DTO (POST body) */ toCreateDTO(data: Partial): CreateExampleDTO; /** * Domain data → Update DTO (PUT body - full) */ toUpdateDTO(data: Partial): UpdateExampleDTO; /** * Domain data → Patch DTO (PATCH body - partial) */ toPatchDTO(data: Partial): PatchExampleDTO; /** * Filters → Query params DTO (GET) */ toQueryDTO(filters: Partial): QueryExampleDTO; /** * Domain → Store state (serializable) */ toStoreState(domain: ExampleEntity): ExampleStoreItem; /** * Store state → Domain (restore computed props) */ fromStoreState(state: ExampleStoreItem): ExampleEntity; /** * Database row → Response DTO * Maps repository output to API response format */ toResponseDTO(row: { id: string; name: string; description: string | null; amount: number; owner_id: string; status: string; is_visible: boolean; created_at: string; updated_at: string; }): ExampleResponseDTO; } export { ExampleMapperClass }; export declare const ExampleMapper: ExampleMapperClass; //# sourceMappingURL=ExampleMapper.d.ts.map