import * as i0 from '@angular/core';
import { Injectable } from '@angular/core';

//#endregion
/**
 * Notify Signers Command (Backend - Mock)
 *
 * Sends notifications to signers about the signature request.
 * This command runs on the backend and handles notification delivery.
 */
class AXCNotifySignersCommand {
    //#region ----   AXPCommand Implementation   ----
    async execute(input) {
        try {
            console.log(`[AXCNotifySignersCommand] Notifying ${input.signers.length} signers for request: ${input.signatureRequestId}`);
            // Validate inputs
            if (!input.signatureRequestId || !input.signers || input.signers.length === 0) {
                throw new Error('Invalid input: signatureRequestId and at least one signer are required');
            }
            // In a real implementation, this would:
            // 1. Send email notifications to each signer
            // 2. Send in-app notifications
            // 3. Create notification records
            // 4. Track notification delivery status
            // Mock: simulate notification sending
            const notifiedCount = input.signers.length;
            console.log(`[AXCNotifySignersCommand] Successfully notified ${notifiedCount} signers`);
            return {
                success: true,
                data: {
                    output: {
                        notifiedCount,
                    },
                    outcomes: {
                        Done: true,
                    },
                },
            };
        }
        catch (error) {
            console.error(`[AXCNotifySignersCommand] Failed to notify signers:`, error);
            return {
                success: false,
                message: {
                    text: error.message || 'Failed to notify signers',
                },
                data: {
                    output: {
                        notifiedCount: 0,
                    },
                    outcomes: {
                        Failed: true,
                    },
                },
            };
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXCNotifySignersCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXCNotifySignersCommand, providedIn: 'root' }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.19", ngImport: i0, type: AXCNotifySignersCommand, decorators: [{
            type: Injectable,
            args: [{
                    providedIn: 'root',
                }]
        }] });

export { AXCNotifySignersCommand };
//# sourceMappingURL=acorex-connectivity-mock-notify-signers.command-BV-b8NBg.mjs.map
