Re-added assetmodel import factory

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-11-13 15:46:25 +00:00
parent 3d3e3a9557
commit 3740b58580

View file

@ -143,4 +143,25 @@ class ImportFactory extends Factory
return $attributes;
});
}
/**
* Create an asset model import type.
*
* @return static
*/
public function assetmodel()
{
return $this->state(function (array $attributes) {
$fileBuilder = Importing\AssetModelsImportFileBuilder::new();
$attributes['name'] = "{$attributes['name']} Asset Model";
$attributes['import_type'] = 'assetmodel';
$attributes['header_row'] = $fileBuilder->toCsv()[0];
$attributes['first_row'] = $fileBuilder->firstRow();
return $attributes;
});
}
}