forked from wangziqi/gongxue-base
feat: add crm webhook worker
This commit is contained in:
@@ -309,6 +309,7 @@ async function main() {
|
||||
where tenant_id = $1
|
||||
and (
|
||||
record_id in ($2::text, $3::text, $4::text, $5::text)
|
||||
or idempotency_key = 'lead:worker-integration'
|
||||
or lead_id in (
|
||||
select id::text
|
||||
from public.referral_leads
|
||||
@@ -320,6 +321,18 @@ async function main() {
|
||||
[tenantId, ids.user, ids.tenantOperatorUser, ids.tenantSalesUser, ids.tenantAgentUser],
|
||||
);
|
||||
|
||||
await client.query(
|
||||
`
|
||||
delete from public.crm_webhook_log
|
||||
where tenant_id = $1
|
||||
and (
|
||||
record_id in ($2::text, $3::text, $4::text, $5::text)
|
||||
or response_summary like '%worker%'
|
||||
)
|
||||
`,
|
||||
[tenantId, ids.user, ids.tenantOperatorUser, ids.tenantSalesUser, ids.tenantAgentUser],
|
||||
);
|
||||
|
||||
await client.query(
|
||||
`
|
||||
with transient_users as (
|
||||
|
||||
Reference in New Issue
Block a user