account-lookup-service 17.13.0 → 17.14.0-snapshot.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CLAUDE.md ADDED
@@ -0,0 +1,100 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Development Commands
6
+
7
+ ### Running the Service
8
+ - `npm start` - Start both API and Admin servers
9
+ - `npm run start:api` - Start only the API server (port 3000)
10
+ - `npm run start:admin` - Start only the Admin server (port 3001)
11
+ - `npm run start:handlers` - Start message handlers with timeout
12
+ - `npm run dev` - Start in development mode with nodemon
13
+
14
+ ### Testing
15
+ - `npm test` or `npm run test:unit` - Run unit tests with Jest
16
+ - `npm run test:coverage-check` - Run tests with coverage validation (90% threshold)
17
+ - `npm run test:int` - Run integration tests (requires database)
18
+ - `npm run test:integration` - Full integration test suite with Docker containers
19
+ - `npm run test:functional` - Run functional tests
20
+
21
+ ### Database Operations
22
+ - `npm run migrate` - Run database migrations and seed data (requires database connection)
23
+ - `npm run migrate:latest` - Run latest migrations
24
+ - `npm run migrate:rollback` - Rollback last migration
25
+ - `npm run seed:run` - Run database seeds
26
+
27
+ ### Code Quality
28
+ - `npm run lint` - Run StandardJS linting
29
+ - `npm run lint:fix` - Auto-fix linting issues
30
+ - `npm run audit:check` - Check for security vulnerabilities
31
+ - `npm run dep:check` - Check for dependency updates
32
+
33
+ ### Docker Development
34
+ - `npm run dc:up` - Start all services with Docker Compose
35
+ - `npm run dc:down` - Stop and remove containers
36
+ - `npm run wait-4-docker` - Wait for Docker services to be ready
37
+
38
+ ## Architecture Overview
39
+
40
+ ### Service Structure
41
+ This is a **Mojaloop Account Lookup Service** built with **Hapi.js** and **MySQL**. The service provides two main servers:
42
+
43
+ - **API Server** (`src/server.js:initializeApi`) - Handles party lookup requests and participant queries
44
+ - **Admin Server** (`src/server.js:initializeAdmin`) - Provides administrative endpoints and health checks
45
+ - **Message Handlers** (`src/handlers/`) - Processes asynchronous messages for timeout handling
46
+
47
+ ### Key Components
48
+
49
+ #### Domain Layer (`src/domain/`)
50
+ - **parties/** - Core party lookup logic and validation
51
+ - **participants/** - Participant management operations
52
+ - **oracle/** - Oracle endpoint resolution
53
+ - **timeout/** - Message timeout handling
54
+
55
+ #### API Layer (`src/api/`)
56
+ - Uses **OpenAPI 3.0** specifications for endpoint definitions
57
+ - Swagger files: `src/interface/api-swagger.yaml` and `src/interface/admin-swagger.yaml`
58
+ - Route handlers split between API and Admin functionality
59
+
60
+ #### Data Access (`src/models/`)
61
+ - **Knex.js** for database operations and migrations
62
+ - MySQL database with connection pooling
63
+ - Cached oracle endpoints for performance
64
+
65
+ #### Caching Strategy
66
+ The service uses multiple cache layers:
67
+ - **ParticipantEndpointCache** - Caches participant endpoints from central ledger
68
+ - **ParticipantCache** - Caches participant information
69
+ - **OracleEndpointCache** - Caches oracle endpoint mappings
70
+ - **ProxyCache** - For inter-scheme proxy operations (Redis/Memory)
71
+
72
+ ### Configuration
73
+ - Main config: `src/lib/config/default.json`
74
+ - Environment-specific configs in `config/` directory
75
+ - Database config: `config/knexfile.js`
76
+ - Docker: `docker-compose.yml` for full service stack
77
+
78
+ ### Testing Strategy
79
+ - **Unit Tests**: Jest with 90% coverage requirement (`jest.config.js`)
80
+ - **Integration Tests**: Docker-based with real database (`jest-int.config.js`)
81
+ - **Functional Tests**: End-to-end API testing
82
+ - Test setup: `test/unit/setup.js`
83
+
84
+ ### Key Dependencies
85
+ - **@hapi/hapi** - Web framework
86
+ - **@mojaloop/central-services-*** - Mojaloop shared libraries for logging, metrics, caching
87
+ - **knex** + **mysql2** - Database ORM and driver
88
+ - **joi** - Request/response validation
89
+ - **commander** - CLI interface
90
+
91
+ ### Database Schema
92
+ Uses Knex migrations in `migrations/` directory. Key tables include participant and oracle endpoint mappings. Always run `npm run migrate` before development.
93
+
94
+ ## Development Notes
95
+
96
+ - Use `standard` for code formatting (no semicolons, 2-space indentation)
97
+ - All database operations should go through the domain layer
98
+ - OpenAPI specs are the source of truth for API contracts
99
+ - Integration tests require Docker and can be run in "wait" mode for debugging
100
+ - The service supports ISO20022 message formats alongside FSPIOP
@@ -79,7 +79,7 @@
79
79
  "MONITORING_PORT": 4003,
80
80
  "TIMEOUT": {
81
81
  "DISABLED": false,
82
- "TIMEXP": "*/30 * * * * *",
82
+ "TIMEXP": "*/15 * * * * *",
83
83
  "TIMEZONE": "UTC",
