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:
@@ -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'];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user