+ Add card rattachement
This commit is contained in:
parent
5d29d3e6b2
commit
cf9419b474
|
@ -121,6 +121,22 @@ class UserController extends Controller
|
||||||
return $randomString;
|
return $randomString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function rattachCard(Request $request , $id_user){
|
||||||
|
$this->validate($request, [
|
||||||
|
// 'id_user' => 'required|integer|min:0|not_in:0',
|
||||||
|
'numero_carte'=>'required',
|
||||||
|
'expiration_date'=>'required_if:facade,front|date_format:m/y|after_or_equal:today',
|
||||||
|
]);
|
||||||
|
$user = User::findOrFail($id_user);
|
||||||
|
$user->numero_carte = $request->numero_carte;
|
||||||
|
$expiration_date = \DateTime::createFromFormat('m/y', $request->expiration_date);
|
||||||
|
if (!$expiration_date)
|
||||||
|
$expiration_date = new \DateTime();
|
||||||
|
$user->expiration_date = $expiration_date;
|
||||||
|
$user->save();
|
||||||
|
return $this->successResponse(trans('messages.successful_card_attachment'));
|
||||||
|
}
|
||||||
|
|
||||||
public function uploadImage(Request $request , $key , $imageCode, $folderName)
|
public function uploadImage(Request $request , $key , $imageCode, $folderName)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ class WalletController extends Controller
|
||||||
|
|
||||||
// Wallets users iLink
|
// Wallets users iLink
|
||||||
public function showWalletUser($id_user){
|
public function showWalletUser($id_user){
|
||||||
$wallet = collect(DB::select('SELECT wu.* , u.user_code from wallets_users wu
|
$wallet = collect(DB::select('SELECT wu.* , u.user_code , u.numero_carte , u.expiration_date from wallets_users wu
|
||||||
INNER JOIN users u ON u.id = wu.idUser WHERE wu.idUser = :id_user',['id_user' => $id_user]))->first();
|
INNER JOIN users u ON u.id = wu.idUser WHERE wu.idUser = :id_user',['id_user' => $id_user]))->first();
|
||||||
if($wallet){
|
if($wallet){
|
||||||
$wallet->country = 'Gabon';
|
$wallet->country = 'Gabon';
|
||||||
|
|
|
@ -20,6 +20,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
* @property string $phone
|
* @property string $phone
|
||||||
* @property string $email
|
* @property string $email
|
||||||
* @property string $user_code
|
* @property string $user_code
|
||||||
|
* @property string $numero_carte
|
||||||
|
* @property Carbon $expiration_date
|
||||||
* @property string $adresse
|
* @property string $adresse
|
||||||
* @property float $solde
|
* @property float $solde
|
||||||
* @property string $encrypted_password
|
* @property string $encrypted_password
|
||||||
|
@ -37,50 +39,53 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
*/
|
*/
|
||||||
class User extends Model
|
class User extends Model
|
||||||
{
|
{
|
||||||
protected $table = 'users';
|
protected $table = 'users';
|
||||||
public $timestamps = false;
|
public $timestamps = false;
|
||||||
|
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'solde' => 'float',
|
'solde' => 'float',
|
||||||
'active' => 'int',
|
'active' => 'int',
|
||||||
'network_id' => 'int'
|
'network_id' => 'int'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $dates = [
|
protected $dates = [
|
||||||
'date_modified',
|
'expiration_date',
|
||||||
'date_created'
|
'date_modified',
|
||||||
];
|
'date_created'
|
||||||
|
];
|
||||||
|
|
||||||
protected $hidden = [
|
protected $hidden = [
|
||||||
'encrypted_password'
|
'encrypted_password'
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'uid',
|
'uid',
|
||||||
'firstname',
|
'firstname',
|
||||||
'lastname',
|
'lastname',
|
||||||
'phone',
|
'phone',
|
||||||
'email',
|
'email',
|
||||||
'user_code',
|
'user_code',
|
||||||
'adresse',
|
'numero_carte',
|
||||||
'solde',
|
'expiration_date',
|
||||||
'encrypted_password',
|
'adresse',
|
||||||
'salt',
|
'solde',
|
||||||
'validation_code',
|
'encrypted_password',
|
||||||
'active',
|
'salt',
|
||||||
'date_modified',
|
'validation_code',
|
||||||
'date_created'
|
'active',
|
||||||
];
|
'date_modified',
|
||||||
|
'date_created'
|
||||||
|
];
|
||||||
|
|
||||||
public function identifications()
|
public function identifications()
|
||||||
{
|
{
|
||||||
return $this->hasMany(Identification::class, 'idUser');
|
return $this->hasMany(Identification::class, 'id_user');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function wallets_users()
|
public function wallets_users()
|
||||||
{
|
{
|
||||||
return $this->hasMany(WalletsUser::class, 'idUser');
|
return $this->hasMany(WalletsUser::class, 'idUser');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function network()
|
public function network()
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,6 +15,7 @@ return [
|
||||||
'user_not_identificated' => 'User is not identificated',
|
'user_not_identificated' => 'User is not identificated',
|
||||||
'validated_identification'=>'Validated identification',
|
'validated_identification'=>'Validated identification',
|
||||||
'identification_already_validated'=>'Identification already validated',
|
'identification_already_validated'=>'Identification already validated',
|
||||||
|
'successful_card_attachment' => 'Attachment of your card made',
|
||||||
'successful_identification_message' => 'Hi :name,
|
'successful_identification_message' => 'Hi :name,
|
||||||
|
|
||||||
Your identification has been taken into account. Contact an iLink World agent with your ID to validate your identity.
|
Your identification has been taken into account. Contact an iLink World agent with your ID to validate your identity.
|
||||||
|
|
|
@ -15,6 +15,7 @@ return [
|
||||||
'user_identificated' => 'Utilisateur déjà identifié',
|
'user_identificated' => 'Utilisateur déjà identifié',
|
||||||
'user_not_identificated' => 'Utilisateur non identifié',
|
'user_not_identificated' => 'Utilisateur non identifié',
|
||||||
'identification_already_validated' => 'Identification deja validée',
|
'identification_already_validated' => 'Identification deja validée',
|
||||||
|
'successful_card_attachment' => 'Rattachement de votre carte effectuée',
|
||||||
'successful_identification_message' => 'Salut :name,
|
'successful_identification_message' => 'Salut :name,
|
||||||
|
|
||||||
Votre identification a été prise en compte . Rapprochez vous auprès d\'un agent iLink World muni de votre pièce d\'identité pour faire valider de votre identité.
|
Votre identification a été prise en compte . Rapprochez vous auprès d\'un agent iLink World muni de votre pièce d\'identité pour faire valider de votre identité.
|
||||||
|
|
|
@ -62,5 +62,6 @@ $router->group(['prefix' => '/identifications'] , function () use ($router){
|
||||||
$router->post('{id_identification}','UserController@validateIdentification');
|
$router->post('{id_identification}','UserController@validateIdentification');
|
||||||
$router->get('{user_phone}','UserController@fetchIdentification');
|
$router->get('{user_phone}','UserController@fetchIdentification');
|
||||||
$router->get('verify/{user_phone}','UserController@verifyIdentification');
|
$router->get('verify/{user_phone}','UserController@verifyIdentification');
|
||||||
|
$router->post('rattach_card/{id_user}', 'UserController@rattachCard');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue