| @@ 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-35 (lines=18) @@ | ||
| 15 | * Trait DespatchDetailValidator |
|
| 16 | * @package Greenter\Xml\Validator |
|
| 17 | */ |
|
| 18 | trait DespatchDetailValidator |
|
| 19 | { |
|
| 20 | public static function loadValidatorMetadata(ClassMetadata $metadata) |
|
| 21 | { |
|
| 22 | $metadata->addPropertyConstraints('codigo', [ |
|
| 23 | new Assert\Length(['max' => 16]), |
|
| 24 | ]); |
|
| 25 | $metadata->addPropertyConstraints('descripcion', [ |
|
| 26 | new Assert\NotBlank(), |
|
| 27 | new Assert\Length(['max' => 250]), |
|
| 28 | ]); |
|
| 29 | $metadata->addPropertyConstraints('unidad', [ |
|
| 30 | new Assert\NotBlank(), |
|
| 31 | new Assert\Length(['max' => 4]), |
|
| 32 | ]); |
|
| 33 | $metadata->addPropertyConstraint('cantidad', new Assert\NotBlank()); |
|
| 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 | } |
|