Skip to content
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuldevgarg authored Dec 13, 2023
2 parents 2a77665 + e30ed55 commit 4308a5d
Show file tree
Hide file tree
Showing 17 changed files with 1,902 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ public class SMSProperties {
@Value("${save.sms.entity.enabled}")
private boolean isSaveSmsEnable;

@Value("#{'${sms.error.codes}'.split(',')}")
protected List<String> smsDisabledTenantList;

@Setter(AccessLevel.PROTECTED) private List<Pattern> whitelistPatterns;
@Setter(AccessLevel.PROTECTED) private List<Pattern> blacklistPatterns;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.*;
import org.egov.tracer.kafka.*;
import org.egov.web.notification.sms.config.SMSProperties;
import org.egov.web.notification.sms.consumer.contract.SMSRequest;
import org.egov.web.notification.sms.models.Category;
import org.egov.web.notification.sms.models.RequestContext;
Expand Down Expand Up @@ -44,6 +45,9 @@ public class SmsNotificationListener {
@Value("${kafka.topics.error.sms}")
String errorSmsTopic;

@Autowired
protected SMSProperties smsProperties;


@Autowired
public SmsNotificationListener(
Expand All @@ -63,18 +67,20 @@ public void process(HashMap<String, Object> consumerRecord) {
SMSRequest request = null;
try {
request = objectMapper.convertValue(consumerRecord, SMSRequest.class);
if (request.getExpiryTime() != null && request.getCategory() == Category.OTP) {
Long expiryTime = request.getExpiryTime();
Long currentTime = System.currentTimeMillis();
if (expiryTime < currentTime) {
log.info("OTP Expired");
if (!StringUtils.isEmpty(expiredSmsTopic))
kafkaTemplate.send(expiredSmsTopic, request);
if(!ObjectUtils.isEmpty(request.getTenantId()) && !smsProperties.getSmsDisabledTenantList().contains(request.getTenantId())) {
if (request.getExpiryTime() != null && request.getCategory() == Category.OTP) {
Long expiryTime = request.getExpiryTime();
Long currentTime = System.currentTimeMillis();
if (expiryTime < currentTime) {
log.info("OTP Expired");
if (!StringUtils.isEmpty(expiredSmsTopic))
kafkaTemplate.send(expiredSmsTopic, request);
} else {
smsService.sendSMS(request.toDomain());
}
} else {
smsService.sendSMS(request.toDomain());
}
} else {
smsService.sendSMS(request.toDomain());
}
} catch (RestClientException rx) {
log.info("Going to backup SMS Service", rx);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,7 @@ spring.kafka.listener.missing-topics-fatal=false

#persister topic of sms
save.sms.entity.topic = save-sms-entity-application
save.sms.entity.enabled = true
save.sms.entity.enabled = true

#Disable tenants SMS
sms.disabled.tenants.list=testing
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
225 changes: 225 additions & 0 deletions frontend/mgramseva/assets/json/capabilities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,225 @@
{
"profiles": {
"default": {
"codePages": {
"0": "CP437",
"1": "CP932",
"2": "CP850",
"3": "CP860",
"4": "CP863",
"5": "CP865",
"6": "Unknown",
"7": "Unknown",
"8": "Unknown",
"11": "CP851",
"12": "CP853",
"13": "CP857",
"14": "CP737",
"15": "ISO_8859-7",
"16": "CP1252",
"17": "CP866",
"18": "CP852",
"19": "CP858",
"20": "Unknown",
"21": "CP874",
"22": "Unknown",
"23": "Unknown",
"24": "Unknown",
"25": "Unknown",
"26": "Unknown",
"30": "TCVN-3-1",
"31": "TCVN-3-2",
"32": "CP720",
"33": "CP775",
"34": "CP855",
"35": "CP861",
"36": "CP862",
"37": "CP864",
"38": "CP869",
"39": "ISO_8859-2",
"40": "ISO_8859-15",
"41": "CP1098",
"42": "CP774",
"43": "CP772",
"44": "CP1125",
"45": "CP1250",
"46": "CP1251",
"47": "CP1253",
"48": "CP1254",
"49": "CP1255",
"50": "CP1256",
"51": "CP1257",
"52": "CP1258",
"53": "RK1048",
"66": "Unknown",
"67": "Unknown",
"68": "Unknown",
"69": "Unknown",
"70": "Unknown",
"71": "Unknown",
"72": "Unknown",
"73": "Unknown",
"74": "Unknown",
"75": "Unknown",
"82": "Unknown",
"254": "Unknown",
"255": "Unknown"
},
"vendor": "Generic",
"model": "Default",
"description": "Default ESC/POS profile"
},

"XP-N160I": {
"codePages": {
"0": "CP437",
"1": "CP932",
"2": "CP850",
"3": "CP860",
"4": "CP863",
"5": "CP865",
"6": "CP1252",
"7": "CP737",
"8": "CP862",
"9": "Unknown",
"10": "Unknown",
"16": "CP1252",
"17": "CP866",
"18": "CP852",
"19": "CP858",
"20": "Unknown",
"21": "Unknown",
"22": "Unknown",
"23": "Unknown",
"24": "CP747",
"25": "CP1257",
"27": "CP1258",
"28": "CP864",
"29": "CP1001",
"30": "Unknown",
"31": "Unknown",
"32": "CP1255",
"50": "CP437",
"51": "CP932",
"52": "CP437",
"53": "CP858",
"54": "CP858",
"55": "CP860",
"56": "CP861",
"57": "CP863",
"58": "CP865",
"59": "CP866",
"60": "CP855",
"61": "CP857",
"62": "CP862",
"63": "CP864",
"64": "CP737",
"65": "CP851",
"66": "CP869",
"67": "CP928",
"68": "CP772",
"69": "CP774",
"70": "CP874",
"71": "CP1252",
"72": "CP1250",
"73": "CP1251",
"74": "CP3840",
"75": "CP3841",
"76": "CP3843",
"77": "CP3844",
"78": "CP3845",
"79": "CP3846",
"80": "CP3847",
"81": "CP3848",
"82": "CP1001",
"83": "CP2001",
"84": "CP3001",
"85": "CP3002",
"86": "CP3011",
"87": "CP3012",
"88": "CP3021",
"89": "CP3041"
},
"vendor": "Xprinter",
"model": "XP-N160I",
"description": ""
},

"RP80USE": {
"codePages": {
"0": "CP437",
"1": "CP932",
"2": "CP850",
"3": "CP860",
"4": "CP863",
"5": "CP865",
"6": "CP1251",
"7": "CP866",
"8": "Unknown",
"9": "Unknown",
"10": "Unknown",
"15": "CP862",
"16": "CP1252",
"17": "CP1253",
"18": "CP852",
"19": "CP858",
"20": "Unknown",
"21": "Unknown",
"22": "CP864",
"23": "ISO_8859-1",
"24": "CP737",
"25": "CP1257",
"26": "Unknown",
"27": "CP720",
"28": "CP855",
"29": "CP857",
"30": "CP1250",
"31": "CP775",
"32": "CP1254",
"34": "CP1256",
"35": "CP1258",
"36": "ISO_8859-2",
"37": "ISO_8859-3",
"38": "ISO_8859-4",
"39": "ISO_8859-5",
"40": "ISO_8859-6",
"41": "ISO_8859-7",
"42": "ISO_8859-8",
"43": "ISO_8859-9",
"44": "ISO_8859-15",
"45": "Unknown",
"46": "CP856",
"47": "CP874"
},
"vendor": "Rongta",
"model": "RP80USE",
"description": ""
},

"TP806L": {
"codePages": {
"0": "PC437",
"1": "Katakana",
"2": "PC850",
"3": "PC860",
"4": "PC863",
"5": "PC865",
"13": "PC857",
"14": "PC737",
"15": "ISO8859-7",
"16": "WPC1252",
"17": "PC866",
"18": "PC852",
"19": "PC858",
"20": "KU42",
"32": "PC720",
"37": "PC864",
"50": "WPC1256",
"63": "ISO-8859-6"
},
"vendor": "HPRT",
"model": "TP806L",
"description": ""
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class ConsumerBillPaymentsState extends State<ConsumerBillPayments> {
navigatorKey.currentContext!)
.translate(i18.consumerReciepts
.GRAM_PANCHAYAT_WATER_SUPPLY_AND_SANITATION),
textScaler: TextScaler.linear(kIsWeb ? 3 : 1),
textScaleFactor: kIsWeb ? 3 : 1,
maxLines: 3,
style: TextStyle(
color: Colors.black,
Expand All @@ -146,7 +146,7 @@ class ConsumerBillPaymentsState extends State<ConsumerBillPayments> {
ApplicationLocalizations.of(
navigatorKey.currentContext!)
.translate(i18.consumerReciepts.WATER_RECEIPT),
textScaler: TextScaler.linear(kIsWeb ? 3 : 1),
textScaleFactor: kIsWeb ? 3 : 1,
style: TextStyle(
color: Colors.black,
fontSize: 10,
Expand Down Expand Up @@ -238,15 +238,15 @@ class ConsumerBillPaymentsState extends State<ConsumerBillPayments> {
height: 8,
),
Text('- - *** - -',
textScaler: TextScaler.linear(kIsWeb ? 3 : 1),
textScaleFactor: kIsWeb ? 3 : 1,
textAlign: TextAlign.start,
style: TextStyle(
color: Colors.black,
fontSize: kIsWeb ? 5 : 6,
fontWeight: FontWeight.bold)),
Text(
"${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.common.RECEIPT_FOOTER)}",
textScaler: TextScaler.linear(kIsWeb ? 3 : 1),
textScaleFactor: kIsWeb ? 3 : 1,
textAlign: TextAlign.start,
style: TextStyle(
color: Colors.black,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,15 @@ class CollectPaymentProvider with ChangeNotifier {
height: 8,
),
Text('- - *** - -',
textScaler: TextScaler.linear(kIsWeb ? 3 : 1),
textScaleFactor: kIsWeb ? 3 : 1,
textAlign: TextAlign.start,
style: TextStyle(
color: Colors.black,
fontSize: kIsWeb ? 5 : 6,
fontWeight: FontWeight.bold)),
Text(
"${ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.common.RECEIPT_FOOTER)}",
textScaler: TextScaler.linear(kIsWeb ? 3 : 1),
textScaleFactor: kIsWeb ? 3 : 1,
textAlign: TextAlign.start,
style: TextStyle(
color: Colors.black,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// You have generated a new plugin project without specifying the `--platforms`
// flag. A plugin project with no platform support was generated. To add a
// platform, run `flutter create -t plugin --platforms <platforms> .` under the
// same directory. You can also find a detailed instruction on how to add
// platforms in the `pubspec.yaml` at
// https://flutter.dev/docs/development/packages-and-plugins/developing-packages#plugin-platforms.
library esc_pos_utils_platform;

export './src/barcode.dart';
export './src/capability_profile.dart';
export './src/enums.dart';
export './src/pos_column.dart';
export './src/pos_styles.dart';
export './src/qrcode.dart';
export './src/generator.dart';
Loading

0 comments on commit 4308a5d

Please sign in to comment.