Skip to content

Commit

Permalink
Ime 86 reporting api graph ql (#36) (#42)
Browse files Browse the repository at this point in the history
* IME-156 Integration tests - Populate MongoDB

* Add skeleton for integration tests.

* Put tests in one file to avoid duplication.

* Improve on the errors seen in the graphql schema implementation.

* Check for null on loaders.

* Transfer resource error fixes

* Update Integration tests.

* Remove central-ledger prisma files and cacheMiddleWare

* Update eventStore.prisma file and add transaction.prisma

* Update mongodb connection

* Add eventstore schema for testing changes

* Update Transfer for new model

* Add db connection for transaction collection

* update: transaction.prisma model types

* fix ime-271

fix transaction query

* fix ime-271

payerParty and payeeParty data not showing

* initial commit

* fix: ime-275

- Fixed issue where null data was returned in the GraphQL `transfers` query output.
- Created Prisma schema types for MongoDB embedded document JSON objects to correctly map transaction data.
- Defined `Transaction` object type in the GraphQL schema.
- Added a new `getAllTransfers` query to fetch multiple transfer records with pagination support (limit and offset).

* create: base tranferSummary query without filter

* fix: deployment test case failure issue

- Fixed test case failing due to some code still having dependency on central ledger

* update: transferSummary query add filter

* Fix: filters wrong result

- Added helper functions to generate dynamic where and group conditions based on filter input.

- Fixed issue with errorCode returning null in query response.

* Add integration tests

* Fix/ime 268 no data (#34)

* add: transfer filter to transfer resource

- Added helper functions to generate dynamic where condition based on filter input.
- Added filter to transfer resource
- Rename query name transfers and getAllTransfers to transfer and transfers

* update: transfer summary query

* update: transfers pagination default limit

* Fix/ime 268 no data (#35)

* add: transfer filter to transfer resource

- Added helper functions to generate dynamic where condition based on filter input.
- Added filter to transfer resource
- Rename query name transfers and getAllTransfers to transfer and transfers

* update: transfer summary query

* update: transfers pagination default limit

* Fix: integration test

* Fix: integration test error

---------




* Update audit check run.

* Fix bug with audit check run.

* Fix bug with audit check run, add a few whitelist items with severity high

* Fix bug with audit check run, add a few whitelist items with severity high

* Update whitelist.

* Fix/ime 268 no data (#37)

* add: transfer filter to transfer resource

- Added helper functions to generate dynamic where condition based on filter input.
- Added filter to transfer resource
- Rename query name transfers and getAllTransfers to transfer and transfers

* update: transfer summary query

* update: transfers pagination default limit

* Fix: integration test

* Fix: integration test error

* Fix: bug int cannot represent non-integer value

-Use scalar type [dateTimeFlex,BigInt]

* update: transfer query to add events fields

-Added quoteEvents field to transfer resource
-Added transferEvents field to transfer resource
-Added partyLookupEventsfield to transfer resource
-Added settlementEvents to transfer resource

* fix: transfer filter bug

transfers query was returning less no of transfers documents than it was existing

* update: transaction schema and query according to new schema

* fix: conversion state filter

* fix: transfers object conversion error when no data returned for query

* create: resolver for fxTransferEvents and fxQuoteEvents lookup

* create: settlement resource prisma model

* create: settlement resource query

* add: conversionSettlementBatchId and transferSettlementBatchId lookup to transfer

---------



* Fix/lint errors (#38)

* add: transfer filter to transfer resource

- Added helper functions to generate dynamic where condition based on filter input.
- Added filter to transfer resource
- Rename query name transfers and getAllTransfers to transfer and transfers

* update: transfer summary query

* update: transfers pagination default limit

* Fix: integration test

* Fix: integration test error

* Fix: bug int cannot represent non-integer value

-Use scalar type [dateTimeFlex,BigInt]

* update: transfer query to add events fields

-Added quoteEvents field to transfer resource
-Added transferEvents field to transfer resource
-Added partyLookupEventsfield to transfer resource
-Added settlementEvents to transfer resource

* fix: transfer filter bug

transfers query was returning less no of transfers documents than it was existing

* update: transaction schema and query according to new schema

* fix: conversion state filter

* fix: transfers object conversion error when no data returned for query

* create: resolver for fxTransferEvents and fxQuoteEvents lookup

* create: settlement resource prisma model

* create: settlement resource query

* add: conversionSettlementBatchId and transferSettlementBatchId lookup to transfer

* fix: lint errors

* Update two packages with high severity: body-parser  <1.20.3 & path-to-regexp  <0.1.10
They will need to be updated.

---------





* Fix/lint errors (#39)

* add: transfer filter to transfer resource

- Added helper functions to generate dynamic where condition based on filter input.
- Added filter to transfer resource
- Rename query name transfers and getAllTransfers to transfer and transfers

* update: transfer summary query

* update: transfers pagination default limit

* Fix: integration test

* Fix: integration test error

* Fix: bug int cannot represent non-integer value

-Use scalar type [dateTimeFlex,BigInt]

* update: transfer query to add events fields

-Added quoteEvents field to transfer resource
-Added transferEvents field to transfer resource
-Added partyLookupEventsfield to transfer resource
-Added settlementEvents to transfer resource

* fix: transfer filter bug

transfers query was returning less no of transfers documents than it was existing

* update: transaction schema and query according to new schema

* fix: conversion state filter

* fix: transfers object conversion error when no data returned for query

* create: resolver for fxTransferEvents and fxQuoteEvents lookup

* create: settlement resource prisma model

* create: settlement resource query

* add: conversionSettlementBatchId and transferSettlementBatchId lookup to transfer

* fix: lint errors

* Update two packages with high severity: body-parser  <1.20.3 & path-to-regexp  <0.1.10
They will need to be updated.

* Fix: unit test , remove unnecessary import

---------





* Fix: IAC deployment issue (#40)

* add: transfer filter to transfer resource

- Added helper functions to generate dynamic where condition based on filter input.
- Added filter to transfer resource
- Rename query name transfers and getAllTransfers to transfer and transfers

* update: transfer summary query

* update: transfers pagination default limit

* Fix: integration test

* Fix: integration test error

* Fix: bug int cannot represent non-integer value

-Use scalar type [dateTimeFlex,BigInt]

* update: transfer query to add events fields

-Added quoteEvents field to transfer resource
-Added transferEvents field to transfer resource
-Added partyLookupEventsfield to transfer resource
-Added settlementEvents to transfer resource

* fix: transfer filter bug

transfers query was returning less no of transfers documents than it was existing

* update: transaction schema and query according to new schema

* fix: conversion state filter

* fix: transfers object conversion error when no data returned for query

* create: resolver for fxTransferEvents and fxQuoteEvents lookup

* create: settlement resource prisma model

* create: settlement resource query

* add: conversionSettlementBatchId and transferSettlementBatchId lookup to transfer

* fix: lint errors

* Update two packages with high severity: body-parser  <1.20.3 & path-to-regexp  <0.1.10
They will need to be updated.

* Fix: unit test , remove unnecessary import

* update: set transferSettlementWindowId nullable

-- set transferSettlementBatchId null when transferSettlementWindowId is null
-- set conversionSettlementBatchId null when conversionSettlementWindowId is null

---------





* chore: fix audit

* Fix/iac deployment issue (#41)

* add: transfer filter to transfer resource

- Added helper functions to generate dynamic where condition based on filter input.
- Added filter to transfer resource
- Rename query name transfers and getAllTransfers to transfer and transfers

* update: transfer summary query

* update: transfers pagination default limit

* Fix: integration test

* Fix: integration test error

* Fix: bug int cannot represent non-integer value

-Use scalar type [dateTimeFlex,BigInt]

* update: transfer query to add events fields

-Added quoteEvents field to transfer resource
-Added transferEvents field to transfer resource
-Added partyLookupEventsfield to transfer resource
-Added settlementEvents to transfer resource

* fix: transfer filter bug

transfers query was returning less no of transfers documents than it was existing

* update: transaction schema and query according to new schema

* fix: conversion state filter

* fix: transfers object conversion error when no data returned for query

* create: resolver for fxTransferEvents and fxQuoteEvents lookup

* create: settlement resource prisma model

* create: settlement resource query

* add: conversionSettlementBatchId and transferSettlementBatchId lookup to transfer

* fix: lint errors

* Update two packages with high severity: body-parser  <1.20.3 & path-to-regexp  <0.1.10
They will need to be updated.

* Fix: unit test , remove unnecessary import

* update: set transferSettlementWindowId nullable

-- set transferSettlementBatchId null when transferSettlementWindowId is null
-- set conversionSettlementBatchId null when conversionSettlementWindowId is null

* update: resolver for events lookup

* update: events resolver to use dataloaders

* add: helper function for event resolver

* remove: unused graphql schema and queries

* update: remove unused mongoclient

* refactor: dataloaders

* chore:add ts-ignore to context.ts and index.ts

* fix: lint issues

---------





* update: .gitignore

* chore: remove dist directory

Remove the dist/ directory

* update: package.json , remove unused line

Assuming it is not used anywhere

---------

Co-authored-by: Nguni <[email protected]>
Co-authored-by: Madalitso Simbeye <[email protected]>
Co-authored-by: v3-Panwar-Ujjwal <[email protected]>
Co-authored-by: Akhilesh Rawat <[email protected]>
Co-authored-by: Ujjwal-Izyane <[email protected]>
  • Loading branch information
6 people authored Dec 24, 2024
1 parent 88e6c21 commit 3f2757c
Show file tree
Hide file tree
Showing 52 changed files with 9,377 additions and 3,074 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
command: mkdir -p ./audit/results
- run:
name: Check for new npm vulnerabilities
command: npm run audit:check -- -o json > ./audit/results/auditResults.json
command: npm run audit:check --silent -- -o json > ./audit/results/auditResults.json
- store_artifacts:
path: ./audit/results
prefix: audit
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ generated/

# Config
.env

# Ignore build files
dist/
10 changes: 9 additions & 1 deletion audit-ci.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
"GHSA-c2qf-rxjj-qqgw",
"GHSA-72xf-g2v4-qvf3",
"GHSA-j8xg-fqg3-53r7",
"GHSA-3h5v-q93c-6h6q"
"GHSA-3h5v-q93c-6h6q",
"GHSA-9wv6-86v2-598j",
"GHSA-qwcr-r2fm-qrc7",
"GHSA-78xj-cgh5-2h22",
"GHSA-9wv6-86v2-598j",
"GHSA-qw6h-vgh9-j6wx",
"GHSA-m6fv-jmcg-4jfg",
"GHSA-cm22-4g7w-348p",
"GHSA-rhx6-c78j-4q9w"
]
}
26 changes: 26 additions & 0 deletions config/test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"PORT": 3000,
"REPORTING_DB": {
"DIALECT": "mysql",
"HOST": "localhost",
"PORT": 3306,
"USER": "central_ledger",
"PASSWORD": "password",
"SCHEMA": "central_ledger"
},
"EVENT_STORE_DB": {
"HOST": "localhost",
"PORT": 27017,
"USER": "",
"PASSWORD": "",
"DATABASE": "admin"
},
"ORY_KETO_READ_URL": "",
"AUTH_CHECK_PARTICIPANTS": false,
"USER_ID_HEADER": "x-user",
"PRISMA_LOGGING_ENABLED": false,
"CORS_WHITELIST": [
"http://localhost:8082"
],
"ALLOW_CREDENTIALS": true
}
Loading

0 comments on commit 3f2757c

Please sign in to comment.