feat: Implement SMS sending functionality with KavehNegar and Rangineh providers

- 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.
This commit is contained in:
hamed
2026-06-09 22:00:34 +03:30
commit de1a78a235
222 changed files with 36388 additions and 0 deletions
@@ -0,0 +1,44 @@
# معماری — تسک ۱۱: ماژول بیمه
## ساختار فایل‌ها
```
src/Module/Insurance/
├── Controller/
│ └── InsuranceController.php
├── Service/
│ └── InsuranceService.php
├── Repository/
│ └── InsuranceRepository.php
├── Entity/
│ └── Insurance.php
└── DTO/
├── Request/
│ ├── CreateInsuranceRequest.php
│ └── UpdateInsuranceRequest.php
└── Response/
└── InsuranceResponse.php
```
## Entity: Insurance
```php
#[ORM\Entity]
#[ORM\Table(name: 'doctor_insurances')]
class Insurance
{
#[ORM\Id, ORM\GeneratedValue, ORM\Column]
private int $id;
#[ORM\ManyToOne(targetEntity: Doctor::class)]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
private Doctor $doctor;
#[ORM\ManyToOne(targetEntity: Category::class)]
#[ORM\JoinColumn(nullable: false)]
private Category $insuranceCategory; // از جدول categories
#[ORM\Column(type: 'boolean', default: true)]
private bool $isActive = true;
// TimestampableTrait
}
```
+31
View File
@@ -0,0 +1,31 @@
# پایگاه داده — تسک ۱۱: ماژول بیمه
## توضیح
در Drupal، بیمه‌ها به عنوان دسته‌بندی (`category` entity) ذخیره می‌شوند:
- bundle=`insurance_type` → بیمه‌های پایه
- bundle=`supplementary_insurance` → بیمه‌های تکمیلی
رابطه doctor-insurance از طریق `field_insurance` روی bundle=clinic در Drupal موجود است (نه مستقیم روی doctor).
در profile کاربر: `field_basic_insurance` و `field_supplementary_insurance` (entity ref → category).
## جدول: doctor_insurances (رابطه doctor ↔ insurance)
_(از endpoint واقعی: PATCH /api/v1/insurance/1 دارای field_price است)_
| ستون | نوع | نام Drupal | توضیح |
|------|-----|-----------|-------|
| id | INT AUTO_INCREMENT PK | id | |
| doctor_id | INT FK → doctors.id CASCADE | field_doctor | دکتر |
| category_id | INT FK → categories.id | field_insurance_type | نوع بیمه (bundle=insurance_type یا supplementary_insurance) |
| price | INT NULL | field_price | مبلغ ویزیت با این بیمه (تومان — اختیاری) |
## ایندکس‌ها
```sql
CREATE UNIQUE INDEX idx_doctor_insurance ON doctor_insurances(doctor_id, category_id);
CREATE INDEX idx_doctor_insurance_cat ON doctor_insurances(category_id);
```
## نکات مهم
- داده‌های بیمه در جدول `categories` ذخیره می‌شوند — نه جدول جداگانه
- `clinic_insurances` هم وجود دارد: رابطه clinic ↔ insurance (تسک ۰۶)
- بیمه کاربر در `profiles` ذخیره می‌شود: field_basic_insurance, field_supplementary_insurance (تسک ۰۳)
- هیچ timestamp در این pivot table لازم نیست
@@ -0,0 +1,17 @@
# نکات پیاده‌سازی — تسک ۱۱: ماژول بیمه
## رابطه با Categories
این ماژول از جدول `categories` برای نام و نوع بیمه استفاده می‌کند.
هنگام create، فقط `insurance_category_id` کافی است.
## مجوزها
```
POST → دکتر (برای خودش) یا ROLE_ADMIN
GET → دکتر مرتبط یا ROLE_ADMIN
PATCH → دکتر مرتبط یا ROLE_ADMIN
DELETE → دکتر مرتبط یا ROLE_ADMIN
```
## یکپارچگی با لیست دکتر
در endpoint `GET /api/v1/doctors`، بیمه‌های هر دکتر باید
به عنوان فیلد در response ظاهر شوند.
+24
View File
@@ -0,0 +1,24 @@
# تسک ۱۱: ماژول بیمه
## توضیح
مدیریت بیمه‌های مرتبط با دکتر یا کلینیک (بیمه‌هایی که دکتر می‌پذیرد).
## Endpoint ها
| متد | مسیر | توضیح | نیاز به Auth |
|-----|------|-------|-------------|
| POST | `/api/v1/insurance/` | ایجاد رابطه بیمه | بله (Doctor/Admin) |
| GET | `/api/v1/insurance/{id}` | دریافت اطلاعات بیمه | بله |
| PATCH | `/api/v1/insurance/{id}` | ویرایش بیمه | بله |
| DELETE | `/api/v1/insurance/{id}` | حذف بیمه | بله |
## پیش‌نیازها
- تسک ۰۱، ۰۲، ۰۵ (Doctor)، ۰۸ (Categories)
## زمان تخمینی
۳ تا ۴ ساعت
## توضیح
این ماژول مشخص می‌کند که یک دکتر کدام بیمه‌ها را می‌پذیرد.
داده‌های اصلی بیمه در ماژول Categories هستند (تسک ۰۸).
این جدول رابطه دکتر ↔ بیمه را ذخیره می‌کند.