add dependent flow
This commit is contained in:
parent
1ee02c793f
commit
66148a91dc
@ -19,12 +19,12 @@ if (project.hasProperty('google-services.json')) {
|
||||
|
||||
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||
if (flutterVersionCode == null) {
|
||||
flutterVersionCode = '70'
|
||||
flutterVersionCode = '71'
|
||||
}
|
||||
|
||||
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||
if (flutterVersionName == null) {
|
||||
flutterVersionName = '2.0.31'
|
||||
flutterVersionName = '2.0.32'
|
||||
}
|
||||
|
||||
def keystoreProperties = new Properties()
|
||||
@ -35,7 +35,8 @@ if (keystorePropertiesFile.exists()) {
|
||||
|
||||
android {
|
||||
namespace "nh.ind.nhance.benefits"
|
||||
compileSdk flutter.compileSdkVersion
|
||||
// Google Play requires target API 36 (Android 16) as of Aug 31, 2026
|
||||
compileSdk 36
|
||||
ndkVersion flutter.ndkVersion
|
||||
|
||||
compileOptions {
|
||||
@ -66,7 +67,7 @@ android {
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||
minSdkVersion flutter.minSdkVersion
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
targetSdkVersion 36
|
||||
versionCode flutterVersionCode.toInteger()
|
||||
versionName flutterVersionName
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -101,6 +101,62 @@ class ApiService {
|
||||
return response;
|
||||
}
|
||||
|
||||
/// Dependent-add UI: policy details, family slots, and add_button_show.
|
||||
Future<Map<String, dynamic>> getEmployeePolicy({
|
||||
required String id,
|
||||
required String empCode,
|
||||
required String clientId,
|
||||
required String clientBranchId,
|
||||
required String clientPolicyId,
|
||||
}) async {
|
||||
logDebug(_postToken);
|
||||
if (_postToken == null) {
|
||||
await _initializeToken();
|
||||
}
|
||||
final url = Uri.parse(
|
||||
'${Environment.apiUrl}getEmployeeByPolicy?id=$id&emp_code=$empCode&client_id=$clientId&client_branch_id=$clientBranchId&client_policy_id=$clientPolicyId');
|
||||
final headers = {
|
||||
'Authorization': 'Bearer $_postToken' ?? '',
|
||||
};
|
||||
final response = await _makeGetRequest(url, headers);
|
||||
return response;
|
||||
}
|
||||
|
||||
/// Add or update dependent (creates with pending_approval).
|
||||
Future<Map<String, dynamic>> addEmployeeAndDependence(
|
||||
List<Map<String, dynamic>> dependents) async {
|
||||
logDebug(_postToken);
|
||||
if (_postToken == null) {
|
||||
await _initializeToken();
|
||||
}
|
||||
final url = Uri.parse('${Environment.apiUrl}addEmployeeAndDependence');
|
||||
final headers = {
|
||||
'Authorization': 'Bearer $_postToken' ?? '',
|
||||
'Content-Type': 'application/json',
|
||||
};
|
||||
final response = await _makePostRequestWithoutFormData(
|
||||
url,
|
||||
jsonEncode(dependents),
|
||||
headers,
|
||||
);
|
||||
return response;
|
||||
}
|
||||
|
||||
/// Soft-delete a dependent (status → deleted, is_active → 0).
|
||||
Future<Map<String, dynamic>> deleteDependence(String dependentId) async {
|
||||
logDebug(_postToken);
|
||||
if (_postToken == null) {
|
||||
await _initializeToken();
|
||||
}
|
||||
final url =
|
||||
Uri.parse('${Environment.apiUrl}deleteDependence?id=$dependentId');
|
||||
final headers = {
|
||||
'Authorization': 'Bearer $_postToken' ?? '',
|
||||
};
|
||||
final response = await _makeGetRequest(url, headers);
|
||||
return response;
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> getFAQsApiData() async {
|
||||
logDebug(_postToken);
|
||||
if (_postToken == null) {
|
||||
@ -458,6 +514,13 @@ class ApiService {
|
||||
ToastHelper.showWarningToast(context, message);
|
||||
return {};
|
||||
} else {
|
||||
// Return API error payload when available so callers can show messages.
|
||||
try {
|
||||
final decoded = jsonDecode(response.body);
|
||||
if (decoded is Map<String, dynamic>) {
|
||||
return decoded;
|
||||
}
|
||||
} catch (_) {}
|
||||
throw Exception('Failed to load data');
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,8 +17,8 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||
# In Windows, build-name is used as the major, minor, and patch parts
|
||||
# of the product and file versions while build-number is used as the build suffix.
|
||||
#version: 1.2.42+99
|
||||
version: 1.0.43+50
|
||||
#version: 2.0.31+70
|
||||
version: 1.0.44+51
|
||||
#version: 2.0.32+71
|
||||
|
||||
environment:
|
||||
sdk: '>=3.3.3 <4.0.0'
|
||||
|
||||
Loading…
Reference in New Issue
Block a user