fix: pulse ingest
This commit is contained in:
@@ -177,6 +177,10 @@ class TeleCartPulseService
|
||||
*/
|
||||
private function pushEvent(array $json): void
|
||||
{
|
||||
$this->logger->debug('Pushing event: ' . Arr::get($json, 'payload.event'), [
|
||||
'data' => $json,
|
||||
]);
|
||||
|
||||
$baseUri = rtrim(env('PULSE_API_HOST', 'http://localhost'), '/') . '/';
|
||||
|
||||
$client = new Client([
|
||||
@@ -218,10 +222,10 @@ class TeleCartPulseService
|
||||
'tracking_id' => $deserialized['tracking_id'],
|
||||
'meta' => [
|
||||
'domain' => Utils::getCurrentDomain(),
|
||||
'version' => Arr::get($data, 'webapp.version'),
|
||||
'platform' => Arr::get($data, 'webapp.platform'),
|
||||
'order_id' => Arr::get($data, 'eventData.order_id'),
|
||||
'currency' => Arr::get($data, 'eventData.currency'),
|
||||
'version' => Arr::get($data, 'payload.webapp.version'),
|
||||
'platform' => Arr::get($data, 'payload.webapp.platform'),
|
||||
'order_id' => Arr::get($data, 'payload.eventData.order_id'),
|
||||
'currency' => Arr::get($data, 'payload.eventData.currency'),
|
||||
],
|
||||
'timestamp' => Carbon::now('UTC')->toJSON(),
|
||||
];
|
||||
|
||||
@@ -98,6 +98,8 @@ class ETLHandler
|
||||
$query
|
||||
->select([
|
||||
'tracking_id',
|
||||
'username',
|
||||
'photo_url',
|
||||
'telegram_user_id' => 'tg_user_id',
|
||||
'telecart_customers.oc_customer_id',
|
||||
'is_premium',
|
||||
@@ -149,6 +151,8 @@ class ETLHandler
|
||||
'data' => array_map(static function ($item) {
|
||||
return [
|
||||
'tracking_id' => $item['tracking_id'],
|
||||
'username' => $item['username'],
|
||||
'photo_url' => $item['photo_url'],
|
||||
'tg_user_id' => filter_var($item['tg_user_id'], FILTER_VALIDATE_INT),
|
||||
'oc_customer_id' => filter_var($item['oc_customer_id'], FILTER_VALIDATE_INT),
|
||||
'is_premium' => filter_var($item['is_premium'], FILTER_VALIDATE_BOOLEAN),
|
||||
|
||||
0
module/oc_telegram_shop/upload/oc_telegram_shop/version.txt
Normal file → Executable file
0
module/oc_telegram_shop/upload/oc_telegram_shop/version.txt
Normal file → Executable file
Reference in New Issue
Block a user