<?php
namespace App\Entity\Common;
use Doctrine\ORM\Mapping as ORM;
use Nellapp\Bundle\SDKBundle\Entity\Common\Address\AddressMethodTrait;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation as Serial;
use Nellapp\Bundle\SDKBundle\Entity\Common\Address\Address as BaseAddress;
#[ORM\Embeddable]
class Address extends BaseAddress
{
use AddressMethodTrait;
#[ORM\Column(type: 'string', nullable: true)]
#[Assert\Length(min: 3, max: 255, minMessage: 'common.address.street.Length.min', maxMessage: 'common.address.street.Length.max', groups: ['Default', 'flow_channel_user_create_step2', 'admin_learner_profile', 'admin_admin_profile'])]
#[Serial\Groups(['Sync'])]
private ?string $street = null;
#[ORM\Column(type: 'string', length: 15, nullable: true)]
#[
Assert\Length(min: 4, max: 15, minMessage: 'common.address.postCode.Length.min', maxMessage: 'common.address.postCode.Length.max', groups: ['Default', 'flow_channel_user_create_step2', 'admin_learner_profile', 'admin_admin_profile']),
Assert\Regex(pattern: '/^\d{4,15}$/', message: 'common.address.postCode.Regex', groups: ['user_edition', 'flow_channel_user_create_step2', 'admin_learner_profile', 'admin_admin_profile']),
]
#[Serial\Groups(['Sync'])]
private ?string $postCode = null;
#[ORM\Column(type: 'string', nullable: true)]
#[Assert\Length(min: 2, max: 255, minMessage: 'common.address.city.Length.min', maxMessage: 'common.address.city.Length.max', groups: ['Default', 'flow_channel_user_create_step2', 'admin_learner_profile', 'admin_admin_profile'])]
#[Serial\Groups(['Sync'])]
private ?string $city = null;
#[ORM\Column(type: 'string', length: 2, nullable: true)]
#[
Assert\Length(min: 2, max: 2, exactMessage: 'common.address.country.Length.exact', groups: ['Default', 'flow_channel_user_create_step2', 'admin_learner_profile', 'admin_admin_profile']),
Assert\Country(message: 'common.address.country.Country', groups: ['Default', 'flow_channel_user_create_step2', 'admin_learner_profile', 'admin_admin_profile']),
]
#[Serial\Groups(['Sync'])]
private ?string $country = null;
}