+ Update swagger documentation
This commit is contained in:
parent
e23e1bf55a
commit
bbf517c00a
|
@ -34,6 +34,76 @@ class UserController extends Controller
|
|||
//
|
||||
}
|
||||
|
||||
// Trame envoyé lors de la demande de rattachement de l'utilisateur dans le wallet service interne
|
||||
|
||||
/**
|
||||
* @OA\Schema(
|
||||
* schema="user_link_bank_account_frame",
|
||||
* title="User - Rattacher le compte bancaire à son wallet - Trame envoyé",
|
||||
* @OA\Property(property="id_transaction",
|
||||
* type="string",
|
||||
* example="KMTCKQHLQE6D",
|
||||
* minLength = 12,
|
||||
* maxLength = 12,
|
||||
* description="ID de la transaction généré dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="id_wallet_user",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example=9,
|
||||
* description="ID du wallet de l'agent enregistré dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="id_wallet_network",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example=101,
|
||||
* description="ID du reseau enregistré dans la base de données auquel appartient le wallet"
|
||||
* ),
|
||||
* @OA\Property(property="iban",
|
||||
* type="string",
|
||||
* minLength = 5,
|
||||
* maxLength = 34,
|
||||
* example = "CM15UBAA412341234123412341233",
|
||||
* description="Identifiant bancaire"
|
||||
* ),
|
||||
* @OA\Property(property="id_bank",
|
||||
* type="integer",
|
||||
* example=4,
|
||||
* minimum = 1,
|
||||
* description="ID de la banque enregistré dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="lastname",
|
||||
* type="string",
|
||||
* description="Noms de l'utilisateur"
|
||||
* ),
|
||||
* @OA\Property(property="firstname",
|
||||
* type="string",
|
||||
* description="Prenoms de l'utilisateur"
|
||||
* ),
|
||||
* @OA\Property(property="type_document_utilisateur",
|
||||
* type="string",
|
||||
* description="Type de document que l'utilisateur a fourni pour son identification"
|
||||
* ),
|
||||
* @OA\Property(property="id_document_utilisateur",
|
||||
* type="string",
|
||||
* description="ID de l'utilisateur sur le document qu'il a fourni pour son identification"
|
||||
* ),
|
||||
* @OA\Property(property="country",
|
||||
* type="string",
|
||||
* minLength=3,
|
||||
* default="Cameroon",
|
||||
* description="Pays de residence de l'utilisateur"
|
||||
* ),
|
||||
* @OA\Property(property="town",
|
||||
* type="string",
|
||||
* minLength=3,
|
||||
* default="Douala",
|
||||
* description="Ville de residence de l'utilisateur"
|
||||
* ),
|
||||
*
|
||||
* )
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
|
@ -101,9 +171,9 @@ class UserController extends Controller
|
|||
return $this->errorResponse(trans('errors.not_authorized_to_process_request'));
|
||||
|
||||
$transaction->is_verified = $request->is_verified;
|
||||
$user = User::where('user_code', $transaction->user_code)->firstOrFail();
|
||||
// if (!$user)
|
||||
// return $this->errorResponse(trans('errors.unexpected_error'));
|
||||
$user = User::where('user_code', $transaction->user_code)->first();
|
||||
if (!$user)
|
||||
return $this->errorResponse(trans('errors.unexpected_error'));
|
||||
|
||||
if ($request->is_verified) {
|
||||
$user->iban = $transaction->iban;
|
||||
|
|
|
@ -0,0 +1,412 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
class iLinkTransactionController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
// Les trames envoyés lors des transctions dans le wallet service internes
|
||||
|
||||
/**
|
||||
* @OA\Schema(
|
||||
* schema="user_send_from_wallet_to_bank_frame",
|
||||
* title = "User - Envoi de wallet à banque - Trame envoyé",
|
||||
* @OA\Property(property="id_transaction",
|
||||
* type="string",
|
||||
* example="3OCNU8CKXL96",
|
||||
* minLength = 12,
|
||||
* maxLength = 12,
|
||||
* description="ID de la transaction généré dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="type",
|
||||
* type="integer",
|
||||
* default=4,
|
||||
* description="ID du type de la transaction dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="id_wallet_user",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example=9,
|
||||
* description="ID du wallet de l'utilisateur enregistré dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="network_emetteur",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example=101,
|
||||
* description="ID du reseau enregistré dans la base de données auquel appartient le wallet"
|
||||
* ),
|
||||
* @OA\Property(property="iban",
|
||||
* type="string",
|
||||
* minLength = 5,
|
||||
* maxLength = 34,
|
||||
* example = "CM15UBAA412341234123412341233",
|
||||
* description="ID bancaire de l'utilisateur"
|
||||
* ),
|
||||
* @OA\Property(property="id_bank",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example = 16,
|
||||
* description="ID de la banque dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="bank",
|
||||
* type="string",
|
||||
* minLength = 3,
|
||||
* default="UBA",
|
||||
* description="Nom de la banque"
|
||||
* ),
|
||||
* @OA\Property(property="country",
|
||||
* type="string",
|
||||
* default="Cameroon",
|
||||
* description="Pays où la transaction été éfféctuée"
|
||||
* ),
|
||||
* @OA\Property(property="montant",
|
||||
* type="number",
|
||||
* minimum = 1,
|
||||
* example = 10000,
|
||||
* description="Montant de la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="frais",
|
||||
* type="number",
|
||||
* minimum = 0,
|
||||
* example = 100,
|
||||
* description="Montant des frais de la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="taxe",
|
||||
* type="number",
|
||||
* minimum = 0,
|
||||
* example = 50,
|
||||
* description="Montant des taxes de la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="commission_hyp",
|
||||
* type="number",
|
||||
* minimum = 0,
|
||||
* example = 25,
|
||||
* description="Montant de la commission de l'hyperviseur du réseau sur la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="commission_banque",
|
||||
* type="number",
|
||||
* minimum = 0,
|
||||
* example = 25,
|
||||
* description="Montant de la commission de la banque sur le réseau sur la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="date",
|
||||
* type="string",
|
||||
* format="datetime",
|
||||
* example = "2020-11-30T08:57:57.000000Z",
|
||||
* description="Date à laquelle la transaction a été éffectuée"
|
||||
* )
|
||||
* )
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Schema(
|
||||
* schema="user_payement_of_operator_frame",
|
||||
* title = "User - Payer une facture chez un operateur - Trame envoyé",
|
||||
* @OA\Property(property="id_transaction",
|
||||
* type="string",
|
||||
* example="PYHL8CCZYPCM",
|
||||
* minLength = 12,
|
||||
* maxLength = 12,
|
||||
* description="ID de la transaction généré dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="type",
|
||||
* type="integer",
|
||||
* default = 19,
|
||||
* description="ID du type de la transaction dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="id_wallet_user",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example=9,
|
||||
* description="ID du wallet de l'utilisateur enregistré dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="network_emetteur",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example=101,
|
||||
* description="ID du reseau enregistré dans la base de données auquel appartient le wallet"
|
||||
* ),
|
||||
* @OA\Property(property="country",
|
||||
* type="string",
|
||||
* minLength = 1,
|
||||
* example ="Cameroon",
|
||||
* description="Pays où la transaction été éfféctuée"
|
||||
* ),
|
||||
* @OA\Property(property="no_facture",
|
||||
* type="string",
|
||||
* minLength = 3,
|
||||
* example ="ENEO1425533",
|
||||
* description="Numero de la facture"
|
||||
* ),
|
||||
* @OA\Property(property="operator",
|
||||
* type="string",
|
||||
* minLength = 3,
|
||||
* example="ENEO",
|
||||
* description="Nom de l'operateur"
|
||||
* ),
|
||||
* @OA\Property(property="type_operator",
|
||||
* type="string",
|
||||
* minLength = 3,
|
||||
* example="Opérateur d'électricité",
|
||||
* description="Type d'operateur"
|
||||
* ),
|
||||
* @OA\Property(property="id_operator",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example = 16,
|
||||
* description="ID de l'operateur"
|
||||
* ),
|
||||
* @OA\Property(property="montant",
|
||||
* type="number",
|
||||
* minimum = 1,
|
||||
* example = 10000,
|
||||
* description="Montant de la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="frais",
|
||||
* type="number",
|
||||
* minimum = 0,
|
||||
* example = 100,
|
||||
* description="Montant des frais de la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="taxe",
|
||||
* type="number",
|
||||
* minimum = 0,
|
||||
* example = 50,
|
||||
* description="Montant des taxes de la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="commission_hyp",
|
||||
* type="number",
|
||||
* minimum = 0,
|
||||
* example = 25,
|
||||
* description="Montant de la commission de l'hyperviseur du réseau sur la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="date",
|
||||
* type="string",
|
||||
* format="datetime",
|
||||
* example = "2020-11-30T08:57:57.000000Z",
|
||||
* description="Date à laquelle la transaction a été éffectuée"
|
||||
* )
|
||||
* )
|
||||
*/
|
||||
|
||||
/**
|
||||
* @OA\Schema(
|
||||
* schema="user_remove_from_bank_to_wallet_frame",
|
||||
* title="User - Retrait de la banque vers le wallet - Trame envoyé ",
|
||||
* @OA\Property(property="id_transaction",
|
||||
* type="string",
|
||||
* example="CBHL9CPZYZCC",
|
||||
* minLength = 12,
|
||||
* maxLength = 12,
|
||||
* description="ID de la transaction généré dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="type",
|
||||
* type="integer",
|
||||
* default = 20,
|
||||
* description="ID du type de la transaction dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="id_wallet_user",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example=9,
|
||||
* description="ID du wallet de l'utilisateur enregistré dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="network_emetteur",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example=101,
|
||||
* description="ID du reseau enregistré dans la base de données auquel appartient le wallet"
|
||||
* ),
|
||||
* @OA\Property(property="iban",
|
||||
* type="string",
|
||||
* minLength = 5,
|
||||
* maxLength = 34,
|
||||
* example = "CM15UBAA412341234123412341233",
|
||||
* description="ID bancaire de l'utilisateur"
|
||||
* ),
|
||||
* @OA\Property(property="id_bank",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example = 16,
|
||||
* description="ID de la banque dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="bank",
|
||||
* type="string",
|
||||
* minLength = 3,
|
||||
* example="UBA",
|
||||
* description="Nom de la banque"
|
||||
* ),
|
||||
* @OA\Property(property="country",
|
||||
* type="string",
|
||||
* minLength = 3,
|
||||
* example = "Cameroon",
|
||||
* description="Pays où la transaction été éfféctuée"
|
||||
* ),
|
||||
* @OA\Property(property="montant",
|
||||
* type="number",
|
||||
* minimum = 1,
|
||||
* example = 10000,
|
||||
* description="Montant de la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="frais",
|
||||
* type="number",
|
||||
* minimum = 1,
|
||||
* example = 100,
|
||||
* description="Montant des frais de la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="taxe",
|
||||
* type="number",
|
||||
* minimum = 1,
|
||||
* example = 50,
|
||||
* description="Montant des taxes de la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="commission_hyp",
|
||||
* type="number",
|
||||
* minimum = 1,
|
||||
* example = 25,
|
||||
* description="Montant de la commission de l'hyperviseur du réseau sur la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="commission_banque",
|
||||
* type="number",
|
||||
* minimum = 1,
|
||||
* example = 25,
|
||||
* description="Montant de la commission de la banque sur le réseau sur la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="date",
|
||||
* type="string",
|
||||
* format = "datetime",
|
||||
* example = "2020-11-30T08:57:57.000000Z",
|
||||
* description="Date à laquelle la transaction a été éffectuée"
|
||||
* )
|
||||
* )
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Schema(
|
||||
* schema="agent_send_from_cash_to_bank_frame",
|
||||
* title="Agent - Envoi de cash vers banque - Trame envoyé",
|
||||
* @OA\Property(property="id_transaction",
|
||||
* type="string",
|
||||
* example="CBHL9CPZYZCC",
|
||||
* minLength = 12,
|
||||
* maxLength = 12,
|
||||
* description="ID de la transaction généré dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="type",
|
||||
* type="integer",
|
||||
* default = 18,
|
||||
* description="ID du type de la transaction dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="id_wallet_user",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example=9,
|
||||
* description="ID du wallet de l'agent enregistré dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="id_wallet_network",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example=101,
|
||||
* description="ID du reseau enregistré dans la base de données auquel appartient le wallet"
|
||||
* ),
|
||||
* @OA\Property(property="iban",
|
||||
* type="string",
|
||||
* minLength = 5,
|
||||
* maxLength = 34,
|
||||
* example = "CM15UBAA412341234123412341233",
|
||||
* description="Identifiant bancaire"
|
||||
* ),
|
||||
* @OA\Property(property="id_bank",
|
||||
* type="integer",
|
||||
* minimum = 1,
|
||||
* example=4,
|
||||
* description="ID de la banque enregistré dans la base de données"
|
||||
* ),
|
||||
* @OA\Property(property="nom_emetteur",
|
||||
* type="string",
|
||||
* minLength = 2,
|
||||
* description="Noms de l'emetteur"
|
||||
* ),
|
||||
* @OA\Property(property="prenom_emetteur",
|
||||
* type="string",
|
||||
* minLength = 0,
|
||||
* description="Prenoms de l'emetteur"
|
||||
* ),
|
||||
* @OA\Property(property="email_emetteur",
|
||||
* type="string",
|
||||
* minLength = 5,
|
||||
* description="Email de l'emetteur"
|
||||
* ),
|
||||
* @OA\Property(property="type_document_emetteur",
|
||||
* type="string",
|
||||
* minLength = 3,
|
||||
* example= "CNI",
|
||||
* description="Type de document que l'emetteur a fourni pour son identification"
|
||||
* ),
|
||||
* @OA\Property(property="id_document_emetteur",
|
||||
* type="string",
|
||||
* minLength = 1,
|
||||
* description="ID de l'emetteur sur le document qu'il a fourni pour son identification"
|
||||
* ),
|
||||
* @OA\Property(property="nom_destinataire",
|
||||
* type="string",
|
||||
* minLength = 2,
|
||||
* description="Noms du destinataire"
|
||||
* ),
|
||||
* @OA\Property(property="prenom_destinataire",
|
||||
* type="string",
|
||||
* minLength = 0,
|
||||
* description="Prenoms du destinataire"
|
||||
* ),
|
||||
* @OA\Property(property="montant",
|
||||
* type="number",
|
||||
* minimum = 1,
|
||||
* example = 10000,
|
||||
* description="Montant de la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="frais",
|
||||
* type="number",
|
||||
* minimum = 0,
|
||||
* example = 100,
|
||||
* description="Montant des frais de la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="taxe",
|
||||
* type="number",
|
||||
* minimum = 0,
|
||||
* example = 50,
|
||||
* description="Montant des taxes de la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="commission_hyp",
|
||||
* type="number",
|
||||
* minimum = 0,
|
||||
* example = 25,
|
||||
* description="Montant de la commission de l'hyperviseur du réseau sur la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="commission_sup",
|
||||
* type="number",
|
||||
* minimum = 0,
|
||||
* example = 25,
|
||||
* description="Montant de la commission du superviseur de l'agent du réseau sur la transaction"
|
||||
* ),
|
||||
* @OA\Property(property="commission_ag",
|
||||
* type="number",
|
||||
* minimum = 0,
|
||||
* example = 25,
|
||||
* description="Montant de la commission de l'agent géolocalisé sur la transaction"
|
||||
* ),
|
||||
* )
|
||||
*/
|
||||
|
||||
}
|
|
@ -39,7 +39,7 @@ trait Helper
|
|||
public function sendMail($email, $title, $messageText)
|
||||
{
|
||||
|
||||
$recipients = [$email];
|
||||
$recipients = [preg_replace("/\s+/", "", $email)];
|
||||
Mail::mailer('smtp')->raw($messageText, function ($message) use ($recipients, $title) {
|
||||
$message->subject($title);
|
||||
$message->to($recipients);
|
||||
|
@ -59,7 +59,7 @@ trait Helper
|
|||
$body->user_code = $user_code;
|
||||
$body->message = $message;
|
||||
$body->data = $data;
|
||||
$body->date = $date;
|
||||
$body->date = $date->format('Y-m-d H:i:s');
|
||||
$promise = $client->requestAsync('POST', '/onesignal/pushToUser', ['json' => $body, 'headers' => $headers])->then();
|
||||
// function (ResponseInterface $res) {
|
||||
// echo $res->getStatusCode() . "\n";
|
||||
|
@ -85,7 +85,7 @@ trait Helper
|
|||
$body->agent_code = $agent_code;
|
||||
$body->message = $message;
|
||||
$body->data = $data;
|
||||
$body->date = $date;
|
||||
$body->date = $date->format('Y-m-d H:i:s');
|
||||
$promise = $client->requestAsync('POST', '/onesignal/pushToAgent', ['json' => $body, 'headers' => $headers])->then();
|
||||
$promise->wait();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue