Skip to content

Wallet-to-Wallet Service First Document flow - #102

Open
Tharun48 wants to merge 10 commits into
Robustrade:mainfrom
Tharun48:main
Open

Wallet-to-Wallet Service First Document flow#102
Tharun48 wants to merge 10 commits into
Robustrade:mainfrom
Tharun48:main

Conversation

@Tharun48

Copy link
Copy Markdown

Summary

Describe your solution briefly.

AI disclosure

Detail how you used AI to help with your submission (including the tools you used, how
you used them and what your prompts were).
Include these points in detail

  1. What tool you used (Cursor, Claude Code, Antigratvity etc.)
  2. How you generally use the tool for your work.
  3. A transcript of your entire session with your AI tool of choice. You can add this to the repo or email it to us with your submission. If for some reason, this is not possible, give us all the prompts that you used with the AI.

Schema Design

Describe the tables, constraints, and indexes you introduced.

Idempotency Strategy

Explain how duplicate requests are handled safely.

Concurrency Strategy

Explain how you prevent race conditions and double spending.

How to Run

How to Test

Tradeoffs / Assumptions

Checklist

  • Tests pass
  • Lint passes
  • Format check passes
  • README or notes updated
  • PR description explains schema, idempotency, and concurrency

@Tharun48
Tharun48 requested a review from amitlambakulu as a code owner June 26, 2026 17:52
Copilot AI review requested due to automatic review settings June 26, 2026 17:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an initial “first flow” design/approach document for the wallet-to-wallet transfer service, describing intended requirements, API contract examples, and strategies for idempotency, concurrency, and ledger integrity.

Changes:

  • Introduces a new Markdown document capturing the proposed transfer flow and system expectations.
  • Documents (at a high level) idempotency lifecycle, pessimistic locking rationale, and double-entry ledger rules.
  • Provides example request/response payloads for wallet creation, transfers, balance lookup, and history.

Comment thread APPROCH.md.md
Comment on lines +20 to +23
-1.Build an application that transfers the amount
-from one wallet to another wallet
-2.api to fetch the balance(either from the ledger entry or the balance bucket)
-3.Transfer api history
Comment thread APPROCH.md.md Outdated
Comment thread APPROCH.md.md
Comment on lines +35 to +40
### 1.Concurrency Control and Double-Deduction Prevention
### 2. Absolute Idempotency Lifecycle
### 3.Ledger Integrity
Inorder to make the system consistent going with the pessmistic locking and to implement pessimistic locking we have to aquire the lock for two wallets in the order to avoid deadlock.

### 2. Absolute Idempotency Lifecycle
Comment thread APPROCH.md.md
Comment on lines +41 to +46
-Must expose idempotency at the entry point of the service boundray and check if the key already exists in the table.
-if there is a key
Completed request then return the same resonse
PROCESSING request conflit, then return the request is already in progress(have to handle the server crash processing request)
FAILED request, then process the request and mark the status as processing
-no KEY process the request
Comment thread APPROCH.md.md
}
```

GET /wallets/{walletId}/history?Month=APR&Category=MONEYSENT&paymentStatus=SUCCESSFULL
Comment thread APPROCH.md.md
Comment on lines +137 to +144
## idempotency behaviour
-Must expose idempotency at the entry point of the service boundray and check if the key already exists in the table.
-if there is a key
Completed request then return the same resonse
PROCESSING request conflit, then return the request is already in progress(have to handle the server crash processing request)
FAILED request, then process the request and mark the status as processing
-no KEY process the request

Comment thread APPROCH.md.md

---
## retry behaviour
-In a distributed setup, your application servers talk to your database cluster over a network network.
Comment thread APPROCH.md.md
Comment on lines +88 to +107
POST /transfer
request:
``` json
{
"idempotencyKey": "abc012",
"fromWalletId": 1001,
"toWalletId": "acha12b",
"amount": 400.00
}
```

``` json
response:
{
"date":"2026 Jun 25 18:53",
"amount":400.00,
"toWallet":"akad901",
"transactionId":9001
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants