freescout2ant/Http/routes.php
Claude 3c3a092f7a
Track failed Ameise archive attempts and add retry tooling
Previously a thread could be skipped silently in ConversationArchiver
(no customer match, ambiguous match, API/network error, attachment
failure) without any record. Default-off logging hid the cause, and the
queue job swallowed exceptions, so messages "archived" in FreeScout
never surfaced as missing in Ameise.

Now every archive attempt records a row in the new crm_archive_attempts
table with status, sanitized HTTP response, attempt counter and
resolution timestamp. ArchiveThreadsJob retries transient failures up to
5 times with exponential backoff; ameise:list-failed-archives and
ameise:retry-failed-archives expose the queue from the CLI; the Ameise
settings page lists open failures with retry/dismiss buttons.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VU73s4KM5JZqVWQYPpK3cP
2026-06-16 23:06:49 +00:00

12 lines
909 B
PHP

<?php
Route::group(['middleware' => 'web', 'prefix' => \Helper::getSubdirectory(), 'namespace' => 'Modules\AmeiseModule\Http\Controllers'], function()
{
Route::get('/ameise/{id}/get-contracts', ['uses' => 'AmeiseController@getContracts'])->name('ameise.get.contracts');
Route::post('/ameise/ajax', ['uses' => 'AmeiseController@ajax', 'laroute' => true])->name('ameise.ajax');
Route::get('/ameise/refresh-token', ['uses' => 'AmeiseController@refreshToken'])->name('ameise.refresh');
Route::get('/crm/auth', ['uses' => 'AmeiseModuleController@auth', 'laroute' => true])->name('crm.auth');
Route::post('/ameise/archive-attempts/{id}/retry', ['uses' => 'AmeiseController@retryArchiveAttempt'])->name('ameise.archive_attempts.retry');
Route::post('/ameise/archive-attempts/{id}/dismiss', ['uses' => 'AmeiseController@dismissArchiveAttempt'])->name('ameise.archive_attempts.dismiss');
});