Files
mykopkb-be/Modules/Investment/Routes/api.php
T

84 lines
4.7 KiB
PHP

<?php
use Illuminate\Support\Facades\Route;
use Modules\Investment\Http\Controllers\BillplzInvestmentController;
use Modules\Investment\Http\Controllers\InvestmentController;
use Modules\Investment\Http\Controllers\InvestmentLimitProfileController;
use Modules\Investment\Http\Controllers\InvestmentTypeController;
use Modules\Investment\Http\Controllers\ProfileInvestmentLimitController;
use Modules\Investment\Http\Controllers\SalaryContributionController;
use Modules\Investment\Http\Controllers\SalaryDeductionBatchController;
use Modules\Investment\Http\Controllers\UserInvestmentLimitController;
use Modules\Investment\Http\Controllers\UserLimitProfileController;
Route::prefix('v1')->group(function () {
// Billplz server-to-server callback (no auth)
Route::post('billplz/callback', [BillplzInvestmentController::class, 'callback'])
->name('billplz.callback');
});
Route::middleware(['auth:sanctum', 'single.session'])->prefix('v1')->group(function () {
// Investment Types
Route::apiResource('investment-types', InvestmentTypeController::class)->names('investment-type');
// Investments
Route::get('investments', [InvestmentController::class, 'index'])
->name('investment.index');
Route::post('investments/manual', [InvestmentController::class, 'storeManual'])
->name('investment.manual.store');
Route::post('investments/billplz', [BillplzInvestmentController::class, 'store'])
->name('investment.billplz.store');
Route::get('investments/{id}/payment-status', [BillplzInvestmentController::class, 'status'])
->name('investment.payment-status');
Route::get('investments/{id}', [InvestmentController::class, 'show'])
->name('investment.show');
// Investment Limit Profiles
Route::apiResource('investment-limit-profiles', InvestmentLimitProfileController::class)
->names('investment-limit-profile');
// Profile Investment Limits
Route::get('investment-limit-profiles/{investment_limit_profile}/limits', [ProfileInvestmentLimitController::class, 'index'])
->name('investment-limit-profile.limits.index');
Route::post('investment-limit-profiles/{investment_limit_profile}/limits', [ProfileInvestmentLimitController::class, 'store'])
->name('investment-limit-profile.limits.store');
Route::put('investment-limit-profiles/{investment_limit_profile}/limits/{limit}', [ProfileInvestmentLimitController::class, 'update'])
->name('investment-limit-profile.limits.update');
Route::delete('investment-limit-profiles/{investment_limit_profile}/limits/{limit}', [ProfileInvestmentLimitController::class, 'destroy'])
->name('investment-limit-profile.limits.destroy');
// User Limit Profiles
Route::get('user-limit-profiles', [UserLimitProfileController::class, 'index'])
->name('user-limit-profile.index');
Route::post('user-limit-profiles', [UserLimitProfileController::class, 'store'])
->name('user-limit-profile.store');
// User Investment Limits
Route::apiResource('user-investment-limits', UserInvestmentLimitController::class)
->names('user-investment-limit');
// Salary contributions (standing instructions)
Route::apiResource('salary-contributions', SalaryContributionController::class)
->names('salary-contribution');
// Salary deduction batches
Route::get('salary-deduction-batches', [SalaryDeductionBatchController::class, 'index'])
->name('salary-deduction-batch.index');
Route::post('salary-deduction-batches', [SalaryDeductionBatchController::class, 'store'])
->name('salary-deduction-batch.store');
Route::post('salary-deduction-batches/generate', [SalaryDeductionBatchController::class, 'generate'])
->name('salary-deduction-batch.generate');
Route::get('salary-deduction-batches/{id}', [SalaryDeductionBatchController::class, 'show'])
->name('salary-deduction-batch.show');
Route::post('salary-deduction-batches/{id}/under-review', [SalaryDeductionBatchController::class, 'markUnderReview'])
->name('salary-deduction-batch.under-review');
Route::post('salary-deduction-batches/{id}/verify-all', [SalaryDeductionBatchController::class, 'verifyAll'])
->name('salary-deduction-batch.verify-all');
Route::post('salary-deduction-batches/{id}/reject', [SalaryDeductionBatchController::class, 'rejectBatch'])
->name('salary-deduction-batch.reject');
Route::post('salary-deduction-batches/{id}/details/{detailId}/verify', [SalaryDeductionBatchController::class, 'verifyDetail'])
->name('salary-deduction-batch.detail.verify');
Route::post('salary-deduction-batches/{id}/details/{detailId}/reject', [SalaryDeductionBatchController::class, 'rejectDetail'])
->name('salary-deduction-batch.detail.reject');
});