A free open source IT asset/license management system
Added locations and supplier import types
snipe94bd11d3c94b
diff --git a/database/factories/ImportFactory.php b/database/factories/ImportFactory.phpindex 11fdbe17a9..f0b0bc0da4 100644--- a/database/factories/ImportFactory.php+++ b/database/factories/ImportFactory.php@@ -165,4 +165,40 @@ class ImportFactory extends Factory});}+ /**+ * Create a supplier import type.+ *+ * @return static+ */+ public function suppliers()+ {+ return $this->state(function (array $attributes) {+ $fileBuilder = Importing\SuppliersImportFileBuilder::new();+ $attributes['name'] = "Supplier {$attributes['name']}";+ $attributes['import_type'] = 'supplier';+ $attributes['header_row'] = $fileBuilder->toCsv()[0];+ $attributes['first_row'] = $fileBuilder->firstRow();++ return $attributes;+ });+ }++ /**+ * Create an supplier import type.+ *+ * @return static+ */+ public function locations()+ {+ return $this->state(function (array $attributes) {+ $fileBuilder = Importing\SuppliersImportFileBuilder::new();+ $attributes['name'] = "Location {$attributes['name']}";+ $attributes['import_type'] = 'location';+ $attributes['header_row'] = $fileBuilder->toCsv()[0];+ $attributes['first_row'] = $fileBuilder->firstRow();++ return $attributes;+ });+ }+}