- Add SendSmsMessage class for encapsulating SMS message data. - Create KavehNegarProvider and RanginehProvider classes implementing SmsProviderInterface for sending SMS. - Implement SmsLogRepository and SmsTemplateRepository for managing SMS logs and templates. - Develop SendSmsHandler for handling SMS sending messages. - Create SmsService to manage SMS dispatching and logging. - Add UserProfileController for managing user profiles with CRUD operations. - Implement UserProfile entity and repository for user profile data management. - Update symfony.lock and bootstrap.php for project dependencies and environment setup.
166 lines
5.3 KiB
Markdown
166 lines
5.3 KiB
Markdown
# تسک ۰۶: ماژول کلینیک
|
|
|
|
## توضیح
|
|
پیادهسازی مدیریت کلینیکها، لیست کلینیکها، لیست دکترهای هر کلینیک
|
|
و آپلود تصویر و لوگوی کلینیک.
|
|
|
|
## Endpoint ها (واقعی از Drupal)
|
|
|
|
| متد | مسیر | توضیح | نیاز به Auth |
|
|
|-----|------|-------|-------------|
|
|
| POST | `/api/v1/clinic` | ایجاد کلینیک | بله |
|
|
| GET | `/api/v1/clinic/{uuid}` | دریافت اطلاعات کامل کلینیک | خیر |
|
|
| PATCH | `/api/v1/clinic/{uuid}` | ویرایش کلینیک | بله (Owner/Admin) |
|
|
| GET | `/api/v1/clinics` | لیست کلینیکها با فیلتر | خیر |
|
|
| GET | `/api/v1/clinic/doctor-list/{clinic_uuid}` | لیست دکترهای کلینیک | خیر |
|
|
| POST | `/file/upload/clinic_pro/clinic/field_image_clinic` | آپلود تصویر گالری کلینیک | بله |
|
|
| POST | `/file/upload/clinic_pro/clinic/field_clinic_logo` | آپلود لوگوی کلینیک | بله |
|
|
|
|
> **⚠ مسیر آپلود واقعی:** `/file/upload/clinic_pro/clinic/field_image_clinic` (نه `/api/v1/clinic/image`)
|
|
|
|
## پیشنیازها
|
|
- تسک ۰۱، ۰۲، ۰۵ (Doctor)، ۰۸ (Categories)
|
|
|
|
## زمان تخمینی
|
|
۶ تا ۸ ساعت
|
|
|
|
---
|
|
|
|
## فیلترهای GET /api/v1/clinics
|
|
|
|
| پارامتر | نوع | الزامی | مثال |
|
|
|---------|-----|--------|------|
|
|
| `state` | string | خیر | `13` |
|
|
| `city` | string | خیر | `32` |
|
|
| `specialty` | string | خیر | `511` |
|
|
| `page` | string | بله | `1` |
|
|
| `limit` | string | بله | `10` |
|
|
| `sort` | string | خیر | `DESC` |
|
|
|
|
---
|
|
|
|
## نمونه واقعی Response — GET /api/v1/clinic/{uuid}
|
|
|
|
```json
|
|
{
|
|
"id": "23",
|
|
"uuid": "e4550163-5a88-4f67-b07e-cd6063738598",
|
|
"title": "clinic 1",
|
|
"images_clinic": [
|
|
{
|
|
"url": "https://domain.com/sites/default/files/2025-11/image.png",
|
|
"fid": "91",
|
|
"filename": "image.png",
|
|
"filemime": "image/png",
|
|
"filesize": 34314
|
|
}
|
|
],
|
|
"clinic_logo": [
|
|
{
|
|
"url": "https://domain.com/sites/default/files/clinics/logo/2025-11/logo.png",
|
|
"fid": "96",
|
|
"filename": "logo.png",
|
|
"filemime": "image/png",
|
|
"filesize": 39281
|
|
}
|
|
],
|
|
"phone_number": "۰۶۱-۳۳۹۱۶۵۸۹",
|
|
"caption": "توضیحات درباره کلینیک...",
|
|
"list_bime": [
|
|
{
|
|
"uuid": "...",
|
|
"id": "1559",
|
|
"name": "بیمه آتیه سازان حافظ",
|
|
"logo": [{ "url": "...", "fid": "5", "filename": "hafez-insurance.png", "filemime": "image/png", "filesize": 16100 }]
|
|
}
|
|
],
|
|
"specialties": [
|
|
{ "uuid": "...", "id": "610", "name": "روماتولوژی", "parent": "602" }
|
|
],
|
|
"services": [
|
|
{ "uuid": "...", "id": "1602", "name": "ویزیت تخصصی" }
|
|
],
|
|
"clinic_specialty": [
|
|
{ "uuid": "...", "id": "610", "name": "روماتولوژی", "parent": "602" }
|
|
],
|
|
"doctors": 3,
|
|
"doctor_list": null,
|
|
"city": [{ "uuid": "...", "id": "130", "name": "بندرعباس", "parent": "29" }],
|
|
"state": [{ "uuid": "...", "id": "29", "name": "هرمزگان" }],
|
|
"location": "بندرعباس: رسالت شمالی- میدان صادقیه",
|
|
"map": { "latitude": "27.200632975404", "longitude": "56.356043815613" },
|
|
"24_7": true,
|
|
"field_working_days": "شنبه تا سه شنبه ساعت ۱۲:۲۰"
|
|
}
|
|
```
|
|
|
|
> **⚠ نکات فیلدهای واقعی Response:**
|
|
> - **`phone_number`** (نه `telephone`!) — شماره تماس
|
|
> - **`caption`** (نه `info`!) — توضیحات کلینیک
|
|
> - **`images_clinic`** (نه `images`!) — تصاویر گالری با url/fid/filename/filemime/filesize
|
|
> - **`clinic_logo`** (نه `logo`!) — لوگو با url/fid/filename/filemime/filesize
|
|
> - **`list_bime`** (نه `insurances`!) — بیمههای کلینیک، هر آیتم دارای `logo` نیز هست
|
|
> - **`field_working_days`** — روزهای کاری (string آزاد)
|
|
> - **`24_7`** — boolean
|
|
> - **`doctors`** — تعداد دکترها (integer)
|
|
> - **`services`** و **`clinic_specialty`** هر دو در response هستند
|
|
|
|
---
|
|
|
|
## فیلدهای PATCH /api/v1/clinic/{uuid}
|
|
|
|
```json
|
|
{
|
|
"name": "نام کلینیک",
|
|
"address": "آدرس",
|
|
"telephone": "شماره تلفن",
|
|
"latitude": "27.2",
|
|
"longitude": "56.3",
|
|
"insurance": [300, 301],
|
|
"info": "توضیحات",
|
|
"doctor_services": [575, 576],
|
|
"working_days": "شنبه تا سهشنبه",
|
|
"24_7": 1,
|
|
"image_clinic": [91, 92],
|
|
"clinic_logo": [96]
|
|
}
|
|
```
|
|
|
|
## فیلدهای POST /api/v1/clinic (ایجاد)
|
|
|
|
```json
|
|
{
|
|
"name": "نام کلینیک",
|
|
"state": [1],
|
|
"city": [32],
|
|
"address": "آدرس",
|
|
"telephone": "شماره تلفن",
|
|
"latitude": "50.21",
|
|
"longitude": "57.212",
|
|
"insurance": [300, 301],
|
|
"info": "توضیحات",
|
|
"doctor_services": [575, 576],
|
|
"working_days": "شنبه تا سهشنبه",
|
|
"24_7": 1,
|
|
"image_clinic": [19],
|
|
"clinic_logo": [20]
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## آپلود تصویر/لوگوی کلینیک
|
|
|
|
```
|
|
POST /file/upload/clinic_pro/clinic/field_image_clinic
|
|
POST /file/upload/clinic_pro/clinic/field_clinic_logo
|
|
|
|
Headers:
|
|
Content-Type: application/octet-stream
|
|
Content-Disposition: file; filename="clinic.png"
|
|
X-CSRF-Token: {token}
|
|
Authorization: Bearer {token}
|
|
Body: binary file content
|
|
Response → { fid, ... } که در image_clinic یا clinic_logo استفاده میشود
|
|
```
|