@ -17,27 +17,33 @@ class LeaveBalanceApiClient {
factory LeaveBalanceApiClient ( ) = > _instance ;
factory LeaveBalanceApiClient ( ) = > _instance ;
Future < List < GetAbsenceTransactionList > > getAbsenceTransactions ( int pSelectedResopID ) async {
Future < List < GetAbsenceTransactionList > > getAbsenceTransactions ( int pSelectedResopID , { String ? empID } ) async {
String url = " ${ ApiConsts . erpRest } GET_ABSENCE_TRANSACTIONS " ;
String url = " ${ ApiConsts . erpRest } GET_ABSENCE_TRANSACTIONS " ;
Map < String , dynamic > postParams = { " P_PAGE_LIMIT " : 50 , " P_PAGE_NUM " : 1 , " P_MENU_TYPE " : " E " , " P_SELECTED_RESP_ID " : pSelectedResopID } ;
Map < String , dynamic > postParams = { " P_PAGE_LIMIT " : 50 , " P_PAGE_NUM " : 1 , " P_MENU_TYPE " : " E " , " P_SELECTED_RESP_ID " : pSelectedResopID } ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
if ( empID ! . isNotEmpty ) {
postParams [ ' P_SELECTED_EMPLOYEE_NUMBER ' ] = empID ;
}
return await ApiClient ( ) . postJsonForObject ( ( json ) {
return await ApiClient ( ) . postJsonForObject ( ( json ) {
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
return responseData . getAbsenceTransactionList ? ? [ ] ;
return responseData . getAbsenceTransactionList ? ? [ ] ;
} , url , postParams ) ;
} , url , postParams ) ;
}
}
Future < List < GetAbsenceAttendanceTypesList > > getAbsenceAttendanceTypes ( ) async {
Future < List < GetAbsenceAttendanceTypesList > > getAbsenceAttendanceTypes ( {String ? empID } ) async {
String url = " ${ ApiConsts . erpRest } GET_ABSENCE_ATTENDANCE_TYPES " ;
String url = " ${ ApiConsts . erpRest } GET_ABSENCE_ATTENDANCE_TYPES " ;
Map < String , dynamic > postParams = { } ;
Map < String , dynamic > postParams = { } ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
if ( empID ! . isNotEmpty ) {
postParams [ ' P_SELECTED_EMPLOYEE_NUMBER ' ] = empID ;
}
return await ApiClient ( ) . postJsonForObject ( ( json ) {
return await ApiClient ( ) . postJsonForObject ( ( json ) {
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
return responseData . getAbsenceAttendanceTypesList ? ? [ ] ;
return responseData . getAbsenceAttendanceTypesList ? ? [ ] ;
} , url , postParams ) ;
} , url , postParams ) ;
}
}
Future < CalculateAbsenceDuration > calculateAbsenceDuration ( int pAbsenceAttendanceTypeID , String pDateStart , String pDateEnd , int pSelectedResopID ) async {
Future < CalculateAbsenceDuration > calculateAbsenceDuration ( int pAbsenceAttendanceTypeID , String pDateStart , String pDateEnd , int pSelectedResopID , { String ? empID } ) async {
String url = " ${ ApiConsts . erpRest } CALCULATE_ABSENCE_DURATION " ;
String url = " ${ ApiConsts . erpRest } CALCULATE_ABSENCE_DURATION " ;
Map < String , dynamic > postParams = {
Map < String , dynamic > postParams = {
" P_ABSENCE_ATTENDANCE_TYPE_ID " : pAbsenceAttendanceTypeID ,
" P_ABSENCE_ATTENDANCE_TYPE_ID " : pAbsenceAttendanceTypeID ,
@ -49,16 +55,22 @@ class LeaveBalanceApiClient {
" P_TIME_START " : null ,
" P_TIME_START " : null ,
} ;
} ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
if ( empID ! . isNotEmpty ) {
postParams [ ' P_SELECTED_EMPLOYEE_NUMBER ' ] = empID ;
}
return await ApiClient ( ) . postJsonForObject ( ( json ) {
return await ApiClient ( ) . postJsonForObject ( ( json ) {
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
return responseData . calculateAbsenceDuration ! ;
return responseData . calculateAbsenceDuration ! ;
} , url , postParams ) ;
} , url , postParams ) ;
}
}
Future < List < GetAbsenceDffStructureList > > getAbsenceDffStructure ( String pDescFlexContextCode , String pFunctionName , int pSelectedResopID ) async {
Future < List < GetAbsenceDffStructureList > > getAbsenceDffStructure ( String pDescFlexContextCode , String pFunctionName , int pSelectedResopID , { String ? empID } ) async {
String url = " ${ ApiConsts . erpRest } GET_ABSENCE_DFF_STRUCTURE " ;
String url = " ${ ApiConsts . erpRest } GET_ABSENCE_DFF_STRUCTURE " ;
Map < String , dynamic > postParams = { " P_DESC_FLEX_CONTEXT_CODE " : pDescFlexContextCode , " P_FUNCTION_NAME " : pFunctionName , " P_MENU_TYPE " : " E " , " P_SELECTED_RESP_ID " : pSelectedResopID } ;
Map < String , dynamic > postParams = { " P_DESC_FLEX_CONTEXT_CODE " : pDescFlexContextCode , " P_FUNCTION_NAME " : pFunctionName , " P_MENU_TYPE " : " E " , " P_SELECTED_RESP_ID " : pSelectedResopID } ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
if ( empID ! . isNotEmpty ) {
postParams [ ' P_SELECTED_EMPLOYEE_NUMBER ' ] = empID ;
}
return await ApiClient ( ) . postJsonForObject ( ( json ) {
return await ApiClient ( ) . postJsonForObject ( ( json ) {
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
return responseData . getAbsenceDffStructureList ? ? [ ] ;
return responseData . getAbsenceDffStructureList ? ? [ ] ;
@ -67,7 +79,7 @@ class LeaveBalanceApiClient {
Future < GenericResponseModel > validateAbsenceTransaction (
Future < GenericResponseModel > validateAbsenceTransaction (
String pDescFlexContextCode , String pFunctionName , int pAbsenceAttendanceTypeID , String pReplacementUserName , String pDateStart , String pDateEnd , int pSelectedResopID , Map < String , String ? > data ,
String pDescFlexContextCode , String pFunctionName , int pAbsenceAttendanceTypeID , String pReplacementUserName , String pDateStart , String pDateEnd , int pSelectedResopID , Map < String , String ? > data ,
{ String comments = " " }) async {
{ String comments = " " , String ? empID }) async {
String url = " ${ ApiConsts . erpRest } VALIDATE_ABSENCE_TRANSACTION " ;
String url = " ${ ApiConsts . erpRest } VALIDATE_ABSENCE_TRANSACTION " ;
Map < String , dynamic > postParams = {
Map < String , dynamic > postParams = {
" P_DESC_FLEX_CONTEXT_CODE " : pDescFlexContextCode ,
" P_DESC_FLEX_CONTEXT_CODE " : pDescFlexContextCode ,
@ -86,6 +98,9 @@ class LeaveBalanceApiClient {
} ;
} ;
postParams . addAll ( data ) ;
postParams . addAll ( data ) ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
if ( empID ! . isNotEmpty ) {
postParams [ ' P_SELECTED_EMPLOYEE_NUMBER ' ] = empID ;
}
return await ApiClient ( ) . postJsonForObject ( ( json ) {
return await ApiClient ( ) . postJsonForObject ( ( json ) {
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
return responseData ;
return responseData ;
@ -94,7 +109,7 @@ class LeaveBalanceApiClient {
Future < SumbitAbsenceTransactionList > submitAbsenceTransaction (
Future < SumbitAbsenceTransactionList > submitAbsenceTransaction (
String pDescFlexContextCode , String pFunctionName , int pAbsenceAttendanceTypeID , String pReplacementUserName , String pDateStart , String pDateEnd , int pSelectedResopID , Map < String , String ? > data ,
String pDescFlexContextCode , String pFunctionName , int pAbsenceAttendanceTypeID , String pReplacementUserName , String pDateStart , String pDateEnd , int pSelectedResopID , Map < String , String ? > data ,
{ String comments = " " }) async {
{ String comments = " " , String ? empID }) async {
String url = " ${ ApiConsts . erpRest } SUBMIT_ABSENCE_TRANSACTION " ;
String url = " ${ ApiConsts . erpRest } SUBMIT_ABSENCE_TRANSACTION " ;
Map < String , dynamic > postParams = {
Map < String , dynamic > postParams = {
" P_DESC_FLEX_CONTEXT_CODE " : pDescFlexContextCode ,
" P_DESC_FLEX_CONTEXT_CODE " : pDescFlexContextCode ,
@ -113,6 +128,9 @@ class LeaveBalanceApiClient {
} ;
} ;
postParams . addAll ( data ) ;
postParams . addAll ( data ) ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
if ( empID ! . isNotEmpty ) {
postParams [ ' P_SELECTED_EMPLOYEE_NUMBER ' ] = empID ;
}
return await ApiClient ( ) . postJsonForObject ( ( json ) {
return await ApiClient ( ) . postJsonForObject ( ( json ) {
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
return responseData . sumbitAbsenceTransactionList ! ;
return responseData . sumbitAbsenceTransactionList ! ;
@ -129,7 +147,7 @@ class LeaveBalanceApiClient {
} , url , postParams ) ;
} , url , postParams ) ;
}
}
Future < StartAbsenceApprovalProccess > startAbsenceApprovalProcess ( int pTransactionID , String comments , int pSelectedResopID ) async {
Future < StartAbsenceApprovalProccess > startAbsenceApprovalProcess ( int pTransactionID , String comments , int pSelectedResopID ,{ String ? empID } ) async {
String url = " ${ ApiConsts . erpRest } START_ABSENCE_APPROVAL_PROCESS " ;
String url = " ${ ApiConsts . erpRest } START_ABSENCE_APPROVAL_PROCESS " ;
Map < String , dynamic > postParams = {
Map < String , dynamic > postParams = {
" P_TRANSACTION_ID " : pTransactionID ,
" P_TRANSACTION_ID " : pTransactionID ,
@ -138,6 +156,9 @@ class LeaveBalanceApiClient {
" P_MENU_TYPE " : " E " ,
" P_MENU_TYPE " : " E " ,
} ;
} ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
postParams . addAll ( AppState ( ) . postParamsJson ) ;
if ( empID ! . isNotEmpty ) {
postParams [ ' P_SELECTED_EMPLOYEE_NUMBER ' ] = empID ;
}
return await ApiClient ( ) . postJsonForObject ( ( json ) {
return await ApiClient ( ) . postJsonForObject ( ( json ) {
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
GenericResponseModel ? responseData = GenericResponseModel . fromJson ( json ) ;
return responseData . startAbsenceApprovalProccess ! ;
return responseData . startAbsenceApprovalProccess ! ;