fix: pulse ingest
This commit is contained in:
@@ -29,7 +29,7 @@ services:
|
|||||||
- XDEBUG_CLIENT_HOST=host.docker.internal
|
- XDEBUG_CLIENT_HOST=host.docker.internal
|
||||||
- XDEBUG_CLIENT_PORT=9003
|
- XDEBUG_CLIENT_PORT=9003
|
||||||
- XDEBUG_DISCOVER_CLIENT_HOST=false
|
- XDEBUG_DISCOVER_CLIENT_HOST=false
|
||||||
- PHP_IDE_CONFIG=serverName=orbstack
|
- PHP_IDE_CONFIG=serverName=telecart
|
||||||
- php.session.gc_maxlifetime=28800
|
- php.session.gc_maxlifetime=28800
|
||||||
- php.session.cookie_lifetime=0
|
- php.session.cookie_lifetime=0
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
@@ -177,6 +177,10 @@ class TeleCartPulseService
|
|||||||
*/
|
*/
|
||||||
private function pushEvent(array $json): void
|
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'), '/') . '/';
|
$baseUri = rtrim(env('PULSE_API_HOST', 'http://localhost'), '/') . '/';
|
||||||
|
|
||||||
$client = new Client([
|
$client = new Client([
|
||||||
@@ -218,10 +222,10 @@ class TeleCartPulseService
|
|||||||
'tracking_id' => $deserialized['tracking_id'],
|
'tracking_id' => $deserialized['tracking_id'],
|
||||||
'meta' => [
|
'meta' => [
|
||||||
'domain' => Utils::getCurrentDomain(),
|
'domain' => Utils::getCurrentDomain(),
|
||||||
'version' => Arr::get($data, 'webapp.version'),
|
'version' => Arr::get($data, 'payload.webapp.version'),
|
||||||
'platform' => Arr::get($data, 'webapp.platform'),
|
'platform' => Arr::get($data, 'payload.webapp.platform'),
|
||||||
'order_id' => Arr::get($data, 'eventData.order_id'),
|
'order_id' => Arr::get($data, 'payload.eventData.order_id'),
|
||||||
'currency' => Arr::get($data, 'eventData.currency'),
|
'currency' => Arr::get($data, 'payload.eventData.currency'),
|
||||||
],
|
],
|
||||||
'timestamp' => Carbon::now('UTC')->toJSON(),
|
'timestamp' => Carbon::now('UTC')->toJSON(),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ class ETLHandler
|
|||||||
$query
|
$query
|
||||||
->select([
|
->select([
|
||||||
'tracking_id',
|
'tracking_id',
|
||||||
|
'username',
|
||||||
|
'photo_url',
|
||||||
'telegram_user_id' => 'tg_user_id',
|
'telegram_user_id' => 'tg_user_id',
|
||||||
'telecart_customers.oc_customer_id',
|
'telecart_customers.oc_customer_id',
|
||||||
'is_premium',
|
'is_premium',
|
||||||
@@ -149,6 +151,8 @@ class ETLHandler
|
|||||||
'data' => array_map(static function ($item) {
|
'data' => array_map(static function ($item) {
|
||||||
return [
|
return [
|
||||||
'tracking_id' => $item['tracking_id'],
|
'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),
|
'tg_user_id' => filter_var($item['tg_user_id'], FILTER_VALIDATE_INT),
|
||||||
'oc_customer_id' => filter_var($item['oc_customer_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),
|
'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