/** * Proposal Repository Port Interface * * Port for Proposal aggregate operations. * Implementations (Drizzle, etc.) are adapters. */ import type { Proposal, NewProposal } from '../schema.js'; /** * Data for creating a new proposal. * Omits system-managed fields (id, createdAt, updatedAt). */ export type CreateProposalData = Omit; /** * Data for updating a proposal. */ export type UpdateProposalData = Partial>; /** * Proposal Repository Port */ export interface ProposalRepository { create(data: CreateProposalData): Promise; createMany(data: CreateProposalData[]): Promise; findById(id: string): Promise; findByAgentId(agentId: string): Promise; findByInitiativeId(initiativeId: string): Promise; findByAgentIdAndStatus(agentId: string, status: string): Promise; update(id: string, data: UpdateProposalData): Promise; updateManyByAgentId(agentId: string, data: UpdateProposalData): Promise; updateManyByAgentIdAndStatus(agentId: string, currentStatus: string, data: UpdateProposalData): Promise; countByAgentIdAndStatus(agentId: string, status: string): Promise; }