Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mojaloop/#3524): add position fulfil to binprocessor #990

Merged
merged 122 commits into from
Dec 13, 2023
Merged
Changes from 1 commit
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
1f02497
feat: added skeleton and comments for prepare bin implementation
vijayg10 Sep 6, 2023
078f212
chore: some changes
vijayg10 Sep 6, 2023
44e4735
feat: added new position handler v2
vijayg10 Sep 7, 2023
83db860
feat: added some functionality to new position handler v2
vijayg10 Sep 7, 2023
4221b8c
feat: added some todos
vijayg10 Sep 7, 2023
6caa4e4
feat: changed new handler name
vijayg10 Sep 8, 2023
f8ac314
fix: lint
vijayg10 Sep 8, 2023
c5377d6
feat: add some changes
vijayg10 Sep 8, 2023
0112ccb
fix: lint
vijayg10 Sep 8, 2023
4424513
chore: added copyright header
vijayg10 Sep 8, 2023
451982e
feat: added some logic
vijayg10 Sep 8, 2023
026c4ef
fix: lint
vijayg10 Sep 8, 2023
41de3fc
feat: added unit tests
vijayg10 Sep 11, 2023
ca1fd41
feat: some improvements
vijayg10 Sep 11, 2023
39e74ee
feat: added bin processor logic
vijayg10 Sep 12, 2023
c300269
fix: lint
vijayg10 Sep 12, 2023
47a821c
feat; refactor
vijayg10 Sep 13, 2023
56e1b53
feat: added limit
vijayg10 Sep 13, 2023
7cf5cc4
fix: unit tests
vijayg10 Sep 13, 2023
4a2cd64
Merge branch 'main' of https://github.com/mojaloop/central-ledger int…
vijayg10 Sep 14, 2023
0ebb926
feat: added integration test
vijayg10 Sep 14, 2023
ea75e60
feat: refactor
vijayg10 Sep 14, 2023
8e775e9
fix: unit tests
vijayg10 Sep 14, 2023
98c48bc
fix: integration tests
vijayg10 Sep 14, 2023
6318ce1
feat: add position prepare bin logic (#970)
kleyow Sep 14, 2023
ba418ea
chore: add tests (#972)
kleyow Sep 15, 2023
e29b8c3
fix: metrics
vijayg10 Sep 15, 2023
6c84aa7
Merge branch feature/position-prepare-binnning of https://github.com/…
vijayg10 Sep 15, 2023
2190012
fix: some issue with bin processor
vijayg10 Sep 18, 2023
26f4b37
feat(mojaloop/#3489): add cached calls for participant currency, upda…
kleyow Sep 19, 2023
e958543
chore: improve coverage and edit metric and query name (#974)
kleyow Sep 21, 2023
d26d222
chore(snapshot): 17.3.0-snapshot.0
vijayg10 Sep 22, 2023
39c5281
fix: test downgrade stream lib
vijayg10 Sep 22, 2023
ac12981
chore(snapshot): 17.3.0-snapshot.1
vijayg10 Sep 22, 2023
8df11e9
fix: notification event action
vijayg10 Sep 25, 2023
8dbcdd2
chore(snapshot): 17.3.0-snapshot.2
vijayg10 Sep 25, 2023
71faf0d
fix: notification event
vijayg10 Sep 25, 2023
531bc0a
chore(snapshot): 17.3.0-snapshot.3
vijayg10 Sep 25, 2023
983dc51
fix: notification messages
vijayg10 Sep 25, 2023
72062f6
chore(snapshot): 17.3.0-snapshot.4
vijayg10 Sep 25, 2023
e9227c3
chore: updated conf
vijayg10 Sep 26, 2023
d393f71
chore: update deps
vijayg10 Sep 26, 2023
e24886e
chore(snapshot): 17.3.0-snapshot.5
vijayg10 Sep 26, 2023
b8b4cb2
fix(mojaloop/#3529): fix high latency (#981)
aaronreynoza Oct 2, 2023
c9032a4
chore(release): 17.2.1 [skip ci]
Oct 2, 2023
695f5e4
feat(mojaloop/#3489): add negative integration tests (#975)
sri-miriyala Sep 27, 2023
48d1ddb
Merge branch main of https://github.com/mojaloop/central-ledger into …
vijayg10 Oct 10, 2023
bc09d45
chore: foreach to for loop
vijayg10 Oct 10, 2023
c3a70c4
chore: cleanup
vijayg10 Oct 10, 2023
fdeb31e
Update src/handlers/index.js
vijayg10 Oct 10, 2023
ceda96a
chore: added readme doc
vijayg10 Oct 10, 2023
557df15
fix: lint
vijayg10 Oct 10, 2023
d8a27a2
fix: unit tests
vijayg10 Oct 10, 2023
72c333e
fix: audit
vijayg10 Oct 10, 2023
e9b191f
chore: cleanup
vijayg10 Oct 10, 2023
ab06b45
fix(mojaloop/#3533): helm v15.2.0-rc fixes (#982)
mdebarros Oct 27, 2023
627a795
chore(release): 17.3.0 [skip ci]
Oct 27, 2023
31ad569
chore: remove uuid4 (#976)
marco-ippolito Nov 1, 2023
898cf29
chore(release): 17.3.1 [skip ci]
Nov 1, 2023
92079d1
fix(mojaloop/#3615): upgrade dependencies (#985)
oderayi Nov 6, 2023
bdc531b
chore(release): 17.3.2 [skip ci]
Nov 6, 2023
3b34e67
fix: remove unneeded async/await
oderayi Nov 9, 2023
12acf12
feat: add validation for participantCurrencyIds / accountIds mapping
oderayi Nov 9, 2023
982bf6e
chore: remove resolved TODOs
oderayi Nov 9, 2023
7871fa8
test: Add test coverage
oderayi Nov 9, 2023
ae88d68
chore: remove whitespaces
oderayi Nov 9, 2023
008b751
fix: fixrebase merge conflict
oderayi Nov 9, 2023
bd499f2
chore: update dependencies
oderayi Nov 9, 2023
3689a6c
chore: resolve conflicts
oderayi Nov 9, 2023
518439f
doc: fix typo
oderayi Nov 10, 2023
2b2c429
chore(snapshot): 17.4.0-snapshot.0
oderayi Nov 10, 2023
b339177
chore(snapshot): 17.4.0-snapshot.1
oderayi Nov 13, 2023
27f7491
test: update unit tests
oderayi Nov 13, 2023
c6aae40
chore(snapshot): 17.4.0-snapshot.2
oderayi Nov 13, 2023
378dc42
fix: route error callback for batch correctly
oderayi Nov 14, 2023
eb02c2b
chore(snapshot): 17.4.0-snapshot.3
oderayi Nov 14, 2023
7b21d9b
fix(batch): fix error callback message routing. update tests
oderayi Nov 14, 2023
5c00e8e
chore(snapshot): 17.4.0-snapshot.4
oderayi Nov 14, 2023
cc92e28
fix(batch): fix message routing / properties for more error cases
oderayi Nov 15, 2023
1533b5a
chore(snapshot): 17.4.0-snapshot.5
oderayi Nov 15, 2023
da295b6
test: update test coverage
oderayi Nov 15, 2023
6079f61
chore(snapshot): 17.4.0-snapshot.6
oderayi Nov 15, 2023
3cd3ced
fix: route bulk-prepare messages to non-batch prepare handler
oderayi Nov 16, 2023
06049e8
chore(snapshot): 17.4.0-snapshot.7
oderayi Nov 16, 2023
e325497
doc: update comment
oderayi Nov 16, 2023
d04cfef
chore: update deps. update README for batch.
oderayi Nov 20, 2023
d827219
doc: Address TODO regarding participanLimits query optimization
oderayi Nov 21, 2023
640e3d9
stash
kleyow Dec 1, 2023
2a5f50b
chore: domain
kleyow Dec 1, 2023
7a4a726
chore: test
kleyow Dec 1, 2023
57c00a7
test
kleyow Dec 1, 2023
3280eed
chore: update bin processor tests
kleyow Dec 4, 2023
55a9a85
chore: coverage
kleyow Dec 4, 2023
7b968a0
log
kleyow Dec 4, 2023
a80b335
Merge remote-tracking branch 'origin/main' into feat/position-fulfil-…
kleyow Dec 5, 2023
15e2613
chore: update
kleyow Dec 6, 2023
6ca898b
chore: up retries
kleyow Dec 6, 2023
1e4ee76
chore: test
kleyow Dec 6, 2023
c2bf642
ci
kleyow Dec 6, 2023
3d18120
test
kleyow Dec 6, 2023
2512cd0
install
kleyow Dec 6, 2023
a5b2b42
test
kleyow Dec 6, 2023
3fa5654
test
kleyow Dec 6, 2023
ad60a52
test
kleyow Dec 7, 2023
fa7ddeb
script
kleyow Dec 7, 2023
dfde6db
chore: fix order
kleyow Dec 7, 2023
c2cd5e1
time
kleyow Dec 7, 2023
7774be1
test
kleyow Dec 7, 2023
9b3c586
time
kleyow Dec 7, 2023
aba070e
time
kleyow Dec 7, 2023
3980b2d
state
kleyow Dec 7, 2023
d155773
time
kleyow Dec 7, 2023
a16f9b5
chore: check transfer state
kleyow Dec 7, 2023
651efd2
test
kleyow Dec 7, 2023
be8b98c
lint
kleyow Dec 7, 2023
b38e7f6
chore: await
kleyow Dec 7, 2023
7c5f250
address comments
kleyow Dec 8, 2023
f3fb493
chore: dep
kleyow Dec 8, 2023
a7daff5
chore: address comments
kleyow Dec 8, 2023
5158115
coverage
kleyow Dec 8, 2023
1acebbb
chore(snapshot): 17.5.0-snapshot.0
kleyow Dec 11, 2023
f660f3f
remove
kleyow Dec 13, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add validation for participantCurrencyIds / accountIds mapping
oderayi committed Nov 9, 2023
commit 12acf128171cd7b4360acbdcb25a7779531acad3
15 changes: 13 additions & 2 deletions src/domain/position/binProcessor.js
Original file line number Diff line number Diff line change
@@ -71,11 +71,22 @@ const processBins = async (bins, trx) => {
// Get all participantIdMap for the accountIds
const participantCurrencyIds = await BatchPositionModelCached.getParticipantCurrencyByIds(trx, accountIds)

// TODO: Validate if all the participantCurrencyIds exist for all the accountIds
// Validate that participantCurrencyIds exist for each of the accountIds
// i.e every unique accountId has a corresponding entry in participantCurrencyIds
const participantIdsHavingCurrencyIdsList = [...new Set(participantCurrencyIds.map(item => item.participantCurrencyId))]

const allAccountIdsHaveParticipantCurrencyIds = accountIds.every(accountId => {
return participantIdsHavingCurrencyIdsList.includes(Number(accountId))
})

if (!allAccountIdsHaveParticipantCurrencyIds) {
// TODO: Add test coverage for this
throw ErrorHandler.Factory.createFSPIOPError(ErrorHandler.Enums.FSPIOPErrorCodes.INTERNAL_SERVER_ERROR, 'Not all accountIds have corresponding participantCurrencyIds')
}

const allSettlementModels = await SettlementModelCached.getAll()

// Construct an object participantIdMap, accountIdMap amd currencyIdMap
// Construct objects participantIdMap, accountIdMap and currencyIdMap
const participantIdMap = {}
const accountIdMap = {}
const currencyIdMap = {}