import { AdapterBase } from '../sdk/adapter-base';
import { AdapterReceiveResult, AdapterSendResult, AdapterValidateResult } from '../sdk/adapter-types';

/**
 * dbis.adapter.swift-gpi
 * Scaffold adapter for SWIFT gpi tracker status updates (UETR).
 */
export class SwiftGpiAdapter extends AdapterBase {
	async validate(_: Record<string, unknown>): Promise<AdapterValidateResult> {
		return { ok: true };
	}
	async send(outboxRecord: { txnId: string; payloadHash: string; envelope: unknown }): Promise<AdapterSendResult> {
		return { status: 'SENT', railMessageId: `GPI-${outboxRecord.txnId}` };
	}
	async receive(_: unknown): Promise<AdapterReceiveResult> {
		return { status: 'STATUS', railMessageId: `GPI-STAT-${Date.now()}`, statusPayload: { code: 'IN_PROGRESS' } };
	}
}

