# Function deleteRoomingPlanCharter

### <a name="func_1"></a>

#### <span style="font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·</span></span><span lang="AR-SA"><span style="mso-spacerun: yes;"> </span>هدف:</span>

این متد برای حذف تخصیص یک مسافر از یک اتاق در یک پلن اتاق‌بندی (رومینگ) طراحی شده است. عملکرد آن بسیار ساده و مستقیم است: با دریافت شناسه پلن (`plan_id`) و شناسه رزرو مسافر (`reserve_id`)، رکورد متناظر را از جدول `charter_plans_rooming` حذف می‌کند. این کار به معنی آزاد کردن جایگاه آن مسافر در پلن است و به او اجازه می‌دهد تا به اتاق دیگری تخصیص یابد یا به طور کلی از پلن حذف شود.

<table border="1" class="align-center" id="bkmrk-%D9%88%DB%8C%DA%98%DA%AF%DB%8C%E2%80%8C%D9%87%D8%A7-%D8%AA%D9%88%D8%B6%DB%8C%D8%AD%D8%A7%D8%AA-%D9%87%D8%AF%D9%81" style="border-collapse: collapse; width: 80.9524%; height: 217.875px; background-color: rgb(236, 202, 250); border: 1px inset rgb(206, 212, 217);"><colgroup><col style="width: 50.0736%;"></col><col style="width: 50.0736%;"></col></colgroup><thead><tr style="height: 31.4583px;"><td style="height: 31.4583px; border-color: rgb(206, 212, 217); background-color: rgb(132, 63, 161);"><span style="color: rgb(255, 255, 255);">**<span lang="AR-SA" style="font-family: 'B Titr';">ویژگی‌ها</span>**</span></td><td style="height: 31.4583px; border-color: rgb(206, 212, 217); background-color: rgb(132, 63, 161);"><span style="color: rgb(255, 255, 255);">**<span lang="AR-SA" style="font-family: 'B Titr';">توضیحات</span>**</span></td></tr></thead><tbody><tr style="height: 46.9167px; background-color: rgb(206, 212, 217);"><td style="height: 46.9167px; border-color: rgb(206, 212, 217); background-color: rgb(236, 202, 250);"><span style="color: rgb(0, 0, 0);">**<span lang="AR-SA">هدف کلی</span>**</span></td><td style="height: 46.9167px; border-color: rgb(206, 212, 217); background-color: rgb(236, 202, 250);"><span lang="AR-SA" style="color: rgb(0, 0, 0);">حذف تخصیص یک مسافر به یک اتاق در پلن (un-rooming).</span></td></tr><tr style="height: 31.4375px; background-color: rgb(206, 212, 217);"><td style="height: 31.4375px; border-color: rgb(206, 212, 217); background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 0, 0);">**<span lang="AR-SA">عملیات اصلی</span>**</span></td><td style="height: 31.4375px; border-color: rgb(206, 212, 217); background-color: rgb(255, 255, 255);"><span lang="AR-SA" style="color: rgb(0, 0, 0);">حذف یک رکورد از جدول `charter_plans_rooming`.</span></td></tr><tr style="height: 31.4375px; background-color: rgb(206, 212, 217);"><td style="height: 31.4375px; border-color: rgb(206, 212, 217); background-color: rgb(236, 202, 250);"><span style="color: rgb(0, 0, 0);">**<span lang="AR-SA">شرایط حذف</span>**</span></td><td style="height: 31.4375px; border-color: rgb(206, 212, 217); background-color: rgb(236, 202, 250);"><span style="color: rgb(0, 0, 0);">حذف بر اساس ترکیب `plan_id` و `reserve_id`.</span></td></tr><tr style="height: 38.3125px; background-color: rgb(206, 212, 217);"><td style="height: 38.3125px; border-color: rgb(206, 212, 217); background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 0, 0);">**<span lang="AR-SA">سادگی</span>**</span></td><td style="height: 38.3125px; border-color: rgb(206, 212, 217); background-color: rgb(255, 255, 255);"><span style="color: rgb(0, 0, 0);">عدم وجود منطق پیچیده، تنها یک عملیات `delete`.</span></td></tr><tr style="height: 38.3125px;"><td style="border-color: rgb(206, 212, 217); background-color: rgb(236, 202, 250); height: 38.3125px;"><span style="color: rgb(0, 0, 0);">**<span lang="AR-SA">پاسخ موفقیت</span>**</span></td><td style="border-color: rgb(206, 212, 217); background-color: rgb(236, 202, 250); height: 38.3125px;"><span style="color: rgb(0, 0, 0);">بازگرداندن پاسخ `204 No Content`.</span></td></tr></tbody></table>

