async findAll(data: Partial<DBCredit>): Promise<DBCredit[]> { const conditions = Object.entries(data) .filter(([_, value]) => value !== undefined) .map(([key, value]) => eq(credits[key as keyof DBCredit], value as any)); const result = await this.db .select() .from(credits) .where(and(...conditions)); return result; }