Completed
Push — main ( ac71af...a55882 )
by Jacobo
15s queued 10s
created
database/factories/Squareetlabs/VeriFactu/Models/InvoiceFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
             'type' => $this->faker->randomElement(array_column(InvoiceType::cases(), 'value')),
32 32
             'external_reference' => $this->faker->optional()->bothify('EXT-####'),
33 33
             'description' => $this->faker->sentence,
34
-            'status' => $this->faker->randomElement(['draft', 'sent', 'paid', 'cancelled']),
34
+            'status' => $this->faker->randomElement([ 'draft', 'sent', 'paid', 'cancelled' ]),
35 35
             'issued_at' => $this->faker->optional()->dateTimeThisYear(),
36 36
             'cancelled_at' => null,
37 37
         ];
Please login to merge, or discard this patch.
database/factories/Squareetlabs/VeriFactu/Models/RecipientFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
             'address' => $this->faker->address,
21 21
             'email' => $this->faker->optional()->safeEmail,
22 22
             'phone' => $this->faker->optional()->phoneNumber,
23
-            'type' => $this->faker->optional()->randomElement(['VAT', 'PASSPORT', 'NATIONAL_ID', 'RESIDENCE_CERTIFICATE', 'OTHER_DOCUMENT', 'UNREGISTERED']),
23
+            'type' => $this->faker->optional()->randomElement([ 'VAT', 'PASSPORT', 'NATIONAL_ID', 'RESIDENCE_CERTIFICATE', 'OTHER_DOCUMENT', 'UNREGISTERED' ]),
24 24
         ];
25 25
     }
26 26
 } 
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
src/Helpers/HashHelper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -30,16 +30,16 @@
 block discarded – undo
30 30
     public static function generateInvoiceHash(array $data): array
31 31
     {
32 32
         self::validateData(self::$invoiceRequiredFields, $data);                
33
-        $inputString = self::field('IDEmisorFactura', $data['issuer_tax_id']);
34
-        $inputString .= self::field('NumSerieFactura', $data['invoice_number']);
35
-        $inputString .= self::field('FechaExpedicionFactura', $data['issue_date']);
36
-        $inputString .= self::field('TipoFactura', $data['invoice_type']);
37
-        $inputString .= self::field('CuotaTotal', $data['total_tax']);
38
-        $inputString .= self::field('ImporteTotal', $data['total_amount']);
39
-        $inputString .= self::field('Huella', $data['previous_hash']);
40
-        $inputString .= self::field('FechaHoraHusoGenRegistro', $data['generated_at'], false);                
33
+        $inputString = self::field('IDEmisorFactura', $data[ 'issuer_tax_id' ]);
34
+        $inputString .= self::field('NumSerieFactura', $data[ 'invoice_number' ]);
35
+        $inputString .= self::field('FechaExpedicionFactura', $data[ 'issue_date' ]);
36
+        $inputString .= self::field('TipoFactura', $data[ 'invoice_type' ]);
37
+        $inputString .= self::field('CuotaTotal', $data[ 'total_tax' ]);
38
+        $inputString .= self::field('ImporteTotal', $data[ 'total_amount' ]);
39
+        $inputString .= self::field('Huella', $data[ 'previous_hash' ]);
40
+        $inputString .= self::field('FechaHoraHusoGenRegistro', $data[ 'generated_at' ], false);                
41 41
         $hash = strtoupper(hash('sha256', $inputString, false));        
42
-        return ['hash' => $hash, 'inputString' => $inputString];
42
+        return [ 'hash' => $hash, 'inputString' => $inputString ];
43 43
     }
44 44
 
45 45
     private static function validateData(array $requiredFields, array $data): void
Please login to merge, or discard this patch.