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

Commit

Permalink
Develop (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahuldevgarg authored Dec 26, 2023
1 parent 0a76932 commit c2ce639
Show file tree
Hide file tree
Showing 156 changed files with 2,912 additions and 1,406 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,32 @@ public int compare(DemandDetail dD1, DemandDetail dD2) {
}
};
}

public Map<String, String> migrateToV1(Integer startBatch, Integer batchSizeInput) {

public static String getCountQuery(String stateLevelTenantId){
return new String("select count(*) from egbs_demand where businessservice IN ('TL','PT') AND tenantid ilike '"+stateLevelTenantId+"%';");
}
public static String getSelectQuery(String stateLevelTenantId){
return new String("select d.id as did,dl.id as dlid,dl.demandid as dldemandid,"
+ "d.consumercode as dconsumercode,d.consumertype as dconsumertype,d.taxperiodfrom as dtaxperiodfrom,"
+ "d.taxperiodto as dtaxperiodto,U.uuid as payer,null as dbillexpirytime,"
+ " d.businessservice as dbusinessservice,d.status as status,d.minimumamountpayable as dminimumamountpayable, "
+ " (CASE WHEN taxheadcode='PT_DECIMAL_CEILING_CREDIT' OR taxheadcode='PT_DECIMAL_CEILING_DEBIT' THEN 'PT_ROUNDOFF' else taxheadcode END)"
+ " as dltaxheadcode, (CASE WHEN taxheadcode IN ('PT_TIME_REBATE', 'PT_ADVANCE_CARRYFORWARD', 'PT_OWNER_EXEMPTION','PT_UNIT_USAGE_EXEMPTION'"
+ ", 'PT_ADHOC_REBATE', 'PT_DECIMAL_CEILING_DEBIT','TL_ADHOC_REBATE') then taxamount*-1 else taxamount END) as dltaxamount,"
+ " dl.collectionamount as dlcollectionamount, dl.createdby as dlcreatedby,dl.createdtime as dlcreatedtime,dl.lastmodifiedby as dllastmodifiedby,"
+ " dl.lastmodifiedtime as dllastmodifiedtime,dl.tenantid as dltenantid, d.createdby as dcreatedby,d.createdtime as dcreatedtime,"
+ " d.lastmodifiedby as dlastmodifiedby,d.lastmodifiedtime as dlastmodifiedtime,d.tenantid as dtenantid "
+ " from egbs_demand d inner join egbs_demanddetail dl ON d.id=dl.demandid AND d.tenantid=dl.tenantid "
+ " LEFT OUTER JOIN eg_user U ON U.id::CHARACTER VARYING=d.owner"
+ " WHERE d.businessservice IN ('TL','PT') AND d.tenantid ilike '"+stateLevelTenantId+"%' "
+ " AND d.id IN (select id from egbs_demand order by id offset ? limit ?);");
}

public Map<String, String> migrateToV1(Integer startBatch, Integer batchSizeInput,String stateLevelTenantId) {

Map<String, String> responseMap = new HashMap<>();

int count = jdbcTemplate.queryForObject(COUNT_QUERY, Integer.class);
int count = jdbcTemplate.queryForObject(getCountQuery(stateLevelTenantId), Integer.class);
int i = 0;
if (null != startBatch && startBatch > 0)
i = startBatch;
Expand All @@ -111,7 +131,7 @@ public Map<String, String> migrateToV1(Integer startBatch, Integer batchSizeInpu

for( ; i<count;i = i+batchSize) {

List<Demand> demands = jdbcTemplate.query(SELECT_QUERY, new Object[] { i, batchSize }, demandRowMapper);
List<Demand> demands = jdbcTemplate.query(getSelectQuery(stateLevelTenantId), new Object[] { i, batchSize }, demandRowMapper);
try {

apportionDemands(demands);
Expand All @@ -128,7 +148,7 @@ public Map<String, String> migrateToV1(Integer startBatch, Integer batchSizeInpu

return responseMap;
}

private void addResponseToMap(List<Demand> demands, Map<String, String> responseMap, String message) {

demands.forEach(demand -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public ResponseEntity<?> search(@RequestBody RequestInfoWrapper requestInfoWrapp
public ResponseEntity<?> migrate(@RequestBody @Valid RequestInfoWrapper wrapper,
@RequestParam(required=false) Integer batchStart, @RequestParam(required=true) Integer batchSizeInput) {

Map<String, String> resultMap = migrationService.migrateToV1(batchStart, batchSizeInput);
Map<String, String> resultMap = migrationService.migrateToV1(batchStart, batchSizeInput, wrapper.getRequestInfo().getUserInfo().getTenantId().substring(0,2));
return new ResponseEntity<>(resultMap, HttpStatus.OK);
}

Expand Down
39 changes: 37 additions & 2 deletions frontend/mgramseva/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,42 @@
# This file should be version controlled and should not be manually edited.

version:
revision: f4abaa0735eba4dfd8f33f73363911d63931fe03
channel: stable
revision: "db7ef5bf9f59442b0e200a90587e8fa5e0c6336a"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: android
create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: ios
create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: linux
create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: macos
create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: web
create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
- platform: windows
create_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a
base_revision: db7ef5bf9f59442b0e200a90587e8fa5e0c6336a

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
1 change: 1 addition & 0 deletions frontend/mgramseva/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ mGramSeva is a Hybrid Application (web + App(Android + IOS)) built using Open So

## Commands for flutter
- **flutter run** : Command to run the app
- **flutter run --no-enable-impeller** : Command to run the app on mac virtual machine without GPU Passthrough
- **flutter build web** : Command to build web
- **flutter build apk --release** : Command to build the apk of the application

Expand Down
10 changes: 7 additions & 3 deletions frontend/mgramseva/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dwss.mgramseva">
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"></uses-permission>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32"/>
<uses-permission android:name="android.permission.READ_MEDIA_VIDEOS" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_AUDIO" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<uses-permission android:name="android.permission.BLUETOOTH_ADVERTISE" />
Expand All @@ -14,7 +17,8 @@
<application
android:allowBackup="false"
android:fullBackupContent="false"
android:label="mgramseva"
android:enableOnBackInvokedCallback="true"
android:label="mGramSeva"
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
Expand Down
2 changes: 1 addition & 1 deletion frontend/mgramseva/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
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.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
1 change: 1 addition & 0 deletions frontend/mgramseva/assets/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STATE_LEVEL_TENANT_ID=pb
2 changes: 1 addition & 1 deletion frontend/mgramseva/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Docker flutter tags https://hub.docker.com/r/cirrusci/flutter/tags?page=1&name=1.16

FROM cirrusci/flutter:3.3.8 AS build
FROM ghcr.io/cirruslabs/flutter:3.16.0 AS build
ARG WORK_DIR
WORKDIR /app
# copy the project files
Expand Down
2 changes: 0 additions & 2 deletions frontend/mgramseva/integration_test/add_expense.dart
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
// TODO 5: Import the app that you want to test
import 'package:mgramseva/main.dart' as app;
import 'package:mgramseva/utils/localization/application_localizations.dart';
Expand Down
6 changes: 3 additions & 3 deletions frontend/mgramseva/integration_test/dashboard_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void main() {
await tester.pumpAndSettle(Duration(milliseconds: 3000));

// final tabSelection = find.byKey(Keys.dashboard.DASHBOARD_SEARCH);
final dashboard_search = find.byKey(Keys.dashboard.DASHBOARD_SEARCH);
final dashboardSearch = find.byKey(Keys.dashboard.DASHBOARD_SEARCH);
final datePicker = find.byKey(Keys.dashboard.DASHBOARD_DATE_PICKER);
final expenditureTab = find.widgetWithText(GestureDetector, ApplicationLocalizations.of(navigatorKey.currentContext!).translate(i18.dashboard.EXPENDITURE)).first;
final tab = find.byKey(Keys.dashboard.SECOND_TAB);
Expand Down Expand Up @@ -86,8 +86,8 @@ void main() {
await tester.pumpAndSettle(Duration(milliseconds: 5000));

/// Searching items
await tester.ensureVisible(dashboard_search);
await tester.enterText(dashboard_search, dashboardTestData['dashboardSearch']);
await tester.ensureVisible(dashboardSearch);
await tester.enterText(dashboardSearch, dashboardTestData['dashboardSearch']);
await tester.pumpAndSettle(Duration(milliseconds: 5000));

// await tester.ensureVisible(share);
Expand Down
4 changes: 0 additions & 4 deletions frontend/mgramseva/integration_test/forgot_password_test.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mgramseva/main.dart' as app;
import 'package:mgramseva/utils/localization/application_localizations.dart';
import 'package:mgramseva/utils/testing_keys/testing_keys.dart';
import 'package:mgramseva/utils/global_variables.dart';
import 'package:mgramseva/widgets/language_card.dart';
import 'package:mgramseva/utils/constants/i18_key_constants.dart';

import 'Test Inputs/test_inputs.dart';

Expand Down
1 change: 0 additions & 1 deletion frontend/mgramseva/integration_test/log_out_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mgramseva/main.dart' as app;
import 'package:mgramseva/utils/testing_keys/testing_keys.dart';
import 'Test Inputs/test_inputs.dart';

void main() {
testWidgets("Log Out Test", (tester) async {
Expand Down
5 changes: 0 additions & 5 deletions frontend/mgramseva/integration_test/login_test.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
// TODO 5: Import the app that you want to test
import 'package:mgramseva/main.dart' as app;
import 'package:mgramseva/utils/localization/application_localizations.dart';
import 'package:mgramseva/utils/testing_keys/testing_keys.dart';
import 'package:mgramseva/utils/global_variables.dart';
import 'package:mgramseva/widgets/language_card.dart';
import 'Test Inputs/test_inputs.dart';
import 'search_Connection_test.dart' as search_Connection;
Expand All @@ -20,7 +16,6 @@ import 'change_password_test.dart' as change_password;
import 'log_out_test.dart' as logout;
// import 'search_Connection_test.dart' as search_Connection;
// import 'create_consumer_test.dart' as create_consumer;
import 'Test Inputs/test_inputs.dart';
import 'update_expense.dart' as update_expense;
import 'add_expense.dart' as add_expense;
import 'dashboard_test.dart' as dashboard;
Expand Down
1 change: 0 additions & 1 deletion frontend/mgramseva/integration_test/update_expense.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
// TODO 5: Import the app that you want to test
import 'package:mgramseva/main.dart' as app;
import 'package:mgramseva/utils/localization/application_localizations.dart';
Expand Down
2 changes: 1 addition & 1 deletion frontend/mgramseva/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# platform :ios, '11.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
Loading

0 comments on commit c2ce639

Please sign in to comment.