- 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.
68 lines
1.9 KiB
Markdown
68 lines
1.9 KiB
Markdown
# معماری — تسک ۱۵: ماژول پرداخت
|
|
|
|
## ساختار فایلها
|
|
```
|
|
src/Module/Payment/
|
|
├── Controller/
|
|
│ ├── PaymentController.php ← ایجاد و دریافت پرداخت
|
|
│ └── PaymentCallbackController.php ← callback درگاه پرداخت
|
|
├── Service/
|
|
│ ├── PaymentService.php
|
|
│ └── Gateway/
|
|
│ ├── PaymentGatewayInterface.php
|
|
│ ├── ZarinpalGateway.php ← درگاه زرینپال
|
|
│ └── NullGateway.php ← برای محیط dev
|
|
├── Repository/
|
|
│ └── PaymentRepository.php
|
|
├── Entity/
|
|
│ └── Payment.php
|
|
├── DTO/
|
|
│ ├── Request/
|
|
│ │ └── CreatePaymentRequest.php
|
|
│ └── Response/
|
|
│ └── PaymentResponse.php
|
|
└── Voter/
|
|
└── PaymentVoter.php
|
|
```
|
|
|
|
## Entity: Payment
|
|
```php
|
|
#[ORM\Entity]
|
|
#[ORM\Table(name: 'payments')]
|
|
class Payment
|
|
{
|
|
#[ORM\Id, ORM\GeneratedValue, ORM\Column]
|
|
private int $id;
|
|
|
|
#[ORM\Column(type: UuidType::NAME, unique: true)]
|
|
private Uuid $uuid;
|
|
|
|
#[ORM\OneToOne(targetEntity: Appointment::class)]
|
|
private Appointment $appointment;
|
|
|
|
#[ORM\ManyToOne(targetEntity: User::class)]
|
|
private User $user;
|
|
|
|
#[ORM\Column(type: 'integer')]
|
|
private int $amount; // ریال
|
|
|
|
// pending, paid, failed, refunded
|
|
#[ORM\Column(length: 20, default: 'pending')]
|
|
private string $status;
|
|
|
|
#[ORM\Column(length: 30, nullable: true)]
|
|
private ?string $paymentMethod; // online, cash, insurance
|
|
|
|
#[ORM\Column(length: 100, nullable: true)]
|
|
private ?string $gatewayToken; // توکن درگاه
|
|
|
|
#[ORM\Column(length: 50, nullable: true)]
|
|
private ?string $referenceCode; // کد پیگیری
|
|
|
|
#[ORM\Column(type: 'datetime_immutable', nullable: true)]
|
|
private ?\DateTimeImmutable $paidAt;
|
|
|
|
// TimestampableTrait
|
|
}
|
|
```
|