feat: implement BankFlow loan workflow API endpoints
This commit is contained in:
1 parent
56a52be180
commit
7824e8f015
43 files changed
+1403
-10
No files matched your search
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class LoanHistoryResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'stage' => $this->stage_code->value,
|
||||
'result' => $this->result->value,
|
||||
'timestamp' => $this->executed_at->toIso8601ZuluString(),
|
||||
'reason' => $this->reason,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class LoanProcessResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'loanId' => $this->public_id,
|
||||
'status' => $this->status->value,
|
||||
'currentStage' => $this->currentStep?->stageDefinition->code,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class LoanResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'loanId' => $this->public_id,
|
||||
'customerId' => $this->customer_id,
|
||||
'amount' => $this->amount,
|
||||
'phone' => $this->phone,
|
||||
'loanType' => $this->loanType->code,
|
||||
'monthlyIncome' => $this->monthly_income,
|
||||
'creditScore' => $this->credit_score,
|
||||
'hasGuarantor' => $this->has_guarantor,
|
||||
'status' => $this->status->value,
|
||||
'currentStage' => $this->currentStep?->stageDefinition->code,
|
||||
'createdAt' => $this->created_at->toIso8601ZuluString(),
|
||||
'updatedAt' => $this->updated_at->toIso8601ZuluString(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user