mirror of
https://gh.wpcy.net/https://github.com/hayBIT/freescout2ant.git
synced 2026-07-15 02:18:36 +08:00
Introduces an "Archive API" setting that switches both reads and writes between the legacy MitarbeiterWebservice API and the new Customer Archives (write) + Stocks (read) APIs. - New write strategy (ArchiveWriterInterface + factory): legacy header-based writer and a Customer Archives JSON writer (CreateArchiveRequestDto, files as base64 data URIs, one entry per attachment), backed by CustomerArchivesApiClient. - New read strategy (CrmReadClientInterface + factory): legacy delegate and a StocksReadClient that normalizes Stocks responses (customers/names, communications, contracts, contract lines/states) to the legacy shape so the controller/frontend stay unchanged. - Hybrid: customer lookup by e-mail stays on MitarbeiterWebservice because the Stocks API cannot search by e-mail. - Settings: ameise_api + ameise_archive_is_public dropdowns, env-backed base URLs for both new APIs (test/live), German translations. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KfJdbw4dRvJdcihTkKt69T
35 lines
1,020 B
PHP
35 lines
1,020 B
PHP
<?php
|
|
|
|
namespace Modules\AmeiseModule\Services\Read;
|
|
|
|
/**
|
|
* Read strategy for customer/contract lookups. The return shapes mirror the
|
|
* legacy MitarbeiterWebservice responses so the controller and frontend stay
|
|
* unchanged regardless of the selected API.
|
|
*
|
|
* Note: searching customers by e-mail is intentionally NOT part of this
|
|
* interface. The Stocks API cannot search by e-mail, so that lookup always
|
|
* stays on the MitarbeiterWebservice (CrmApiClient) as a hybrid fallback.
|
|
*/
|
|
interface CrmReadClientInterface
|
|
{
|
|
/**
|
|
* Search customers by customer number or name.
|
|
*/
|
|
public function fetchUserByIdOrName($data);
|
|
|
|
/**
|
|
* Fetch customer detail for the given endpoint (e.g. 'kontaktdaten').
|
|
*/
|
|
public function fetchUserDetail($id, $endPoints);
|
|
|
|
/**
|
|
* Fetch contracts for a customer.
|
|
*/
|
|
public function getContracts($customerId);
|
|
|
|
/**
|
|
* Fetch reference data ('sparten', 'vertragsstatus').
|
|
*/
|
|
public function getContactEndPoints($endPoints);
|
|
}
|