/** * BaseService - Abstract Service with Common CRUD Operations * * Provides multi-tenant aware CRUD operations using TypeORM. * All domain services should extend this base class. * * @module @shared/services */ import { Repository, FindOptionsWhere, FindManyOptions, DeepPartial, ObjectLiteral } from 'typeorm'; export interface PaginationOptions { page?: number; limit?: number; } export interface PaginatedResult { data: T[]; meta: { total: number; page: number; limit: number; totalPages: number; }; } export interface ServiceContext { tenantId: string; userId?: string; } export declare abstract class BaseService { protected readonly repository: Repository; constructor(repository: Repository); /** * Find all records for a tenant with optional pagination */ findAll(ctx: ServiceContext, options?: PaginationOptions & { where?: FindOptionsWhere; }): Promise>; /** * Find one record by ID for a tenant */ findById(ctx: ServiceContext, id: string): Promise; /** * Find one record by criteria */ findOne(ctx: ServiceContext, where: FindOptionsWhere): Promise; /** * Find records by custom options */ find(ctx: ServiceContext, options: FindManyOptions): Promise; /** * Create a new record */ create(ctx: ServiceContext, data: DeepPartial): Promise; /** * Update an existing record */ update(ctx: ServiceContext, id: string, data: DeepPartial): Promise; /** * Soft delete a record */ softDelete(ctx: ServiceContext, id: string): Promise; /** * Hard delete a record (use with caution) */ hardDelete(ctx: ServiceContext, id: string): Promise; /** * Count records */ count(ctx: ServiceContext, where?: FindOptionsWhere): Promise; /** * Check if a record exists */ exists(ctx: ServiceContext, where: FindOptionsWhere): Promise; } //# sourceMappingURL=base.service.d.ts.map