Add customer listing and import functionality for Economic

Implemented endpoints to list and import customers from the Economic API, including query filtering, pagination, and validation. Added supporting trait methods, database functions, and error handling. Expanded the user object for Economic integration and introduced utilities for type checking and parameter extraction.
This commit is contained in:
Jepp9350
2025-02-13 12:50:35 +01:00
parent 7525a89154
commit 2151cf2b7b
10 changed files with 336 additions and 1 deletions
+16
View File
@@ -842,4 +842,20 @@ class users_o extends db
$this->getCustomerEcocomicData($user['customer_number']);
}
}
public function isImportedFromEconomic($customerNumber): bool
{
// Check if the user is imported from the external source
if (self::countRowsWhere(['customer_number' => $customerNumber]) > 0) {
return true;
}
return false;
}
public function getUserIdFromEconomic($customerNumber): int
{
// Get the user id from the external source
$user = self::getFieldsWhere(['customer_number' => $customerNumber], ['id']);
return $user[0]['id'];
}
}