| @@ 18-55 (lines=38) @@ | ||
| 15 | * Trait PerceptionValidator |
|
| 16 | * @package Greenter\Xml\Validator |
|
| 17 | */ |
|
| 18 | trait PerceptionValidator |
|
| 19 | { |
|
| 20 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
|
| 21 | { |
|
| 22 | $metadata->addPropertyConstraints('serie', [ |
|
| 23 | new Assert\NotBlank(), |
|
| 24 | new Assert\Length(['max' => 4]), |
|
| 25 | ]); |
|
| 26 | $metadata->addPropertyConstraints('correlativo', [ |
|
| 27 | new Assert\NotBlank(), |
|
| 28 | new Assert\Length(['max' => 8]), |
|
| 29 | ]); |
|
| 30 | $metadata->addPropertyConstraints('fechaEmision', [ |
|
| 31 | new Assert\NotBlank(), |
|
| 32 | new Assert\Date(), |
|
| 33 | ]); |
|
| 34 | $metadata->addPropertyConstraints('proveedor', [ |
|
| 35 | new Assert\NotBlank(), |
|
| 36 | new Assert\Valid(), |
|
| 37 | ]); |
|
| 38 | $metadata->addPropertyConstraints('regimen', [ |
|
| 39 | new Assert\NotBlank(), |
|
| 40 | new Assert\Length(['min' => 2, 'max' => 2]), |
|
| 41 | ]); |
|
| 42 | $metadata->addPropertyConstraint('tasa', new Assert\NotBlank()); |
|
| 43 | $metadata->addPropertyConstraint('impRetenido', new Assert\NotBlank()); |
|
| 44 | $metadata->addPropertyConstraint('impPagado', new Assert\NotBlank()); |
|
| 45 | $metadata->addPropertyConstraints('moneda', [ |
|
| 46 | new Assert\NotBlank(), |
|
| 47 | new Assert\Length(['min' => 3, 'max' => 3]), |
|
| 48 | ]); |
|
| 49 | $metadata->addPropertyConstraint('observacion', new Assert\Length(['max' => 250])); |
|
| 50 | $metadata->addPropertyConstraints('details', [ |
|
| 51 | new Assert\NotBlank(), |
|
| 52 | new Assert\Valid(), |
|
| 53 | ]); |
|
| 54 | } |
|
| 55 | } |
|
| @@ 18-55 (lines=38) @@ | ||
| 15 | * Trait RetentionValidator |
|
| 16 | * @package Greenter\Xml\Validator |
|
| 17 | */ |
|
| 18 | trait RetentionValidator |
|
| 19 | { |
|
| 20 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
|
| 21 | { |
|
| 22 | $metadata->addPropertyConstraints('serie', [ |
|
| 23 | new Assert\NotBlank(), |
|
| 24 | new Assert\Length(['max' => 4]), |
|
| 25 | ]); |
|
| 26 | $metadata->addPropertyConstraints('correlativo', [ |
|
| 27 | new Assert\NotBlank(), |
|
| 28 | new Assert\Length(['max' => 8]), |
|
| 29 | ]); |
|
| 30 | $metadata->addPropertyConstraints('fechaEmision', [ |
|
| 31 | new Assert\NotBlank(), |
|
| 32 | new Assert\Date(), |
|
| 33 | ]); |
|
| 34 | $metadata->addPropertyConstraints('proveedor', [ |
|
| 35 | new Assert\NotBlank(), |
|
| 36 | new Assert\Valid(), |
|
| 37 | ]); |
|
| 38 | $metadata->addPropertyConstraints('regimen', [ |
|
| 39 | new Assert\NotBlank(), |
|
| 40 | new Assert\Length(['min' => 2, 'max' => 2]), |
|
| 41 | ]); |
|
| 42 | $metadata->addPropertyConstraint('tasa', new Assert\NotBlank()); |
|
| 43 | $metadata->addPropertyConstraint('impPercibido', new Assert\NotBlank()); |
|
| 44 | $metadata->addPropertyConstraint('impCobrado', new Assert\NotBlank()); |
|
| 45 | $metadata->addPropertyConstraints('moneda', [ |
|
| 46 | new Assert\NotBlank(), |
|
| 47 | new Assert\Length(['min' => 3, 'max' => 3]), |
|
| 48 | ]); |
|
| 49 | $metadata->addPropertyConstraint('observacion', new Assert\Length(['max' => 250])); |
|
| 50 | $metadata->addPropertyConstraints('details', [ |
|
| 51 | new Assert\NotBlank(), |
|
| 52 | new Assert\Valid(), |
|
| 53 | ]); |
|
| 54 | } |
|
| 55 | } |
|