84
84
  "BATCH_SIZE": 100,
85
85
  "DIST_LOCK": {
@@ -4,7 +4,7 @@ networks:
4
4
 
5
5
  # @see https://uninterrupted.tech/blog/hassle-free-redis-cluster-deployment-using-docker/
6
6
  x-redis-node: &REDIS_NODE
7
- image: docker.io/bitnami/redis-cluster:6.2.14
7
+ image: docker.io/bitnamilegacy/redis-cluster:6.2.14
8
8
  environment: &REDIS_ENVS
9
9
  ALLOW_EMPTY_PASSWORD: yes
10
10
  REDIS_CLUSTER_DYNAMIC_IPS: no
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "account-lookup-service",
3
3
  "description": "Account Lookup Service is used to validate Party and Participant lookups.",
4
- "version": "17.13.0",
4
+ "version": "17.14.0-snapshot.3",
5
5
  "license": "Apache-2.0",
6
6
  "author": "ModusBox",
7
7
  "contributors": [
@@ -93,13 +93,13 @@
93
93
  "@hapi/vision": "7.0.3",
94
94
  "@mojaloop/central-services-error-handling": "13.1.2",
95
95
  "@mojaloop/central-services-health": "15.1.0",
96
- "@mojaloop/central-services-logger": "11.9.3",
96
+ "@mojaloop/central-services-logger": "11.10.1",
97
97
  "@mojaloop/central-services-metrics": "12.7.1",
98
- "@mojaloop/central-services-shared": "18.33.0",
98
+ "@mojaloop/central-services-shared": "18.33.3",
99
99
  "@mojaloop/central-services-stream": "11.8.7",
100
100
  "@mojaloop/database-lib": "^11.3.2",
101
101
  "@mojaloop/event-sdk": "14.7.0",
102
- "@mojaloop/inter-scheme-proxy-cache-lib": "2.6.0",
102
+ "@mojaloop/inter-scheme-proxy-cache-lib": "2.7.0-snapshot.2",
103
103
  "@mojaloop/ml-schema-transformer-lib": "2.7.8",
104
104
  "@mojaloop/sdk-standard-components": "19.17.0",
105
105
  "@now-ims/hapi-now-auth": "2.1.0",
@@ -113,7 +113,7 @@
113
113
  "knex": "3.1.0",
114
114
  "mustache": "4.2.0",
115
115
  "mysql": "2.18.1",
116
- "mysql2": "^3.14.5",
116
+ "mysql2": "^3.15.0",
117
117
  "npm-run-all": "4.1.5",
118
118
  "parse-strings-in-object": "2.0.0",
119
119
  "rc": "1.2.8"
@@ -175,7 +175,7 @@
175
175
  "jest-junit": "16.0.0",
176
176
  "jsdoc": "4.0.4",
177
177
  "nodemon": "3.1.10",
178
- "npm-check-updates": "18.1.1",
178
+ "npm-check-updates": "18.3.0",
179
179
  "nyc": "17.1.0",
180
180
  "pre-commit": "1.2.2",
181
181
  "proxyquire": "2.1.3",