-
Notifications
You must be signed in to change notification settings - Fork 45
Release 3.6.0 #284
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
base: main
Are you sure you want to change the base?
Release 3.6.0 #284
Changes from all commits
f49b34b
6ee70b2
5cfac3f
5785c70
5939168
f14beb2
1eaeab7
61c13a1
42b8161
c495576
f89737a
98759f9
bff3dab
dffa07f
c8bc5de
597fdce
21fb980
ea74406
9c4c726
b71ef0c
ca10e2e
786e31e
79150b4
ee67c57
c935f37
4e52aa8
af2abc7
320605a
6c0a72f
c054fa8
e4ea5c3
78b9247
6cc8749
b554799
678b3b0
c8a4f05
91600e4
ae09714
5ab6b7f
515f27c
27cf841
0e7b33b
a72334e
680a732
f30311f
ad19656
6171755
0be53ed
8e186e6
121c33f
2dfb40d
6f86bb7
75633a0
d29eccb
08450e6
634d365
d13e32a
32c5f68
61f1626
c1b6e83
01c6f08
160071b
33e0f69
cb7bdd7
2ed19b0
1ad9c81
8f5a947
357f28f
0f7628d
997bee3
7d80955
bf08081
6d40fd0
bf15109
32a2b4f
f8a16f4
d8881d4
fb1f504
27eac5b
7eb4e5d
c2e67a7
ae01abc
5559b91
ee87acb
2e6f376
7d30086
45399c2
e305d5d
b9fd226
84a75fa
0695327
6b3d22e
355eafe
c1caeae
ff53e66
9df0542
c2b1a44
eccc116
abfc4e4
ace7340
86042b9
555e274
17bad73
9f2ebd6
edb6137
3dd6522
3aa039e
16194a1
aaf41c9
4771ce6
6f1cc9a
089035d
f75892e
fa648d2
79cc8b1
ab64879
88b042a
50416d6
afdf9f0
0d22d68
ad11e10
2f281b0
f8d2784
d113d36
acd9ee1
77b823f
2ab86e1
3551a00
bddf0dc
affd611
13031c4
433ffec
af65376
d4d6cbf
1441f99
4376a8a
807f043
2f728d3
2c8277f
157a6e6
c88d2c1
1e900a3
845c138
d6abd65
9a743da
6c1417d
cd9417a
8bf6d0c
52660af
7d21b14
1a07e56
272db98
78531fa
a66ac6f
534665d
d176d64
634b9e2
c25aa3f
697ba36
e2dab17
d3c6f2f
e6e992b
1b5b9b9
15b7055
61ae6af
8680ecb
e7c6b04
376e704
795c427
ebd595e
3e9d00e
82434e1
34bd50d
dff88e6
5441939
616dbfc
bae3a68
ad459c2
e84e28f
2b806a7
d2d8fb6
7a5e8cd
3a14f56
00197a2
df1c324
d61a2dc
bbbb623
1237757
254a9a0
e1cf6bd
5bc5445
0aed4f0
1b2e7a0
2802fb3
7030151
7a280b6
b92d7d7
4ed6798
ae5bc54
9d05db2
9ebd258
100245b
3379b71
36a177e
2f7b7d3
4e65a33
dd0957d
300659b
6112a78
7531f30
268642e
ff5dc76
e9c9dea
a1ec0ee
f69fab4
717148c
59e7a85
acb2ff2
d5fdbd7
9aebcc7
aabe287
91ef53d
aaf013c
cf526ce
8938dd1
5f0d92b
0cb6287
c584be7
8fbf9f1
f928523
3adda88
1753021
c504ef9
7dbc8ee
e4717c8
c32fb6b
e73d1cc
50e2313
c181b2a
9ffee16
6c00a6b
f93e2f4
e5789f4
ca036e6
7f6f4dc
3336300
435fb88
8fd476b
18a3151
7ec95be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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} | ||||||||||
|
@@ -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} | ||||||||||
generateBeneficiaryIDs-api-url={GEN_BENEFICIARY_IDS_API_URL} | ||||||||||
Comment on lines
+197
to
+198
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix placeholder syntax for new Docker properties These entries use -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
Suggested change
π€ Prompt for AI Agents
|
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||
@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() | ||
); | ||
SauravBizbRolly marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 |
---|---|---|
|
@@ -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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π οΈ Refactor suggestion Donβt echo or log OTP-bearing success strings; return a generic message and unify error codes. Passing through - 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
Suggested change
π€ Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
@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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π οΈ Refactor suggestion Avoid returning exception details to clients; prefer constants and neutral messages. Leakage of stack/context via - 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
Suggested change
π€ Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
@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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π οΈ Refactor suggestion Mask PII in logs and avoid free-text contains("otp") branching. Same issues as - 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
Suggested change
π€ Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. π οΈ Refactor suggestion Remove 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
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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
Suggested change
π€ Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
@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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
π€ Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
@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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Suggested change
π€ Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
@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)); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
π οΈ Refactor suggestion
Bug: placeholder syntax missing
$
.Spring will not resolve
{VIDEO_RECORDING_PATH}
.Fix:
Additionally, fix the same issue for Jibri output (nearby line):
π Committable suggestion
π€ Prompt for AI Agents