Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
50c5952
Elasticsearch implementation for Beneficiary Search (#324)
vanitha1822 Dec 18, 2025
1bc9298
variable added
sac2kadam Dec 31, 2025
4b975ff
Merge pull request #330 from PSMRI/add_ci_docker_properties
drtechie Dec 31, 2025
65efdc7
Elastic Search Implementation for Advanced Search (#327)
vanitha1822 Jan 8, 2026
17620d3
fix:signature check for mmu
vishwab1 Jan 9, 2026
68b246e
Merge pull request #335 from PSMRI/release-3.6.1-sign
snehar-nd Jan 9, 2026
c3bc3cb
fix: retrive any user without deleted
vishwab1 Jan 13, 2026
8dcdfc3
Merge pull request #336 from PSMRI/release-3.6.1-sign
snehar-nd Jan 13, 2026
134fa75
fix: update KM filepath
vanitha1822 Jan 29, 2026
c6e42d9
FLW-713 Remove All File Upload Options (#350)
SauravBizbRolly Jan 30, 2026
f487978
Move code to 3.6.1 to 3.8.0 (#372)
vishwab1 Mar 12, 2026
1cc3888
fix: add OTP rate limiting to prevent OTP flooding on sendConsent end…
vishwab1 Mar 12, 2026
01110c1
Health api (#376)
vishwab1 Mar 18, 2026
0efc2f8
add facilityData with employeeId in login response (#385)
vishwab1 Mar 26, 2026
eb917b2
fix: property values are not fetching after deploying in linux server
snehar-nd Apr 2, 2026
1f8111c
feature for hindi translation for CG
SauravBizbRolly Apr 10, 2026
d97a721
Merge pull request #393 from PSMRI/feature/hindhi_translation_changes
SauravBizbRolly Apr 10, 2026
c0fe9c6
1097 Abandon call real time data (#365)
vanitha1822 Mar 2, 2026
8dd19e1
fix: fetch from .env (#369)
vanitha1822 Mar 12, 2026
37a5577
Merge pull request #395 from PSMRI/nd/vs/code_3.3
snehar-nd Apr 13, 2026
62b53af
Merge remote-tracking branch 'upstream/release-3.6.3' into merge_3.8.…
SauravBizbRolly Apr 16, 2026
29aec50
Merge remote-tracking branch 'upstream/release-3.8.1' into merge_3.8.…
SauravBizbRolly Apr 16, 2026
e39df83
add otp_consent template key
SauravBizbRolly May 2, 2026
304230a
fix welcome sms code
SauravBizbRolly May 2, 2026
81241a9
fix welcome sms code
SauravBizbRolly May 3, 2026
2ea6aba
Merge pull request #405 from PSMRI/bug/hindhi_translation_welcome_sms…
SauravBizbRolly May 6, 2026
d8abb19
fix: login response asha list misisng
vishwab1 May 7, 2026
73df48e
Merge pull request #409 from PSMRI/vbb/release-3.8.1
SauravBizbRolly May 13, 2026
56e33f8
fix: occupationID and educationID not saved during beneficiary update
snehar-nd May 13, 2026
c574506
Revert "fix: property values are not fetching after deploying in linu…
snehar-nd May 13, 2026
a22a0db
Merge pull request #410 from PSMRI/sn/3.8.1
snehar-nd May 13, 2026
544d557
fix: concurrent session logout not invalidating JWT in first system
snehar-nd May 14, 2026
341aeff
Merge pull request #411 from PSMRI/sn/3.8.1
snehar-nd May 14, 2026
80fa0e5
fix: concurrent session logout not invalidating JWT on first system
snehar-nd May 14, 2026
c82c9ad
Merge pull request #412 from PSMRI/fix/concurrent-session-jwt-denylist
snehar-nd May 14, 2026
ccab7de
fix(security): remove PII from JWT token for mobile logins (#413)
vishwab1 May 18, 2026
8251770
feat: add mobile to peersAtFacility and ashaList in facilityData logi…
vishwab1 May 19, 2026
b4b15be
Merge Releases 3.7.0 and 3.8.1 (#416)
vanitha1822 May 19, 2026
3437e74
fix: aam-2313 phone number leading with zero - removed zero (#418)
snehar-nd May 21, 2026
ddadb3a
fix: merge with main
vanitha1822 May 22, 2026
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
98 changes: 98 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# CLAUDE.md - Common-API

## Project Overview

Common-API is the gateway microservice for the AMRIT healthcare platform. It provides shared APIs consumed by all frontend UIs including authentication, beneficiary registration, call handling, location masters, notifications, feedback, reporting, and integrations with external systems (c-Zentrix CTI, Everwell, eAusadha, eSanjeevani, ABDM, Firebase, Honeywell POCT devices).

## Tech Stack

- Java 17
- Spring Boot 3.2.2
- Spring Data JPA / Hibernate
- MySQL 8.0
- Redis (session management, caching)
- MongoDB (optional, for specific integrations)
- Maven (build tool)
- Swagger/OpenAPI (API documentation)
- Lombok, MapStruct
- CryptoJS-compatible AES encryption
- Firebase Admin SDK
- WAR packaging (deploys to Wildfly)

## Build and Run

```bash
# Build
mvn clean install -DENV_VAR=local

# Run locally (start Redis first)
mvn spring-boot:run -DENV_VAR=local

# Package WAR
mvn -B package --file pom.xml -P <profile> # profiles: dev, local, test, ci, uat

# Run tests
mvn test
```

### Configuration

- Copy `src/main/environment/common_example.properties` to `common_local.properties` and edit.
- Environment selected via `-DENV_VAR=<env>`.
- Swagger UI: `http://localhost:8083/swagger-ui.html`

## Package Structure

Base package: `com.iemr.common`

| Layer | Package | Description |
|-------|---------|-------------|
| Controllers | `controller.*` | REST endpoints (40+ sub-packages) |
| Services | `service.*` | Business logic |
| Repositories | `repository.*`, `repo.*` | JPA repositories |
| Entities | `data.*` | JPA entity classes |
| DTOs | `model.*` | Transfer objects |
| Mappers | `mapper.*` | Object mapping |
| Config | `config.*` | Swagger, encryption, Firebase, Quartz, prototypes |
| Constants | `constant` | Application constants |
| Utils | `utils.*` | Redis, HTTP, session, validation, exception |

## Key Functional Domains

- **Authentication/Authorization**: `controller.users` - login, session, user management
- **Beneficiary Registration**: `controller.beneficiary` - create, search, update beneficiaries
- **Call Handling**: `controller.callhandling` - CTI integration, call lifecycle
- **Feedback/Grievance**: `controller.feedback`, `controller.grievance` - feedback and complaint management
- **Location**: `controller.location` - state, district, block, village masters
- **Notifications**: `controller.notification` - alerts, SMS, email, Firebase push
- **Reporting**: `controller.report`, `controller.secondaryReport` - CRM reports
- **Helpline 104**: `controller.helpline104history` - medical advice history
- **COVID**: `controller.covid` - vaccination status
- **CTI Integration**: `controller.cti` - c-Zentrix computer telephony
- **External Integrations**: `controller.eausadha`, `controller.esanjeevani`, `controller.everwell`, `controller.honeywell`, `controller.brd`, `controller.carestream`
- **ABDM**: `controller.abdmfacility` - Ayushman Bharat Digital Mission
- **KM File Management**: `controller.kmfilemanager` - OpenKM document management
- **OTP/SMS**: `controller.otp`, `controller.sms` (via SMS gateway)
- **Scheduling**: `controller.questionconfig`, `controller.scheme`
- **Door-to-Door App**: `controller.door_to_door_app` - field worker support
- **NHM Dashboard**: `controller.nhmdashboard` - National Health Mission integration

## Architecture Notes

- Entry point: `CommonMain.java` (main class in `utils` package)
- Acts as the API gateway; all frontend UIs authenticate through Common-API
- Session management via Redis with 27-minute timeout
- HTTP interceptors attach `Authorization` and `ServerAuthorization` headers
- Status code `5002` signals session expiration to frontends
- AES + PBKDF2 encryption for password handling (`config.encryption`)
- Firebase integration for push notifications (`config.firebase`)
- Quartz scheduler for background jobs (`config.quartz`)
- Extensive test coverage with unit tests under `src/test/`

## CI/CD

- GitHub Actions: `package.yml`, `build-on-pull-request.yml`, `sast.yml`, `commit-lint.yml`, `codeql.yml`
- Conventional Commits enforced via Husky + commitlint
- Checkstyle configuration in `checkstyle.xml`
- JaCoCo for code coverage, SonarQube integration configured
- Dockerfile for containerized deployment
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,9 @@ private String cleanPhoneNumber(String phoneNumber) {
// Remove 91 prefix if it's a 12-digit number (91 + 10 digit mobile)
else if (cleaned.startsWith("91") && cleaned.length() == 12) {
cleaned = cleaned.substring(2);
} else if (cleaned.startsWith("0") && cleaned.length() == 11) {
// Handle case where number starts with 0 and is 11 digits long
cleaned = cleaned.substring(1);
}

return cleaned.trim();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

@Service
// @Primary
public class OpenKMServiceImpl implements KMService {

private final Logger logger = LoggerFactory.getLogger(this.getClass().getName());
Expand Down
Loading