@cfxlabsinc/b2b-services
    Preparing search index...

    Moves a payment's note and attachments onto an approval request when it is created, and from the request onto the transaction when it executes. Promoted files stay when a request ends DECLINED or CANCELLED: Make again may reuse them.

    Index
    instance: (...args: []) => TransactionRequestMetadataService = ...

    The process default: built from each dependency's own instance().

    • Record the request on the transaction's metadata (approvalRequestId, the requester as creator, never the approver whose click ran execution), write the request's note and attach its files. Safe to retry after a crash: the metadata upserts and a file already attached is returned, not duplicated. The files keep their request-owned keys (no second copy), which TransactionMetadataFileService.get serves as it does any transaction file. A failure throws so execution retries. created lists the files this call added, for the caller's activity rows.

      Parameters

      • __namedParameters: {
            customerId: string;
            metadata: TransactionRequestMetadata;
            requesterDashboardUserId: string;
            requestId: string;
            transactionId: string;
        }

      Returns Promise<
          {
              ok: true;
              value: {
                  files: { created: boolean; file: TransactionMetadataFile }[];
                  metadata: TransactionMetadata;
              };
          },
      >