Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
303 commits
Select commit Hold shift + click to select a range
f49b34b
IDENTITY_BASE_URL fix
SauravBizbRolly Jul 3, 2025
6ee70b2
Merge pull request #246 from toarunmishra/fix_identity_api_url
SauravBizbRolly Jul 3, 2025
5cfac3f
IDENTITY_BASE_URL fix
SauravBizbRolly Jul 4, 2025
5785c70
Merge branch '3.3.0' into 3.3.0
SauravBizbRolly Jul 4, 2025
5939168
Merge pull request #247 from toarunmishra/3.3.0
SauravBizbRolly Jul 4, 2025
f14beb2
IDENTITY_BASE_URL fix
SauravBizbRolly Jul 4, 2025
1eaeab7
Merge remote-tracking branch 'origin/3.3.0' into 3.3.0
SauravBizbRolly Jul 4, 2025
61c13a1
IDENTITY_BASE_URL fix
SauravBizbRolly Jul 4, 2025
42b8161
Merge pull request #248 from toarunmishra/fix_identity_varibale
SauravBizbRolly Jul 4, 2025
c495576
IDENTITY_BASE_URL fix
SauravBizbRolly Jul 4, 2025
f89737a
IDENTITY_BASE_URL fix
SauravBizbRolly Jul 4, 2025
98759f9
Merge pull request #249 from toarunmishra/fix
SauravBizbRolly Jul 4, 2025
bff3dab
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 4, 2025
dffa07f
Merge pull request #250 from toarunmishra/fix_docker_variable
SauravBizbRolly Jul 4, 2025
c8bc5de
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 4, 2025
597fdce
Merge pull request #251 from toarunmishra/fix_url_issue
SauravBizbRolly Jul 4, 2025
21fb980
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 4, 2025
ea74406
Merge branch '3.3.0' into fix_identity_url
SauravBizbRolly Jul 4, 2025
9c4c726
Merge pull request #252 from toarunmishra/fix_identity_url
SauravBizbRolly Jul 4, 2025
b71ef0c
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 4, 2025
ca10e2e
Merge pull request #253 from toarunmishra/3.3.0
SauravBizbRolly Jul 4, 2025
786e31e
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 4, 2025
79150b4
Merge pull request #255 from toarunmishra/3.3.0
SauravBizbRolly Jul 4, 2025
ee67c57
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 4, 2025
c935f37
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 4, 2025
4e52aa8
Merge pull request #256 from toarunmishra/fix_build
SauravBizbRolly Jul 4, 2025
af2abc7
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 7, 2025
320605a
Merge pull request #259 from toarunmishra/fix_build
SauravBizbRolly Jul 7, 2025
6c0a72f
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 7, 2025
c054fa8
Merge pull request #260 from toarunmishra/fix_build
SauravBizbRolly Jul 7, 2025
e4ea5c3
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 7, 2025
78b9247
Merge pull request #261 from toarunmishra/fix_build
SauravBizbRolly Jul 7, 2025
6cc8749
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 7, 2025
b554799
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 7, 2025
678b3b0
Merge pull request #262 from toarunmishra/fix_identity_varible_issue
SauravBizbRolly Jul 7, 2025
c8a4f05
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 7, 2025
91600e4
Merge pull request #263 from toarunmishra/fix_identity_varible_issue
SauravBizbRolly Jul 7, 2025
ae09714
dynamic from feature
SauravBizbRolly Jul 16, 2025
5ab6b7f
Merge remote-tracking branch 'upstream/develop' into feature_dynamic_…
SauravBizbRolly Jul 16, 2025
515f27c
dynamic from feature
SauravBizbRolly Jul 16, 2025
27cf841
dynamic from feature
SauravBizbRolly Jul 16, 2025
0e7b33b
dynamic from feature
SauravBizbRolly Jul 16, 2025
a72334e
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly Jul 17, 2025
680a732
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly Jul 17, 2025
f30311f
Merge branch 'master_dynamic_form' into 3.3.0
SauravBizbRolly Jul 18, 2025
ad19656
Update application.properties
SauravBizbRolly Jul 18, 2025
6171755
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly Jul 18, 2025
0be53ed
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly Jul 18, 2025
8e186e6
Update JwtUserIdValidationFilter.java
SauravBizbRolly Jul 21, 2025
121c33f
Update CommonIdentityMapperDecorator.java
SauravBizbRolly Aug 4, 2025
2dfb40d
Update JwtUserIdValidationFilter.java
SauravBizbRolly Aug 12, 2025
6f86bb7
Update FirebaseNotificationController.java
SauravBizbRolly Aug 12, 2025
75633a0
Update FirebaseNotificationService.java
SauravBizbRolly Aug 12, 2025
d29eccb
Update BeneficiaryConsentController.java
SauravBizbRolly Aug 12, 2025
08450e6
welcome sms
SauravBizbRolly Aug 13, 2025
634d365
Merge pull request #277 from toarunmishra/3.3.0
SauravBizbRolly Aug 13, 2025
d13e32a
fix issue
SauravBizbRolly Aug 13, 2025
32c5f68
fix issue
SauravBizbRolly Aug 13, 2025
61f1626
Update application.properties
SauravBizbRolly Aug 13, 2025
c1b6e83
fix issue
SauravBizbRolly Aug 13, 2025
01c6f08
Merge remote-tracking branch 'upstream/release-3.6.0' into release-3.6.0
SauravBizbRolly Aug 13, 2025
160071b
fix issue
SauravBizbRolly Aug 13, 2025
33e0f69
fix issue
SauravBizbRolly Aug 13, 2025
cb7bdd7
fix issue
SauravBizbRolly Aug 13, 2025
2ed19b0
fix issue
SauravBizbRolly Aug 13, 2025
1ad9c81
fix issue
SauravBizbRolly Aug 13, 2025
8f5a947
Update JwtUserIdValidationFilter.java
SauravBizbRolly Aug 18, 2025
357f28f
Update WelcomeBenificarySmsServiceImpl.java
SauravBizbRolly Aug 18, 2025
0f7628d
Update application.properties
SauravBizbRolly Aug 20, 2025
997bee3
Update IEMRAdminController.java
SauravBizbRolly Aug 20, 2025
7d80955
fix issue
SauravBizbRolly Aug 21, 2025
bf08081
Merge remote-tracking branch 'upstream/release-3.6.0' into release-3.6.0
SauravBizbRolly Aug 21, 2025
6d40fd0
fix issue
SauravBizbRolly Aug 21, 2025
bf15109
fix issue
SauravBizbRolly Aug 21, 2025
32a2b4f
fix issue
SauravBizbRolly Aug 21, 2025
f8a16f4
fix issue
SauravBizbRolly Aug 21, 2025
d8881d4
fix issue
SauravBizbRolly Aug 21, 2025
fb1f504
fix issue
SauravBizbRolly Aug 21, 2025
27eac5b
fix issue
SauravBizbRolly Aug 21, 2025
7eb4e5d
fix issue
SauravBizbRolly Aug 21, 2025
c2e67a7
fix issue
SauravBizbRolly Aug 21, 2025
ae01abc
fix issue
SauravBizbRolly Aug 21, 2025
5559b91
Merge branch 'main' of https://github.com/PSMRI/Common-API into relea…
vishwab1 Aug 26, 2025
ee87acb
changed the pom correction
vishwab1 Aug 26, 2025
2e6f376
Merge pull request #283 from PSMRI/release-3.6.0-temp
SauravBizbRolly Aug 26, 2025
7d30086
fix: allowed file format for upload
vishwab1 Aug 26, 2025
45399c2
fix: changed application properties
vishwab1 Aug 26, 2025
e305d5d
fix: removed firebase enabled
vishwab1 Aug 26, 2025
b9fd226
fix: added firebase enabled
vishwab1 Aug 26, 2025
84a75fa
fix firebase issue
SauravBizbRolly Aug 27, 2025
0695327
Merge remote-tracking branch 'upstream/release-3.6.0' into release-3.6.0
SauravBizbRolly Aug 27, 2025
6b3d22e
fix sms issue
SauravBizbRolly Aug 28, 2025
355eafe
fix sms issue
SauravBizbRolly Aug 28, 2025
c1caeae
fix sms issue
SauravBizbRolly Aug 28, 2025
ff53e66
fix firebase code issue
SauravBizbRolly Aug 28, 2025
9df0542
fix code issue
SauravBizbRolly Aug 28, 2025
c2b1a44
fix code issue
SauravBizbRolly Aug 28, 2025
eccc116
fix code issue
SauravBizbRolly Aug 28, 2025
abfc4e4
fix code issue
SauravBizbRolly Aug 28, 2025
ace7340
fix code issue
SauravBizbRolly Aug 28, 2025
86042b9
fix code issue
SauravBizbRolly Aug 28, 2025
555e274
fix code issue
SauravBizbRolly Aug 28, 2025
17bad73
fix code issue
SauravBizbRolly Aug 28, 2025
9f2ebd6
fix code issue
SauravBizbRolly Aug 28, 2025
edb6137
fix code issue
SauravBizbRolly Aug 28, 2025
3dd6522
fix code issue
SauravBizbRolly Aug 28, 2025
3aa039e
fix code issue
SauravBizbRolly Aug 28, 2025
16194a1
fix code issue
SauravBizbRolly Aug 28, 2025
aaf41c9
fix code issue
SauravBizbRolly Aug 28, 2025
4771ce6
fix code issue
SauravBizbRolly Aug 28, 2025
6f1cc9a
Merge branch 'release-3.6.0' into release-3.6.0-develop
vishwab1 Sep 1, 2025
089035d
fix code issue
SauravBizbRolly Sep 2, 2025
f75892e
VAPT: File Upload Validation and Security Hardening (#285)
vishwab1 Sep 2, 2025
fa648d2
Update application.properties
SauravBizbRolly Sep 2, 2025
79cc8b1
Beneficiary consent
SauravBizbRolly Mar 10, 2025
ab64879
Beneficiary consent
SauravBizbRolly Apr 10, 2025
88b042a
Beneficiary consent
SauravBizbRolly Apr 10, 2025
50416d6
Beneficiary consent
SauravBizbRolly Jun 13, 2025
afdf9f0
Beneficiary consent
SauravBizbRolly Mar 10, 2025
0d22d68
firebase setup
SauravBizbRolly Apr 11, 2025
ad11e10
firebase setup
SauravBizbRolly Apr 11, 2025
2f281b0
firebase setup
SauravBizbRolly Apr 11, 2025
f8d2784
firebase setup
SauravBizbRolly Apr 14, 2025
d113d36
firebase setup
SauravBizbRolly Apr 17, 2025
acd9ee1
Firebase Configuration in ci
SauravBizbRolly Apr 17, 2025
77b823f
Firebase Configuration in ci
SauravBizbRolly Apr 17, 2025
2ab86e1
firebase notification setup
SauravBizbRolly May 2, 2025
3551a00
Firebase update userToken
SauravBizbRolly Jun 19, 2025
bddf0dc
Firebase update userToken
SauravBizbRolly Jun 19, 2025
affd611
Add firebase variables in common_docker.properties
SauravBizbRolly Jun 19, 2025
13031c4
Add firebase variables in common_docker.properties
SauravBizbRolly Jun 19, 2025
433ffec
update firebase variables in common_docker.properties
SauravBizbRolly Jun 20, 2025
af65376
update firebase variables in common_docker.properties
SauravBizbRolly Jun 20, 2025
d4d6cbf
update firebase variables in common_docker.properties
SauravBizbRolly Jun 20, 2025
1441f99
fixed code
SauravBizbRolly Jun 21, 2025
4376a8a
fixed code
SauravBizbRolly Jun 21, 2025
807f043
Fixed security hotspot
SauravBizbRolly Jun 23, 2025
2f728d3
Fixed security hotspot
SauravBizbRolly Jun 23, 2025
2c8277f
Remove firebase base64 variable
SauravBizbRolly Jun 23, 2025
157a6e6
Remove firebase base64 variable
SauravBizbRolly Jun 23, 2025
c88d2c1
fix firebase file access issue
SauravBizbRolly Jun 23, 2025
1e900a3
fix firebase file access issue
SauravBizbRolly Jun 23, 2025
845c138
dynamic form
SauravBizbRolly Jun 30, 2025
d6abd65
dynamic form
SauravBizbRolly Jun 30, 2025
9a743da
dynamic form
SauravBizbRolly Jun 30, 2025
6c1417d
dynamic form
SauravBizbRolly Jul 1, 2025
cd9417a
IDENTITY_BASE_URL fix
SauravBizbRolly Jul 3, 2025
8bf6d0c
IDENTITY_BASE_URL fix
SauravBizbRolly Jul 3, 2025
52660af
IDENTITY_BASE_URL fix
SauravBizbRolly Jul 4, 2025
7d21b14
IDENTITY_BASE_URL fix
SauravBizbRolly Jul 4, 2025
1a07e56
IDENTITY_BASE_URL fix
SauravBizbRolly Jul 4, 2025
272db98
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 4, 2025
78531fa
IDENTITY_BASE_URL fix
SauravBizbRolly Jul 4, 2025
a66ac6f
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 4, 2025
534665d
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 4, 2025
d176d64
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 4, 2025
634b9e2
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 7, 2025
c25aa3f
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 7, 2025
697ba36
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 7, 2025
e2dab17
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 7, 2025
d3c6f2f
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 7, 2025
e6e992b
fix IDENTITY_API_BASE_URL variable in docker file
SauravBizbRolly Jul 7, 2025
1b5b9b9
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly Jul 17, 2025
15b7055
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly Jul 17, 2025
61ae6af
Update application.properties
SauravBizbRolly Jul 18, 2025
8680ecb
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly Jul 18, 2025
e7c6b04
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly Jul 18, 2025
376e704
Update JwtUserIdValidationFilter.java
SauravBizbRolly Jul 21, 2025
795c427
Update CommonIdentityMapperDecorator.java
SauravBizbRolly Aug 4, 2025
ebd595e
Update JwtUserIdValidationFilter.java
SauravBizbRolly Aug 12, 2025
3e9d00e
Update FirebaseNotificationController.java
SauravBizbRolly Aug 12, 2025
82434e1
Update FirebaseNotificationService.java
SauravBizbRolly Aug 12, 2025
34bd50d
Update BeneficiaryConsentController.java
SauravBizbRolly Aug 12, 2025
dff88e6
dynamic from feature
SauravBizbRolly Jul 16, 2025
5441939
dynamic from feature
SauravBizbRolly Jul 16, 2025
616dbfc
dynamic from feature
SauravBizbRolly Jul 16, 2025
bae3a68
dynamic from feature
SauravBizbRolly Jul 16, 2025
ad459c2
welcome sms
SauravBizbRolly Aug 13, 2025
e84e28f
fix issue
SauravBizbRolly Aug 13, 2025
2b806a7
fix issue
SauravBizbRolly Aug 13, 2025
d2d8fb6
fix issue
SauravBizbRolly Aug 13, 2025
7a5e8cd
Update application.properties
SauravBizbRolly Aug 13, 2025
3a14f56
fix issue
SauravBizbRolly Aug 13, 2025
00197a2
fix issue
SauravBizbRolly Aug 13, 2025
df1c324
fix issue
SauravBizbRolly Aug 13, 2025
d61a2dc
fix issue
SauravBizbRolly Aug 13, 2025
bbbb623
fix issue
SauravBizbRolly Aug 13, 2025
1237757
fix issue
SauravBizbRolly Aug 21, 2025
254a9a0
Update WelcomeBenificarySmsServiceImpl.java
SauravBizbRolly Aug 18, 2025
e1cf6bd
Update application.properties
SauravBizbRolly Aug 20, 2025
5bc5445
Update IEMRAdminController.java
SauravBizbRolly Aug 20, 2025
0aed4f0
fix issue
SauravBizbRolly Aug 21, 2025
1b2e7a0
fix issue
SauravBizbRolly Aug 21, 2025
2802fb3
fix issue
SauravBizbRolly Aug 21, 2025
7030151
fix issue
SauravBizbRolly Aug 21, 2025
7a280b6
fix issue
SauravBizbRolly Aug 21, 2025
b92d7d7
fix issue
SauravBizbRolly Aug 21, 2025
4ed6798
fix issue
SauravBizbRolly Aug 21, 2025
ae5bc54
fix issue
SauravBizbRolly Aug 21, 2025
9d05db2
fix issue
SauravBizbRolly Aug 21, 2025
9ebd258
fix firebase issue
SauravBizbRolly Aug 27, 2025
100245b
changed the pom correction
vishwab1 Aug 26, 2025
3379b71
fix sms issue
SauravBizbRolly Aug 28, 2025
36a177e
fix sms issue
SauravBizbRolly Aug 28, 2025
2f7b7d3
fix firebase code issue
SauravBizbRolly Aug 28, 2025
4e65a33
fix code issue
SauravBizbRolly Aug 28, 2025
dd0957d
fix code issue
SauravBizbRolly Aug 28, 2025
300659b
fix code issue
SauravBizbRolly Aug 28, 2025
6112a78
fix code issue
SauravBizbRolly Aug 28, 2025
7531f30
fix code issue
SauravBizbRolly Aug 28, 2025
268642e
fix code issue
SauravBizbRolly Aug 28, 2025
ff5dc76
fix code issue
SauravBizbRolly Aug 28, 2025
e9c9dea
fix code issue
SauravBizbRolly Aug 28, 2025
a1ec0ee
fix code issue
SauravBizbRolly Aug 28, 2025
f69fab4
fix code issue
SauravBizbRolly Aug 28, 2025
717148c
fix code issue
SauravBizbRolly Aug 28, 2025
59e7a85
fix code issue
SauravBizbRolly Aug 28, 2025
acb2ff2
fix code issue
SauravBizbRolly Aug 28, 2025
d5fdbd7
fix code issue
SauravBizbRolly Aug 28, 2025
9aebcc7
fix code issue
SauravBizbRolly Aug 28, 2025
aabe287
fix code issue
SauravBizbRolly Sep 2, 2025
91ef53d
Merge remote-tracking branch 'upstream/release-3.6.0' into release-3.6.0
SauravBizbRolly Sep 3, 2025
aaf013c
fix code issue
SauravBizbRolly Sep 3, 2025
cf526ce
fix code issue
SauravBizbRolly Sep 3, 2025
8938dd1
Update application.properties
SauravBizbRolly Sep 3, 2025
5f0d92b
Update ScheduleForGrievanceDataSync.java
SauravBizbRolly Sep 3, 2025
0cb6287
Update BeneficiaryOTPHandlerImpl.java
SauravBizbRolly Sep 3, 2025
c584be7
Update WelcomeBenificarySmsServiceImpl.java
SauravBizbRolly Sep 3, 2025
8fbf9f1
Update application.properties
SauravBizbRolly Sep 3, 2025
f928523
Update common_ci.properties
SauravBizbRolly Sep 3, 2025
3adda88
Update common_docker.properties
SauravBizbRolly Sep 3, 2025
1753021
Update NHMDetailCallReportScheduler.java
SauravBizbRolly Sep 3, 2025
c504ef9
merge with main
SauravBizbRolly Sep 3, 2025
7dbc8ee
merge with main
SauravBizbRolly Sep 3, 2025
e4717c8
merge with main
SauravBizbRolly Sep 3, 2025
c32fb6b
merge with main
SauravBizbRolly Sep 3, 2025
e73d1cc
Merge pull request #288 from PSMRI/release-3.6.0-develop
SauravBizbRolly Sep 5, 2025
50e2313
fix: fix the session expiry issue (#286)
vanitha1822 Sep 5, 2025
c181b2a
Content disposition modified signature (#287)
ravishanigarapu Sep 8, 2025
9ffee16
Update pom.xml
5Amogh Sep 25, 2025
6c00a6b
Update pom.xml
5Amogh Sep 25, 2025
f93e2f4
refresh token unauthorize issue (#296)
ravishanigarapu Sep 25, 2025
e5789f4
fix: missing env added
5Amogh Sep 26, 2025
ca036e6
Merge pull request #297 from PSMRI/rel-3.5.1-env-fix
5Amogh Sep 26, 2025
7f6f4dc
Merge branch 'release-3.6.0' into release-3.5.1
5Amogh Sep 26, 2025
3336300
Merge pull request #298 from PSMRI/release-3.5.1
5Amogh Sep 26, 2025
435fb88
finding userId baserd on createdBy (#299)
ravishanigarapu Sep 26, 2025
8fd476b
Nd/vs/fix ben (#300)
vanitha1822 Sep 26, 2025
18a3151
Merge branch 'release-3.6.0' into release-3.5.0
snehar-nd Sep 30, 2025
7ec95be
Merge pull request #301 from PSMRI/release-3.5.0
snehar-nd Sep 30, 2025
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
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.iemr.common-API</groupId>
<artifactId>common-api</artifactId>
<version>3.4.0</version>
<version>3.6.0</version>
<packaging>war</packaging>

<name>Common-API</name>
Expand Down Expand Up @@ -111,6 +111,12 @@

</exclusions>
</dependency>

<dependency>
<groupId>com.google.firebase</groupId>
<artifactId>firebase-admin</artifactId>
<version>9.4.3</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
Expand Down
9 changes: 8 additions & 1 deletion src/main/environment/common_ci.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ identity-1097-api-url = @env.IDENTITY_1097_API_URL@
send-sms=@env.SEND_SMS@
sendSMSUrl = @env.SEND_SMS_URL@
source-address=@env.SMS_SOURCE_ADDRESS@
sms-consent-source-address = @env.SMS_CONSENT_SOURCE_ADDRESS@
sms-username=@env.SMS_USERNAME@
sms-password=@env.SMS_PASSWORD@
send-message-url=@env.SMS_MESSAGE_URL@
Expand All @@ -40,6 +41,11 @@ send-message-url=@env.SMS_MESSAGE_URL@
start-sms-scheduler=true
cron-scheduler-sms=0 0/1 * * * ? *

# Firebase Configuration
firebase.enabled=@env.FIREBASE_ENABLE@
# if using file
firebase.credential-file=@env.FIREBASE_CREDENTIAL@

#### Email Configuration
send-email=@env.SEND_EMAIL@
spring.mail.host=@env.MAIL_HOST@
Expand Down Expand Up @@ -185,4 +191,5 @@ cors.allowed-origins=@env.CORS_ALLOWED_ORIGINS@

video-call-url=@env.VIDEO_CALL_URL@
jibri.output.path=@env.JIBRI_OUTPUT_PATH@
video.recording.path=@env.VIDEO_RECORDING_PATH@
video.recording.path=@env.VIDEO_RECORDING_PATH@
generateBeneficiaryIDs-api-url=@env.GEN_BENEFICIARY_IDS_API_URL@
10 changes: 9 additions & 1 deletion src/main/environment/common_docker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ identity-1097-api-url = ${IDENTITY_1097_API_URL}
send-sms=${SEND_SMS}
sendSMSUrl = ${SEND_SMS_URL}
source-address=${SMS_SOURCE_ADDRESS}
sms-consent-source-address=${SMS_CONSENT_SOURCE_ADDRESS}
sms-username=${SMS_USERNAME}
sms-password=${SMS_PASSWORD}
send-message-url=${SMS_MESSAGE_URL}
Expand Down Expand Up @@ -185,6 +186,13 @@ captcha.enable-captcha=${ENABLE_CAPTCHA}

cors.allowed-origins=${CORS_ALLOWED_ORIGINS}

# # Firebase Configuration
firebase.enabled=${FIREBASE_ENABLE}
# # if using file
firebase.credential-file=${FIREBASE_CREDENTIAL}


video-call-url=${VIDEO_CALL_URL}
jibri.output.path={JIBRI_OUTPUT_PATH}
video.recording.path={VIDEO_RECORDING_PATH}
video.recording.path={VIDEO_RECORDING_PATH}
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

⚠️ Potential issue

Bug: placeholder syntax missing $.

Spring will not resolve {VIDEO_RECORDING_PATH}.

Fix:

-video.recording.path={VIDEO_RECORDING_PATH}
+video.recording.path=${VIDEO_RECORDING_PATH}

Additionally, fix the same issue for Jibri output (nearby line):

- jibri.output.path={JIBRI_OUTPUT_PATH}
+ jibri.output.path=${JIBRI_OUTPUT_PATH}
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
video.recording.path={VIDEO_RECORDING_PATH}
# In src/main/environment/common_docker.properties
video.recording.path=${VIDEO_RECORDING_PATH}
jibri.output.path=${JIBRI_OUTPUT_PATH}
πŸ€– Prompt for AI Agents
In src/main/environment/common_docker.properties around line 196, the
video.recording.path entry uses {VIDEO_RECORDING_PATH} which Spring will not
resolve; change the placeholder to ${VIDEO_RECORDING_PATH} so Spring property
placeholder resolution works. Also locate the Jibri output property nearby and
update its placeholder to use the ${...} syntax (e.g., ${JIBRI_OUTPUT_PATH}) to
fix the same issue.

generateBeneficiaryIDs-api-url={GEN_BENEFICIARY_IDS_API_URL}
Comment on lines +197 to +198
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | πŸ”΄ Critical

Fix placeholder syntax for new Docker properties

These entries use {VAR} instead of Spring’s ${VAR} syntax, so the deployed container will literally see {VIDEO_RECORDING_PATH} / {GEN_BENEFICIARY_IDS_API_URL} and fail to resolve the configured paths. Please switch to ${...} (and, while touching this block, fix the same issue for jibri.output.path on Line 196).

-video.recording.path={VIDEO_RECORDING_PATH}
-generateBeneficiaryIDs-api-url={GEN_BENEFICIARY_IDS_API_URL}
+video.recording.path=${VIDEO_RECORDING_PATH}
+generateBeneficiaryIDs-api-url=${GEN_BENEFICIARY_IDS_API_URL}
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
video.recording.path={VIDEO_RECORDING_PATH}
generateBeneficiaryIDs-api-url={GEN_BENEFICIARY_IDS_API_URL}
video.recording.path=${VIDEO_RECORDING_PATH}
generateBeneficiaryIDs-api-url=${GEN_BENEFICIARY_IDS_API_URL}
πŸ€– Prompt for AI Agents
In src/main/environment/common_docker.properties around lines 196 to 198, the
new Docker property placeholders use {VAR} instead of Spring's required ${VAR},
causing literal unresolved values; replace jibri.output.path,
video.recording.path, and generateBeneficiaryIDs-api-url values to use
${VIDEO_RECORDING_PATH}, ${GEN_BENEFICIARY_IDS_API_URL} (and the correct env var
for jibri.output.path) respectively so Spring resolves them at runtime.

2 changes: 2 additions & 0 deletions src/main/environment/common_example.properties
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,5 @@ captcha.enable-captcha=true

cors.allowed-origins=http://localhost:*

### generate Beneficiary IDs URL
generateBeneficiaryIDs-api-url=/generateBeneficiaryController/generateBeneficiaryIDs
1 change: 0 additions & 1 deletion src/main/java/com/iemr/common/CommonApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer;
import org.springframework.data.redis.serializer.StringRedisSerializer;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package com.iemr.common.config.firebase;

import com.google.auth.oauth2.GoogleCredentials;
import com.google.firebase.FirebaseApp;
import com.google.firebase.FirebaseOptions;
import com.google.firebase.messaging.FirebaseMessaging;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;

import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Base64;

@Configuration
public class FirebaseMessagingConfig {
private Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());

@Value("${firebase.enabled:false}")
private boolean firebaseEnabled;

Comment on lines +24 to +26
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Remove redundant flag check; don’t return null from @bean.

@ConditionalOnProperty already guards bean creation. Returning null from a @bean is an anti-pattern; either don’t create the bean or fail fast.

-    @Value("${firebase.enabled:false}")
-    private boolean firebaseEnabled;
@@
-    public FirebaseMessaging firebaseMessaging() throws IOException {
-        if (!firebaseEnabled) {
-            logger.error("⚠️ Firebase disabled by config");
-            return null;
-        }
+    public FirebaseMessaging firebaseMessaging() {

Also applies to: 31-37

πŸ€– Prompt for AI Agents
In src/main/java/com/iemr/common/config/firebase/FirebaseMessagingConfig.java
around lines 24-26 and 31-37, remove the redundant @Value boolean field and any
runtime checks that return null from the @Bean method; rely on the existing
@ConditionalOnProperty to control bean creation and ensure the @Bean method
always returns a valid FirebaseMessaging (or fails fast by allowing exceptions
to propagate) instead of returning null.

@Value("${firebase.credential-file:}")
private String firebaseCredentialFile;


@Bean
@ConditionalOnProperty(name = "firebase.enabled", havingValue = "true")
public FirebaseMessaging firebaseMessaging() throws IOException {
if (!firebaseEnabled) {
logger.error("⚠️ Firebase disabled by config");
return null;
}

try {
if (firebaseCredentialFile == null || firebaseCredentialFile.isBlank()) {
logger.error("⚠️ No Firebase credentials path provided");
return null; // don't throw, app will still start
}

GoogleCredentials credentials = GoogleCredentials.fromStream(
new ClassPathResource(firebaseCredentialFile).getInputStream()
);
FirebaseOptions options = FirebaseOptions.builder()
.setCredentials(credentials)
.build();

FirebaseApp firebaseApp = FirebaseApp.getApps().isEmpty()
? FirebaseApp.initializeApp(options)
: FirebaseApp.getInstance();

return FirebaseMessaging.getInstance(firebaseApp);

} catch (Exception e) {
logger.error("⚠️ Firebase init failed: " + e.getMessage());
return null; // keep app running
}

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ public void execute() {
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*
* AMRIT – Accessible Medical Records via Integrated Technology
* Integrated EHR (Electronic Health Records) Solution
*
* Copyright (C) "Piramal Swasthya Management and Research Institute"
*
* This file is part of AMRIT.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
package com.iemr.common.controller.beneficiaryConsent;

import com.iemr.common.data.beneficiaryConsent.BeneficiaryConsentRequest;
import com.iemr.common.service.beneficiaryOTPHandler.BeneficiaryOTPHandler;
import com.iemr.common.utils.mapper.InputMapper;
import com.iemr.common.utils.response.OutputResponse;
import io.lettuce.core.dynamic.annotation.Param;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.ws.rs.core.MediaType;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping(value = { "/beneficiaryConsent" })
@RestController
public class BeneficiaryConsentController {
final Logger logger = LoggerFactory.getLogger(this.getClass().getName());

@Autowired
private BeneficiaryOTPHandler beneficiaryOTPHandler;

@Operation(summary = "Send Consent")
@RequestMapping(value = "/sendConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
public String sendConsent(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody String requestOBJ) {

OutputResponse response = new OutputResponse();

try {
BeneficiaryConsentRequest obj = InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class);

String success = beneficiaryOTPHandler.sendOTP(obj); // method name unchanged if internal logic still uses 'OTP'
logger.info(success.toString());
response.setResponse(success);


} catch (Exception e) {
response.setError(500, "error : " + e);
}
return response.toString();
}
Comment on lines +49 to +66
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

⚠️ Potential issue

Don’t echo or log OTP-bearing success strings; return a generic message and unify error codes.

Passing through success risks exposing OTP. Use a neutral message and consistent failure code.

-    public String sendConsent(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody String requestOBJ) {
+    public String sendConsent(@RequestBody String requestOBJ) {
 …
-            String success = beneficiaryOTPHandler.sendOTP(obj); // method name unchanged if internal logic still uses 'OTP'
-            logger.info(success.toString());
-            response.setResponse(success);
+            String success = beneficiaryOTPHandler.sendOTP(obj);
+            logger.debug("sendConsent: handler responded");
+            // TODO: handler should return a structured result; temporary neutral response:
+            response.setResponse("{\"message\":\"OTP sent\"}");
 …
-        } catch (Exception e) {
-            response.setError(500, "error : " + e);
+        } catch (Exception e) {
+            logger.error("error in sending Consent", e);
+            response.setError(OutputResponse.GENERIC_FAILURE, "failure");
         }
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@RequestMapping(value = "/sendConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
public String sendConsent(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody String requestOBJ) {
OutputResponse response = new OutputResponse();
try {
BeneficiaryConsentRequest obj = InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class);
String success = beneficiaryOTPHandler.sendOTP(obj); // method name unchanged if internal logic still uses 'OTP'
logger.info(success.toString());
response.setResponse(success);
} catch (Exception e) {
response.setError(500, "error : " + e);
}
return response.toString();
}
@RequestMapping(value = "/sendConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
public String sendConsent(@RequestBody String requestOBJ) {
OutputResponse response = new OutputResponse();
try {
BeneficiaryConsentRequest obj = InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class);
String success = beneficiaryOTPHandler.sendOTP(obj);
logger.debug("sendConsent: handler responded");
// TODO: handler should return a structured result; temporary neutral response:
response.setResponse("{\"message\":\"OTP sent\"}");
} catch (Exception e) {
logger.error("error in sending Consent", e);
response.setError(OutputResponse.GENERIC_FAILURE, "failure");
}
return response.toString();
}
πŸ€– Prompt for AI Agents
In
src/main/java/com/iemr/common/controller/beneficiaryConsent/BeneficiaryConsentController.java
around lines 49 to 66, the controller currently logs and returns the raw
"success" string (which may contain an OTP) and returns inconsistent error
detail; change it to never log or return OTP-bearing content: replace logging of
success.toString() with a non-sensitive log entry (e.g., "OTP sent for
beneficiary" with no OTP), and set the response body to a neutral message such
as "OTP_SENT" or "REQUEST_ACCEPTED" instead of echoing the success string; also
standardize error handling to return a consistent, non-sensitive error message
and code (e.g., response.setError(500, "Internal server error")) without
exposing exception details.


@Operation(summary = "Validate Consent")
@RequestMapping(value = "/validateConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
public String validateConsent(@Param(value = "{\"mobNo\":\"String\",\"otp\":\"Integer\"}") @RequestBody String requestOBJ) {

OutputResponse response = new OutputResponse();

try {
BeneficiaryConsentRequest obj = InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class);

JSONObject responseOBJ = beneficiaryOTPHandler.validateOTP(obj);
if (responseOBJ != null)
response.setResponse(responseOBJ.toString());
else
response.setError(500, "failure");

} catch (Exception e) {
logger.error("error in validating Consent : " + e);
response.setError(500, "error : " + e);
}
return response.toString();
}
Comment on lines +68 to +88
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

⚠️ Potential issue

Avoid returning exception details to clients; prefer constants and neutral messages.

Leakage of stack/context via e.toString() is a security smell. Use OutputResponse constants.

-            if (responseOBJ != null)
-                response.setResponse(responseOBJ.toString());
-            else
-                response.setError(500, "failure");
+            if (responseOBJ != null) {
+                response.setResponse(responseOBJ.toString());
+            } else {
+                response.setError(OutputResponse.GENERIC_FAILURE, "failure");
+            }
 …
-        } catch (Exception e) {
-            logger.error("error in validating Consent : " + e);
-            response.setError(500, "error : " + e);
+        } catch (Exception e) {
+            logger.error("error in validating Consent", e);
+            response.setError(OutputResponse.GENERIC_FAILURE, "failure");
         }
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@Operation(summary = "Validate Consent")
@RequestMapping(value = "/validateConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
public String validateConsent(@Param(value = "{\"mobNo\":\"String\",\"otp\":\"Integer\"}") @RequestBody String requestOBJ) {
OutputResponse response = new OutputResponse();
try {
BeneficiaryConsentRequest obj = InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class);
JSONObject responseOBJ = beneficiaryOTPHandler.validateOTP(obj);
if (responseOBJ != null)
response.setResponse(responseOBJ.toString());
else
response.setError(500, "failure");
} catch (Exception e) {
logger.error("error in validating Consent : " + e);
response.setError(500, "error : " + e);
}
return response.toString();
}
@Operation(summary = "Validate Consent")
@RequestMapping(value = "/validateConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
public String validateConsent(@Param(value = "{\"mobNo\":\"String\",\"otp\":\"Integer\"}") @RequestBody String requestOBJ) {
OutputResponse response = new OutputResponse();
try {
BeneficiaryConsentRequest obj = InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class);
JSONObject responseOBJ = beneficiaryOTPHandler.validateOTP(obj);
if (responseOBJ != null) {
response.setResponse(responseOBJ.toString());
} else {
response.setError(OutputResponse.GENERIC_FAILURE, "failure");
}
} catch (Exception e) {
logger.error("error in validating Consent", e);
response.setError(OutputResponse.GENERIC_FAILURE, "failure");
}
return response.toString();
}
πŸ€– Prompt for AI Agents
In
src/main/java/com/iemr/common/controller/beneficiaryConsent/BeneficiaryConsentController.java
around lines 68-88, do not return exception details to clients; instead log the
full exception and return neutral OutputResponse constants. Replace the catch
block so the logger records the stacktrace via logger.error("error in validating
Consent", e) (pass the exception as a parameter rather than concatenating), and
call response.setError(...) with the appropriate OutputResponse constant(s) (use
the standard internal-error code/message constants from OutputResponse) instead
of response.setError(500, "error : " + e) so no exception text is leaked to the
client.


@Operation(summary = "Resend Consent")
@RequestMapping(value = "/resendConsent", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON)
public String resendConsent(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody String requestOBJ) {
logger.info(requestOBJ.toString());

OutputResponse response = new OutputResponse();

try {
BeneficiaryConsentRequest obj = InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class);

String success = beneficiaryOTPHandler.resendOTP(obj);
logger.info(success.toString());

if (success.contains("otp"))
response.setResponse(success);
else
response.setError(500, "failure");

} catch (Exception e) {
logger.error("error in re-sending Consent : " + e);
response.setError(500, "error : " + e);
}
return response.toString();
}
Comment on lines +92 to +113
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

⚠️ Potential issue

Mask PII in logs and avoid free-text contains("otp") branching.

Same issues as OTPGateway: PII logging and brittle success checks.

-    public String resendConsent(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody String requestOBJ) {
-        logger.info(requestOBJ.toString());
+    public String resendConsent(@RequestBody String requestOBJ) {
+        logger.debug("resendConsent: request received");
 …
-            String success = beneficiaryOTPHandler.resendOTP(obj);
-            logger.info(success.toString());
-
-            if (success.contains("otp"))
-                response.setResponse(success);
-            else
-                response.setError(500, "failure");
+            String success = beneficiaryOTPHandler.resendOTP(obj);
+            logger.debug("resendConsent: handler responded");
+            boolean ok = success != null && success.toLowerCase(java.util.Locale.ROOT).contains("otp sent");
+            if (ok) {
+                response.setResponse("{\"message\":\"OTP resent\"}");
+            } else {
+                response.setError(OutputResponse.GENERIC_FAILURE, "failure");
+            }
 …
-        } catch (Exception e) {
-            logger.error("error in re-sending Consent : " + e);
-            response.setError(500, "error : " + e);
+        } catch (Exception e) {
+            logger.error("error in re-sending Consent", e);
+            response.setError(OutputResponse.GENERIC_FAILURE, "failure");
         }
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
public String resendConsent(@Param(value = "{\"mobNo\":\"String\"}") @RequestBody String requestOBJ) {
logger.info(requestOBJ.toString());
OutputResponse response = new OutputResponse();
try {
BeneficiaryConsentRequest obj = InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class);
String success = beneficiaryOTPHandler.resendOTP(obj);
logger.info(success.toString());
if (success.contains("otp"))
response.setResponse(success);
else
response.setError(500, "failure");
} catch (Exception e) {
logger.error("error in re-sending Consent : " + e);
response.setError(500, "error : " + e);
}
return response.toString();
}
public String resendConsent(@RequestBody String requestOBJ) {
logger.debug("resendConsent: request received");
OutputResponse response = new OutputResponse();
try {
BeneficiaryConsentRequest obj =
InputMapper.gson().fromJson(requestOBJ, BeneficiaryConsentRequest.class);
String success = beneficiaryOTPHandler.resendOTP(obj);
logger.debug("resendConsent: handler responded");
boolean ok = success != null
&& success.toLowerCase(java.util.Locale.ROOT).contains("otp sent");
if (ok) {
response.setResponse("{\"message\":\"OTP resent\"}");
} else {
response.setError(OutputResponse.GENERIC_FAILURE, "failure");
}
} catch (Exception e) {
logger.error("error in re-sending Consent", e);
response.setError(OutputResponse.GENERIC_FAILURE, "failure");
}
return response.toString();
}
πŸ€– Prompt for AI Agents
In
src/main/java/com/iemr/common/controller/beneficiaryConsent/BeneficiaryConsentController.java
around lines 92-113, avoid logging raw PII and brittle string contains checks:
do not log the full requestOBJ (mask the mobile number before logging or only
log a non-PII identifier), parse requestOBJ into BeneficiaryConsentRequest first
and log only a masked version of obj.getMobNo() (e.g., keep last 2 digits), and
change the success handling to rely on a structured response from
beneficiaryOTPHandler.resendOTP (prefer a boolean or a Result/Status enum or
JSON with a status field) instead of contains("otp"); branch on that structured
status and set response accordingly. Also log exceptions using
logger.error("error in re-sending Consent", e) to capture stack trace rather
than concatenating the exception to the message.



}


Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
package com.iemr.common.controller.dynamicForm;

import com.iemr.common.dto.dynamicForm.FieldDTO;
import com.iemr.common.dto.dynamicForm.FormDTO;
import com.iemr.common.dto.dynamicForm.ModuleDTO;
import com.iemr.common.service.dynamicForm.FormMasterService;
import com.iemr.common.utils.response.ApiResponse;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequestMapping(value = "dynamicForm")
@RestController
public class DynamicFormController {
@Autowired
private FormMasterService formMasterService;

@PostMapping(value = "createModule",headers = "Authorization")
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Remove headers="Authorization" from mappings; rely on security config.

Header-constrained mappings can cause 404s and CORS preflight issues. Enforce auth via Spring Security instead.

-    @PostMapping(value = "createModule",headers = "Authorization")
+    @PostMapping("createModule")
-    @PostMapping(value = "createForm",headers = "Authorization")
+    @PostMapping("createForm")
-    @PostMapping(value = "createFields",headers = "Authorization")
+    @PostMapping("createFields")
-    @PostMapping(value = "field/update",headers = "Authorization")
+    @PostMapping("field/update")
-    @DeleteMapping(value = "delete/{fieldId}/field",headers = "Authorization")
+    @DeleteMapping("delete/{fieldId}/field")

Also applies to: 37-37, 49-49, 61-61, 73-73

πŸ€– Prompt for AI Agents
In
src/main/java/com/iemr/common/controller/dynamicForm/DynamicFormController.java
around lines 22, 37, 49, 61 and 73, remove the header constraint
headers="Authorization" from the @PostMapping (and any other mapping)
annotations; these header-based constraints should be enforced by Spring
Security configuration instead to avoid 404s and CORS preflight failures. Update
each mapping signature to omit the headers attribute so the endpoints use
standard mapping annotations and rely on security filters for
authentication/authorization.

public ResponseEntity<ApiResponse<?>> createModule(@Valid @RequestBody ModuleDTO moduleDTO) {
try {
Object result = formMasterService.createModule(moduleDTO);
return ResponseEntity.status(HttpStatus.OK)
.body(ApiResponse.success("Module created successfully", HttpStatus.OK.value(), result));
} catch (IllegalArgumentException e) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body(ApiResponse.error("Invalid module data: " + e.getMessage(), HttpStatus.BAD_REQUEST.value(), null));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(ApiResponse.error("Failed to create module", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
}
}

@PostMapping(value = "createForm",headers = "Authorization")
public ResponseEntity<ApiResponse<?>> createForm(@Valid @RequestBody FormDTO dto) {
try {
Object result = formMasterService.createForm(dto);
return ResponseEntity.status(HttpStatus.OK)
.body(ApiResponse.success("Form created successfully", HttpStatus.OK.value(), result));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(ApiResponse.error("Failed to create form", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
}
}
Comment on lines +37 to +47
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Map IllegalArgumentException to 400 on createForm.

Service throws IllegalArgumentException for invalid module; respond with BAD_REQUEST.

     public ResponseEntity<ApiResponse<?>> createForm(@Valid @RequestBody FormDTO dto) {
         try {
             Object result = formMasterService.createForm(dto);
             return ResponseEntity.status(HttpStatus.OK)
                     .body(ApiResponse.success("Form created successfully", HttpStatus.OK.value(), result));
-        } catch (Exception e) {
+        } catch (IllegalArgumentException e) {
+            return ResponseEntity.status(HttpStatus.BAD_REQUEST)
+                    .body(ApiResponse.error("Invalid form data: " + e.getMessage(), HttpStatus.BAD_REQUEST.value(), null));
+        } catch (Exception e) {
             return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
                     .body(ApiResponse.error("Failed to create form", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
         }
     }
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@PostMapping(value = "createForm",headers = "Authorization")
public ResponseEntity<ApiResponse<?>> createForm(@Valid @RequestBody FormDTO dto) {
try {
Object result = formMasterService.createForm(dto);
return ResponseEntity.status(HttpStatus.OK)
.body(ApiResponse.success("Form created successfully", HttpStatus.OK.value(), result));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(ApiResponse.error("Failed to create form", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
}
}
@PostMapping(value = "createForm", headers = "Authorization")
public ResponseEntity<ApiResponse<?>> createForm(@Valid @RequestBody FormDTO dto) {
try {
Object result = formMasterService.createForm(dto);
return ResponseEntity.status(HttpStatus.OK)
.body(ApiResponse.success("Form created successfully", HttpStatus.OK.value(), result));
} catch (IllegalArgumentException e) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body(ApiResponse.error("Invalid form data: " + e.getMessage(), HttpStatus.BAD_REQUEST.value(), null));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(ApiResponse.error("Failed to create form", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
}
}
πŸ€– Prompt for AI Agents
In
src/main/java/com/iemr/common/controller/dynamicForm/DynamicFormController.java
around lines 37 to 47, the controller currently catches Exception for createForm
and always returns 500; add a specific catch for IllegalArgumentException before
the general catch and map it to ResponseEntity.status(HttpStatus.BAD_REQUEST)
returning ApiResponse.error(...) (include e.getMessage() in the error body for
clarity), leaving the existing generic catch for other exceptions to return 500.


@PostMapping(value = "createFields",headers = "Authorization")
public ResponseEntity<ApiResponse<?>> createField(@Valid @RequestBody List<FieldDTO> dto) {
try {
Object result = formMasterService.createField(dto);
return ResponseEntity.status(HttpStatus.OK)
.body(ApiResponse.success("Fields created successfully", HttpStatus.OK.value(), result));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(ApiResponse.error("Failed to create fields", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
}
}
Comment on lines +49 to +59
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Map IllegalArgumentException to 400 on createFields.

Aligns with service behavior when formId is invalid.

-        } catch (Exception e) {
+        } catch (IllegalArgumentException e) {
+            return ResponseEntity.status(HttpStatus.BAD_REQUEST)
+                    .body(ApiResponse.error("Invalid fields data: " + e.getMessage(), HttpStatus.BAD_REQUEST.value(), null));
+        } catch (Exception e) {
             return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
                     .body(ApiResponse.error("Failed to create fields", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
         }
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@PostMapping(value = "createFields",headers = "Authorization")
public ResponseEntity<ApiResponse<?>> createField(@Valid @RequestBody List<FieldDTO> dto) {
try {
Object result = formMasterService.createField(dto);
return ResponseEntity.status(HttpStatus.OK)
.body(ApiResponse.success("Fields created successfully", HttpStatus.OK.value(), result));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(ApiResponse.error("Failed to create fields", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
}
}
@PostMapping(value = "createFields", headers = "Authorization")
public ResponseEntity<ApiResponse<?>> createField(@Valid @RequestBody List<FieldDTO> dto) {
try {
Object result = formMasterService.createField(dto);
return ResponseEntity.status(HttpStatus.OK)
.body(ApiResponse.success("Fields created successfully", HttpStatus.OK.value(), result));
} catch (IllegalArgumentException e) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body(ApiResponse.error(
"Invalid fields data: " + e.getMessage(),
HttpStatus.BAD_REQUEST.value(),
null
));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(ApiResponse.error("Failed to create fields", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
}
}
πŸ€– Prompt for AI Agents
In
src/main/java/com/iemr/common/controller/dynamicForm/DynamicFormController.java
around lines 49 to 59, the createField endpoint currently treats all exceptions
as 500; change it so IllegalArgumentException (thrown by the service for an
invalid formId) is caught separately and returns ResponseEntity with
HttpStatus.BAD_REQUEST (400) and a descriptive error body (include the exception
message), while preserving the existing catch-all for other exceptions to return
500.


@PostMapping(value = "field/update",headers = "Authorization")
public ResponseEntity<ApiResponse<?>> updateField(@Valid @RequestBody FieldDTO dto) {
try {
Object result = formMasterService.updateField(dto);
return ResponseEntity.status(HttpStatus.OK)
.body(ApiResponse.success("Field updated successfully", HttpStatus.OK.value(), result));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(ApiResponse.error("Failed to update field", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
}
}
Comment on lines +61 to +71
Copy link
Contributor

Choose a reason for hiding this comment

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

πŸ› οΈ Refactor suggestion

Map IllegalArgumentException to 400 on updateField.

Surface client errors correctly.

-        } catch (Exception e) {
+        } catch (IllegalArgumentException e) {
+            return ResponseEntity.status(HttpStatus.BAD_REQUEST)
+                    .body(ApiResponse.error("Invalid field update: " + e.getMessage(), HttpStatus.BAD_REQUEST.value(), null));
+        } catch (Exception e) {
             return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
                     .body(ApiResponse.error("Failed to update field", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
         }
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@PostMapping(value = "field/update",headers = "Authorization")
public ResponseEntity<ApiResponse<?>> updateField(@Valid @RequestBody FieldDTO dto) {
try {
Object result = formMasterService.updateField(dto);
return ResponseEntity.status(HttpStatus.OK)
.body(ApiResponse.success("Field updated successfully", HttpStatus.OK.value(), result));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(ApiResponse.error("Failed to update field", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
}
}
@PostMapping(value = "field/update",headers = "Authorization")
public ResponseEntity<ApiResponse<?>> updateField(@Valid @RequestBody FieldDTO dto) {
try {
Object result = formMasterService.updateField(dto);
return ResponseEntity.status(HttpStatus.OK)
.body(ApiResponse.success("Field updated successfully", HttpStatus.OK.value(), result));
} catch (IllegalArgumentException e) {
return ResponseEntity.status(HttpStatus.BAD_REQUEST)
.body(ApiResponse.error("Invalid field update: " + e.getMessage(), HttpStatus.BAD_REQUEST.value(), null));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(ApiResponse.error("Failed to update field", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
}
}
πŸ€– Prompt for AI Agents
In
src/main/java/com/iemr/common/controller/dynamicForm/DynamicFormController.java
around lines 61 to 71, the updateField endpoint currently maps all exceptions to
500; catch IllegalArgumentException specifically and return a 400 Bad Request
response instead. Update the try/catch so IllegalArgumentException is handled
first (return ResponseEntity.status(HttpStatus.BAD_REQUEST) with
ApiResponse.error containing the exception message and
HttpStatus.BAD_REQUEST.value()), while other Exceptions continue to map to 500
as before.


@DeleteMapping(value = "delete/{fieldId}/field",headers = "Authorization")
public ResponseEntity<ApiResponse<?>> deleteField(@PathVariable Long fieldId) {
try {
formMasterService.deleteField(fieldId);
return ResponseEntity.status(HttpStatus.OK)
.body(ApiResponse.success("Field deleted successfully", HttpStatus.OK.value(), null));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(ApiResponse.error("Failed to delete field", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
}
}

@GetMapping(value = "form/{formId}/fields")
public ResponseEntity<ApiResponse<?>> getStructuredForm(@PathVariable String formId) {
try {
Object result = formMasterService.getStructuredFormByFormId(formId);
return ResponseEntity.status(HttpStatus.OK)
.body(ApiResponse.success("Form structure fetched successfully", HttpStatus.OK.value(), result));
} catch (Exception e) {
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
.body(ApiResponse.error("Failed to fetch form structure", HttpStatus.INTERNAL_SERVER_ERROR.value(), null));
}
}


}
Loading