Casser Epargne Ok
This commit is contained in:
parent
ce46111f09
commit
9ba8e81274
12
App.js
12
App.js
|
@ -80,6 +80,10 @@ import NavigationService from './utils/NavigationService';
|
|||
import AdhererGroupNanoCredit from './screens/nano-credit/AdhererGroupNanoCredit';
|
||||
import MyNanoCreditGroup from './screens/nano-credit/MyNanoCreditGroup';
|
||||
import AskNanoCredit from './screens/nano-credit/AskNanoCredit';
|
||||
import RefundNanoCreditUser from './screens/nano-credit/RefundNanoCreditUser';
|
||||
import CautionNanoCreditAgent from './screens/nano-credit/CautionNanoCreditAgent';
|
||||
import EpargnerArgentUser from './screens/nano-credit/EpargnerArgentUser';
|
||||
import CasserEpargneUser from './screens/nano-credit/CasserEpargneUser';
|
||||
|
||||
const instructions = Platform.select({
|
||||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
|
||||
|
@ -192,7 +196,9 @@ const AppStack = createDrawerNavigator({
|
|||
},
|
||||
demandeValidationGroupe: DemandGroupNanoCreditDetail,
|
||||
adhererGroupNanoCredit: AdhererGroupNanoCredit,
|
||||
askNanoCredit: AskNanoCredit
|
||||
askNanoCredit: AskNanoCredit,
|
||||
refundNanoCreditUser: RefundNanoCreditUser,
|
||||
casserEpargneUser: CasserEpargneUser
|
||||
|
||||
})
|
||||
}, { contentComponent: OptionsMenu, headerMode: 'none', contentOptions: { activeTintColor: theme.accent } })
|
||||
|
@ -254,7 +260,9 @@ const AppAgentStack = createDrawerNavigator({
|
|||
envoieCashVersAutreWalletAgent: EnvoieCashVersAutreWalletAgent,
|
||||
envoieCashVersCarteAgent: EnvoieCashVersCarteAgent,
|
||||
envoiCashVersCashAgent: EnvoiCashVersCashAgent,
|
||||
createGroupNanoCredit: CreateGroupNanoCredit
|
||||
createGroupNanoCredit: CreateGroupNanoCredit,
|
||||
cautionNanoCreditAgent: CautionNanoCreditAgent,
|
||||
epargnerArgentUser: EpargnerArgentUser
|
||||
})
|
||||
}, {
|
||||
contentComponent: OptionsMenu,
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -57,5 +57,6 @@
|
|||
"groupNanoCredit": "groupNanoCredit",
|
||||
"demandGroupNanoCreditDetail": "demandeValidationGroupe",
|
||||
"adhererGroupNanoCredit": "adhererGroupNanoCredit",
|
||||
"myNanoCreditGroup": "myNanoCreditGroup"
|
||||
"myNanoCreditGroup": "myNanoCreditGroup",
|
||||
"askNanoCredit": "askNanoCredit"
|
||||
}
|
||||
|
|
|
@ -113,6 +113,7 @@
|
|||
"GROUP_CODE": "Group code",
|
||||
"NOM_GROUP": "Group name",
|
||||
"GROUP": "Group",
|
||||
"INDIVIDUAL": "Individual",
|
||||
"LIMIT_OF_CREDIT": "Credit limit",
|
||||
"CODE_USER_ILINK_SPONSOR_1": "iLink user code sponsor 1",
|
||||
"CODE_USER_ILINK_SPONSOR_2": "iLink user code sponsor 2",
|
||||
|
@ -138,6 +139,9 @@
|
|||
"NANO_CREDIT_DESCRIPTION": "Nano credit description",
|
||||
"NANO_SANTE": "Nano health",
|
||||
"NANO_SANTE_DESCRIPTION": "Nano health description",
|
||||
"CAUTION_TYPE": "Caution type",
|
||||
"DEMAND_NANO_CREDIT": "Nano credit demand",
|
||||
"DEMAND_DURATION_IN_MONTH": "Duration (in months)",
|
||||
"PAIEMENT_FACTURE": "Bill payment",
|
||||
"NUMERO_ABONNE": "Subscriber number",
|
||||
"IDENTIFIANT_ETUDIANT": "Student ID",
|
||||
|
|
|
@ -118,6 +118,7 @@
|
|||
"SUCCES_JOIN_GROUP": "Adhésion réussie",
|
||||
"NOM_GROUP": "Nom du groupe",
|
||||
"GROUP": "Groupe",
|
||||
"INDIVIDUAL": "Individuel",
|
||||
"LIMIT_OF_CREDIT": "Limite du crédit",
|
||||
"CODE_USER_ILINK_SPONSOR_1": "Code utilisateur iLink Sponsor 1",
|
||||
"CODE_USER_ILINK_SPONSOR_2": "Code utilisateur iLink Sponsor 2",
|
||||
|
@ -144,6 +145,9 @@
|
|||
"NANO_CREDIT_DESCRIPTION": "Nano crédit iLink",
|
||||
"NANO_SANTE": "Nano santé",
|
||||
"NANO_SANTE_DESCRIPTION": "Nano santé iLink",
|
||||
"CAUTION_TYPE": "Type de caution",
|
||||
"DEMAND_NANO_CREDIT": "Demande de nano crédit",
|
||||
"DEMAND_DURATION_IN_MONTH": "Durée (en mois)",
|
||||
"PAIEMENT_FACTURE": "Paiement de facture",
|
||||
"NUMERO_ABONNE": "Numéro d'abonnée",
|
||||
"IDENTIFIANT_ETUDIANT": "Identifiant étudiant",
|
||||
|
|
|
@ -30,7 +30,26 @@ import {
|
|||
GET_NANO_CREDIT_DEMAND_DURATION_PENDING,
|
||||
GET_NANO_CREDIT_DEMAND_DURATION_SUCCESS,
|
||||
GET_NANO_CREDIT_DEMAND_DURATION_ERROR,
|
||||
GET_NANO_CREDIT_DEMAND_DURATION_RESET
|
||||
GET_NANO_CREDIT_DEMAND_DURATION_RESET,
|
||||
REFUND_CREDIT_DEMAND_USER_PENDING,
|
||||
REFUND_CREDIT_DEMAND_USER_RESET,
|
||||
REFUND_CREDIT_DEMAND_USER_ERROR,
|
||||
CAUTION_CREDIT_DEMAND_AGENT_PENDING,
|
||||
CAUTION_CREDIT_DEMAND_AGENT_RESET,
|
||||
CAUTION_CREDIT_DEMAND_AGENT_ERROR,
|
||||
GET_NANO_CREDIT_DEMAND_DETAIL_PENDING,
|
||||
GET_NANO_CREDIT_DEMAND_DETAIL_SUCCESS,
|
||||
GET_NANO_CREDIT_DEMAND_DETAIL_ERROR,
|
||||
GET_NANO_CREDIT_DEMAND_DETAIL_RESET,
|
||||
CAUTION_CREDIT_DEMAND_AGENT_SUCCESS,
|
||||
EPARGNER_ARGENT_USER_PENDING,
|
||||
EPARGNER_ARGENT_USER_SUCCESS,
|
||||
EPARGNER_ARGENT_USER_ERROR,
|
||||
EPARGNER_ARGENT_USER_RESET,
|
||||
CASSER_EPARGNE_USER_PENDING,
|
||||
CASSER_EPARGNE_USER_SUCCESS,
|
||||
CASSER_EPARGNE_USER_ERROR,
|
||||
CASSER_EPARGNE_USER_RESET
|
||||
} from "../types/NanoCreditType";
|
||||
|
||||
export const fetchCreateGroupPending = () => ({
|
||||
|
@ -198,4 +217,99 @@ export const fetchGetNanoCreditDemandDurationError = (error) => ({
|
|||
|
||||
export const fetchGetNanoCreditDemandDurationReset = () => ({
|
||||
type: GET_NANO_CREDIT_DEMAND_DURATION_RESET
|
||||
});
|
||||
|
||||
|
||||
export const fetchCautionCreditDemandUserPending = () => ({
|
||||
type: REFUND_CREDIT_DEMAND_USER_PENDING
|
||||
});
|
||||
|
||||
export const fetchCautionCreditDemandUserSuccess = (res) => ({
|
||||
type: REFUND_CREDIT_DEMAND_USER_RESET,
|
||||
result: res,
|
||||
});
|
||||
|
||||
export const fetchCautionCreditDemandUserError = (error) => ({
|
||||
type: REFUND_CREDIT_DEMAND_USER_ERROR,
|
||||
result: error
|
||||
});
|
||||
|
||||
export const fetchCautionCreditDemandUserReset = () => ({
|
||||
type: REFUND_CREDIT_DEMAND_USER_RESET
|
||||
});
|
||||
|
||||
|
||||
export const fetchCautionCreditDemandAgentPending = () => ({
|
||||
type: CAUTION_CREDIT_DEMAND_AGENT_PENDING
|
||||
});
|
||||
|
||||
export const fetchCautionCreditDemandAgentSuccess = (res) => ({
|
||||
type: CAUTION_CREDIT_DEMAND_AGENT_SUCCESS,
|
||||
result: res,
|
||||
});
|
||||
|
||||
export const fetchCautionCreditDemandAgentError = (error) => ({
|
||||
type: CAUTION_CREDIT_DEMAND_AGENT_ERROR,
|
||||
result: error
|
||||
});
|
||||
|
||||
export const fetchCautionCreditDemandAgentReset = () => ({
|
||||
type: CAUTION_CREDIT_DEMAND_AGENT_RESET
|
||||
});
|
||||
|
||||
|
||||
export const fetchGetNanoCreditDemandDetailPending = () => ({
|
||||
type: GET_NANO_CREDIT_DEMAND_DETAIL_PENDING
|
||||
});
|
||||
|
||||
export const fetchGetNanoCreditDemandDetailSuccess = (res) => ({
|
||||
type: GET_NANO_CREDIT_DEMAND_DETAIL_SUCCESS,
|
||||
result: res,
|
||||
});
|
||||
|
||||
export const fetchGetNanoCreditDemandDetailError = (error) => ({
|
||||
type: GET_NANO_CREDIT_DEMAND_DETAIL_ERROR,
|
||||
result: error
|
||||
});
|
||||
|
||||
export const fetchGetNanoCreditDemandDetailReset = () => ({
|
||||
type: GET_NANO_CREDIT_DEMAND_DETAIL_RESET
|
||||
});
|
||||
|
||||
|
||||
export const fetchEpargnerArgentUserPending = () => ({
|
||||
type: EPARGNER_ARGENT_USER_PENDING
|
||||
});
|
||||
|
||||
export const fetchEpargnerArgentUserSuccess = (res) => ({
|
||||
type: EPARGNER_ARGENT_USER_SUCCESS,
|
||||
result: res,
|
||||
});
|
||||
|
||||
export const fetchEpargnerArgentUserError = (error) => ({
|
||||
type: EPARGNER_ARGENT_USER_ERROR,
|
||||
result: error
|
||||
});
|
||||
|
||||
export const fetchEpargnerArgentUserReset = () => ({
|
||||
type: EPARGNER_ARGENT_USER_RESET
|
||||
});
|
||||
|
||||
|
||||
export const fetchCasserEpargneUserPending = () => ({
|
||||
type: CASSER_EPARGNE_USER_PENDING
|
||||
});
|
||||
|
||||
export const fetchCasserEpargneUserSuccess = (res) => ({
|
||||
type: CASSER_EPARGNE_USER_SUCCESS,
|
||||
result: res,
|
||||
});
|
||||
|
||||
export const fetchCasserEpargneUserError = (error) => ({
|
||||
type: CASSER_EPARGNE_USER_ERROR,
|
||||
result: error
|
||||
});
|
||||
|
||||
export const fetchCasserEpargneUserReset = () => ({
|
||||
type: CASSER_EPARGNE_USER_RESET
|
||||
});
|
|
@ -0,0 +1,33 @@
|
|||
import { CASSER_EPARGNE_USER_PENDING, CASSER_EPARGNE_USER_SUCCESS, CASSER_EPARGNE_USER_ERROR, CASSER_EPARGNE_USER_RESET } from "../types/NanoCreditType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
result: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case CASSER_EPARGNE_USER_PENDING: return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case CASSER_EPARGNE_USER_SUCCESS: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case CASSER_EPARGNE_USER_ERROR: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case CASSER_EPARGNE_USER_RESET: return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,33 @@
|
|||
import { CAUTION_CREDIT_DEMAND_AGENT_PENDING, CAUTION_CREDIT_DEMAND_AGENT_SUCCESS, CAUTION_CREDIT_DEMAND_AGENT_ERROR, CAUTION_CREDIT_DEMAND_AGENT_RESET } from "../types/NanoCreditType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
result: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case CAUTION_CREDIT_DEMAND_AGENT_PENDING: return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case CAUTION_CREDIT_DEMAND_AGENT_SUCCESS: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case CAUTION_CREDIT_DEMAND_AGENT_ERROR: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case CAUTION_CREDIT_DEMAND_AGENT_RESET: return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,33 @@
|
|||
import { EPARGNER_ARGENT_USER_PENDING, EPARGNER_ARGENT_USER_SUCCESS, EPARGNER_ARGENT_USER_ERROR, EPARGNER_ARGENT_USER_RESET } from "../types/NanoCreditType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
result: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case EPARGNER_ARGENT_USER_PENDING: return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case EPARGNER_ARGENT_USER_SUCCESS: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case EPARGNER_ARGENT_USER_ERROR: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case EPARGNER_ARGENT_USER_RESET: return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -1,4 +1,4 @@
|
|||
import { GET_DEMAND_GROUP_PENDING, GET_DEMAND_GROUP_SUCCESS, GET_DEMAND_GROUP_ERROR, GET_DEMAND_GROUP_RESET } from "../types/NanoCreditType";
|
||||
import { GET_NANO_CREDIT_DEMAND_DETAIL_ERROR, GET_NANO_CREDIT_DEMAND_DETAIL_PENDING, GET_NANO_CREDIT_DEMAND_DETAIL_RESET, GET_NANO_CREDIT_DEMAND_DETAIL_SUCCESS } from "../types/NanoCreditType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
|
@ -8,23 +8,23 @@ const initialState = {
|
|||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case GET_DEMAND_GROUP_PENDING: return {
|
||||
case GET_NANO_CREDIT_DEMAND_DETAIL_PENDING: return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case GET_DEMAND_GROUP_SUCCESS: return {
|
||||
case GET_NANO_CREDIT_DEMAND_DETAIL_SUCCESS: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case GET_DEMAND_GROUP_ERROR: return {
|
||||
case GET_NANO_CREDIT_DEMAND_DETAIL_ERROR: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case GET_DEMAND_GROUP_RESET: return initialState;
|
||||
case GET_NANO_CREDIT_DEMAND_DETAIL_RESET: return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
import { GET_NANO_CREDIT_DEMAND_DETAIL_PENDING, GET_NANO_CREDIT_DEMAND_DETAIL_SUCCESS, GET_NANO_CREDIT_DEMAND_DETAIL_RESET, GET_NANO_CREDIT_DEMAND_DETAIL_ERROR } from "../types/NanoCreditType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
result: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case GET_NANO_CREDIT_DEMAND_DETAIL_PENDING: return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case GET_NANO_CREDIT_DEMAND_DETAIL_SUCCESS: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case GET_NANO_CREDIT_DEMAND_DETAIL_ERROR: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case GET_NANO_CREDIT_DEMAND_DETAIL_RESET: return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -0,0 +1,33 @@
|
|||
import { REFUND_CREDIT_DEMAND_USER_PENDING, REFUND_CREDIT_DEMAND_USER_RESET, REFUND_CREDIT_DEMAND_USER_SUCCESS, REFUND_CREDIT_DEMAND_USER_ERROR } from "../types/NanoCreditType";
|
||||
|
||||
const initialState = {
|
||||
loading: false,
|
||||
result: null,
|
||||
error: null
|
||||
};
|
||||
|
||||
export default (state = initialState, action) => {
|
||||
switch (action.type) {
|
||||
case REFUND_CREDIT_DEMAND_USER_PENDING: return {
|
||||
...state,
|
||||
loading: true
|
||||
}
|
||||
case REFUND_CREDIT_DEMAND_USER_SUCCESS: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: action.result.data,
|
||||
error: null
|
||||
}
|
||||
case REFUND_CREDIT_DEMAND_USER_ERROR: return {
|
||||
...state,
|
||||
loading: false,
|
||||
result: null,
|
||||
error: action.result
|
||||
}
|
||||
case REFUND_CREDIT_DEMAND_USER_RESET: return initialState;
|
||||
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
};
|
|
@ -1,39 +1,44 @@
|
|||
import { AsyncStorage } from "react-native";
|
||||
import { persistCombineReducers } from "redux-persist";
|
||||
import ActiveCountryListReducer from "./ActiveCountryListReducer";
|
||||
import AskNanoCreditReducer from "./AskNanoCreditReducer";
|
||||
import authKeyReducer from "./AuthKeyReducer";
|
||||
import CautionCreditDemandAgentReducer from "./CautionCreditDemandAgentReducer";
|
||||
import CountryByDialCodeReducer from "./CountryByDialCodeReducer";
|
||||
import CreateGroupReducer from "./CreateGroupReducer";
|
||||
import creditCancelDemandReducer from "./CreditCancelDemandReducer";
|
||||
import creditTreatDemandReducer from "./CreditTreatDemandReducer";
|
||||
import depositReducer from "./DepositReducer";
|
||||
import EnvoieUserWalletToCardGetCommissionReducer from "./EnvoieUserWalletToCardGetCommissionReducer";
|
||||
import EnvoieUserWalletToCardReducer from "./EnvoieUserWalletToCardReducer";
|
||||
import EnvoieUserWalletToCashGetCommissionReducer from "./EnvoieUserWalletToCashGetCommissionReducer";
|
||||
import EnvoieUserWalletToCashReducer from "./EnvoieUserWalletToCashReducer";
|
||||
import EnvoieUserWalletToWalletGetCommissionReducer from "./EnvoieUserWalletToWalletGetCommissionReducer";
|
||||
import EnvoieUserWalletToWalletReducer from "./EnvoieUserWalletToWalletReducer";
|
||||
import GetDemandsGroupReducer from "./GetDemandsGroupReducer";
|
||||
import GetNanoCreditDemandDetailReducer from "./GetNanoCreditDemandDetailReducer";
|
||||
import GetNanoCreditDemandDurationReducer from "./GetNanoCreditDemandDurationReducer";
|
||||
import GetNotificationReducer from "./GetNotificationReducer";
|
||||
import GetNumberInformation from "./GetNumberInformation";
|
||||
import GetUniqueDemandsGroupReducer from "./GetUniqueDemandsGroupReducer";
|
||||
import GetUserGroupDetailReducer from "./GetUserGroupDetailReducer";
|
||||
import GetUserIdentificationReducer from "./GetUserIdentificationReducer";
|
||||
import CreateIdentificationReducer from "./IdentificationReducer";
|
||||
import JoinGroupReducer from "./JoinGroupReducer";
|
||||
import LinkCardReducer from "./LinkCardReducer";
|
||||
import PayCountryNetworkReducer from "./PayCountryNetworkReducer";
|
||||
import RefundCreditDemandUserReducer from "./RefundCreditDemandUserReducer";
|
||||
import RetraitCashAgentIdVerificationReducer from "./RetraitCashAgentIdVerificationReducer";
|
||||
import SaveOnesignalReducer from "./SaveOnesignalReducer";
|
||||
import TreatDemandGroupReducer from "./TreatDemandGroupReducer";
|
||||
import ValidateIdentificationReducer from "./ValidateIdentificationReducer";
|
||||
import walletDetailReducer from "./WalletDetailReducer.js";
|
||||
import WalletGetCommissionReducer from "./WalletGetCommissionReducer";
|
||||
import walletReducer from "./WalletReducer";
|
||||
import walletHistoryReducer from "./WalletTransactionHistoryReducer";
|
||||
import walletTransferCommissionReducer from "./WalletTransferCommission";
|
||||
import CountryByDialCodeReducer from "./CountryByDialCodeReducer";
|
||||
import EnvoieUserWalletToWalletReducer from "./EnvoieUserWalletToWalletReducer";
|
||||
import EnvoieUserWalletToWalletGetCommissionReducer from "./EnvoieUserWalletToWalletGetCommissionReducer";
|
||||
import EnvoieUserWalletToCashReducer from "./EnvoieUserWalletToCashReducer";
|
||||
import EnvoieUserWalletToCashGetCommissionReducer from "./EnvoieUserWalletToCashGetCommissionReducer";
|
||||
import EnvoieUserWalletToCardReducer from "./EnvoieUserWalletToCardReducer";
|
||||
import EnvoieUserWalletToCardGetCommissionReducer from "./EnvoieUserWalletToCardGetCommissionReducer";
|
||||
import LinkCardReducer from "./LinkCardReducer";
|
||||
import RetraitCashAgentIdVerificationReducer from "./RetraitCashAgentIdVerificationReducer";
|
||||
import CreateGroupReducer from "./CreateGroupReducer";
|
||||
import SaveOnesignalReducer from "./SaveOnesignalReducer";
|
||||
import GetDemandsGroupReducer from "./GetDemandsGroupReducer";
|
||||
import GetUniqueDemandsGroupReducer from "./GetUniqueDemandsGroupReducer";
|
||||
import TreatDemandGroupReducer from "./TreatDemandGroupReducer";
|
||||
import JoinGroupReducer from "./JoinGroupReducer";
|
||||
import GetUserGroupDetailReducer from "./GetUserGroupDetailReducer";
|
||||
import GetNotificationReducer from "./GetNotificationReducer";
|
||||
import AskNanoCreditReducer from "./AskNanoCreditReducer";
|
||||
import GetNanoCreditDemandDurationReducer from "./GetNanoCreditDemandDurationReducer";
|
||||
import EpargnerArgentUserReducer from "./EpargnerArgentUserReducer";
|
||||
import CasserEpargneUserReducer from "./CasserEpargneUserReducer";
|
||||
|
||||
const persistConfig = {
|
||||
key: 'root',
|
||||
|
@ -78,6 +83,11 @@ const rootReducer = persistCombineReducers(persistConfig, {
|
|||
getNotificationReducer: GetNotificationReducer,
|
||||
askNanoCreditReducer: AskNanoCreditReducer,
|
||||
getNanoCreditDemandDurationReducer: GetNanoCreditDemandDurationReducer,
|
||||
cautionCreditDemandAgentReducer: CautionCreditDemandAgentReducer,
|
||||
refundCreditDemandReducer: RefundCreditDemandUserReducer,
|
||||
getNanoCreditDemandDetailReducer: GetNanoCreditDemandDetailReducer,
|
||||
epargnerArgentUserReducer: EpargnerArgentUserReducer,
|
||||
casserEpargneUserReducer: CasserEpargneUserReducer
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -42,3 +42,28 @@ export const GET_NANO_CREDIT_DEMAND_DURATION_PENDING = 'GET_NANO_CREDIT_DEMAND_D
|
|||
export const GET_NANO_CREDIT_DEMAND_DURATION_SUCCESS = 'GET_NANO_CREDIT_DEMAND_DURATION_SUCCESS';
|
||||
export const GET_NANO_CREDIT_DEMAND_DURATION_ERROR = 'GET_NANO_CREDIT_DEMAND_DURATION_ERROR';
|
||||
export const GET_NANO_CREDIT_DEMAND_DURATION_RESET = 'GET_NANO_CREDIT_DEMAND_DURATION_RESET';
|
||||
|
||||
export const REFUND_CREDIT_DEMAND_USER_PENDING = 'REFUND_CREDIT_DEMAND_USER_PENDING';
|
||||
export const REFUND_CREDIT_DEMAND_USER_SUCCESS = 'REFUND_CREDIT_DEMAND_USER_SUCCESS';
|
||||
export const REFUND_CREDIT_DEMAND_USER_ERROR = 'REFUND_CREDIT_DEMAND_USER_ERROR';
|
||||
export const REFUND_CREDIT_DEMAND_USER_RESET = 'REFUND_CREDIT_DEMAND_USER_RESET';
|
||||
|
||||
export const CAUTION_CREDIT_DEMAND_AGENT_PENDING = 'CAUTION_CREDIT_DEMAND_AGENT_PENDING';
|
||||
export const CAUTION_CREDIT_DEMAND_AGENT_SUCCESS = 'CAUTION_CREDIT_DEMAND_AGENT_SUCCESS';
|
||||
export const CAUTION_CREDIT_DEMAND_AGENT_ERROR = 'CAUTION_CREDIT_DEMAND_AGENT_ERROR';
|
||||
export const CAUTION_CREDIT_DEMAND_AGENT_RESET = 'CAUTION_CREDIT_DEMAND_AGENT_RESET';
|
||||
|
||||
export const GET_NANO_CREDIT_DEMAND_DETAIL_PENDING = 'GET_NANO_CREDIT_DEMAND_DETAIL_PENDING';
|
||||
export const GET_NANO_CREDIT_DEMAND_DETAIL_SUCCESS = 'GET_NANO_CREDIT_DEMAND_DETAIL_SUCCESS';
|
||||
export const GET_NANO_CREDIT_DEMAND_DETAIL_ERROR = 'GET_NANO_CREDIT_DEMAND_DETAIL_ERROR';
|
||||
export const GET_NANO_CREDIT_DEMAND_DETAIL_RESET = 'GET_NANO_CREDIT_DEMAND_DETAIL_RESET';
|
||||
|
||||
export const EPARGNER_ARGENT_USER_PENDING = 'EPARGNER_ARGENT_USER_PENDING';
|
||||
export const EPARGNER_ARGENT_USER_SUCCESS = 'EPARGNER_ARGENT_USER_SUCCESS';
|
||||
export const EPARGNER_ARGENT_USER_ERROR = 'EPARGNER_ARGENT_USER_ERROR';
|
||||
export const EPARGNER_ARGENT_USER_RESET = 'EPARGNER_ARGENT_USER_RESET';
|
||||
|
||||
export const CASSER_EPARGNE_USER_PENDING = 'CASSER_EPARGNE_USER_PENDING';
|
||||
export const CASSER_EPARGNE_USER_SUCCESS = 'CASSER_EPARGNE_USER_SUCCESS';
|
||||
export const CASSER_EPARGNE_USER_ERROR = 'CASSER_EPARGNE_USER_ERROR';
|
||||
export const CASSER_EPARGNE_USER_RESET = 'CASSER_EPARGNE_USER_RESET';
|
||||
|
|
|
@ -58,5 +58,9 @@
|
|||
"demandGroupNanoCreditDetail": "demandeValidationGroupe",
|
||||
"adhererGroupNanoCredit": "adhererGroupNanoCredit",
|
||||
"myNanoCreditGroup": "myNanoCreditGroup",
|
||||
"askNanoCredit": "askNanoCredit"
|
||||
"askNanoCredit": "askNanoCredit",
|
||||
"refundNanoCreditUser": "refundNanoCreditUser",
|
||||
"cautionNanoCreditAgent": "cautionNanoCreditAgent",
|
||||
"epargnerArgentUser": "epargnerArgentUser",
|
||||
"casserEpargneUser": "casserEpargneUser"
|
||||
}
|
||||
|
|
|
@ -1426,7 +1426,7 @@ class Home extends BaseScreen {
|
|||
translucent={true}
|
||||
/>
|
||||
{/* Start here to comment */}
|
||||
{/* {
|
||||
{/* {
|
||||
(this.state.loadingDialog || this.props.loading) ?
|
||||
<View
|
||||
style={{ position: "absolute", zIndex: 1, backgroundColor: "#00000050", width: this.state.loadingDialog ? responsiveWidth(100) : 0, height: this.state.loadingDialog ? responsiveHeight(100) : 0, flex: 1, justifyContent: 'center', alignItems: 'center' }}
|
||||
|
|
|
@ -70,6 +70,7 @@ class AskNanoCredit extends Component {
|
|||
isModalConfirmVisible: false,
|
||||
typeCaution: typeCaution(),
|
||||
typeCautionName: (typeCaution()[0]).name,
|
||||
typeCautionToSend: 'groupe',
|
||||
wallet: store.getState().walletDetailReducer.result.response
|
||||
};
|
||||
|
||||
|
@ -187,14 +188,14 @@ class AskNanoCredit extends Component {
|
|||
}
|
||||
|
||||
|
||||
renderCreateGroupReponse = () => {
|
||||
renderAskNanoCreditResponse = () => {
|
||||
|
||||
const { result, error } = this.props;
|
||||
|
||||
if (error !== null) {
|
||||
if (typeof error.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t("ERROR_JOIN_GROUP"),
|
||||
I18n.t("ERROR_LABLE"),
|
||||
error.data.error,
|
||||
[
|
||||
{
|
||||
|
@ -211,7 +212,7 @@ class AskNanoCredit extends Component {
|
|||
if (result !== null) {
|
||||
if (result.response !== null) {
|
||||
Alert.alert(
|
||||
I18n.t("SUCCES_JOIN_GROUP"),
|
||||
I18n.t("DEMAND_SEND"),
|
||||
result.response,
|
||||
[
|
||||
{
|
||||
|
@ -248,7 +249,7 @@ class AskNanoCredit extends Component {
|
|||
|
||||
this.props.askNanoCreditAction({
|
||||
id_user: this.state.user.id,
|
||||
type_caution: this.state.typeCautionName === I18n.t('GROUP') ? 'groupe' : 'individuel',
|
||||
type_caution: this.state.typeCautionToSend,
|
||||
duree_mois: this.state.durationSelect,
|
||||
montant: this.state.montant,
|
||||
password: this.state.password
|
||||
|
@ -275,7 +276,7 @@ class AskNanoCredit extends Component {
|
|||
return (
|
||||
<>
|
||||
{(this.props.loading || this.props.loadingGetNanoCredit || this.state.modalVisible) && this.renderLoader()}
|
||||
{this.state.isDataSubmit && this.renderCreateGroupReponse()}
|
||||
{this.state.isDataSubmit && this.renderAskNanoCreditResponse()}
|
||||
{!this.state.hasLoadDuration && this.renderGetDurationesponse()}
|
||||
<ScrollView style={styles.container}>
|
||||
|
||||
|
@ -323,9 +324,15 @@ class AskNanoCredit extends Component {
|
|||
value={this.state.typeCautionName}
|
||||
onChangeText={(value, index, data) => {
|
||||
if (value === I18n.t('INDIVIDUAL'))
|
||||
this.setState({ typeCautionName: 'individual' });
|
||||
this.setState({
|
||||
typeCautionToSend: 'individuel',
|
||||
typeCautionName: I18n.t('INDIVIDUAL')
|
||||
});
|
||||
else
|
||||
this.setState({ typeCautionName: 'groupe' })
|
||||
this.setState({
|
||||
typeCautionToSend: 'groupe',
|
||||
typeCautionName: I18n.t('GROUP')
|
||||
})
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
|
|
|
@ -0,0 +1,286 @@
|
|||
import Button from 'apsl-react-native-button';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isNil from 'lodash/isNil';
|
||||
import React, { Component } from 'react';
|
||||
import { Alert, ScrollView, StyleSheet, Text, View } from 'react-native';
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import I18n from 'react-native-i18n';
|
||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
||||
import { Fumi } from 'react-native-textinput-effects';
|
||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { Color } from '../../config/Color';
|
||||
import { FontWeight, Typography } from '../../config/typography';
|
||||
import { store } from "../../redux/store";
|
||||
import { IlinkEmitter } from '../../utils/events';
|
||||
import { readUser } from '../../webservice/AuthApi';
|
||||
import { createGroupAction, createGroupReset } from '../../webservice/NanoCreditApi';
|
||||
import { isNormalInteger } from '../../utils/UtilsFunction';
|
||||
import { casserEpargneUserAction, casserEpargneUserReset } from '../../webservice/user/NanoCreditApi';
|
||||
let theme = require('../../utils/theme.json');
|
||||
let route = require('../../route.json');
|
||||
|
||||
|
||||
class CasserEpargneUser extends Component {
|
||||
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
password: null,
|
||||
idEpargne: null,
|
||||
codeGroup: null,
|
||||
loading: false,
|
||||
user: null,
|
||||
triggerSubmitClick: false,
|
||||
isSubmitClick: false,
|
||||
isDataSubmit: false,
|
||||
isModalConfirmVisible: false,
|
||||
isGroupToModify: false,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
static navigatorStyle = {
|
||||
navBarBackgroundColor: Color.primaryColor,
|
||||
statusBarColor: Color.primaryDarkColor,
|
||||
navBarTextColor: '#FFFFFF',
|
||||
navBarButtonColor: '#FFFFFF'
|
||||
|
||||
};
|
||||
|
||||
static navigationOptions = () => {
|
||||
return {
|
||||
drawerLabel: () => null,
|
||||
headerTitle: I18n.t('BREAK_EPARGNE'),
|
||||
headerTintColor: 'white',
|
||||
headerStyle: {
|
||||
backgroundColor: Color.primaryColor,
|
||||
marginTop: 0,
|
||||
color: 'white'
|
||||
},
|
||||
headerTitleStyle: {
|
||||
color: "white"
|
||||
},
|
||||
title: I18n.t('BREAK_EPARGNE')
|
||||
}
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
this.setState({ user });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ckeckIfFieldIsOK(champ) {
|
||||
return (isNil(champ) || isEqual(champ.length, 0));
|
||||
}
|
||||
|
||||
renderBreakEpargneRespons = () => {
|
||||
|
||||
const { result, error } = this.props;
|
||||
|
||||
if (error !== null) {
|
||||
if (typeof error.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t("ERROR_LABLE"),
|
||||
error.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.casserEpargneUserReset();
|
||||
}
|
||||
}
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (result !== null) {
|
||||
if (result.response !== null) {
|
||||
Alert.alert(
|
||||
I18n.t("BREAK_EPARGNE_DONE"),
|
||||
result.response,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.casserEpargneUserReset();
|
||||
IlinkEmitter.emit("refreshWallet");
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateLangue() {
|
||||
this.props.navigation.setParams({ name: I18n.t('REFUND_NANO_CREDIT') })
|
||||
this.forceUpdate()
|
||||
}
|
||||
|
||||
ckeckIfFieldIsOK(champ) {
|
||||
return (isNil(champ) || isEqual(champ.length, 0));
|
||||
}
|
||||
|
||||
onCasserEpargne = () => {
|
||||
const { idEpargne, password } = this.state;
|
||||
|
||||
if (this.ckeckIfFieldIsOK(idEpargne))
|
||||
this.idEpargneAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(password))
|
||||
this.passwordAnim.shake(800);
|
||||
else {
|
||||
|
||||
this.props.casserEpargneUserAction({
|
||||
id_user: this.state.user.id,
|
||||
id_epargne: this.state.idEpargne,
|
||||
password: this.state.password
|
||||
}, 0);
|
||||
}
|
||||
this.setState({
|
||||
isDataSubmit: true
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
renderLoader = () => {
|
||||
return (
|
||||
<ProgressDialog
|
||||
visible={this.props.loading || this.props.loadingGetCommission}
|
||||
title={I18n.t('LOADING')}
|
||||
message={I18n.t('LOADING_INFO')}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
{(this.props.loading || this.props.loadingGetCommission) && this.renderLoader()}
|
||||
{this.state.isDataSubmit && this.renderBreakEpargneRespons()}
|
||||
<ScrollView style={styles.container}>
|
||||
|
||||
<Text style={styles.subbigtitle}>{I18n.t('DEMAND_INFO')}</Text>
|
||||
|
||||
<Animatable.View ref={(comp) => { idEpargneAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
|
||||
label={I18n.t('ID_EPARGNE')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.idEpargne}
|
||||
onChangeText={(idEpargne) => {
|
||||
|
||||
this.setState({ idEpargne })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
|
||||
<Animatable.View ref={(comp) => { this.passwordAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
||||
label={I18n.t('PASSWORD')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
secureTextEntry={true}
|
||||
value={this.state.password}
|
||||
onChangeText={(password) => {
|
||||
this.setState({ password })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Button style={styles.btnvalide}
|
||||
textStyle={styles.textbtnvalide}
|
||||
onPress={() => { this.onSubmitCasserEpargne(); }}>
|
||||
{this.state.isGroupToModify ? I18n.t('MODIFY') : I18n.t('SUBMIT_LABEL')}</Button>
|
||||
</ScrollView>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const maptStateToProps = state => ({
|
||||
|
||||
loading: state.casserEpargneUserReducer.loading,
|
||||
result: state.casserEpargneUserReducer.result,
|
||||
error: state.casserEpargneUserReducer.error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
|
||||
casserEpargneUserAction,
|
||||
casserEpargneUserReset,
|
||||
|
||||
}, dispatch);
|
||||
|
||||
export default connect(maptStateToProps, mapDispatchToProps)(CasserEpargneUser);
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: Color.primaryDarkColor,
|
||||
},
|
||||
textbtnvalide: {
|
||||
color: 'white',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
bigtitle: {
|
||||
color: 'white',
|
||||
fontSize: 20,
|
||||
flex: 1,
|
||||
fontWeight: 'bold',
|
||||
textAlign: 'center',
|
||||
margin: 20,
|
||||
},
|
||||
blockView: {
|
||||
paddingVertical: 10,
|
||||
borderBottomWidth: 1
|
||||
},
|
||||
subbigtitle: {
|
||||
color: 'white',
|
||||
fontSize: 17,
|
||||
textAlign: 'center',
|
||||
margin: 5,
|
||||
},
|
||||
btnvalide: {
|
||||
marginTop: 20,
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: Color.accentLightColor,
|
||||
height: 52
|
||||
},
|
||||
btnSubmit: {
|
||||
marginTop: 20,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: Color.accentLightColor,
|
||||
height: 52,
|
||||
width: "30%",
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
},
|
||||
input: {
|
||||
height: 60,
|
||||
marginTop: responsiveHeight(2),
|
||||
marginLeft: responsiveWidth(5),
|
||||
marginRight: responsiveWidth(5),
|
||||
borderRadius: 5,
|
||||
}
|
||||
});
|
|
@ -0,0 +1,507 @@
|
|||
import Button from 'apsl-react-native-button';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isNil from 'lodash/isNil';
|
||||
import React, { Component } from 'react';
|
||||
import { Alert, ScrollView, StyleSheet, Text, View } from 'react-native';
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import Dialog from "react-native-dialog";
|
||||
import I18n from 'react-native-i18n';
|
||||
import { store } from "../../redux/store";
|
||||
import { Dropdown } from 'react-native-material-dropdown';
|
||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
||||
import { Fumi } from 'react-native-textinput-effects';
|
||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { Color } from '../../config/Color';
|
||||
import { FontWeight, Typography } from '../../config/typography';
|
||||
import { IlinkEmitter } from '../../utils/events';
|
||||
import { cautionCreditDemandAgentAction, cautionCreditDemandAgentReset, getNanoCreditDemandDetailAction, getNanoCreditDemandDetailReset } from '../../webservice/agent/NanoCreditAgentApi';
|
||||
import { readUser } from '../../webservice/AuthApi';
|
||||
import { withdrawalMode } from '../../utils/UtilsFunction';
|
||||
import thousands from 'thousands';
|
||||
const moment = require('moment');
|
||||
|
||||
let theme = require('../../utils/theme.json');
|
||||
let route = require('../../route.json');
|
||||
|
||||
|
||||
class CautionNanoCreditAgent extends Component {
|
||||
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
password: null,
|
||||
idDemand: null,
|
||||
codeGroup: null,
|
||||
loading: false,
|
||||
user: null,
|
||||
triggerSubmitClick: false,
|
||||
isSubmitClick: false,
|
||||
isDataSubmit: false,
|
||||
withdrawalInCashType: withdrawalMode(),
|
||||
withdrawalInCashTypeName: withdrawalMode()[0].name,
|
||||
isModalConfirmVisible: false,
|
||||
isGroupToModify: false,
|
||||
isModalConfirmVisible: false,
|
||||
withdrawalInCash: true,
|
||||
wallet: store.getState().walletDetailReducer.result.response
|
||||
};
|
||||
|
||||
this.props.getNanoCreditDemandDetailReset();
|
||||
this.props.cautionCreditDemandAgentReset();
|
||||
|
||||
}
|
||||
|
||||
static navigatorStyle = {
|
||||
navBarBackgroundColor: Color.primaryColor,
|
||||
statusBarColor: Color.primaryDarkColor,
|
||||
navBarTextColor: '#FFFFFF',
|
||||
navBarButtonColor: '#FFFFFF'
|
||||
|
||||
};
|
||||
|
||||
static navigationOptions = () => {
|
||||
return {
|
||||
drawerLabel: () => null,
|
||||
headerTitle: I18n.t('REFUND_NANO_CREDIT'),
|
||||
headerTintColor: 'white',
|
||||
headerStyle: {
|
||||
backgroundColor: Color.primaryColor,
|
||||
marginTop: 0,
|
||||
color: 'white'
|
||||
},
|
||||
headerTitleStyle: {
|
||||
color: "white"
|
||||
},
|
||||
title: I18n.t('REFUND_NANO_CREDIT')
|
||||
}
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
this.setState({ user });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
|
||||
if (nextProps.resultGetNanoCreditDemandDetail != null) {
|
||||
|
||||
if (typeof nextProps.resultGetNanoCreditDemandDetail.response !== 'undefined') {
|
||||
|
||||
if (!nextProps.loadingGetNanoCreditDemandDetail)
|
||||
this.setState({
|
||||
isModalConfirmVisible: true
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
modalConfirmTransaction = (data) => {
|
||||
const idDemand = data.response.id_demande;
|
||||
const montant = data.response.montant;
|
||||
const duree = data.response.duree_mois;
|
||||
const etat = data.response.etat;
|
||||
const taxe = data.response.taxe;
|
||||
const interet = data.response.interet;
|
||||
const dateDemand = data.response.date_demande;
|
||||
const dateRemboursementPrevu = data.response.date_remboursement_prevu;
|
||||
const dateRemboursement = data.response.date_remboursement;
|
||||
const retraitCash = data.response.retrait_cash;
|
||||
const dateCreation = data.response.date_creation;
|
||||
|
||||
return (
|
||||
|
||||
<Dialog.Container useNativeDriver={true} visible={this.state.isModalConfirmVisible}>
|
||||
|
||||
<Dialog.Title>{I18n.t('DEMAND_DETAIL')}</Dialog.Title>
|
||||
|
||||
<View>
|
||||
|
||||
<View style={[styles.blockView, { borderBottomColor: Color.borderColor }]}>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text style={[styles.body2]}>{I18n.t('ID_DEMAND')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{idDemand}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text style={[styles.body2]}>{I18n.t('AMOUNT')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(montant, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text tyle={[Typography.body2]}>{I18n.t('TAXES')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(taxe, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text tyle={[Typography.body2]}>{I18n.t('INTERET')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{`${thousands(interet, ' ')} ${this.state.wallet.currency_code}`}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text tyle={[Typography.body2]}>{I18n.t('WITHDRAWAL_TYPE')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{retraitCash ? I18n.t('WITHDRAWAL_IN_CASH') : I18n.t('TRANSFER_IN_ACCOUNT')}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text tyle={[Typography.body2]}>{I18n.t('ETAT')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{I18n.t(etat)}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text tyle={[Typography.body2]}>{I18n.t('DEMAND_DURATION_IN_MONTH')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{duree}</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View style={{ flexDirection: 'row', marginTop: 10 }}>
|
||||
<View style={{ flex: 1 }}>
|
||||
<Text tyle={[Typography.body2]}>{I18n.t('CREATION_DATE')}</Text>
|
||||
</View>
|
||||
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
||||
<Text style={[Typography.caption1, Color.grayColor]}>{moment(dateCreation).format('DD-MM-YYYY')}</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
<Dialog.Button bold={true} label={I18n.t('CANCEL_LABEL')} onPress={() => {
|
||||
this.setState({
|
||||
isModalConfirmVisible: false
|
||||
});
|
||||
}} />
|
||||
<Dialog.Button bold={true} label={I18n.t('SUBMIT_LABEL')} onPress={() => {
|
||||
this.setState({
|
||||
isModalConfirmVisible: false,
|
||||
isDataSubmit: true
|
||||
});
|
||||
this.props.cautionCreditDemandAgentAction({
|
||||
id_demande: this.state.idDemand,
|
||||
id_wallet_agent: this.state.wallet.id,
|
||||
retrait_cash: this.state.withdrawalInCash,
|
||||
password: this.state.password
|
||||
});
|
||||
this.props.getNanoCreditDemandDetailReset();
|
||||
}} />
|
||||
|
||||
</Dialog.Container>
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
ckeckIfFieldIsOK(champ) {
|
||||
return (isNil(champ) || isEqual(champ.length, 0));
|
||||
}
|
||||
|
||||
renderRefundNanoCreditResponse = () => {
|
||||
|
||||
const { result, error } = this.props;
|
||||
|
||||
if (error !== null) {
|
||||
if (typeof error.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t("ERROR_LABLE"),
|
||||
error.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.cautionCreditDemandAgentReset();
|
||||
IlinkEmitter.emit("refreshWallet");
|
||||
}
|
||||
}
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (result !== null) {
|
||||
if (result.response !== null) {
|
||||
Alert.alert(
|
||||
I18n.t("REFUND_DONE"),
|
||||
result.response,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.cautionCreditDemandAgentReset();
|
||||
IlinkEmitter.emit("refreshWallet");
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateLangue() {
|
||||
this.props.navigation.setParams({ name: I18n.t('REFUND_NANO_CREDIT') })
|
||||
this.forceUpdate()
|
||||
}
|
||||
|
||||
ckeckIfFieldIsOK(champ) {
|
||||
return (isNil(champ) || isEqual(champ.length, 0));
|
||||
}
|
||||
|
||||
onSubmitSendWalletToCard = () => {
|
||||
const { idDemand, password } = this.state;
|
||||
|
||||
if (this.ckeckIfFieldIsOK(idDemand))
|
||||
this.idDemandAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(password))
|
||||
this.passwordAnim.shake(800);
|
||||
else {
|
||||
|
||||
this.props.getNanoCreditDemandDetailAction(this.state.idDemand);
|
||||
}
|
||||
this.setState({
|
||||
triggerSubmitClick: true
|
||||
});
|
||||
}
|
||||
|
||||
renderGetNanoCreditDemandDetailResponse = () => {
|
||||
const { resultGetNanoCreditDemandDetail, errorGetNanoCreditDemandDetail } = this.props;
|
||||
|
||||
if (errorGetNanoCreditDemandDetail !== null) {
|
||||
if (typeof errorGetNanoCreditDemandDetail.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
errorGetNanoCreditDemandDetail.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getNanoCreditDemandDetailReset();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
JSON.stringify(errorGetNanoCreditDemandDetail),
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getNanoCreditDemandDetailAction();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
renderLoader = () => {
|
||||
return (
|
||||
<ProgressDialog
|
||||
visible={this.props.loading || this.props.loadingGetNanoCreditDemandDetail}
|
||||
title={I18n.t('LOADING')}
|
||||
message={I18n.t('LOADING_INFO')}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
render() {
|
||||
const { resultGetNanoCreditDemandDetail } = this.props;
|
||||
|
||||
return (
|
||||
<>
|
||||
{(this.props.loading || this.props.loadingGetNanoCreditDemandDetail) && this.renderLoader()}
|
||||
{this.state.isDataSubmit && this.renderRefundNanoCreditResponse()}
|
||||
{
|
||||
(resultGetNanoCreditDemandDetail !== null) &&
|
||||
(typeof resultGetNanoCreditDemandDetail.response !== 'undefined') &&
|
||||
this.modalConfirmTransaction(resultGetNanoCreditDemandDetail)
|
||||
}
|
||||
<ScrollView style={styles.container}>
|
||||
|
||||
<Text style={styles.subbigtitle}>{I18n.t('DEMAND_INFO')}</Text>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.idDemandAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
|
||||
label={I18n.t('ID_DEMAND')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.idDemand}
|
||||
onChangeText={(idDemand) => {
|
||||
|
||||
this.setState({ idDemand })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.typeRetraitAnim = comp }}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('WITHDRAWAL_TYPE')}
|
||||
data={this.state.withdrawalInCashType}
|
||||
useNativeDriver={true}
|
||||
value={this.state.withdrawalInCashTypeName}
|
||||
onChangeText={(value, index, data) => {
|
||||
if (value === I18n.t('WITHDRAWAL_IN_CASH'))
|
||||
this.setState({
|
||||
withdrawalInCash: true,
|
||||
withdrawalInCashTypeName: I18n.t('WITHDRAWAL_IN_CASH')
|
||||
});
|
||||
else
|
||||
this.setState({
|
||||
withdrawalInCash: false,
|
||||
withdrawalInCashTypeName: I18n.t('TRANSFER_IN_ACCOUNT')
|
||||
})
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
|
||||
<Animatable.View ref={(comp) => { this.passwordAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
||||
label={I18n.t('PASSWORD')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
secureTextEntry={true}
|
||||
value={this.state.password}
|
||||
onChangeText={(password) => {
|
||||
this.setState({ password })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Button style={styles.btnvalide}
|
||||
textStyle={styles.textbtnvalide}
|
||||
onPress={() => { this.onSubmitSendWalletToCard(); }}>
|
||||
{this.state.isGroupToModify ? I18n.t('MODIFY') : I18n.t('SUBMIT_LABEL')}</Button>
|
||||
</ScrollView>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const maptStateToProps = state => ({
|
||||
|
||||
loading: state.cautionCreditDemandAgentReducer.loading,
|
||||
result: state.cautionCreditDemandAgentReducer.result,
|
||||
error: state.cautionCreditDemandAgentReducer.error,
|
||||
|
||||
loadingGetNanoCreditDemandDetail: state.getNanoCreditDemandDetailReducer.loading,
|
||||
resultGetNanoCreditDemandDetail: state.getNanoCreditDemandDetailReducer.result,
|
||||
errorGetNanoCreditDemandDetail: state.getNanoCreditDemandDetailReducer.error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
|
||||
cautionCreditDemandAgentAction,
|
||||
cautionCreditDemandAgentReset,
|
||||
|
||||
getNanoCreditDemandDetailAction,
|
||||
getNanoCreditDemandDetailReset
|
||||
|
||||
}, dispatch);
|
||||
|
||||
export default connect(maptStateToProps, mapDispatchToProps)(CautionNanoCreditAgent);
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: Color.primaryDarkColor,
|
||||
},
|
||||
textbtnvalide: {
|
||||
color: 'white',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
bigtitle: {
|
||||
color: 'white',
|
||||
fontSize: 20,
|
||||
flex: 1,
|
||||
fontWeight: 'bold',
|
||||
textAlign: 'center',
|
||||
margin: 20,
|
||||
},
|
||||
blockView: {
|
||||
paddingVertical: 10,
|
||||
borderBottomWidth: 1
|
||||
},
|
||||
subbigtitle: {
|
||||
color: 'white',
|
||||
fontSize: 17,
|
||||
textAlign: 'center',
|
||||
margin: 5,
|
||||
},
|
||||
btnvalide: {
|
||||
marginTop: 20,
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: Color.accentLightColor,
|
||||
height: 52
|
||||
},
|
||||
btnSubmit: {
|
||||
marginTop: 20,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: Color.accentLightColor,
|
||||
height: 52,
|
||||
width: "30%",
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
},
|
||||
input: {
|
||||
height: 60,
|
||||
marginTop: responsiveHeight(2),
|
||||
marginLeft: responsiveWidth(5),
|
||||
marginRight: responsiveWidth(5),
|
||||
borderRadius: 5,
|
||||
}
|
||||
});
|
|
@ -0,0 +1,475 @@
|
|||
import Button from 'apsl-react-native-button';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isNil from 'lodash/isNil';
|
||||
import React, { Component } from 'react';
|
||||
import { Alert, ScrollView, StyleSheet, Text, View } from 'react-native';
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import I18n from 'react-native-i18n';
|
||||
import { Dropdown } from 'react-native-material-dropdown';
|
||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
||||
import { Fumi } from 'react-native-textinput-effects';
|
||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { Color } from '../../config/Color';
|
||||
import { FontWeight, Typography } from '../../config/typography';
|
||||
import { store } from "../../redux/store";
|
||||
import { isNormalInteger, typeEpargne } from '../../utils/UtilsFunction';
|
||||
import { readUser } from '../../webservice/AuthApi';
|
||||
import { getNanoCreditDemandDurationAction, getNanoCreditDemandDurationReset } from '../../webservice/NanoCreditApi';
|
||||
import { epargnerArgentUserAction, epargnerArgentUserReset } from "../../webservice/user/NanoCreditApi";
|
||||
let theme = require('../../utils/theme.json');
|
||||
let route = require('../../route.json');
|
||||
|
||||
|
||||
class EpargnerArgentUser extends Component {
|
||||
|
||||
static navigatorStyle = {
|
||||
navBarBackgroundColor: Color.primaryColor,
|
||||
statusBarColor: Color.primaryDarkColor,
|
||||
navBarTextColor: '#FFFFFF',
|
||||
navBarButtonColor: '#FFFFFF'
|
||||
|
||||
};
|
||||
|
||||
static navigationOptions = () => {
|
||||
return {
|
||||
drawerLabel: () => null,
|
||||
headerTitle: I18n.t('SAVE_MONEY'),
|
||||
headerTintColor: 'white',
|
||||
headerStyle: {
|
||||
backgroundColor: Color.primaryColor,
|
||||
marginTop: 0,
|
||||
color: 'white'
|
||||
},
|
||||
headerTitleStyle: {
|
||||
color: "white"
|
||||
},
|
||||
title: I18n.t('SAVE_MONEY')
|
||||
}
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
codeGroupe: null,
|
||||
codeSponsor: null,
|
||||
nomGroupe: null,
|
||||
codeSponsor: null,
|
||||
user: null,
|
||||
montant: null,
|
||||
password: null,
|
||||
durations: [],
|
||||
durationSelect: null,
|
||||
triggerSubmitClick: false,
|
||||
hasLoadDuration: false,
|
||||
modalVisible: false,
|
||||
isSubmitClick: false,
|
||||
isDataSubmit: false,
|
||||
isModalConfirmVisible: false,
|
||||
typeEpargne: typeEpargne(),
|
||||
typeEpargneName: (typeEpargne()[0]).name,
|
||||
typeEpargneToSend: 'simple',
|
||||
wallet: store.getState().walletDetailReducer.result.response
|
||||
};
|
||||
|
||||
this.props.getNanoCreditDemandDurationReset();
|
||||
|
||||
readUser().then((user) => {
|
||||
console.log("USER", user);
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
this.props.getNanoCreditDemandDurationAction(user.id);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
this.setState({ user });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ckeckIfFieldIsOK(champ) {
|
||||
return (isNil(champ) || isEqual(champ.length, 0));
|
||||
}
|
||||
|
||||
isMontantValid = () => {
|
||||
const { montant } = this.state;
|
||||
if ((parseInt(isEqual(montant, 0)) || montant < 0))
|
||||
return {
|
||||
errorMessage: I18n.t('ENTER_AMOUNT_SUPERIOR_ZEROR'),
|
||||
isValid: false
|
||||
};
|
||||
|
||||
else if (!isNormalInteger(montant))
|
||||
return {
|
||||
errorMessage: I18n.t('ENTER_VALID_AMOUNT'),
|
||||
isValid: false
|
||||
};
|
||||
|
||||
|
||||
else if (montant > parseInt(this.state.comptePrincipal))
|
||||
return {
|
||||
errorMessage: I18n.t('AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT'),
|
||||
isValid: false
|
||||
};
|
||||
|
||||
else
|
||||
return {
|
||||
errorMessage: '',
|
||||
isValid: true
|
||||
};
|
||||
}
|
||||
|
||||
renderGetDurationesponse = () => {
|
||||
const { resultGetNanoCreditDuration, errorGetNanoCreditDuration } = this.props;
|
||||
if (resultGetNanoCreditDuration !== null) {
|
||||
if (typeof resultGetNanoCreditDuration.response !== 'undefined') {
|
||||
if (resultGetNanoCreditDuration.response.length > 0) {
|
||||
this.setState({
|
||||
hasLoadDuration: true,
|
||||
durations: resultGetNanoCreditDuration.response,
|
||||
durationSelect: resultGetNanoCreditDuration.response[0].value,
|
||||
modalVisible: false
|
||||
});
|
||||
}
|
||||
else if (resultGetNanoCreditDuration.response.length === 0) {
|
||||
this.setState({
|
||||
hasLoadDuration: true,
|
||||
durations: [],
|
||||
durationSelect: '',
|
||||
modalVisible: false
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (errorGetNanoCreditDuration !== null) {
|
||||
if (typeof errorGetNanoCreditDuration.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
errorGetNanoCreditDuration.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getNanoCreditDemandDurationReset();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
} else {
|
||||
Alert.alert(
|
||||
I18n.t('ERROR_LABEL'),
|
||||
JSON.stringify(errorGetNanoCreditDuration),
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.getNanoCreditDemandDurationReset();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
renderEpargnerArgentResponse = () => {
|
||||
|
||||
const { result, error } = this.props;
|
||||
|
||||
if (error !== null) {
|
||||
if (typeof error.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t("ERROR_LABLE"),
|
||||
error.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.epargnerArgentUserReset();
|
||||
}
|
||||
}
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (result !== null) {
|
||||
if (result.response !== null) {
|
||||
Alert.alert(
|
||||
I18n.t("EPARGNE_DEPOSE"),
|
||||
result.response,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.epargnerArgentUserReset();
|
||||
//IlinkEmitter.emit("treatNanoGroupDemand");
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateLangue() {
|
||||
this.props.navigation.setParams({ name: I18n.t('SAVE_MONEY') })
|
||||
this.forceUpdate()
|
||||
}
|
||||
|
||||
|
||||
onSubmitEpargnerArgent = () => {
|
||||
const { montant, typeEpargneName, durationSelect } = this.state;
|
||||
|
||||
if (this.ckeckIfFieldIsOK(typeEpargneName))
|
||||
this.typeEpargneAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(durationSelect))
|
||||
this.typeEpargneAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(montant) || !this.isMontantValid().isValid)
|
||||
this.montantAnim.shake(800);
|
||||
else {
|
||||
|
||||
this.props.epargnerArgentUserAction({
|
||||
id_user: this.state.user.id,
|
||||
type: this.state.typeEpargneToSend,
|
||||
duree_mois: this.state.durationSelect,
|
||||
montant: this.state.montant,
|
||||
password: this.state.password
|
||||
});
|
||||
|
||||
}
|
||||
this.setState({
|
||||
isDataSubmit: true
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
renderLoader = () => {
|
||||
return (
|
||||
<ProgressDialog
|
||||
visible={this.props.loading || this.props.loadingGetNanoCredit}
|
||||
title={I18n.t('LOADING')}
|
||||
message={I18n.t('LOADING_INFO')}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
{(this.props.loading || this.props.loadingGetNanoCredit || this.state.modalVisible) && this.renderLoader()}
|
||||
{this.state.isDataSubmit && this.renderEpargnerArgentResponse()}
|
||||
{!this.state.hasLoadDuration && this.renderGetDurationesponse()}
|
||||
<ScrollView style={styles.container}>
|
||||
|
||||
<Text style={styles.subbigtitle}>{I18n.t('FILL_INFORMATION')}</Text>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.typeEpargneAnim = comp }}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('DEMAND_DURATION_IN_MONTH')}
|
||||
data={this.state.durations}
|
||||
useNativeDriver={true}
|
||||
value={this.state.durationSelect !== null ? this.state.durationSelect : ''}
|
||||
onChangeText={(value, index, data) => {
|
||||
this.setState({ durationSelect: value });
|
||||
}}
|
||||
valueExtractor={(value) => { return value.value }}
|
||||
labelExtractor={(value) => { return value.value }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.typeEpargneAnim = comp }}
|
||||
style={{
|
||||
width: responsiveWidth(90),
|
||||
height: 60,
|
||||
marginTop: 20,
|
||||
alignSelf: 'center',
|
||||
borderRadius: 10,
|
||||
paddingLeft: 20,
|
||||
paddingRight: 20,
|
||||
backgroundColor: 'white'
|
||||
}}>
|
||||
<Dropdown
|
||||
label={I18n.t('SAVE_MONEY_TYPE')}
|
||||
data={this.state.typeEpargne}
|
||||
useNativeDriver={true}
|
||||
value={this.state.typeEpargneName}
|
||||
onChangeText={(value, index, data) => {
|
||||
if (value === I18n.t('SIMPLE'))
|
||||
this.setState({
|
||||
typeEpargneToSend: 'simple',
|
||||
typeEpargneName: I18n.t('SIMPLE')
|
||||
});
|
||||
else
|
||||
this.setState({
|
||||
typeEpargneToSend: 'blocked',
|
||||
typeEpargneName: I18n.t('BLOCKED')
|
||||
})
|
||||
}}
|
||||
valueExtractor={(value) => { return value.name }}
|
||||
labelExtractor={(value) => { return value.name }}
|
||||
/>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.montantAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'money'}
|
||||
label={I18n.t('AMOUNT')}
|
||||
iconColor={'#f95a25'}
|
||||
keyboardType='numeric'
|
||||
iconSize={20}
|
||||
value={this.state.montant}
|
||||
onChangeText={(montant) => {
|
||||
this.setState({ montant })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
<View style={{
|
||||
position: 'absolute',
|
||||
left: responsiveWidth(82),
|
||||
top: 35,
|
||||
flexDirection: 'row'
|
||||
}}>
|
||||
<View
|
||||
style={{
|
||||
width: 1,
|
||||
borderLeftColor: '#f0f0f0',
|
||||
height: 40,
|
||||
left: -8,
|
||||
top: -10,
|
||||
borderLeftWidth: 1,
|
||||
|
||||
}}
|
||||
/>
|
||||
<Text style={[Typography.body1, FontWeight.bold]}>{this.state.wallet.currency_code}</Text>
|
||||
</View>
|
||||
</Animatable.View>
|
||||
|
||||
<Animatable.View ref={(comp) => { this.passwordAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
||||
label={I18n.t('PASSWORD')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
secureTextEntry={true}
|
||||
value={this.state.password}
|
||||
onChangeText={(password) => {
|
||||
this.setState({ password })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Button style={styles.btnvalide}
|
||||
textStyle={styles.textbtnvalide}
|
||||
onPress={() => { this.onSubmitEpargnerArgent(); }}>
|
||||
{I18n.t('SUBMIT_LABEL')}</Button>
|
||||
</ScrollView>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const maptStateToProps = state => ({
|
||||
|
||||
loading: state.epargnerArgentUserReducer.loading,
|
||||
result: state.epargnerArgentUserReducer.result,
|
||||
error: state.epargnerArgentUserReducer.error,
|
||||
|
||||
loadingGetNanoCreditDuration: state.getNanoCreditDemandDurationReducer.loading,
|
||||
resultGetNanoCreditDuration: state.getNanoCreditDemandDurationReducer.result,
|
||||
errorGetNanoCreditDuration: state.getNanoCreditDemandDurationReducer.error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
|
||||
epargnerArgentUserAction,
|
||||
epargnerArgentUserReset,
|
||||
|
||||
getNanoCreditDemandDurationAction,
|
||||
getNanoCreditDemandDurationReset
|
||||
|
||||
}, dispatch);
|
||||
|
||||
export default connect(maptStateToProps, mapDispatchToProps)(EpargnerArgentUser);
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: Color.primaryDarkColor,
|
||||
},
|
||||
textbtnvalide: {
|
||||
color: 'white',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
bigtitle: {
|
||||
color: 'white',
|
||||
fontSize: 20,
|
||||
flex: 1,
|
||||
fontWeight: 'bold',
|
||||
textAlign: 'center',
|
||||
margin: 20,
|
||||
},
|
||||
blockView: {
|
||||
paddingVertical: 10,
|
||||
borderBottomWidth: 1
|
||||
},
|
||||
subbigtitle: {
|
||||
color: 'white',
|
||||
fontSize: 17,
|
||||
textAlign: 'center',
|
||||
margin: 5,
|
||||
},
|
||||
btnvalide: {
|
||||
marginTop: 20,
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: Color.accentLightColor,
|
||||
height: 52
|
||||
},
|
||||
btnSubmit: {
|
||||
marginTop: 20,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: Color.accentLightColor,
|
||||
height: 52,
|
||||
width: "30%",
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
},
|
||||
input: {
|
||||
height: 60,
|
||||
marginTop: responsiveHeight(2),
|
||||
marginLeft: responsiveWidth(5),
|
||||
marginRight: responsiveWidth(5),
|
||||
borderRadius: 5,
|
||||
}
|
||||
});
|
|
@ -0,0 +1,286 @@
|
|||
import Button from 'apsl-react-native-button';
|
||||
import isEqual from 'lodash/isEqual';
|
||||
import isNil from 'lodash/isNil';
|
||||
import React, { Component } from 'react';
|
||||
import { Alert, ScrollView, StyleSheet, Text, View } from 'react-native';
|
||||
import * as Animatable from 'react-native-animatable';
|
||||
import I18n from 'react-native-i18n';
|
||||
import { responsiveHeight, responsiveWidth } from 'react-native-responsive-dimensions';
|
||||
import { ProgressDialog } from 'react-native-simple-dialogs';
|
||||
import { Fumi } from 'react-native-textinput-effects';
|
||||
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome';
|
||||
import { connect } from 'react-redux';
|
||||
import { bindActionCreators } from 'redux';
|
||||
import { Color } from '../../config/Color';
|
||||
import { FontWeight, Typography } from '../../config/typography';
|
||||
import { store } from "../../redux/store";
|
||||
import { IlinkEmitter } from '../../utils/events';
|
||||
import { readUser } from '../../webservice/AuthApi';
|
||||
import { createGroupAction, createGroupReset } from '../../webservice/NanoCreditApi';
|
||||
import { isNormalInteger } from '../../utils/UtilsFunction';
|
||||
import { refundCreditDemandUserAction, refundCreditDemandUserReset } from '../../webservice/user/NanoCreditApi';
|
||||
let theme = require('../../utils/theme.json');
|
||||
let route = require('../../route.json');
|
||||
|
||||
|
||||
class RefundNanoCreditUser extends Component {
|
||||
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
password: null,
|
||||
idDemand: null,
|
||||
codeGroup: null,
|
||||
loading: false,
|
||||
user: null,
|
||||
triggerSubmitClick: false,
|
||||
isSubmitClick: false,
|
||||
isDataSubmit: false,
|
||||
isModalConfirmVisible: false,
|
||||
isGroupToModify: false,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
static navigatorStyle = {
|
||||
navBarBackgroundColor: Color.primaryColor,
|
||||
statusBarColor: Color.primaryDarkColor,
|
||||
navBarTextColor: '#FFFFFF',
|
||||
navBarButtonColor: '#FFFFFF'
|
||||
|
||||
};
|
||||
|
||||
static navigationOptions = () => {
|
||||
return {
|
||||
drawerLabel: () => null,
|
||||
headerTitle: I18n.t('REFUND_NANO_CREDIT'),
|
||||
headerTintColor: 'white',
|
||||
headerStyle: {
|
||||
backgroundColor: Color.primaryColor,
|
||||
marginTop: 0,
|
||||
color: 'white'
|
||||
},
|
||||
headerTitleStyle: {
|
||||
color: "white"
|
||||
},
|
||||
title: I18n.t('REFUND_NANO_CREDIT')
|
||||
}
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
readUser().then((user) => {
|
||||
if (user) {
|
||||
if (user !== undefined) {
|
||||
this.setState({ user });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ckeckIfFieldIsOK(champ) {
|
||||
return (isNil(champ) || isEqual(champ.length, 0));
|
||||
}
|
||||
|
||||
renderRefundNanoCreditResponse = () => {
|
||||
|
||||
const { result, error } = this.props;
|
||||
|
||||
if (error !== null) {
|
||||
if (typeof error.data !== 'undefined') {
|
||||
Alert.alert(
|
||||
I18n.t("ERROR_LABLE"),
|
||||
error.data.error,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.refundCreditDemandUserReset();
|
||||
}
|
||||
}
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if (result !== null) {
|
||||
if (result.response !== null) {
|
||||
Alert.alert(
|
||||
I18n.t("REFUND_DONE"),
|
||||
result.response,
|
||||
[
|
||||
{
|
||||
text: I18n.t("OK"), onPress: () => {
|
||||
this.props.refundCreditDemandUserReset();
|
||||
IlinkEmitter.emit("refreshWallet");
|
||||
this.props.navigation.pop();
|
||||
}
|
||||
}
|
||||
|
||||
],
|
||||
{ cancelable: false }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateLangue() {
|
||||
this.props.navigation.setParams({ name: I18n.t('REFUND_NANO_CREDIT') })
|
||||
this.forceUpdate()
|
||||
}
|
||||
|
||||
ckeckIfFieldIsOK(champ) {
|
||||
return (isNil(champ) || isEqual(champ.length, 0));
|
||||
}
|
||||
|
||||
onSubmitRefundNanoCredit = () => {
|
||||
const { idDemand, password } = this.state;
|
||||
|
||||
if (this.ckeckIfFieldIsOK(idDemand))
|
||||
this.idDemandAnim.shake(800);
|
||||
else if (this.ckeckIfFieldIsOK(password))
|
||||
this.passwordAnim.shake(800);
|
||||
else {
|
||||
|
||||
this.props.refundCreditDemandUserAction({
|
||||
id_user: this.state.user.id,
|
||||
id_demande: this.state.idDemand,
|
||||
password: this.state.password
|
||||
}, 0);
|
||||
}
|
||||
this.setState({
|
||||
isDataSubmit: true
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
renderLoader = () => {
|
||||
return (
|
||||
<ProgressDialog
|
||||
visible={this.props.loading || this.props.loadingGetCommission}
|
||||
title={I18n.t('LOADING')}
|
||||
message={I18n.t('LOADING_INFO')}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
{(this.props.loading || this.props.loadingGetCommission) && this.renderLoader()}
|
||||
{this.state.isDataSubmit && this.renderRefundNanoCreditResponse()}
|
||||
<ScrollView style={styles.container}>
|
||||
|
||||
<Text style={styles.subbigtitle}>{I18n.t('DEMAND_INFO')}</Text>
|
||||
|
||||
<Animatable.View ref={(comp) => { thisidDemandAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'id-card'}
|
||||
label={I18n.t('ID_DEMAND')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
value={this.state.idDemand}
|
||||
onChangeText={(idDemand) => {
|
||||
|
||||
this.setState({ idDemand })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
|
||||
<Animatable.View ref={(comp) => { this.passwordAnim = comp }}>
|
||||
<Fumi iconClass={FontAwesomeIcon} iconName={'lock'}
|
||||
label={I18n.t('PASSWORD')}
|
||||
iconColor={'#f95a25'}
|
||||
iconSize={20}
|
||||
secureTextEntry={true}
|
||||
value={this.state.password}
|
||||
onChangeText={(password) => {
|
||||
this.setState({ password })
|
||||
}}
|
||||
style={styles.input}
|
||||
>
|
||||
</Fumi>
|
||||
</Animatable.View>
|
||||
|
||||
<Button style={styles.btnvalide}
|
||||
textStyle={styles.textbtnvalide}
|
||||
onPress={() => { this.onSubmitCasserEpargne(); }}>
|
||||
{this.state.isGroupToModify ? I18n.t('MODIFY') : I18n.t('SUBMIT_LABEL')}</Button>
|
||||
</ScrollView>
|
||||
</>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const maptStateToProps = state => ({
|
||||
|
||||
loading: state.casserEpargneUserReducer.loading,
|
||||
result: state.casserEpargneUserReducer.result,
|
||||
error: state.casserEpargneUserReducer.error,
|
||||
});
|
||||
|
||||
const mapDispatchToProps = dispatch => bindActionCreators({
|
||||
|
||||
refundCreditDemandUserAction,
|
||||
refundCreditDemandUserReset,
|
||||
|
||||
}, dispatch);
|
||||
|
||||
export default connect(maptStateToProps, mapDispatchToProps)(RefundNanoCreditUser);
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
flex: 1,
|
||||
backgroundColor: Color.primaryDarkColor,
|
||||
},
|
||||
textbtnvalide: {
|
||||
color: 'white',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
bigtitle: {
|
||||
color: 'white',
|
||||
fontSize: 20,
|
||||
flex: 1,
|
||||
fontWeight: 'bold',
|
||||
textAlign: 'center',
|
||||
margin: 20,
|
||||
},
|
||||
blockView: {
|
||||
paddingVertical: 10,
|
||||
borderBottomWidth: 1
|
||||
},
|
||||
subbigtitle: {
|
||||
color: 'white',
|
||||
fontSize: 17,
|
||||
textAlign: 'center',
|
||||
margin: 5,
|
||||
},
|
||||
btnvalide: {
|
||||
marginTop: 20,
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: Color.accentLightColor,
|
||||
height: 52
|
||||
},
|
||||
btnSubmit: {
|
||||
marginTop: 20,
|
||||
borderColor: 'transparent',
|
||||
backgroundColor: Color.accentLightColor,
|
||||
height: 52,
|
||||
width: "30%",
|
||||
marginLeft: 20,
|
||||
marginRight: 20,
|
||||
},
|
||||
input: {
|
||||
height: 60,
|
||||
marginTop: responsiveHeight(2),
|
||||
marginLeft: responsiveWidth(5),
|
||||
marginRight: responsiveWidth(5),
|
||||
borderRadius: 5,
|
||||
}
|
||||
});
|
|
@ -259,7 +259,8 @@ export default class OptionsMenu extends Component {
|
|||
|| item === 'retraitCarteVersWalletUser' || item === 'retraitEnCashAgent' || item === 'retraitCarteVersCashAgent' || item === 'envoieCashVersWalletAgent'
|
||||
|| item === 'envoieCashVersAutreWalletAgent' || item === 'retraitCarteVersCashUser' || item === 'envoiCashVersCashAgent' || item === 'envoieCashVersCashAgent'
|
||||
|| item === 'envoieCashVersCarteAgent' || item === 'modifyIdentificationUser' || item === 'createGroupNanoCredit' || item === 'groupNanoCredit' || item === 'demandeValidationGroupe'
|
||||
|| item === 'adhererGroupNanoCredit' || item === 'myNanoCreditGroup') {
|
||||
|| item === 'adhererGroupNanoCredit' || item === 'myNanoCreditGroup' || item === 'askNanoCredit' || item === 'refundNanoCreditUser' || item === 'cautionNanoCreditAgent'
|
||||
|| item === 'epargnerArgentUser' || item === 'askNanoCredit' || item === 'casserEpargneUser') {
|
||||
return null
|
||||
} else {
|
||||
const color = this.state.currentId === item.id ? theme.accent : "grey"
|
||||
|
|
|
@ -24,7 +24,7 @@ import Dialog from "react-native-dialog";
|
|||
import { Typography } from '../../config/typography';
|
||||
import * as Utils from '../../utils/DeviceUtils';
|
||||
import { IlinkEmitter } from "../../utils/events";
|
||||
import { cutString, cutStringWithoutDot, isEmptyObject, transactionHistoryIlinkLabel, isIlinkWorldWallet, optionDepotScreen, optionIdentificationScreen, optionPaiementFacture, optionRetraitScreen, transactionHistoryLabel, optionNanoCreditScreen } from '../../utils/UtilsFunction';
|
||||
import { cutString, cutStringWithoutDot, isEmptyObject, transactionHistoryIlinkLabel, isIlinkWorldWallet, optionDepotScreen, optionIdentificationScreen, optionPaiementFacture, optionRetraitScreen, transactionHistoryLabel, optionNanoCreditScreen, optionNanoCreditAgentScreen } from '../../utils/UtilsFunction';
|
||||
import { depositActionReset } from '../../webservice/DepositApi';
|
||||
import { baseUrl } from '../../webservice/IlinkConstants';
|
||||
import { getWalletDetailActivated, resetWalletListDetailReducer } from '../../webservice/WalletApi';
|
||||
|
@ -769,7 +769,7 @@ class WalletDetail extends Component {
|
|||
onPress={
|
||||
() => {
|
||||
this.props.navigation.push(route.walletOptionSelect, {
|
||||
optionSelect: optionNanoCreditScreen,
|
||||
optionSelect: optionNanoCreditAgentScreen,
|
||||
wallet,
|
||||
lottie: {
|
||||
source: require("./../../datas/json/cedit-cards.json"),
|
||||
|
|
|
@ -80,6 +80,17 @@ export const identityPieces = () => {
|
|||
]
|
||||
}
|
||||
|
||||
export const withdrawalMode = () => {
|
||||
return [
|
||||
{
|
||||
name: I18n.t('WITHDRAWAL_IN_CASH')
|
||||
},
|
||||
{
|
||||
name: I18n.t('TRANSFER_IN_ACCOUNT')
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export const typeCaution = () => {
|
||||
return [
|
||||
{
|
||||
|
@ -91,6 +102,17 @@ export const typeCaution = () => {
|
|||
]
|
||||
}
|
||||
|
||||
export const typeEpargne = () => {
|
||||
return [
|
||||
{
|
||||
name: I18n.t('SIMPLE')
|
||||
},
|
||||
{
|
||||
name: I18n.t('BLOCKED')
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export const typeIdIDestinataire = () => {
|
||||
return [
|
||||
{
|
||||
|
@ -416,25 +438,6 @@ export const optionNanoCreditScreen = {
|
|||
icon: 'account-multiple',
|
||||
title: I18n.t('MANAGE_GROUP'),
|
||||
screen: route.groupNanoCredit
|
||||
/* hasSubMenu: true,
|
||||
subMenuOption: [
|
||||
{
|
||||
title: I18n.t('DELETE'),
|
||||
screen: ""
|
||||
},
|
||||
{
|
||||
title: I18n.t('CREATE'),
|
||||
screen: route.createGroupNanoCredit
|
||||
},
|
||||
{
|
||||
title: I18n.t('JOIN'),
|
||||
screen: ""
|
||||
},
|
||||
{
|
||||
title: I18n.t('VALIDATE'),
|
||||
screen: route.groupNanoCredit
|
||||
},
|
||||
], */
|
||||
},
|
||||
/* {
|
||||
screen: "",
|
||||
|
@ -447,15 +450,49 @@ export const optionNanoCreditScreen = {
|
|||
title: I18n.t('OPEN_ACCOUNT'),
|
||||
},
|
||||
*/
|
||||
/* {
|
||||
screen: route.askNanoCredit,
|
||||
icon: 'cash',
|
||||
title: I18n.t('MANAGE_CREDIT'),
|
||||
}, */
|
||||
{
|
||||
title: I18n.t('DEMAND_NANO_CREDIT'),
|
||||
screen: route.askNanoCredit,
|
||||
icon: 'cash',
|
||||
title: I18n.t('MANAGE_CREDIT'),
|
||||
icon: 'cash'
|
||||
},
|
||||
{
|
||||
screen: "",
|
||||
icon: 'briefcase-edit',
|
||||
title: I18n.t('MANAGE_SAVINGS'),
|
||||
title: I18n.t('REFUND_NANO_CREDIT'),
|
||||
screen: route.refundNanoCreditUser,
|
||||
icon: "cash-refund"
|
||||
},
|
||||
/* {
|
||||
screen: "",
|
||||
icon: 'briefcase-edit',
|
||||
title: I18n.t('MANAGE_SAVINGS'),
|
||||
}, */
|
||||
{
|
||||
screen: route.epargnerArgentUser,
|
||||
icon: 'cash-register',
|
||||
title: I18n.t('SAVE_MONEY'),
|
||||
},
|
||||
{
|
||||
screen: route.casserEpargneUser,
|
||||
icon: 'cash-multiple',
|
||||
title: I18n.t('BREAK_EPARGNE'),
|
||||
},
|
||||
|
||||
]
|
||||
}
|
||||
|
||||
export const optionNanoCreditAgentScreen = {
|
||||
type: 'NANO_CREDIT',
|
||||
title: I18n.t('NANO_CREDIT'),
|
||||
subTitle: I18n.t('CHOOSE_OPTION'),
|
||||
options: [
|
||||
{
|
||||
screen: route.cautionNanoCreditAgent,
|
||||
icon: 'cash',
|
||||
title: I18n.t('CAUTION_CREDIT'),
|
||||
},
|
||||
]
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
"AMOUNT_SUPERIOR_TO_PRINCIPAL_ACCOUNT": "Amount greater than that of the agent's main account",
|
||||
"MAKE_DEPOSIT": "Make a deposit",
|
||||
"MAKE_WITHDRAWAL": "Make withdrawal",
|
||||
"WITHDRAWAL_TYPE": "Withdrawal mode",
|
||||
"DEPOSIT_DESCRIPTION": "Make a deposit",
|
||||
"ERROR_TRANSFER": "Transfer error",
|
||||
"SUCCESS_TRANSFER": "Transfer done",
|
||||
|
@ -47,6 +48,10 @@
|
|||
"WITHDRAWAL_ERROR": "Withdrawal error",
|
||||
"WALLET_TO_WALLET_SUCCESS_TRANSFER": "Wallet to wallet transfer successfully completed",
|
||||
"DEPOSIT": "Deposit",
|
||||
"EN_ATTENTE_DE_VALIDATION": "Waiting for validation",
|
||||
"REMBOURSE": "Reimbursed",
|
||||
"NON_VALIDE": "Invalid",
|
||||
"VALIDE": "Validate",
|
||||
"ENVOIE_ARGENT": "Send money",
|
||||
"RETRAIT_ARGENT": "Receive money",
|
||||
"CONFIRM_DEPOSIT": "Confirm deposit",
|
||||
|
@ -71,6 +76,7 @@
|
|||
"DESTINATAIRE": "Recipient",
|
||||
"WITHDRAWAL": "Withdrawal",
|
||||
"LINK_CARD": "Link my card",
|
||||
"TRANSFER_IN_ACCOUNT": "Transfer in account",
|
||||
"WITHDRAWAL_IN_CASH": "Withdrawal in cash",
|
||||
"WITHDRAWAL_IN_CASH_DESCRIPTION": "Withdrawal money in cash",
|
||||
"WITHDRAWAL_WALLET_TO_CASH": "Withdrawal wallet to cash",
|
||||
|
@ -99,8 +105,11 @@
|
|||
"DEPOSIT_CASH_TO_CASH": "Cash to cash",
|
||||
"ENVOIE_CASH_TO_CASH": "Send money in cash to cash",
|
||||
"TRANSACTION_DETAIL": "Transaction detail",
|
||||
"DEMAND_DETAIL": "Demand detail",
|
||||
"CODE_IBAN": "IBAN Code",
|
||||
"FEES_AND_TAXES": "Fees and taxes",
|
||||
"TAXES": "Taxes",
|
||||
"INTERET": "Interest",
|
||||
"SUCCESS_CREATION_GROUP": "Creation information",
|
||||
"ERROR_CREATION_GROUP": "Creation error",
|
||||
"ERROR_JOIN_GROUP": "Join error",
|
||||
|
@ -110,6 +119,7 @@
|
|||
"DELETE_DEMAND": "Deletion request",
|
||||
"TYPE_DEMAND": "Demand type",
|
||||
"GROUP_INFOS": "Fill in the group information",
|
||||
"FILL_INFORMATION": "Please fill in the information",
|
||||
"GROUP_CODE": "Group code",
|
||||
"NOM_GROUP": "Group name",
|
||||
"GROUP": "Group",
|
||||
|
@ -141,11 +151,21 @@
|
|||
"NANO_SANTE_DESCRIPTION": "Nano health description",
|
||||
"CAUTION_TYPE": "Caution type",
|
||||
"DEMAND_NANO_CREDIT": "Nano credit demand",
|
||||
"REFUND_NANO_CREDIT": "Refund nano credit",
|
||||
"REFUND_DONE": "Refund done",
|
||||
"SAVE_MONEY": "Epargner de l'argent",
|
||||
"SAVE_MONEY_TYPE": "Savings type",
|
||||
"CAUTION_CREDIT": "Caution credit demand",
|
||||
"ID_DEMAND": "Demand ID",
|
||||
"DEMAND_DURATION_IN_MONTH": "Duration (in months)",
|
||||
"PAIEMENT_FACTURE": "Bill payment",
|
||||
"NUMERO_ABONNE": "Subscriber number",
|
||||
"IDENTIFIANT_ETUDIANT": "Student ID",
|
||||
"DEMAND_SEND": "Demand send",
|
||||
"EPARGNE_DEPOSE": "Savings deposited",
|
||||
"BREAK_EPARGNE": "Break my saving",
|
||||
"BREAK_EPARGNE_DONE": "Break saving done",
|
||||
"ID_EPARGNE": "Saving ID",
|
||||
"NO_DEMAND_CREATION_GROUP": "No group creation request",
|
||||
"WITHDRAWAL_DESCRIPTION": "Make a withdrawal",
|
||||
"COMMISSION_ACCOUNT_TITLE": "Commission account",
|
||||
|
@ -280,6 +300,8 @@
|
|||
"QUIT": "Quit",
|
||||
"QUIT_": "Quit",
|
||||
"OK": "OK",
|
||||
"SIMPLE": "Simple",
|
||||
"BLOCKED": "Blocked",
|
||||
"COMMISSION_FEES": "Commission fees",
|
||||
"TOTAL": "Total",
|
||||
"APP_FULLNAME": "Ilink World",
|
||||
|
@ -311,6 +333,7 @@
|
|||
"SUBMIT_LABEL": "Submit",
|
||||
"ERROR_LABEL": "Error",
|
||||
"SUCCESS": "Success",
|
||||
"ETAT": "State",
|
||||
"DEPOSIT_SUCCESS": "Deposit done successfully",
|
||||
"TEXT_GUIDE_USER_1": "You have just connected.\n Your location is marked in the center of the map with the indication \"You are here\" ",
|
||||
"TEXT_GUIDE_USER_3": "Clicking the '+' button will open the options menu",
|
||||
|
|
|
@ -40,9 +40,14 @@
|
|||
"ERROR_LABEL": "Erreur",
|
||||
"DEPOSIT_SUCCESS": "Dépôt effectué avec succès",
|
||||
"SUCCESS": "Succès",
|
||||
"ETAT": "Etat",
|
||||
"MY_ACCOUNT": "Mon compte",
|
||||
"WALLET": "Wallet",
|
||||
"DEPOSIT": "Dépôt",
|
||||
"EN_ATTENTE_DE_VALIDATION": "En attente de validation",
|
||||
"REMBOURSE": "Remboursé",
|
||||
"NON_VALIDE": "Non validé",
|
||||
"VALIDE": "Validé",
|
||||
"ENVOIE_ARGENT": "Envoyer de l'argent",
|
||||
"RETRAIT_ARGENT": "Retirer de l'argent",
|
||||
"CONFIRM_DEPOSIT": "Confirmer le dépôt",
|
||||
|
@ -53,6 +58,7 @@
|
|||
"ENTER_VALID_SERIAL_NUMBER": "Veuillez renseigner un numéro de série correct",
|
||||
"MAKE_DEPOSIT": "Effectuer un dépôt",
|
||||
"MAKE_WITHDRAWAL": "Effectuer un retrait",
|
||||
"WITHDRAWAL_TYPE": "Mode de paiement",
|
||||
"CHOOSE_SOURCE": "Choisir la source",
|
||||
"CHANGE_SOURCE_CARD": "Changer le type du numéro de saisie",
|
||||
"CREDIT_CARD": "Carte de crédit",
|
||||
|
@ -76,6 +82,7 @@
|
|||
"WALLET_TO_WALLET_SUCCESS_TRANSFER": "Transfert de wallet à wallet effectué avec succès",
|
||||
"WITHDRAWAL": "Retrait",
|
||||
"LINK_CARD": "Lier ma carte",
|
||||
"TRANSFER_IN_ACCOUNT": "Transfert dans le compte",
|
||||
"WITHDRAWAL_IN_CASH": "Retrait en cash",
|
||||
"WITHDRAWAL_IN_CASH_DESCRIPTION": "Retrait d'argent en cash",
|
||||
"WITHDRAWAL_WALLET_TO_CASH": "Retrait de votre wallet vers cash",
|
||||
|
@ -104,13 +111,17 @@
|
|||
"DEPOSIT_CASH_TO_CASH": "Cash vers cash",
|
||||
"ENVOIE_CASH_TO_CASH": "Envoie d'argent en cash vers cash",
|
||||
"TRANSACTION_DETAIL": "Détail de la transaction",
|
||||
"DEMAND_DETAIL": "Détail de la demande",
|
||||
"FEES_AND_TAXES": "Frais et taxes",
|
||||
"TAXES": "Taxes",
|
||||
"INTERET": "Intérêt",
|
||||
"CREATE_GROUP": "Créer un groupe",
|
||||
"MANAGE_GROUP": "Gérer le groupe",
|
||||
"VALIDATION_DEMAND": "Demandes de validation",
|
||||
"DELETE_DEMAND": "Demande de suppression",
|
||||
"TYPE_DEMAND": "Type de demande",
|
||||
"GROUP_INFOS": "Renseigner les informations du groupe",
|
||||
"FILL_INFORMATION": "Veuillez renseigner les informations",
|
||||
"GROUP_CODE": "Code du groupe",
|
||||
"SUCCESS_CREATION_GROUP": "Informations sur la création",
|
||||
"ERROR_CREATION_GROUP": "Erreur de création",
|
||||
|
@ -147,6 +158,12 @@
|
|||
"NANO_SANTE_DESCRIPTION": "Nano santé iLink",
|
||||
"CAUTION_TYPE": "Type de caution",
|
||||
"DEMAND_NANO_CREDIT": "Demande de nano crédit",
|
||||
"REFUND_NANO_CREDIT": "Rembourser un nano crédit",
|
||||
"SAVE_MONEY": "Epargner de l'argent",
|
||||
"SAVE_MONEY_TYPE": "Type d'épargne",
|
||||
"REFUND_DONE": "Remboursement effectué",
|
||||
"CAUTION_CREDIT": "Cautionner une demande de crédit",
|
||||
"ID_DEMAND": "Identifiant de la demande",
|
||||
"DEMAND_DURATION_IN_MONTH": "Durée (en mois)",
|
||||
"PAIEMENT_FACTURE": "Paiement de facture",
|
||||
"NUMERO_ABONNE": "Numéro d'abonnée",
|
||||
|
@ -169,6 +186,10 @@
|
|||
"DEPOSIT_TRANSACTION_HISTORY_DESCRIPTION": "Dépôt de",
|
||||
"NO_WALLET_HISTORY": "Aucune transaction à ce jour",
|
||||
"DEMAND_SEND": "Demande envoyé",
|
||||
"EPARGNE_DEPOSE": "Epargne déposé",
|
||||
"BREAK_EPARGNE_DONE": "Epargne cassé avec succès",
|
||||
"BREAK_EPARGNE": "Casser mon épargne",
|
||||
"ID_EPARGNE": "Identifiant de l'épargne",
|
||||
"NO_DEMAND_CREATION_GROUP": "Aucune demande de création de groupe",
|
||||
"NO_WALLET_ACTIVED": "Aucun wallet n'est activé pour votre compte",
|
||||
"TRANSFER_TO_PRINCIPAL_ACCOUNT": "Transférer commissions",
|
||||
|
@ -289,6 +310,8 @@
|
|||
"TOTAL": "Total",
|
||||
"QUIT_": "Quitter",
|
||||
"OK": "OK",
|
||||
"SIMPLE": "Simple",
|
||||
"BLOCKED": "Bloqué",
|
||||
"APP_FULLNAME": "Ilink World",
|
||||
"GUIDE_TITLE": "Bienvenue dans le Guide de",
|
||||
"GUIDE_USER_SIMPLE": "Guide pour un utilisateur",
|
||||
|
|
|
@ -56,8 +56,13 @@ export const groupUrl = testBaseUrl + '/walletService/groups';
|
|||
export const treatDemandUrl = testBaseUrl + '/walletService/groups/demands/validate';
|
||||
export const cancelDemandUrl = testBaseUrl + '/walletService/groups/demands/cancel';
|
||||
export const askNanoCreditUrl = testBaseUrl + '/walletService/groups/nanoCredit/ask';
|
||||
export const cautionCreditDemandtUrl = testBaseUrl + '/walletService/groups/nanoCredit/guarantee';
|
||||
export const refundCreditDemandUrl = testBaseUrl + '/walletService/groups/nanoCredit/refund';
|
||||
export const getNanoCreditDemandUrl = testBaseUrl + '/walletService/groups/nanoCredit/details';
|
||||
export const joinGroupUrl = testBaseUrl + '/walletService/groups/join';
|
||||
export const getNanoCreditDemandDureationUrl = testBaseUrl + '/walletService/groups/nanoCredit/durations';
|
||||
export const epargnerArgentUrl = testBaseUrl + '/walletService/groups/nanoCredit/savings/make';
|
||||
export const casserEpargneUrl = testBaseUrl + '/walletService/groups/nanoCredit/savings/break';
|
||||
export const saveOnesignalIds = testBaseUrl + '/notificationService/onesignal';
|
||||
export const getNotificationUrl = testBaseUrl + '/notificationService/notifications';
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import I18n from 'react-native-i18n';
|
|||
import { fetchCreateGroupError, fetchCreateGroupPending, fetchCreateGroupReset, fetchCreateGroupSuccess, fetchTreatDemandsGroupPending, fetchTreatDemandsGroupSuccess, fetchTreatDemandsGroupError, fetchTreatDemandsGroupReset, fetchJoinGroupPending, fetchJoinGroupSuccess, fetchJoinGroupError, fetchJoinGroupReset, fetchAskNanoCreditPending, fetchAskNanoCreditSuccess, fetchAskNanoCreditError, fetchAskNanoCreditReset, fetchGetNanoCreditDemandDurationPending, fetchGetNanoCreditDemandDurationSuccess, fetchGetNanoCreditDemandDurationError, fetchGetNanoCreditDemandDurationReset } from "../redux/actions/NanoCreditAction";
|
||||
import { store } from "../redux/store";
|
||||
import { groupUrl, getNanoCreditDemandDureationUrl, treatDemandUrl, joinGroupUrl, cancelDemandUrl, askNanoCreditUrl } from "./IlinkConstants";
|
||||
import AskNanoCreditReducer from "../redux/reducers/AskNanoCreditReducer";
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
import { cautionCreditDemandtUrl, getNanoCreditDemandUrl } from "../IlinkConstants";
|
||||
import axios from "axios";
|
||||
import I18n from 'react-native-i18n';
|
||||
import { store } from "../../redux/store";
|
||||
import { fetchCautionCreditDemandAgentPending, fetchCautionCreditDemandAgentSuccess, fetchCautionCreditDemandAgentError, fetchCautionCreditDemandAgentReset, fetchGetNanoCreditDemandDetailPending, fetchGetNanoCreditDemandDetailSuccess, fetchGetNanoCreditDemandDetailReset } from "../../redux/actions/NanoCreditAction";
|
||||
|
||||
export const cautionCreditDemandAgentAction = (data) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchCautionCreditDemandAgentPending());
|
||||
|
||||
axios({
|
||||
url: cautionCreditDemandtUrl,
|
||||
method: 'POST',
|
||||
data,
|
||||
headers: {
|
||||
'Authorization': authKey,
|
||||
'X-Localization': I18n.currentLocale()
|
||||
},
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
dispatch(fetchCautionCreditDemandAgentSuccess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response)
|
||||
dispatch(fetchCautionCreditDemandAgentError(error.response));
|
||||
else if (error.request)
|
||||
dispatch(fetchCautionCreditDemandAgentError(error.request))
|
||||
else
|
||||
dispatch(fetchCautionCreditDemandAgentError(error.message))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const cautionCreditDemandAgentReset = () => {
|
||||
return dispatch => {
|
||||
dispatch(fetchCautionCreditDemandAgentReset());
|
||||
}
|
||||
}
|
||||
|
||||
export const getNanoCreditDemandDetailAction = (idDemand) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchGetNanoCreditDemandDetailPending());
|
||||
|
||||
axios({
|
||||
url: `${getNanoCreditDemandUrl}/${idDemand}`,
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Authorization': authKey,
|
||||
'X-Localization': I18n.currentLocale()
|
||||
},
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
dispatch(fetchGetNanoCreditDemandDetailSuccess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response)
|
||||
dispatch(fetchGetNanoCreditDemandDetailError(error.response));
|
||||
else if (error.request)
|
||||
dispatch(fetchGetNanoCreditDemandDetailError(error.request))
|
||||
else
|
||||
dispatch(fetchGetNanoCreditDemandDetailError(error.message))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const getNanoCreditDemandDetailReset = () => {
|
||||
return dispatch => {
|
||||
dispatch(fetchGetNanoCreditDemandDetailReset());
|
||||
}
|
||||
}
|
|
@ -2,9 +2,8 @@
|
|||
import axios from "axios";
|
||||
import I18n from 'react-native-i18n';
|
||||
import { store } from "../../redux/store";
|
||||
import { idVerificationUrl, getCreditDemand, groupUrl } from "../IlinkConstants";
|
||||
import { fetchRetraitCashAgentIdVerificationPending, fetchRetraitCashAgentIdVerificationSuccess, fetchRetraitCashAgentIdVerificationError, fetchRetraitCashAgentIdVerificationReset } from "../../redux/actions/EnvoieAgentAction";
|
||||
import { fetchGetDemandsGroupSuccess, fetchGetDemandsGroupPending, fetchGetDemandsGroupError, fetchGetDemandsGroupReset, fetchGetUniqueDemandsGroupPending, fetchGetUniqueDemandsGroupSuccess, fetchGetUniqueDemandsGroupReset, fetchGetUniqueDemandsGroupError, fetchGetUserGroupDetailPending, fetchGetUserGroupDetailSuccess, fetchGetUserGroupDetailReset, fetchGetUserGroupDetailError } from "../../redux/actions/NanoCreditAction";
|
||||
import { fetchCautionCreditDemandUserError, fetchCautionCreditDemandUserPending, fetchCautionCreditDemandUserReset, fetchCautionCreditDemandUserSuccess, fetchGetDemandsGroupError, fetchGetDemandsGroupPending, fetchGetDemandsGroupReset, fetchGetDemandsGroupSuccess, fetchGetUniqueDemandsGroupError, fetchGetUniqueDemandsGroupPending, fetchGetUniqueDemandsGroupReset, fetchGetUniqueDemandsGroupSuccess, fetchGetUserGroupDetailError, fetchGetUserGroupDetailPending, fetchGetUserGroupDetailReset, fetchGetUserGroupDetailSuccess, fetchEpargnerArgentUserPending, fetchEpargnerArgentUserSuccess, fetchEpargnerArgentUserError, fetchEpargnerArgentUserReset, fetchCasserEpargneUserPending, fetchCasserEpargneUserSuccess, fetchCasserEpargneUserError, fetchCasserEpargneUserReset } from "../../redux/actions/NanoCreditAction";
|
||||
import { cautionCreditDemandtUrl, getCreditDemand, groupUrl, refundCreditDemandUrl, epargnerArgentUrl, casserEpargneUrl } from "../IlinkConstants";
|
||||
|
||||
export const getNanoCreditDemandsAction = (id) => {
|
||||
|
||||
|
@ -116,4 +115,121 @@ export const getUserGroupDetailReset = () => {
|
|||
return dispatch => {
|
||||
dispatch(fetchGetUserGroupDetailReset());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const refundCreditDemandUserAction = (data) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchCautionCreditDemandUserPending());
|
||||
|
||||
axios({
|
||||
url: refundCreditDemandUrl,
|
||||
method: 'POST',
|
||||
data,
|
||||
headers: {
|
||||
'Authorization': authKey,
|
||||
'X-Localization': I18n.currentLocale()
|
||||
},
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
dispatch(fetchCautionCreditDemandUserSuccess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response)
|
||||
dispatch(fetchCautionCreditDemandUserError(error.response));
|
||||
else if (error.request)
|
||||
dispatch(fetchCautionCreditDemandUserError(error.request))
|
||||
else
|
||||
dispatch(fetchCautionCreditDemandUserError(error.message))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const refundCreditDemandUserReset = () => {
|
||||
return dispatch => {
|
||||
dispatch(fetchCautionCreditDemandUserReset());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const epargnerArgentUserAction = (data) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchEpargnerArgentUserPending());
|
||||
|
||||
axios({
|
||||
url: epargnerArgentUrl,
|
||||
method: 'POST',
|
||||
data,
|
||||
headers: {
|
||||
'Authorization': authKey,
|
||||
'X-Localization': I18n.currentLocale()
|
||||
},
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
dispatch(fetchEpargnerArgentUserSuccess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response)
|
||||
dispatch(fetchEpargnerArgentUserError(error.response));
|
||||
else if (error.request)
|
||||
dispatch(fetchEpargnerArgentUserError(error.request))
|
||||
else
|
||||
dispatch(fetchEpargnerArgentUserError(error.message))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const epargnerArgentUserReset = () => {
|
||||
return dispatch => {
|
||||
dispatch(fetchEpargnerArgentUserReset());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const casserEpargneUserAction = (data) => {
|
||||
|
||||
const auth = store.getState().authKeyReducer;
|
||||
const authKey = auth !== null ? `${auth.authKey.token_type} ${auth.authKey.access_token}` : '';
|
||||
|
||||
return dispatch => {
|
||||
dispatch(fetchCasserEpargneUserPending());
|
||||
|
||||
axios({
|
||||
url: casserEpargneUrl,
|
||||
method: 'POST',
|
||||
data,
|
||||
headers: {
|
||||
'Authorization': authKey,
|
||||
'X-Localization': I18n.currentLocale()
|
||||
},
|
||||
})
|
||||
.then(response => {
|
||||
console.log(response);
|
||||
dispatch(fetchCasserEpargneUserSuccess(response));
|
||||
})
|
||||
.catch(error => {
|
||||
if (error.response)
|
||||
dispatch(fetchCasserEpargneUserError(error.response));
|
||||
else if (error.request)
|
||||
dispatch(fetchCasserEpargneUserError(error.request))
|
||||
else
|
||||
dispatch(fetchCasserEpargneUserError(error.message))
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export const casserEpargneUserReset = () => {
|
||||
return dispatch => {
|
||||
dispatch(fetchCasserEpargneUserReset());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue