Improve TeleCart Pulse ETL, time handling and customer tracking

- Ensure Pulse store always prefers tracking_id from backend response when saving Telegram customer data.
- Route storeOrder calls through shared ftch helper instead of manual fetch.
- Remove legacy catalog controller extension/tgshop/handle and obsolete telecart_cache migration and setting mapping for Yandex Metrika.
- Update migrations framework to rely on Carbon, sort migration files deterministically and store executed_at as a Carbon timestamp without DEFAULT CURRENT_TIMESTAMP.
- Introduce DateUtils helper to convert timestamps between UTC and system time zone and use it in ETLHandler responses.
- Make TeleCartPulse PayloadSigner and TeleCartPulseService accept nullable secrets/API keys but fail fast when secret is missing.
- Normalize ETL customer payload shape and convert all date fields to UTC JSON timestamps.
- Default created order customer_id to 0 when no OpenCart customer id is available.
This commit is contained in:
2025-12-01 16:11:40 +03:00
parent ef785654b9
commit 49b0201b5f
13 changed files with 79 additions and 38 deletions

View File

@@ -37,7 +37,7 @@ export const usePulseStore = defineStore('pulse', {
console.debug('[Pulse] Saving Telegram customer data');
saveTelegramCustomer(userData)
.then((response) => {
this.tracking_id = this.tracking_id || response?.data?.tracking_id || null;
this.tracking_id = response?.data?.tracking_id || this.tracking_id || null;
console.debug(
'[Pulse] Telegram customer data saved successfully. Tracking ID: ',
toRaw(this.tracking_id)

View File

@@ -43,10 +43,7 @@ async function ftchPost(action, json = {}) {
}
export async function storeOrder(data) {
return await apiFetch(`${BASE_URL}index.php?route=extension/tgshop/handle&api_action=storeOrder`, {
method: 'POST',
body: data,
});
return ftch('storeOrder', null, data);
}
export async function getCart() {