isEmpty($row, 'bill_number')) { return []; } $row['bill_number'] = (string) $row['bill_number']; $row = parent::map($row); $row['type'] = 'expense'; $row['account_id'] = $this->getAccountId($row); $row['category_id'] = $this->getCategoryId($row, 'expense'); $row['contact_id'] = $this->getContactId($row, 'vendor'); $row['currency_code'] = $this->getCurrencyCode($row); $row['document_id'] = $this->getDocumentId($row); $row['number'] = $row['transaction_number']; return $row; } public function prepareRules(array $rules): array { $rules['bill_number'] = 'required|string'; return $rules; } }