Files
clinicpro/docs/tasks/task-12-rating-comment/architecture.md
T
hamed de1a78a235 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.
2026-06-09 22:00:34 +03:30

2.1 KiB

معماری — تسک ۱۲: ماژول امتیاز و نظرات

ساختار فایل‌ها

src/Module/Rating/
├── Controller/
│   ├── RatingController.php
│   └── CommentController.php
├── Service/
│   ├── RatingService.php         ← آپدیت average_rating دکتر
│   └── CommentService.php
├── Repository/
│   ├── RatingRepository.php
│   └── CommentRepository.php
├── Entity/
│   ├── Rating.php
│   └── Comment.php
├── DTO/
│   ├── Request/
│   │   ├── CreateRatingRequest.php
│   │   ├── CreateCommentRequest.php
│   │   └── ConfirmCommentRequest.php
│   └── Response/
│       ├── RatingResponse.php
│       └── CommentResponse.php
└── Voter/
    ├── RatingVoter.php
    └── CommentVoter.php

Entity: Rating

#[ORM\Entity]
#[ORM\Table(name: 'ratings')]
class Rating
{
    #[ORM\Id, ORM\GeneratedValue, ORM\Column]
    private int $id;

    #[ORM\Column(type: UuidType::NAME, unique: true)]
    private Uuid $uuid;

    #[ORM\ManyToOne(targetEntity: User::class)]
    private User $patient;

    #[ORM\ManyToOne(targetEntity: Doctor::class)]
    private Doctor $doctor;

    #[ORM\Column(type: 'integer')]
    private int $score;  // 1 تا 5

    #[ORM\OneToOne(targetEntity: Appointment::class, nullable: true)]
    private ?Appointment $appointment;

    // TimestampableTrait
}

Entity: Comment

#[ORM\Entity]
#[ORM\Table(name: 'comments')]
class Comment
{
    #[ORM\Id, ORM\GeneratedValue, ORM\Column]
    private int $id;

    #[ORM\Column(type: UuidType::NAME, unique: true)]
    private Uuid $uuid;

    #[ORM\ManyToOne(targetEntity: User::class)]
    private User $author;

    #[ORM\ManyToOne(targetEntity: Doctor::class)]
    private Doctor $doctor;

    #[ORM\Column(type: 'text')]
    private string $text;

    // pending, approved, rejected
    #[ORM\Column(length: 20, default: 'pending')]
    private string $status;

    #[ORM\ManyToOne(targetEntity: Rating::class, nullable: true)]
    private ?Rating $rating;

    // TimestampableTrait
}