Compare commits
7 Commits
feature/Pa
...
5c757e1823
| Author | SHA1 | Date | |
|---|---|---|---|
| 5c757e1823 | |||
| 9ad3d6cea0 | |||
| 8554f4cc55 | |||
| 5e48777e1c | |||
| 5b79cefe28 | |||
| 41b7ead69e | |||
| f3a9b5e788 |
43
backend/app/Enums/BusinessTypeEnum.php
Normal file
43
backend/app/Enums/BusinessTypeEnum.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum BusinessTypeEnum: int
|
||||
{
|
||||
case MEDICAL = 1;
|
||||
case LEGAL = 2;
|
||||
case ENGINEERING = 3;
|
||||
case EDUCATION = 4;
|
||||
case CONSULTING = 5;
|
||||
case BEAUTY = 6;
|
||||
case TECHNICAL_SERVICES = 7;
|
||||
case FINANCIAL = 8;
|
||||
case REAL_ESTATE = 9;
|
||||
case RESTAURANT = 10;
|
||||
case SHOP = 11;
|
||||
case TRANSPORTATION = 12;
|
||||
case ART = 13;
|
||||
case SPORT = 14;
|
||||
case OTHER = 15;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::MEDICAL => 'medical',
|
||||
self::LEGAL => 'legal',
|
||||
self::ENGINEERING => 'engineering',
|
||||
self::EDUCATION => 'education',
|
||||
self::CONSULTING => 'consulting',
|
||||
self::BEAUTY => 'beauty',
|
||||
self::TECHNICAL_SERVICES => 'technical_services',
|
||||
self::FINANCIAL => 'financial',
|
||||
self::REAL_ESTATE => 'real_estate',
|
||||
self::RESTAURANT => 'restaurant',
|
||||
self::SHOP => 'shop',
|
||||
self::TRANSPORTATION => 'transportation',
|
||||
self::ART => 'art',
|
||||
self::SPORT => 'sport',
|
||||
self::OTHER => 'other',
|
||||
};
|
||||
}
|
||||
}
|
||||
23
backend/app/Enums/PaymentStatusEnum.php
Normal file
23
backend/app/Enums/PaymentStatusEnum.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Enums;
|
||||
|
||||
enum PaymentStatusEnum:int
|
||||
{
|
||||
case Unpaid = 0;
|
||||
case Cancelled = 1;
|
||||
case Expired = 2;
|
||||
case Paid = 3;
|
||||
case Refunded = 4;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match ($this) {
|
||||
self::Unpaid => 'unpaid',
|
||||
self::Cancelled => 'cancelled',
|
||||
self::Expired => 'expired',
|
||||
self::Paid => 'paid',
|
||||
self::Refunded => 'refunded',
|
||||
};
|
||||
}
|
||||
}
|
||||
18
backend/app/User/Controllers/CityController.php
Executable file
18
backend/app/User/Controllers/CityController.php
Executable file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\City;
|
||||
use App\Traits\ApiResponse;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class CityController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
|
||||
public function list(): JsonResponse
|
||||
{
|
||||
return response()->json(City::all(['id', 'name']));
|
||||
}
|
||||
}
|
||||
17
backend/app/User/Controllers/ProvinceController.php
Executable file
17
backend/app/User/Controllers/ProvinceController.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\User\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Province;
|
||||
use App\Traits\ApiResponse;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class ProvinceController extends Controller
|
||||
{
|
||||
use ApiResponse;
|
||||
public function list(): JsonResponse
|
||||
{
|
||||
return response()->json(Province::all(['id', 'name']));
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class BusinessTypeSeeder extends Seeder
|
||||
{
|
||||
@@ -12,6 +13,22 @@ class BusinessTypeSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
DB::table('business_types')->insert([
|
||||
['id' => 1, 'name' => 'medical', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 2, 'name' => 'legal', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 3, 'name' => 'engineering', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 4, 'name' => 'education', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 5, 'name' => 'consulting', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 6, 'name' => 'beauty', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 7, 'name' => 'technical_services', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 8, 'name' => 'financial', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 9, 'name' => 'real_estate', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 10, 'name' => 'restaurant', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 11, 'name' => 'shop', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 12, 'name' => 'transportation', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 13, 'name' => 'art', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 14, 'name' => 'sport', 'created_at' => now(), 'updated_at' => now()],
|
||||
['id' => 15, 'name' => 'other', 'created_at' => now(), 'updated_at' => now()],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class PaymentStatusSeeder extends Seeder
|
||||
{
|
||||
@@ -12,6 +13,12 @@ class PaymentStatusSeeder extends Seeder
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
//
|
||||
DB::table('payment_statuses')->insert([
|
||||
['id' => 0, 'name' => 'unpaid', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 1, 'name' => 'cancelled', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 2, 'name' => 'expired', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 3, 'name' => 'paid', 'created_at' => now(), 'updated_at' => now(),],
|
||||
['id' => 4, 'name' => 'refunded', 'created_at' => now(), 'updated_at' => now(),],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,9 @@ use App\Admin\Controllers\PermissionManagementController;
|
||||
use App\Admin\Controllers\RoleManagementController;
|
||||
use App\Admin\Controllers\UserManagementController;
|
||||
use App\User\Controllers\AuthController;
|
||||
use App\User\Controllers\CityController;
|
||||
use App\User\Controllers\ProfileController;
|
||||
use App\User\Controllers\ProvinceController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
Route::prefix('auth')
|
||||
@@ -26,3 +28,17 @@ Route::prefix('profile')
|
||||
Route::post('edit', 'edit')->name('edit');
|
||||
Route::post('change_password', 'changePassword')->name('changePassword');
|
||||
});
|
||||
|
||||
Route::prefix('province')
|
||||
->name('province.')
|
||||
->controller(ProvinceController::class)
|
||||
->group(function () {
|
||||
Route::get('list', 'list')->name('list');
|
||||
});
|
||||
|
||||
Route::prefix('city')
|
||||
->name('city.')
|
||||
->controller(CityController::class)
|
||||
->group(function () {
|
||||
Route::get('list', 'list')->name('list');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user