/** * DAO Repository * Database access layer for DAO records * MVP: In-memory storage, replace with actual DB later */ import type { DaoRecord } from '../../domain/dao/types'; // MVP: In-memory storage const daoStore: Map = new Map(); export const daoRepository = { async save(record: DaoRecord): Promise { daoStore.set(record.daoId, record); }, async findById(daoId: string): Promise { return daoStore.get(daoId) || null; }, async findAll(filter?: { level?: string; type?: string }): Promise { const all = Array.from(daoStore.values()); if (!filter) { return all; } return all.filter(dao => { if (filter.level && dao.level !== filter.level) { return false; } if (filter.type && dao.type !== filter.type) { return false; } return true; }); }, async delete(daoId: string): Promise { daoStore.delete(daoId); }, };