<div align="right" id="bkmrk-"></div>---

#### <span style="font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="AR-SA">ورودی</span><span lang="FA" style="font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-language: FA;">‌ها (پارامتر‌ها):</span>

<span dir="LTR"> </span>

<table border="1" class="align-center" id="bkmrk-%D8%AA%D9%88%D8%B6%DB%8C%D8%AD%D8%A7%D8%AA-%D9%86%D9%88%D8%B9-%D8%AF%D8%A7%D8%AF%D9%87-%D9%86%D8%A7%D9%85" style="border-collapse: collapse; width: 80.9524%; height: 129.229px; background-color: rgb(236, 202, 250); border: 1px inset rgb(206, 212, 217);"><colgroup><col style="width: 49.9524%;"></col><col style="width: 12.5249%;"></col><col style="width: 12.5249%;"></col><col style="width: 25.0499%;"></col></colgroup><thead><tr style="height: 31.4583px;"><td style="height: 31.4583px; border-color: rgb(206, 212, 217); background-color: rgb(132, 63, 161);"><span style="color: rgb(255, 255, 255);">**<span lang="AR-SA" style="font-family: 'B Titr';">توضیحات</span>**</span></td><td style="border-color: rgb(206, 212, 217); background-color: rgb(132, 63, 161);"><span style="color: rgb(255, 255, 255);">**<span lang="AR-SA" style="font-family: 'B Titr';">موقعیت</span>**</span></td><td style="height: 31.4583px; border-color: rgb(206, 212, 217); background-color: rgb(132, 63, 161);"><span style="color: rgb(255, 255, 255);">**<span lang="AR-SA" style="font-family: 'B Titr';">نوع داده</span>**</span></td><td style="border-color: rgb(206, 212, 217); background-color: rgb(132, 63, 161); height: 31.4583px;"><span style="color: rgb(255, 255, 255);">**<span lang="AR-SA" style="font-family: 'B Titr';">نام پارمتر</span>**</span></td></tr></thead><tbody><tr style="height: 49.5417px;"><td style="border-color: rgb(206, 212, 217); background-color: rgb(236, 202, 250); height: 49.5417px;"><span style="color: rgb(0, 0, 0);">**شناسه پلن اتاق‌بندی.**</span></td><td dir="ltr" style="border-color: rgb(206, 212, 217); background-color: rgb(236, 202, 250);">**<span style="color: black; mso-color-alt: windowtext;">`Body`</span>**</td><td dir="ltr" style="border-color: rgb(206, 212, 217); background-color: rgb(236, 202, 250); height: 49.5417px;">**<span style="color: black; mso-color-alt: windowtext;">`integer`</span>**</td><td dir="ltr" style="border-color: rgb(206, 212, 217); background-color: rgb(236, 202, 250); height: 49.5417px;"><span style="color: rgb(0, 0, 0);">**`$request->plan_id`**</span></td></tr><tr style="height: 48.2292px;"><td style="border-color: rgb(206, 212, 217); background-color: rgb(255, 255, 255); height: 48.2292px;"><span style="color: rgb(0, 0, 0);">**<span lang="AR-SA">شناسه رزرو مسافری که تخصیص او باید حذف شود.</span>**</span></td><td dir="ltr" style="border-color: rgb(206, 212, 217); background-color: rgb(255, 255, 255);">**<span style="color: black; mso-color-alt: windowtext;">`Body`</span>**</td><td dir="ltr" style="border-color: rgb(206, 212, 217); background-color: rgb(255, 255, 255); height: 48.2292px;">**<span style="color: black; mso-color-alt: windowtext;">`integer`</span>**</td><td dir="ltr" style="border-color: rgb(206, 212, 217); background-color: rgb(255, 255, 255); height: 48.2292px;"><span lang="AR-SA" style="color: rgb(0, 0, 0);">**<span style="color: black; mso-color-alt: windowtext;">`$request->reserve_id`</span>**</span></td></tr></tbody></table>

<div align="right" id="bkmrk--2"></div>---

#### <span style="font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·<span style="font: 7.0pt 'Times New Roman';"> </span></span></span><span lang="AR-SA">خروجی</span><span dir="LTR"> (Return)</span><span lang="FA" style="font-family: 'Calibri',sans-serif; mso-ascii-theme-font: minor-latin; mso-hansi-theme-font: minor-latin; mso-bidi-language: FA;">:</span>

