Allow to import attachments and parameters via entity import

This fixes issue #363
This commit is contained in:
Jan Böhmer 2024-06-23 00:41:25 +02:00
parent bbf7222a6a
commit 06c8e584a4
19 changed files with 73 additions and 58 deletions

View file

@ -48,7 +48,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
/**
* @var string The address of the company
*/
#[Groups(['full', 'company:read', 'company:write'])]
#[Groups(['full', 'company:read', 'company:write', 'import', 'extended'])]
#[ORM\Column(type: Types::STRING)]
#[Assert\Length(max: 255)]
protected string $address = '';
@ -56,7 +56,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
/**
* @var string The phone number of the company
*/
#[Groups(['full', 'company:read', 'company:write'])]
#[Groups(['full', 'company:read', 'company:write', 'import', 'extended'])]
#[ORM\Column(type: Types::STRING)]
#[Assert\Length(max: 255)]
protected string $phone_number = '';
@ -64,7 +64,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
/**
* @var string The fax number of the company
*/
#[Groups(['full', 'company:read', 'company:write'])]
#[Groups(['full', 'company:read', 'company:write', 'import', 'extended'])]
#[ORM\Column(type: Types::STRING)]
#[Assert\Length(max: 255)]
protected string $fax_number = '';
@ -73,7 +73,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
* @var string The email address of the company
*/
#[Assert\Email]
#[Groups(['full', 'company:read', 'company:write'])]
#[Groups(['full', 'company:read', 'company:write', 'import', 'extended'])]
#[ORM\Column(type: Types::STRING)]
#[Assert\Length(max: 255)]
protected string $email_address = '';
@ -82,12 +82,12 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
* @var string The website of the company
*/
#[Assert\Url]
#[Groups(['full', 'company:read', 'company:write'])]
#[Groups(['full', 'company:read', 'company:write', 'import', 'extended'])]
#[ORM\Column(type: Types::STRING)]
#[Assert\Length(max: 255)]
protected string $website = '';
#[Groups(['company:read', 'company:write'])]
#[Groups(['company:read', 'company:write', 'import', 'full', 'extended'])]
protected string $comment = '';
/**
@ -95,6 +95,7 @@ abstract class AbstractCompany extends AbstractPartsContainingDBElement
*/
#[ORM\Column(type: Types::STRING)]
#[Assert\Length(max: 255)]
#[Groups(['full', 'company:read', 'company:write', 'import', 'extended'])]
protected string $auto_product_url = '';
/********************************************************************************

View file

@ -38,7 +38,7 @@ use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\MappedSuperclass(repositoryClass: AbstractPartsContainingRepository::class)]
abstract class AbstractPartsContainingDBElement extends AbstractStructuralDBElement
{
#[Groups(['full'])]
#[Groups(['full', 'import'])]
protected Collection $parameters;
public function __construct()