| @@ 18-35 (lines=18) @@ | ||
| 15 | * Trait ClientValidator |
|
| 16 | * @package Greenter\Xml\Validator |
|
| 17 | */ |
|
| 18 | trait ClientValidator |
|
| 19 | { |
|
| 20 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
|
| 21 | { |
|
| 22 | $metadata->addPropertyConstraints('tipoDoc', [ |
|
| 23 | new Assert\NotBlank(), |
|
| 24 | new Assert\Length(['min' => 1, 'max' => 1]), |
|
| 25 | ]); |
|
| 26 | $metadata->addPropertyConstraints('numDoc', [ |
|
| 27 | new Assert\NotBlank(), |
|
| 28 | new Assert\Length(['max' => 15]), |
|
| 29 | ]); |
|
| 30 | $metadata->addPropertyConstraints('rznSocial', [ |
|
| 31 | new Assert\NotBlank(), |
|
| 32 | new Assert\Length(['max' => 100]), |
|
| 33 | ]); |
|
| 34 | } |
|
| 35 | } |
|
| @@ 18-36 (lines=19) @@ | ||
| 15 | * Trait ExchangeValidator |
|
| 16 | * @package Greenter\Xml\Validator |
|
| 17 | */ |
|
| 18 | trait ExchangeValidator |
|
| 19 | { |
|
| 20 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
|
| 21 | { |
|
| 22 | $metadata->addPropertyConstraints('monedaRef', [ |
|
| 23 | new Assert\NotBlank(), |
|
| 24 | new Assert\Length(['min' => 3, 'max' => 3]), |
|
| 25 | ]); |
|
| 26 | $metadata->addPropertyConstraints('monedaObj', [ |
|
| 27 | new Assert\NotBlank(), |
|
| 28 | new Assert\Length(['min' => 3, 'max' => 3]), |
|
| 29 | ]); |
|
| 30 | $metadata->addPropertyConstraint('factor', new Assert\NotBlank()); |
|
| 31 | $metadata->addPropertyConstraints('fecha', [ |
|
| 32 | new Assert\NotBlank(), |
|
| 33 | new Assert\Date(), |
|
| 34 | ]); |
|
| 35 | } |
|
| 36 | } |
|
| @@ 18-38 (lines=21) @@ | ||
| 15 | * Trait PrepaymentValidator |
|
| 16 | * @package Greenter\Xml\Validator |
|
| 17 | */ |
|
| 18 | trait PrepaymentValidator |
|
| 19 | { |
|
| 20 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
|
| 21 | { |
|
| 22 | $metadata->addPropertyConstraints('tipoDocRel', [ |
|
| 23 | new Assert\NotBlank(), |
|
| 24 | new Assert\Length([ |
|
| 25 | 'min' => 2, |
|
| 26 | 'max' => 2, |
|
| 27 | ]), |
|
| 28 | ]); |
|
| 29 | $metadata->addPropertyConstraints('nroDocRel', [ |
|
| 30 | new Assert\NotBlank(), |
|
| 31 | new Assert\Length([ 'max' => 30]), |
|
| 32 | ]); |
|
| 33 | $metadata->addPropertyConstraints('total',[ |
|
| 34 | new Assert\NotBlank(), |
|
| 35 | new Assert\Type(['type' => 'numeric']), |
|
| 36 | ]); |
|
| 37 | } |
|
| 38 | } |
|