Trying to Model

Hi all

Please see the below diagram.
Trying to define the sink from Kafka -> Neo4J using Kafka Connector Process.
Original I was thinking of creating the transactions between Payer and Payee as direct edges/links... but wondering if it does not make sense to create the transaction as a node.
And then link that node on either side with the Payer node and Payee Node.

The following is my current Kafka Connect Sink, but it's not showing the edges/links and not sure if I read it I like it...
I already have the "ProvideServicesTo" and "HasAnAccountWith" edges/links between AccountHolder and Banks on both Outbound and Inbound Account.

{
  "name": "neo4j-ah-txn-ah-edge-sink", 
  "config": {
    "connector.class": "org.neo4j.connectors.kafka.sink.Neo4jConnector",
    "topics": "ob_txn_edge, ib_txn_edge",
    "neo4j.cypher.topic.ob_txn_edge": "MERGE (payer:AccountHolder {accountEntityId: $accountEntityId}) MERGE (payee:AccountHolder {accountEntityId: $counterpartyEntityId}) MERGE (txn:Transaction {transactionId: $transactionId}) ON CREATE SET txn += {eventTime: datetime($eventTime), baseValue: $baseValue, currency: $currency, settlementMethod: $settlementMethod, chargeBearer: $chargeBearer, transactionType: $transactionType, settlementClearingSystemCode: $settlementClearingSystemCode, overallScore: $overallScore} CREATE (payer)-[r:PAID_FUNDS_TO { eventId: $eventId, transaction: $transaction }]->(payee) CREATE (r)-[:PART_OF]->(txn)",
    "neo4j.cypher.topic.ib_txn_edge": "MERGE (payer:AccountHolder {accountEntityId: $counterpartyEntityId}) ON CREATE SET payer += {bicfi: $counterpartyBICFI} MERGE (payee:AccountHolder {accountEntityId: $accountEntityId}) ON CREATE SET payee += {tenantId: $tenantId, bicfi: $bicfi} MERGE (txn:Transaction {transactionId: $transactionId}) ON CREATE SET txn += {eventTime: datetime($eventTime), baseValue: $baseValue, currency: $currency, settlementMethod: $settlementMethod, chargeBearer: $chargeBearer, transactionType: $transactionType, settlementClearingSystemCode: $settlementClearingSystemCode, overallScore: $overallScore} CREATE (payee)-[r:RECEIVED_FUNDS_FROM { eventId: $eventId, transaction: $transaction }]->(payer) CREATE (r)-[:PART_OF]->(txn)",
    ... 
  }
}

some time stepping away makes you think...

As much as making the transaction a node in hindsight it does not make sense... i'm thinking a implementation as per above makes most sense.

The part where a payment as a node make sense is when many payments between the payer/payee is to be visualised as each become a node with properties and then the links/edges....

The source information I can't changed, how I package the inbound and outbound tx payload I have control over.

need advise.

G