A free open source IT asset/license management system
Added location as checkout target for asset history importer
snipee8d3450cf8a3
diff --git a/app/Importer/AssetHistoryImporter.php b/app/Importer/AssetHistoryImporter.phpindex 1b7e47dcaa..c0a29f36dd 100644--- a/app/Importer/AssetHistoryImporter.php+++ b/app/Importer/AssetHistoryImporter.php@@ -4,6 +4,7 @@ namespace App\Importer;use App\Models\Actionlog;use App\Models\Asset;+use App\Models\Location;use App\Models\Setting;use App\Models\User;use Carbon\Carbon;@@ -25,11 +26,15 @@ class AssetHistoryImporter extends Importer// match the historical CSV template's bare "Name" column. Merge these// in every time setFieldMappings runs (which ItemImportRequest does// even for callers that don't pass column-mappings, wiping constructor-- // level overrides).+ // level overrides). target_type is optional. When the CSV omits it+ // the row defaults to a user checkout, matching the earlier+ // behavior of the importer for backwards compat with older exports.private array $historyFieldMapExtras = ['checkout_date' => 'checkout date','checkin_date' => 'checkin date','full_name' => 'name',+ 'target_type' => 'target type',+ 'notes' => 'notes',];public function setFieldMappings($fields)@@ -130,40 +135,90 @@ class AssetHistoryImporter extends Importer$checkin_date = Carbon::parse(now())->format('Y-m-d H:i:s');}- $user = $this->resolveTargetUser($name);+ $target_type_raw = strtolower(trim((string) $this->findCsvMatch($row, 'target_type')));++ // Optional column. Blank or absent falls back to user so+ // earlier-style CSVs behave unchanged. An explicit value that+ // isn't one of the two accepted forms surfaces as a per-row+ // error. Reject early with the actual bad value in the message.+ $lookupLocation = false;+ if ($target_type_raw !== '' && $target_type_raw !== 'user') {+ if ($target_type_raw === 'location') {+ $lookupLocation = true;+ } else {+ $this->log('Unrecognized target_type "' . $target_type_raw . '" for asset ' . $asset_tag);+ $this->recordSkipped();+ $this->addRowError(+ trans('general.asset') . ' ' . $asset_tag,+ trans('general.import-history'),+ 'target_type',+ trans('admin/hardware/message.import.history.invalid_target_type_message', [+ 'value' => $target_type_raw,+ ]),+ );++ return;+ }+ }- if (! $user) {- $this->log('User "'.$name.'" does not exist so no checkin log was created for asset '.$asset_tag);+ $target = $lookupLocation+ ? $this->resolveTargetLocation($name)+ : $this->resolveTargetUser($name);++ if (!$target) {+ $missingLabel = $lookupLocation ? 'Location' : 'User';+ $this->log($missingLabel . ' "' . $name . '" does not exist so no checkin log was created for asset ' . $asset_tag);$this->recordSkipped();$this->addRowError(trans('general.asset').' '.$asset_tag,trans('general.import-history'),'name',- trans('admin/hardware/message.import.history.user_not_matched_message', ['name' => $name]),+ trans('admin/hardware/message.import.history.target_not_matched_message', [+ 'name' => $name,+ 'target_type' => strtolower($missingLabel),+ ]),);return;}+ // Optional per-row note from the CSV.+ $csvNote = trim((string) $this->findCsvMatch($row, 'notes'));+ $checkoutNote = $csvNote !== ''+ ? $csvNote+ : 'Checkout imported by ' . (auth()->user()?->display_name ?? 'CSV importer') . ' from history importer';+Actionlog::firstOrCreate(['item_id' => $asset->id,'item_type' => Asset::class,'created_by' => $this->created_by,- 'note' => 'Checkout imported by '.(auth()->user()?->display_name ?? 'CSV importer').' from history importer',- 'target_id' => $user->id,- 'target_type' => User::class,+ 'note' => $checkoutNote,+ 'target_id' => $target->id,+ 'target_type' => get_class($target),'created_at' => $checkout_date,'action_type' => 'checkout',]);// If the CSV explicitly told us about a checkin column and this row's// checkin is empty or in the future, the asset is still assigned to- // the target user. Otherwise leave the current assignment alone -+ // the target. Otherwise leave the current assignment alone -// the asset is (by the source-of-truth CSV) already checked in.if ($checkinHeaderPresent) {if (empty($checkin_date) || strtotime($checkin_date) > strtotime(Carbon::now())) {- $asset->assigned_to = $user->id;- $asset->assigned_type = User::class;+ $asset->assigned_to = $target->id;+ $asset->assigned_type = get_class($target);++ // Mirror Asset::checkOut()'s Location branch: when the+ // asset is currently checked out TO a location, its own+ // location_id must point at that location too so it+ // shows up in the right place on the hardware list and+ // location-specific reports. Without this a location+ // checkout would flip assigned_to but leave location_id+ // pinned to whatever it was before, producing an+ // inconsistent state Snipe-IT itself never emits.+ if ($target instanceof Location) {+ $asset->location_id = $target->id;+ }}}@@ -180,7 +235,8 @@ class AssetHistoryImporter extends Importer}if ($asset->save()) {- $this->log('Asset history imported for '.$asset_tag.' -> '.$user->username.' at '.$checkout_date);+ $identity = $target instanceof User ? $target->username : $target->name;+ $this->log('Asset history imported for ' . $asset_tag . ' -> ' . $identity . ' at ' . $checkout_date);$this->recordCreated();} else {$this->recordErrored();@@ -223,6 +279,23 @@ class AssetHistoryImporter extends Importer);}+ /**+ * Resolve a location by name for the location-target branch. Same+ * "first match wins" contract as resolveTargetUser: no tie-breaker+ * across parents, which matches how Location::name is uniqued in+ * the schema (unique on name+parent_id, not globally unique). MySQL+ * collates case-insensitively by default so no explicit lower-case+ * fallback here.+ */+ private function resolveTargetLocation(?string $name): ?Location+ {+ if (empty($name)) {+ return null;+ }++ return Location::where('name', '=', $name)->first();+ }+private function resolveTargetUser(?string $name): ?User{if (empty($name)) {diff --git a/app/Livewire/Importer.php b/app/Livewire/Importer.phpindex c7653019ae..2f1dd79dc6 100644--- a/app/Livewire/Importer.php+++ b/app/Livewire/Importer.php@@ -617,6 +617,16 @@ class Importer extends Component'email' => trans('general.email'),'checkout_date' => trans('admin/hardware/table.checkout_date'),'checkin_date' => trans('admin/hardware/form.checkin_date'),+ // Optional. Values "user" or "location" (case-insensitive)+ // disambiguate what Name should resolve to. Absent or empty+ // falls back to user for CSVs authored before the location+ // branch existed.+ 'target_type' => trans('general.importer.checkout_type'),+ // Optional per-row note that lands on the checkout+ // actionlog. Legacy systems often carried a per-checkout+ // narrative ("student damaged screen", "shipped to remote+ // site"), and the column lets that history migrate through.+ 'notes' => trans('general.notes'),];/**diff --git a/resources/lang/en-US/admin/hardware/general.php b/resources/lang/en-US/admin/hardware/general.phpindex 8db24ea73c..224cf9ae5a 100644--- a/resources/lang/en-US/admin/hardware/general.php+++ b/resources/lang/en-US/admin/hardware/general.php@@ -37,7 +37,7 @@ return ['undeployable_tooltip' => 'This asset has a status label that is undeployable and cannot be checked out at this time.','view' => 'View Asset','csv_error' => 'You have an error in your CSV file:',- 'import_text' => '<p>Upload a CSV that contains asset history. The assets and users MUST already exist in the system, or they will be skipped. Matching assets for history import happens against the asset tag. We will try to find a matching user based on the user\'s name you provide, and the criteria you select below. If you do not select any criteria below, it will simply try to match on the username format you configured in the <code>Admin > General Settings</code>.</p><p>Fields included in the CSV must match the headers: <strong>Asset Tag, Name, Checkout Date, Checkin Date</strong>. Any additional fields will be ignored. </p><p>Checkin Date: blank or future checkin dates will checkout items to associated user. Excluding the Checkin Date column will create a checkin date with todays date.</p> ',+ 'import_text' => '<p>Upload a CSV that contains asset history. The assets, users, and locations referenced MUST already exist in the system, or the row will be skipped. Matching assets for history import happens against the asset tag. For user rows we will try to find a matching user based on the user\'s name you provide, and the criteria you select below. If you do not select any criteria below, it will simply try to match on the username format you configured in the <code>Admin > General Settings</code>. For assets checked out to locations, the CSV location name must match an existing location\'s name exactly.</p><p>Fields included in the CSV must match the headers: <strong>Asset Tag, Name, Checkout Date, Checkin Date, Target Type, Notes</strong>. <code>Target Type</code> is optional and accepts <code>user</code> or <code>location</code>. Blank or absent target type rows falls back to <code>user</code>. <code>Notes</code> is optional and gets logged to the checkout action. Any additional fields will be ignored.</p><p>Checkin Date: blank or future checkin dates will checkout items to the target on the row. (This should be in <code>YYYY-MM-DD HH:MM:SS</code> format) Excluding the Checkin Date column will create a checkin date with today\'s date (which sort of defeats the purpose of this particular kind of import.)</p> ','csv_import_match_f-l' => 'Try to match users by <strong>firstname.lastname</strong> (<code>jane.smith</code>) format','csv_import_match_initial_last' => 'Try to match users by <strong>first initial last name</strong> (<code>jsmith</code>) format','csv_import_match_first' => 'Try to match users by <strong>first name</strong> (<code>jane</code>) format',diff --git a/resources/lang/en-US/admin/hardware/message.php b/resources/lang/en-US/admin/hardware/message.phpindex 4c1b8e25ec..54dd61f8bd 100644--- a/resources/lang/en-US/admin/hardware/message.php+++ b/resources/lang/en-US/admin/hardware/message.php@@ -111,7 +111,8 @@ return ['missing_asset_tag_identity' => '(missing asset tag)','missing_asset_tag_message' => 'Row skipped: no asset tag provided.','asset_not_found_message' => 'Asset with this tag does not exist. Import assets first, then re-run the history import.',- 'user_not_matched_message' => 'No user matched ":name" - toggle the match-by options in step 1 or create the user first.',+ 'target_not_matched_message' => 'No :target_type matched ":name". For users, toggle the match-by options in step 1 or create the user first. For locations, make sure the CSV location name matches an existing location exactly.',+ 'invalid_target_type_message' => 'Target Type ":value" is not recognized. Use "user" or "location", or leave the column blank to default to user.',],'wizard' => ['step_type' => 'Choose type',diff --git a/resources/views/livewire/importer.blade.php b/resources/views/livewire/importer.blade.phpindex f59369a1ef..8273b05acd 100644--- a/resources/views/livewire/importer.blade.php+++ b/resources/views/livewire/importer.blade.php@@ -422,7 +422,7 @@</div>@endif- @if ($typeOfImport === 'user' || $this->hasUserCheckoutMapping)+ @if (($typeOfImport === 'user' || $this->hasUserCheckoutMapping) && $typeOfImport !== 'assetHistory'){{-- Also shown for non-user imports (asset,accessory, etc.) when the current columnmapping includes any user-identifying@@ -430,7 +430,10 @@items out to users. The welcome emailonly fires for users that are actuallycreated by the importer; existing-user- matches don't retrigger it. --}}+ matches don't retrigger it.++ assetHistory is excluded because it+ never creates users --}}<x-form.checkbox-rowname="send_welcome":label="trans('general.send_welcome_email_to_users')"diff --git a/tests/Feature/Assets/Ui/ImportAssetHistoryTest.php b/tests/Feature/Assets/Ui/ImportAssetHistoryTest.phpindex e59b114a3b..a111292445 100644--- a/tests/Feature/Assets/Ui/ImportAssetHistoryTest.php+++ b/tests/Feature/Assets/Ui/ImportAssetHistoryTest.php@@ -5,6 +5,7 @@ namespace Tests\Feature\Assets\Ui;use App\Models\Actionlog;use App\Models\Asset;use App\Models\Import;+use App\Models\Location;use App\Models\User;use Tests\Support\Importing\AssetHistoryImportFileBuilder;use Tests\Support\Importing\CleansUpImportFiles;@@ -262,4 +263,272 @@ class ImportAssetHistoryTest extends TestCase'action_type' => 'checkout',]);}++ public function test_asset_history_import_checks_out_to_location_when_target_type_is_location(): void+ {+ // Ensures the resulting state is+ // the same shape Snipe-IT itself would produce via a UI checkout.+ $actor = User::factory()->canImport()->create();+ $location = Location::factory()->create(['name' => 'Fundo Chao']);+ $asset = Asset::factory()->create([+ 'asset_tag' => 'AHIST-LOC-1',+ 'assigned_to' => null,+ 'assigned_type' => null,+ ]);++ $file = AssetHistoryImportFileBuilder::new([+ 'assetTag' => $asset->asset_tag,+ 'name' => $location->name,+ 'email' => '',+ 'checkoutDate' => now()->subDay()->format('Y-m-d H:i:s'),+ 'checkinDate' => now()->addDays(30)->format('Y-m-d H:i:s'),+ 'targetType' => 'location',+ ]);++ $import = Import::factory()->assetHistory()->create([+ 'created_by' => $actor->id,+ 'file_path' => $file->saveToImportsDirectory(),+ ]);++ $this->actingAsForApi($actor);+ $this->postJson(+ route('api.imports.importFile', ['import' => $import->id]),+ ['import-type' => 'assetHistory', 'import' => $import->id],+ )->assertOk();++ $asset->refresh();+ $this->assertEquals($location->id, $asset->assigned_to);+ $this->assertEquals(Location::class, $asset->assigned_type);+ $this->assertEquals(+ $location->id,+ $asset->location_id,+ 'When checked out to a Location, the asset\'s own location_id must mirror the target so the hardware list places it correctly.'+ );++ $this->assertDatabaseHas('action_logs', [+ 'item_id' => $asset->id,+ 'item_type' => Asset::class,+ 'target_id' => $location->id,+ 'target_type' => Location::class,+ 'action_type' => 'checkout',+ ]);+ }++ public function test_asset_history_import_falls_back_to_user_lookup_when_target_type_absent(): void+ {+ // Backwards-compat with pre-target-type CSVs: Name should still+ // resolve as a user when the CSV has no target_type column.+ $actor = User::factory()->canImport()->create();+ $target = User::factory()->create(['username' => 'legacy.compat.user']);+ $asset = Asset::factory()->create([+ 'asset_tag' => 'AHIST-LEGACY-1',+ 'assigned_to' => null,+ 'assigned_type' => null,+ ]);++ $file = AssetHistoryImportFileBuilder::new([+ 'assetTag' => $asset->asset_tag,+ 'name' => $target->username,+ 'email' => '',+ 'checkoutDate' => now()->format('Y-m-d H:i:s'),+ 'checkinDate' => now()->addDays(7)->format('Y-m-d H:i:s'),+ // targetType intentionally omitted from the CSV.+ ]);+ $file->forget('targetType');++ $import = Import::factory()->assetHistory()->create([+ 'created_by' => $actor->id,+ 'file_path' => $file->saveToImportsDirectory(),+ ]);++ $this->actingAsForApi($actor);+ $this->postJson(+ route('api.imports.importFile', ['import' => $import->id]),+ [+ 'import-type' => 'assetHistory',+ 'import' => $import->id,+ 'match_username' => true,+ ],+ )->assertOk();++ $asset->refresh();+ $this->assertEquals($target->id, $asset->assigned_to);+ $this->assertEquals(User::class, $asset->assigned_type);+ }++ public function test_asset_history_import_stamps_csv_note_onto_checkout_actionlog(): void+ {+ // Legacy systems commonly carry a per-checkout narrative that+ // needs to migrate through ("student damaged screen",+ // "shipped to remote site"). CSV Notes column value takes over+ // the actionlog note field so that context lands with the row.+ $actor = User::factory()->canImport()->create();+ $target = User::factory()->create(['username' => 'note.receiver']);+ $asset = Asset::factory()->create([+ 'asset_tag' => 'AHIST-NOTE-1',+ 'assigned_to' => null,+ 'assigned_type' => null,+ ]);++ $file = AssetHistoryImportFileBuilder::new([+ 'assetTag' => $asset->asset_tag,+ 'name' => $target->username,+ 'email' => '',+ 'checkoutDate' => now()->subDay()->format('Y-m-d H:i:s'),+ 'checkinDate' => now()->addDays(7)->format('Y-m-d H:i:s'),+ 'notes' => 'Damaged screen on return',+ ]);++ $import = Import::factory()->assetHistory()->create([+ 'created_by' => $actor->id,+ 'file_path' => $file->saveToImportsDirectory(),+ ]);++ $this->actingAsForApi($actor);+ $this->postJson(+ route('api.imports.importFile', ['import' => $import->id]),+ ['import-type' => 'assetHistory', 'import' => $import->id, 'match_username' => true],+ )->assertOk();++ $this->assertDatabaseHas('action_logs', [+ 'item_id' => $asset->id,+ 'target_id' => $target->id,+ 'action_type' => 'checkout',+ 'note' => 'Damaged screen on return',+ ]);+ }++ public function test_asset_history_import_keeps_default_note_when_csv_note_is_absent(): void+ {+ // Regression guard for the "blank / absent falls back" branch:+ // when the CSV doesn't include a Notes column at all, the+ // actionlog still gets the auto-generated "imported by X from+ // history importer" line so the audit trail records how the+ // row landed.+ $actor = User::factory()->canImport()->create();+ $target = User::factory()->create(['username' => 'nonote.user']);+ $asset = Asset::factory()->create([+ 'asset_tag' => 'AHIST-NOTE-2',+ 'assigned_to' => null,+ 'assigned_type' => null,+ ]);++ $file = AssetHistoryImportFileBuilder::new([+ 'assetTag' => $asset->asset_tag,+ 'name' => $target->username,+ 'email' => '',+ 'checkoutDate' => now()->format('Y-m-d H:i:s'),+ 'checkinDate' => now()->addDays(7)->format('Y-m-d H:i:s'),+ ]);+ $file->forget('notes');++ $import = Import::factory()->assetHistory()->create([+ 'created_by' => $actor->id,+ 'file_path' => $file->saveToImportsDirectory(),+ ]);++ $this->actingAsForApi($actor);+ $this->postJson(+ route('api.imports.importFile', ['import' => $import->id]),+ ['import-type' => 'assetHistory', 'import' => $import->id, 'match_username' => true],+ )->assertOk();++ $checkoutLog = Actionlog::where('item_id', $asset->id)+ ->where('action_type', 'checkout')+ ->first();+ $this->assertNotNull($checkoutLog);+ $this->assertStringContainsString(+ 'from history importer',+ $checkoutLog->note,+ 'Actionlog note should carry the auto-generated importer marker when the CSV omitted the Notes column.'+ );+ }++ public function test_asset_history_import_rejects_row_with_unrecognized_target_type(): void+ {+ // Typo scenario ("Locaiton", "gerbil"). Silently degrading to+ // user would produce a "user not matched" error for every row+ // and hide the actual cause. Reject with the actual bad value+ // in the message so the operator can fix their CSV.+ $actor = User::factory()->canImport()->create();+ $asset = Asset::factory()->create([+ 'asset_tag' => 'AHIST-TT-BAD',+ 'assigned_to' => null,+ 'assigned_type' => null,+ ]);++ $file = AssetHistoryImportFileBuilder::new([+ 'assetTag' => $asset->asset_tag,+ 'name' => 'any.value',+ 'email' => '',+ 'checkoutDate' => now()->format('Y-m-d H:i:s'),+ 'checkinDate' => '',+ 'targetType' => 'Locaiton',+ ]);++ $import = Import::factory()->assetHistory()->create([+ 'created_by' => $actor->id,+ 'file_path' => $file->saveToImportsDirectory(),+ ]);++ $this->actingAsForApi($actor);+ $response = $this->postJson(+ route('api.imports.importFile', ['import' => $import->id]),+ ['import-type' => 'assetHistory', 'import' => $import->id],+ );+ $response->assertStatus(500);+ $this->assertEquals('import-errors', $response->json('status'));+ $this->assertArrayHasKey('Asset ' . $asset->asset_tag, $response->json('messages'));++ $asset->refresh();+ $this->assertNull($asset->assigned_to);+ $this->assertDatabaseMissing('action_logs', [+ 'item_id' => $asset->id,+ 'action_type' => 'checkout',+ ]);+ }++ public function test_asset_history_import_skips_row_when_location_target_not_matched(): void+ {+ // Location-target row where the CSV location name doesn't match+ // any existing location should surface a per-row error and NOT+ // touch the asset's assignment. Same shape as the user+ // not-matched case, distinct message.+ $actor = User::factory()->canImport()->create();+ $asset = Asset::factory()->create([+ 'asset_tag' => 'AHIST-LOC-MISS',+ 'assigned_to' => null,+ 'assigned_type' => null,+ ]);++ $file = AssetHistoryImportFileBuilder::new([+ 'assetTag' => $asset->asset_tag,+ 'name' => 'no.such.location',+ 'email' => '',+ 'checkoutDate' => now()->format('Y-m-d H:i:s'),+ 'checkinDate' => '',+ 'targetType' => 'location',+ ]);++ $import = Import::factory()->assetHistory()->create([+ 'created_by' => $actor->id,+ 'file_path' => $file->saveToImportsDirectory(),+ ]);++ $this->actingAsForApi($actor);+ $response = $this->postJson(+ route('api.imports.importFile', ['import' => $import->id]),+ ['import-type' => 'assetHistory', 'import' => $import->id],+ );+ $response->assertStatus(500);+ $this->assertEquals('import-errors', $response->json('status'));+ $this->assertArrayHasKey('Asset ' . $asset->asset_tag, $response->json('messages'));++ $asset->refresh();+ $this->assertNull($asset->assigned_to);+ $this->assertDatabaseMissing('action_logs', [+ 'item_id' => $asset->id,+ 'action_type' => 'checkout',+ ]);+ }}diff --git a/tests/Feature/Importer/AssetHistoryWizardUiTest.php b/tests/Feature/Importer/AssetHistoryWizardUiTest.phpnew file mode 100644index 0000000000..6c6e1a2223--- /dev/null+++ b/tests/Feature/Importer/AssetHistoryWizardUiTest.php@@ -0,0 +1,52 @@+<?php++namespace Tests\Feature\Importer;++use App\Livewire\Importer;+use App\Models\User;+use Livewire\Livewire;+use Tests\TestCase;++/**+ * Wizard-level regression coverage for the assetHistory import type.+ *+ * The wizard exposes a few checkboxes that are meaningful for CRUD+ * imports (welcome-email, update-existing, etc.) but nonsensical for+ * the assetHistory type because that importer only writes actionlogs+ * against existing rows. This file pins the "not shown" branches so+ * future edits to the shared wizard template don't accidentally+ * re-enable them.+ */+class AssetHistoryWizardUiTest extends TestCase+{+ public function test_send_welcome_checkbox_is_not_rendered_on_asset_history_type(): void+ {+ // AssetHistoryImporter's resolveTargetUser() only queries the+ // users table (see the private method's body). It never creates+ // users, so a "send welcome email to newly-created users"+ // checkbox is dead UI here. hasUserCheckoutMapping IS true for+ // assetHistory because its field_map contains full_name, so the+ // guard has to be on the typeOfImport itself.+ $this->actingAs(User::factory()->superuser()->create());++ $component = Livewire::test(Importer::class)+ ->set('typeOfImport', 'assetHistory')+ ->set('wizardStep', 1);++ $component->assertDontSee('name="send_welcome"', false);+ }++ public function test_send_welcome_checkbox_is_still_rendered_on_user_type(): void+ {+ // Positive-side regression guard: the exclusion added for+ // assetHistory must not leak into the user import type, where+ // the checkbox is load-bearing.+ $this->actingAs(User::factory()->superuser()->create());++ $component = Livewire::test(Importer::class)+ ->set('typeOfImport', 'user')+ ->set('wizardStep', 1);++ $component->assertSee('name="send_welcome"', false);+ }+}diff --git a/tests/Support/Importing/AssetHistoryImportFileBuilder.php b/tests/Support/Importing/AssetHistoryImportFileBuilder.phpindex 54671f4eec..09efedf6b4 100644--- a/tests/Support/Importing/AssetHistoryImportFileBuilder.php+++ b/tests/Support/Importing/AssetHistoryImportFileBuilder.php@@ -13,6 +13,8 @@ namespace Tests\Support\Importing;* email?: string,* checkoutDate?: string,* checkinDate?: string,+ * targetType?: string,+ * notes?: string,* }** @extends FileBuilder<Row>@@ -27,6 +29,8 @@ class AssetHistoryImportFileBuilder extends FileBuilder'email' => 'Email','checkoutDate' => 'Checkout Date','checkinDate' => 'Checkin Date',+ 'targetType' => 'Target Type',+ 'notes' => 'Notes',];}@@ -38,6 +42,8 @@ class AssetHistoryImportFileBuilder extends FileBuilder'email' => fake()->safeEmail,'checkoutDate' => fake()->date,'checkinDate' => '',+ 'targetType' => '',+ 'notes' => '',];}}