<span dir="LTR"> </span>

<div align="right" id="bkmrk-%D8%AA%D9%88%D8%B6%DB%8C%D8%AD%D8%A7%D8%AA-%D9%86%D9%88%D8%B9-%D8%AF%D8%A7%D8%AF%D9%87-%D8%B1%D8%B4%D8%AA"></div><table border="1" class="align-center" id="bkmrk-%D8%AA%D9%88%D8%B6%DB%8C%D8%AD%D8%A7%D8%AA-%D9%86%D9%88%D8%B9-%D8%AF%D8%A7%D8%AF%D9%87-%D8%B1%D8%B4%D8%AA-1" style="border-collapse: collapse; width: 80.9524%; height: 111.604px; background-color: rgb(236, 202, 250); border: 1px inset rgb(206, 212, 217);"><colgroup><col style="width: 50.0736%;"></col><col style="width: 50.0736%;"></col></colgroup><thead><tr style="height: 31.4583px;"><td style="height: 31.4583px; border-color: rgb(206, 212, 217); background-color: rgb(132, 63, 161);"><span style="color: rgb(255, 255, 255);">**<span lang="AR-SA" style="font-family: 'B Titr';">توضیحات</span>**</span></td><td style="height: 31.4583px; border-color: rgb(206, 212, 217); background-color: rgb(132, 63, 161);"><span style="color: rgb(255, 255, 255);">**<span lang="AR-SA" style="font-family: 'B Titr';">نوع داده</span>**</span></td></tr></thead><tbody><tr style="height: 48.4583px; background-color: rgb(206, 212, 217);"><td style="height: 48.4583px; border-color: rgb(206, 212, 217); background-color: rgb(236, 202, 250);"><span style="color: rgb(0, 0, 0);">**<span lang="AR-SA"><span dir="RTL" lang="AR-SA" style="font-size: 11.0pt; line-height: 107%; font-family: 'B Nazanin'; mso-ascii-font-family: 'B Nazanin'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: 'B Nazanin'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">در صورت موفقیت، یک پاسخ خالی با کد `204 No Content`.</span></span>**</span></td><td style="height: 48.4583px; border-color: rgb(206, 212, 217); background-color: rgb(236, 202, 250);"><span lang="AR-SA" style="color: rgb(0, 0, 0);">**<span style="font-size: 11.0pt; line-height: 107%; font-family: 'B Nazanin'; mso-ascii-font-family: 'B Nazanin'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: 'B Nazanin'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">`Illuminate\Http\JsonResponse`</span>**</span></td></tr><tr style="height: 31.6875px;"><td style="border-color: rgb(206, 212, 217); background-color: rgb(255, 255, 255); height: 31.6875px;"><span style="color: rgb(0, 0, 0);">**<span lang="AR-SA"><span dir="RTL" lang="AR-SA" style="font-size: 11.0pt; line-height: 107%; font-family: 'B Nazanin'; mso-ascii-font-family: 'B Nazanin'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: 'B Nazanin'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">در صورت بروز خطا، یک پاسخ با کد `400 Bad Request`.</span></span>**</span></td><td style="border-color: rgb(206, 212, 217); background-color: rgb(255, 255, 255); height: 31.6875px;"><span lang="AR-SA" style="color: rgb(0, 0, 0);">**<span style="font-size: 11.0pt; line-height: 107%; font-family: 'B Nazanin'; mso-ascii-font-family: 'B Nazanin'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-hansi-font-family: 'B Nazanin'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA;">`Illuminate\Http\JsonResponse`</span>**</span></td></tr></tbody></table>

---

#### <span style="font-family: Symbol; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol;"><span style="mso-list: Ignore;">·</span></span><span lang="AR-SA"><span style="mso-spacerun: yes;"> </span>مثا</span>ل استفاده / سناریو:

**<span style="text-decoration: underline; background-color: rgb(251, 238, 184);">سناریو</span>: حذف مسافر با رزرو شناسه ۵۴۳۲ از پلن ۵**

- **Request Body:**

<div class="code-header" dir="ltr" id="bkmrk-json"><span class="language-label">json</span></div>```
    {
        "plan_id": 5,
        "reserve_id": 5432
    }
```

- **Action:**

1. `DELETE FROM charter_plans_rooming WHERE plan_id = 5 AND reserve_id = 5432` اجرا می‌شود.

- **Response:**
- `HTTP Status`: `204 No Content`