+ Translate missing states of requests
This commit is contained in:
parent
21cc818763
commit
ed12235c96
|
@ -158,8 +158,8 @@ class NanoCreditController extends Controller
|
||||||
|
|
||||||
$message = trans('messages.successful_user_group_nano_credit_demand',
|
$message = trans('messages.successful_user_group_nano_credit_demand',
|
||||||
['id_demand' => $demande_credit->id_demande, 'amount' => $this->toMoney($montant_total, $init_country), 'duration' => $demande_credit->duree_mois,
|
['id_demand' => $demande_credit->id_demande, 'amount' => $this->toMoney($montant_total, $init_country), 'duration' => $demande_credit->duree_mois,
|
||||||
'net' => $this->toMoney($demande_credit->montant, $init_country), 'fees' => $this->toMoney($demande_credit->interet , $init_country),
|
'net' => $this->toMoney($demande_credit->montant, $init_country), 'fees' => $this->toMoney($demande_credit->interet, $init_country),
|
||||||
'date' => $demande_credit->date_remboursement_prevu , 'tax' => $this->toMoney($demande_credit->taxe, $init_country)]);
|
'date' => $demande_credit->date_remboursement_prevu, 'tax' => $this->toMoney($demande_credit->taxe, $init_country)]);
|
||||||
$this->sendMail($user->email, trans('messages.successful_nano_credit_demand'), $message);
|
$this->sendMail($user->email, trans('messages.successful_nano_credit_demand'), $message);
|
||||||
return $this->successResponse($message . trans('messages.sent_by_mail'));
|
return $this->successResponse($message . trans('messages.sent_by_mail'));
|
||||||
}
|
}
|
||||||
|
@ -197,7 +197,11 @@ class NanoCreditController extends Controller
|
||||||
|
|
||||||
// Supprimer les underscore sur les etats
|
// Supprimer les underscore sur les etats
|
||||||
$merge = array_map(function ($demand) {
|
$merge = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = trans('states.' . $demand->etat);
|
||||||
|
if (isset($demand->type))
|
||||||
|
$demand->type = trans('states.' . $demand->type);
|
||||||
|
if (isset($demand->type_caution))
|
||||||
|
$demand->type_caution = trans('states.' . $demand->type_caution);
|
||||||
return $demand;
|
return $demand;
|
||||||
}, array_merge($demandes, $savings));
|
}, array_merge($demandes, $savings));
|
||||||
|
|
||||||
|
@ -213,7 +217,8 @@ class NanoCreditController extends Controller
|
||||||
$demandes = DB::select('SELECT i.montant , i.user as destinataire, i.* FROM infos_users_demandes_credits i WHERE i.id_user = :id ORDER BY i.date_creation DESC;', ['id' => $id_user]);
|
$demandes = DB::select('SELECT i.montant , i.user as destinataire, i.* FROM infos_users_demandes_credits i WHERE i.id_user = :id ORDER BY i.date_creation DESC;', ['id' => $id_user]);
|
||||||
|
|
||||||
$result = array_map(function ($demand) {
|
$result = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = trans('states.' . $demand->etat);
|
||||||
|
$demand->type_caution = trans('states.' . $demand->type_caution);
|
||||||
return $demand;
|
return $demand;
|
||||||
}, $demandes);
|
}, $demandes);
|
||||||
return $this->successResponse($result);
|
return $this->successResponse($result);
|
||||||
|
@ -225,7 +230,8 @@ class NanoCreditController extends Controller
|
||||||
$demandes = DB::select("SELECT type_caution , etat , montant , date_creation , id_demande , montant_rembourse ,partiellement_rembourse , duree_mois , interet , taxe , date_validation ,date_remboursement_prevu,
|
$demandes = DB::select("SELECT type_caution , etat , montant , date_creation , id_demande , montant_rembourse ,partiellement_rembourse , duree_mois , interet , taxe , date_validation ,date_remboursement_prevu,
|
||||||
retrait_cash , agent FROM infos_users_demandes_credits i WHERE i.id_user = :id AND i.etat = 'VALIDE' ORDER BY date_creation DESC;", ['id' => $id_user]);
|
retrait_cash , agent FROM infos_users_demandes_credits i WHERE i.id_user = :id AND i.etat = 'VALIDE' ORDER BY date_creation DESC;", ['id' => $id_user]);
|
||||||
$result = array_map(function ($demand) {
|
$result = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = trans('states.' . $demand->etat);
|
||||||
|
$demand->type_caution = trans('states.' . $demand->type_caution);
|
||||||
return $demand;
|
return $demand;
|
||||||
}, $demandes);
|
}, $demandes);
|
||||||
return $this->successResponse($result);
|
return $this->successResponse($result);
|
||||||
|
@ -236,7 +242,8 @@ class NanoCreditController extends Controller
|
||||||
$demandes = DB::select('SELECT i.montant , i.user as destinataire, i.* FROM infos_users_demandes_credits i WHERE i.id_wallet_agent = :id ORDER BY i.date_creation DESC;'
|
$demandes = DB::select('SELECT i.montant , i.user as destinataire, i.* FROM infos_users_demandes_credits i WHERE i.id_wallet_agent = :id ORDER BY i.date_creation DESC;'
|
||||||
, ['id' => $id_wallet_agent]);
|
, ['id' => $id_wallet_agent]);
|
||||||
$result = array_map(function ($demand) {
|
$result = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = trans('states.' . $demand->etat);
|
||||||
|
$demand->type_caution = trans('states.' . $demand->type_caution);
|
||||||
return $demand;
|
return $demand;
|
||||||
}, $demandes);
|
}, $demandes);
|
||||||
return $this->successResponse($result);
|
return $this->successResponse($result);
|
||||||
|
@ -246,7 +253,8 @@ class NanoCreditController extends Controller
|
||||||
{
|
{
|
||||||
$savings = DB::select('SELECT i.montant , i.user as destinataire, i.* FROM infos_users_epargnes i WHERE i.id_user = :id ORDER BY i.date_creation DESC;', ['id' => $id_user]);
|
$savings = DB::select('SELECT i.montant , i.user as destinataire, i.* FROM infos_users_epargnes i WHERE i.id_user = :id ORDER BY i.date_creation DESC;', ['id' => $id_user]);
|
||||||
$result = array_map(function ($demand) {
|
$result = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = trans('states.' . $demand->etat);
|
||||||
|
$demand->type = trans('states.' . $demand->type);
|
||||||
return $demand;
|
return $demand;
|
||||||
}, $savings);
|
}, $savings);
|
||||||
return $this->successResponse($result);
|
return $this->successResponse($result);
|
||||||
|
@ -300,7 +308,8 @@ class NanoCreditController extends Controller
|
||||||
{
|
{
|
||||||
$savings = DB::select("SELECT i.type , etat, montant, montant_retire , date_creation , id_epargne , duree_mois , interet , taxe , date_fin FROM infos_users_epargnes i WHERE i.id_user = :id AND i.etat = 'EN_COURS' ORDER BY i.date_creation DESC;", ['id' => $id_user]);
|
$savings = DB::select("SELECT i.type , etat, montant, montant_retire , date_creation , id_epargne , duree_mois , interet , taxe , date_fin FROM infos_users_epargnes i WHERE i.id_user = :id AND i.etat = 'EN_COURS' ORDER BY i.date_creation DESC;", ['id' => $id_user]);
|
||||||
$result = array_map(function ($demand) {
|
$result = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = trans('states.' . $demand->etat);
|
||||||
|
$demand->type = trans('states.' . $demand->type);//trans('states.'.$demand->etat);
|
||||||
return $demand;
|
return $demand;
|
||||||
}, $savings);
|
}, $savings);
|
||||||
return $this->successResponse($result);
|
return $this->successResponse($result);
|
||||||
|
@ -427,7 +436,7 @@ class NanoCreditController extends Controller
|
||||||
public function getDurations(Request $request)
|
public function getDurations(Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->validate($request , [
|
$this->validate($request, [
|
||||||
'type' => 'required|in:nano_credit,epargne',
|
'type' => 'required|in:nano_credit,epargne',
|
||||||
'id_user' => 'required|integer|min:0|not_in:0',
|
'id_user' => 'required|integer|min:0|not_in:0',
|
||||||
]);
|
]);
|
||||||
|
@ -599,7 +608,8 @@ class NanoCreditController extends Controller
|
||||||
{
|
{
|
||||||
$demand = UsersDemandesCredit::where('id_demande', $id_demand)->first();
|
$demand = UsersDemandesCredit::where('id_demande', $id_demand)->first();
|
||||||
if ($demand) {
|
if ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = trans('states.' . $demand->etat);
|
||||||
|
$demand->type_caution = trans('states.' . $demand->type_caution);
|
||||||
return $this->successResponse($demand);
|
return $this->successResponse($demand);
|
||||||
} else {
|
} else {
|
||||||
return $this->errorResponse(trans('errors.nano_credit_not_found'));
|
return $this->errorResponse(trans('errors.nano_credit_not_found'));
|
||||||
|
@ -610,14 +620,16 @@ class NanoCreditController extends Controller
|
||||||
{
|
{
|
||||||
$demand = UsersEpargne::where('id_epargne', $id_saving)->first();
|
$demand = UsersEpargne::where('id_epargne', $id_saving)->first();
|
||||||
if ($demand) {
|
if ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = trans('states.' . $demand->etat);
|
||||||
|
$demand->type = trans('states.' . $demand->type);
|
||||||
return $this->successResponse($demand);
|
return $this->successResponse($demand);
|
||||||
} else {
|
} else {
|
||||||
return $this->errorResponse(trans('errors.savings_not_found'));
|
return $this->errorResponse(trans('errors.savings_not_found'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getNanoCreditAccount($id_user){
|
public function getNanoCreditAccount($id_user)
|
||||||
|
{
|
||||||
$user = User::findOrFail($id_user);
|
$user = User::findOrFail($id_user);
|
||||||
$data = new \stdClass();
|
$data = new \stdClass();
|
||||||
$data->balance_credit = $user->balance_credit;
|
$data->balance_credit = $user->balance_credit;
|
||||||
|
|
|
@ -168,7 +168,11 @@ class WalletController extends Controller
|
||||||
|
|
||||||
// Supprimer les underscore sur les etats
|
// Supprimer les underscore sur les etats
|
||||||
$merge = array_map(function ($demand) {
|
$merge = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = trans('states.' . $demand->etat);
|
||||||
|
if (isset($demand->type))
|
||||||
|
$demand->type = trans('states.' . $demand->type);
|
||||||
|
if (isset($demand->type_caution))
|
||||||
|
$demand->type_caution = trans('states.' . $demand->type_caution);
|
||||||
return $demand;
|
return $demand;
|
||||||
}, array_merge($demandes, $savings));
|
}, array_merge($demandes, $savings));
|
||||||
|
|
||||||
|
@ -179,10 +183,11 @@ class WalletController extends Controller
|
||||||
return $this->successResponse($this->arrayPaginator($result, $request));
|
return $this->successResponse($this->arrayPaginator($result, $request));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function superHistory($id_wallet, Request $request)
|
public function superHistory($agent_code, Request $request)
|
||||||
{
|
{
|
||||||
|
|
||||||
$walletSup = WalletAgent::where('wallet_id', $id_wallet)->firstOrFail();
|
$walletSup = WalletAgent::where('codeMembre', $agent_code)->firstOrFail();
|
||||||
|
$id_wallet = $walletSup->wallet_id;
|
||||||
|
|
||||||
$demandes = DB::select("SELECT 'N' as type_historique , i.montant ,i.user as destinataire , i.* FROM infos_users_demandes_credits i WHERE codeParrain = :code ;", ['code' => $walletSup->codeMembre]);
|
$demandes = DB::select("SELECT 'N' as type_historique , i.montant ,i.user as destinataire , i.* FROM infos_users_demandes_credits i WHERE codeParrain = :code ;", ['code' => $walletSup->codeMembre]);
|
||||||
|
|
||||||
|
@ -223,7 +228,8 @@ class WalletController extends Controller
|
||||||
|
|
||||||
// Supprimer les underscore sur les etats
|
// Supprimer les underscore sur les etats
|
||||||
$demandes_mapped = array_map(function ($demand) {
|
$demandes_mapped = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = trans('states.' . $demand->etat);
|
||||||
|
$demand->type_caution = trans('states.' . $demand->type_caution);
|
||||||
return $demand;
|
return $demand;
|
||||||
}, $demandes);
|
}, $demandes);
|
||||||
|
|
||||||
|
@ -281,7 +287,11 @@ class WalletController extends Controller
|
||||||
|
|
||||||
// Supprimer les underscore sur les etats
|
// Supprimer les underscore sur les etats
|
||||||
$merge = array_map(function ($demand) {
|
$merge = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = trans('states.' . $demand->etat);
|
||||||
|
if (isset($demand->type))
|
||||||
|
$demand->type = trans('states.' . $demand->type);
|
||||||
|
if (isset($demand->type_caution))
|
||||||
|
$demand->type_caution = trans('states.' . $demand->type_caution);
|
||||||
return $demand;
|
return $demand;
|
||||||
}, array_merge($demandes, $savings));
|
}, array_merge($demandes, $savings));
|
||||||
|
|
||||||
|
@ -292,10 +302,11 @@ class WalletController extends Controller
|
||||||
return $this->successResponse($result);
|
return $this->successResponse($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function allSuperHistory($id_wallet)
|
public function allSuperHistory($agent_code)
|
||||||
{
|
{
|
||||||
|
|
||||||
$walletSup = WalletAgent::where('wallet_id', $id_wallet)->firstOrFail();
|
$walletSup = WalletAgent::where('codeMembre', $agent_code)->firstOrFail();
|
||||||
|
$id_wallet = $walletSup->wallet_id;
|
||||||
|
|
||||||
$demandes = DB::select("SELECT 'N' as type_historique, i.montant , i.user as destinataire , i.* FROM infos_users_demandes_credits i WHERE codeParrain = :code ;", ['code' => $walletSup->codeMembre]);
|
$demandes = DB::select("SELECT 'N' as type_historique, i.montant , i.user as destinataire , i.* FROM infos_users_demandes_credits i WHERE codeParrain = :code ;", ['code' => $walletSup->codeMembre]);
|
||||||
|
|
||||||
|
@ -342,7 +353,8 @@ class WalletController extends Controller
|
||||||
|
|
||||||
// Supprimer les underscore sur les etats
|
// Supprimer les underscore sur les etats
|
||||||
$demandes_mapped = array_map(function ($demand) {
|
$demandes_mapped = array_map(function ($demand) {
|
||||||
$demand->etat = str_replace('_', ' ', $demand->etat);
|
$demand->etat = trans('states.' . $demand->etat);
|
||||||
|
$demand->type_caution = trans('states.' . $demand->type_caution);
|
||||||
return $demand;
|
return $demand;
|
||||||
}, $demandes);
|
}, $demandes);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
return [
|
||||||
|
"EN_COURS" => "CURRENT",
|
||||||
|
"CASSE" => "BROKEN",
|
||||||
|
"EN_ATTENTE_DE_VALIDATION" => "PENDING VALIDATION",
|
||||||
|
"REMBOURSE" => "REFUND",
|
||||||
|
"NON_VALIDE" => "INVALID",
|
||||||
|
"VALIDE" => "VALID",
|
||||||
|
"SIMPLE" => "SIMPLE",
|
||||||
|
"BLOQUE" => "BLOCKED",
|
||||||
|
"NON_TRAITEE" => "NOT TREATED",
|
||||||
|
"TRAITEE" => "TREATED",
|
||||||
|
"groupe" => 'GROUP',
|
||||||
|
"individuel" => "INDIVIDUAL"
|
||||||
|
];
|
|
@ -0,0 +1,15 @@
|
||||||
|
<?php
|
||||||
|
return [
|
||||||
|
"EN_COURS" => "EN COURS",
|
||||||
|
"CASSE" => "CASSÉE",
|
||||||
|
"EN_ATTENTE_DE_VALIDATION" => "EN ATTENTE DE VALIDATION",
|
||||||
|
"REMBOURSE" => "REMBOURSE",
|
||||||
|
"NON_VALIDE" => "NON VALIDE",
|
||||||
|
"VALIDE" => "VALIDE",
|
||||||
|
"SIMPLE" => "SIMPLE",
|
||||||
|
"BLOQUE" => "BLOQUÉE",
|
||||||
|
"NON_TRAITEE" => "NON_TRAITÉE",
|
||||||
|
"TRAITEE" => "TRAITÉE",
|
||||||
|
"groupe" => 'GROUPE',
|
||||||
|
"individuel" => "INDIVIDUEL"
|
||||||
|
];
|
|
@ -60,10 +60,10 @@ $router->group(['prefix' => '', 'middleware' => 'auth'], function () use ($route
|
||||||
|
|
||||||
//Les historiques globals des hyperviseur et superviseur
|
//Les historiques globals des hyperviseur et superviseur
|
||||||
$router->get('hyper_history/{id_network}', 'WalletController@hyperHistory');
|
$router->get('hyper_history/{id_network}', 'WalletController@hyperHistory');
|
||||||
$router->get('super_history/{id_wallet}', 'WalletController@superHistory');
|
$router->get('super_history/{agent_code}', 'WalletController@superHistory');
|
||||||
// Routes sans pagination
|
// Routes sans pagination
|
||||||
$router->get('all_hyper_history/{id_network}', 'WalletController@allHyperHistory');
|
$router->get('all_hyper_history/{id_network}', 'WalletController@allHyperHistory');
|
||||||
$router->get('all_super_history/{id_wallet}', 'WalletController@allSuperHistory');
|
$router->get('all_super_history/{agent_code}', 'WalletController@allSuperHistory');
|
||||||
|
|
||||||
// Wallets users iLink
|
// Wallets users iLink
|
||||||
$router->group(['prefix' => '/users'], function () use ($router) {
|
$router->group(['prefix' => '/users'], function () use ($router) {
|
||||||
|
|
Loading…
Reference in New Issue