# معماری — تسک ۰۳: ماژول پروفایل کاربر

## ساختار فایل‌ها
```
src/Module/UserProfile/
├── Controller/
│   └── UserProfileController.php
├── Service/
│   └── UserProfileService.php
├── Repository/
│   └── UserProfileRepository.php
├── Entity/
│   └── UserProfile.php
├── DTO/
│   ├── Request/
│   │   ├── CreateUserProfileRequest.php
│   │   └── UpdateUserProfileRequest.php
│   └── Response/
│       └── UserProfileResponse.php
└── Voter/
    └── UserProfileVoter.php
```

## Entity: UserProfile
```php
#[ORM\Entity]
#[ORM\Table(name: 'user_profiles')]
class UserProfile
{
    #[ORM\Id, ORM\GeneratedValue, ORM\Column]
    private int $id;

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

    #[ORM\OneToOne(targetEntity: User::class)]
    #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
    private User $user;

    #[ORM\Column(length: 200, nullable: true)]
    private ?string $name;

    #[ORM\Column(type: 'text', nullable: true)]
    private ?string $description;

    #[ORM\Column(length: 20, nullable: true)]
    private ?string $birthday;

    #[ORM\Column(type: 'json', nullable: true)]
    private ?array $basicInsurance;

    #[ORM\Column(length: 30, nullable: true)]
    private ?string $bloodType;

    #[ORM\Column(length: 50, nullable: true)]
    private ?string $education;

    #[ORM\Column(length: 100, nullable: true)]
    private ?string $fathersName;

    #[ORM\Column(length: 10, nullable: true)]
    private ?string $gender;

    #[ORM\Column(length: 20, nullable: true)]
    private ?string $homePhone;

    #[ORM\Column(length: 100, nullable: true)]
    private ?string $job;

    #[ORM\Column(length: 30, nullable: true)]
    private ?string $maritalStatus;

    #[ORM\Column(length: 50, nullable: true)]
    private ?string $supplementaryInsurance;

    #[ORM\Column(length: 20, nullable: true)]
    private ?string $workPhone;

    #[ORM\Column(type: 'text', nullable: true)]
    private ?string $address;

    // اطلاعات پزشکی پیچیده به صورت JSON
    #[ORM\Column(type: 'json', nullable: true)]
    private ?array $diseases;

    #[ORM\Column(type: 'json', nullable: true)]
    private ?array $allergies;

    #[ORM\Column(type: 'json', nullable: true)]
    private ?array $medications;

    #[ORM\Column(type: 'json', nullable: true)]
    private ?array $surgeries;

    #[ORM\Column(type: 'json', nullable: true)]
    private ?array $familyHistory;

    #[ORM\Column(type: 'json', nullable: true)]
    private ?array $relatives;

    // TimestampableTrait
}
```
