{
	"info": {
		"_postman_id": "mgmt-changes-autohub-2026",
		"name": "AutoHub — تعديلات الإدارة فقط (Management delta)",
		"description": "## قبل التجربة\n1. **Migration:** `php artisan migrate` (إن لم تُشغَّل بعد — يشمل أعمدة full_name, city, chassis_number وفهارس favorites).\n2. **Seed كامل:** `php artisan migrate:fresh --seed` أو على بيانات موجودة: `php artisan db:seed --class=ManagementFeaturesDemoSeeder`\n\n## OTP للتجربة (بيئة local فقط)\nالسيدر `ManagementFeaturesDemoSeeder` يضيف كود **999999** للهاتف **520000001** (عميل الديمو) بعد تشغيله في `APP_ENV=local`.\n\n## المتغيرات\nعبّي `customer_token` و`guest_token` و`store_token` من استجابات الطلبات. حدّث `category_root_id` من `GET /categories` و`address_id` / `product_id` / `order_id` حسب قاعدتك.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
	},
	"variable": [
		{ "key": "base_url", "value": "http://127.0.0.1:8000" },
		{ "key": "customer_token", "value": "" },
		{ "key": "guest_token", "value": "" },
		{ "key": "store_token", "value": "" },
		{ "key": "category_root_id", "value": "1" },
		{ "key": "store_id", "value": "1" },
		{ "key": "address_id", "value": "1" },
		{ "key": "product_id", "value": "1" },
		{ "key": "order_id", "value": "1" }
	],
	"item": [
		{
			"name": "1 — Auth (عميل OTP + تسجيل)",
			"item": [
				{
					"name": "POST customer/register (name, email, بدون password)",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"phone\": \"5298888777\",\n  \"account_type\": \"individual\",\n  \"name\": \"مستخدم تجريبي\",\n  \"email\": \"demo.user.mgmt@example.com\"\n}"
						},
						"url": "{{base_url}}/api/auth/customer/register"
					}
				},
				{
					"name": "POST customer/login (إرسال OTP لعميل موجود)",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"phone\": \"520000001\"\n}"
						},
						"url": "{{base_url}}/api/auth/customer/login"
					}
				},
				{
					"name": "POST customer/otp/verify (phone + otp + guest_token اختياري)",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"phone\": \"520000001\",\n  \"otp\": \"999999\",\n  \"guest_token\": null\n}"
						},
						"url": "{{base_url}}/api/auth/customer/otp/verify"
					}
				},
				{
					"name": "POST customer/otp/resend",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"phone\": \"520000001\"\n}"
						},
						"url": "{{base_url}}/api/auth/customer/otp/resend"
					}
				},
				{
					"name": "POST login — عميل (مرفوض: استخدم OTP)",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"username\": \"customer_1\",\n  \"password\": \"password\",\n  \"user_type\": \"customer\"\n}"
						},
						"url": "{{base_url}}/api/auth/login"
					}
				},
				{
					"name": "POST login — متجر (password)",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"username\": \"store_owner_1\",\n  \"password\": \"password\",\n  \"user_type\": \"store\"\n}"
						},
						"url": "{{base_url}}/api/auth/login"
					}
				}
			]
		},
		{
			"name": "2 — عامة (بدون توكن عميل)",
			"item": [
				{
					"name": "GET shipment-methods",
					"request": {
						"method": "GET",
						"header": [{ "key": "Accept", "value": "application/json" }],
						"url": "{{base_url}}/api/shipment-methods"
					}
				},
				{
					"name": "GET payment-methods",
					"request": {
						"method": "GET",
						"header": [{ "key": "Accept", "value": "application/json" }],
						"url": "{{base_url}}/api/payment-methods"
					}
				},
				{
					"name": "GET dynamic-labels (ليبلز الفلتر — عام)",
					"request": {
						"method": "GET",
						"header": [{ "key": "Accept", "value": "application/json" }],
						"url": "{{base_url}}/api/dynamic-labels"
					}
				},
				{
					"name": "GET categories (جذور المنصة)",
					"request": {
						"method": "GET",
						"header": [{ "key": "Accept", "value": "application/json" }],
						"url": "{{base_url}}/api/categories"
					}
				},
				{
					"name": "GET categories/{id}/children",
					"request": {
						"method": "GET",
						"header": [{ "key": "Accept", "value": "application/json" }],
						"url": "{{base_url}}/api/categories/{{category_root_id}}/children"
					}
				},
				{
					"name": "GET guest/home (يحتوي categories)",
					"request": {
						"method": "GET",
						"header": [{ "key": "Accept", "value": "application/json" }],
						"url": "{{base_url}}/api/guest/home"
					}
				},
				{
					"name": "GET filter — keyword q",
					"request": {
						"method": "GET",
						"header": [{ "key": "Accept", "value": "application/json" }],
						"url": "{{base_url}}/api/filter?q=filter&keyword=&price_min=&price_max=&category_id=&sort="
					}
				},
				{
					"name": "POST filter/options — body كامل + keyword",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"q\": \"Oil\",\n  \"keyword\": \"\",\n  \"price_min\": null,\n  \"price_max\": null,\n  \"category_id\": null,\n  \"label_id\": null,\n  \"sort\": \"price_asc\",\n  \"options\": [\n    { \"name\": \"car_make\", \"value\": \"Toyota\" }\n  ]\n}"
						},
						"url": "{{base_url}}/api/filter/options"
					}
				},
				{
					"name": "GET stores/{id} — pagination + per_page",
					"request": {
						"method": "GET",
						"header": [{ "key": "Accept", "value": "application/json" }],
						"url": "{{base_url}}/api/stores/{{store_id}}"
					}
				}
			]
		},
		{
			"name": "3 — Guest (توكن ضيف)",
			"item": [
				{
					"name": "POST guest/ — إنشاء ضيف",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"device_token\": \"postman-guest-device-001\",\n  \"platform\": \"android\"\n}"
						},
						"url": "{{base_url}}/api/guest"
					}
				},
				{
					"name": "GET guest/favorites",
					"request": {
						"method": "GET",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{guest_token}}" }
						],
						"url": "{{base_url}}/api/guest/favorites"
					}
				},
				{
					"name": "POST guest/favorites — منتج",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{guest_token}}" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"product_id\": {{product_id}}\n}"
						},
						"url": "{{base_url}}/api/guest/favorites"
					}
				},
				{
					"name": "POST guest/favorites — متجر",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{guest_token}}" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"store_id\": {{store_id}}\n}"
						},
						"url": "{{base_url}}/api/guest/favorites"
					}
				},
				{
					"name": "DELETE guest/favorites/{productId}",
					"request": {
						"method": "DELETE",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{guest_token}}" }
						],
						"url": "{{base_url}}/api/guest/favorites/{{product_id}}"
					}
				},
				{
					"name": "DELETE guest/favorites/store/{storeId}",
					"request": {
						"method": "DELETE",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{guest_token}}" }
						],
						"url": "{{base_url}}/api/guest/favorites/store/{{store_id}}"
					}
				}
			]
		},
		{
			"name": "4 — Customer (توكن عميل)",
			"item": [
				{
					"name": "GET user/home (categories)",
					"request": {
						"method": "GET",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"url": "{{base_url}}/api/user/home"
					}
				},
				{
					"name": "PUT user/profile — full_name / name / email",
					"request": {
						"method": "PUT",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"full_name\": \"اسم كامل من البروفايل\",\n  \"name\": \"\",\n  \"email\": \"updated@example.com\",\n  \"phone\": \"520000001\",\n  \"birthday\": \"1990-01-15\",\n  \"gender\": \"male\",\n  \"avatar\": null\n}"
						},
						"url": "{{base_url}}/api/user/profile"
					}
				},
				{
					"name": "POST user/addresses — title, description, city, area",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"lat\": 24.7136,\n  \"lng\": 46.6753,\n  \"title\": \"المنزل\",\n  \"city\": \"Riyadh\",\n  \"area\": \"العليا\",\n  \"description\": \"تفاصيل إضافية للعنوان — بجانب المول\"\n}"
						},
						"url": "{{base_url}}/api/user/addresses"
					}
				},
				{
					"name": "POST user/vehicles — chassis_number, engine_size, transmission",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"brand_id\": 1,\n  \"car_model\": \"Corolla\",\n  \"year\": 2020,\n  \"fuel_type\": \"Gas\",\n  \"color\": \"White\",\n  \"engine_type\": \"I4\",\n  \"engine_size\": \"2.0\",\n  \"transmission\": \"AT\",\n  \"chassis_number\": \"JT2BF22K1W0123456\"\n}"
						},
						"url": "{{base_url}}/api/user/vehicles"
					}
				},
				{
					"name": "POST user/orders/preview — calc bill (بدون إنشاء طلب)",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"address_id\": {{address_id}},\n  \"payment_method_id\": 1,\n  \"delivery_method\": \"standard\",\n  \"delivery_instructions\": \"اتصل عند الوصول\",\n  \"items\": [\n    {\n      \"product_id\": {{product_id}},\n      \"quantity\": 2\n    }\n  ]\n}"
						},
						"url": "{{base_url}}/api/user/orders/preview"
					}
				},
				{
					"name": "POST user/orders — إنشاء طلب (= checkout)",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"address_id\": {{address_id}},\n  \"payment_method_id\": 1,\n  \"delivery_method\": \"standard\",\n  \"delivery_instructions\": \"\",\n  \"items\": [\n    {\n      \"product_id\": {{product_id}},\n      \"quantity\": 1\n    }\n  ]\n}"
						},
						"url": "{{base_url}}/api/user/orders"
					}
				},
				{
					"name": "POST user/checkout — نفس إنشاء الطلب",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"address_id\": {{address_id}},\n  \"payment_method_id\": 1,\n  \"delivery_method\": \"express\",\n  \"delivery_instructions\": null,\n  \"items\": [\n    {\n      \"product_id\": {{product_id}},\n      \"quantity\": 1\n    }\n  ]\n}"
						},
						"url": "{{base_url}}/api/user/checkout"
					}
				},
				{
					"name": "GET user/orders/active",
					"request": {
						"method": "GET",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"url": "{{base_url}}/api/user/orders/active"
					}
				},
				{
					"name": "GET user/orders/{order}",
					"request": {
						"method": "GET",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"url": "{{base_url}}/api/user/orders/{{order_id}}"
					}
				},
				{
					"name": "GET user/favorites",
					"request": {
						"method": "GET",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"url": "{{base_url}}/api/user/favorites"
					}
				},
				{
					"name": "POST user/favorites — منتج",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"product_id\": {{product_id}}\n}"
						},
						"url": "{{base_url}}/api/user/favorites"
					}
				},
				{
					"name": "POST user/favorites — متجر",
					"request": {
						"method": "POST",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Content-Type", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"body": {
							"mode": "raw",
							"raw": "{\n  \"store_id\": {{store_id}}\n}"
						},
						"url": "{{base_url}}/api/user/favorites"
					}
				},
				{
					"name": "DELETE user/favorites/{productId}",
					"request": {
						"method": "DELETE",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"url": "{{base_url}}/api/user/favorites/{{product_id}}"
					}
				},
				{
					"name": "DELETE user/favorites/store/{storeId}",
					"request": {
						"method": "DELETE",
						"header": [
							{ "key": "Accept", "value": "application/json" },
							{ "key": "Authorization", "value": "Bearer {{customer_token}}" }
						],
						"url": "{{base_url}}/api/user/favorites/store/{{store_id}}"
					}
				}
			]
		}
	]
}
