/**
 * PMO Ticket Provider
 *
 * Default provider for users without external integrations.
 * Wraps the existing PMO storage calls.
 * Emits ticket:status_changed events via the storage layer.
 */
export class PMOTicketProvider {
    storage;
    projectId;
    name = 'pmo';
    constructor(storage, projectId) {
        this.storage = storage;
        this.projectId = projectId;
    }
    async moveTicket(ticketId, newState) {
        try {
            await this.storage.moveTicket(this.projectId, ticketId, newState);
            return { success: true, provider: 'pmo' };
        }
        catch (error) {
            return {
                success: false,
                provider: 'pmo',
                error: error instanceof Error ? error.message : String(error),
            };
        }
    }
    async deleteTicket(ticketId) {
        try {
            await this.storage.deleteTicket(ticketId);
            return { success: true, provider: 'pmo' };
        }
        catch (error) {
            return {
                success: false,
                provider: 'pmo',
                error: error instanceof Error ? error.message : String(error),
            };
        }
    }
    async listTickets(projectId, filter) {
        try {
            const tickets = await this.storage.listTickets(projectId, filter);
            return { success: true, provider: 'pmo', tickets };
        }
        catch (error) {
            return {
                success: false,
                provider: 'pmo',
                tickets: [],
                error: error instanceof Error ? error.message : String(error),
            };
        }
    }
    async createTicket(projectId, input) {
        try {
            const ticket = await this.storage.createTicket(projectId, input);
            return { success: true, provider: 'pmo', ticket };
        }
        catch (error) {
            return {
                success: false,
                provider: 'pmo',
                error: error instanceof Error ? error.message : String(error),
            };
        }
    }
    async getTicket(ticketId) {
        try {
            const ticket = await this.storage.getTicket(ticketId);
            return { success: true, provider: 'pmo', ticket };
        }
        catch (error) {
            return {
                success: false,
                provider: 'pmo',
                error: error instanceof Error ? error.message : String(error),
            };
        }
    }
}
//# sourceMappingURL=pmo-provider.js.map