realtimex-crm 0.14.0 → 0.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "realtimex-crm",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "description": "RealTimeX CRM - A full-featured CRM built with React, shadcn-admin-kit, and Supabase. Fork of Atomic CRM with RealTimeX App SDK integration.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -110,7 +110,7 @@ CREATE TRIGGER set_internal_heartbeat_timestamp
110
110
  -- Phase 5: Internal Heartbeat Computation Function
111
111
  -- ============================================================================
112
112
 
113
- CREATE OR REPLACE FUNCTION compute_company_internal_heartbeat(company_id bigint)
113
+ CREATE OR REPLACE FUNCTION compute_company_internal_heartbeat(p_company_id bigint)
114
114
  RETURNS void AS $$
115
115
  DECLARE
116
116
  score integer := 0;
@@ -131,7 +131,7 @@ BEGIN
131
131
  LEFT JOIN deals d ON c.id = d.company_id
132
132
  LEFT JOIN contacts co ON c.id = co.company_id
133
133
  LEFT JOIN tasks t ON co.id = t.contact_id
134
- WHERE c.id = company_id;
134
+ WHERE c.id = p_company_id;
135
135
 
136
136
  -- Scoring algorithm (simple recency-based, 0-100 scale)
137
137
  score := 100;
@@ -166,7 +166,7 @@ BEGIN
166
166
  internal_heartbeat_score = score,
167
167
  internal_heartbeat_status = status,
168
168
  internal_heartbeat_updated_at = now()
169
- WHERE id = company_id;
169
+ WHERE id = p_company_id;
170
170
  END;
171
171
  $$ LANGUAGE plpgsql;
172
172
 
@@ -1,4 +1,6 @@
1
1
  -- Fix ambiguous column reference in compute_company_internal_heartbeat by renaming parameter
2
+ -- This fix is moved earlier in the migration sequence to ensure it's available
3
+ -- before the tasks enhancement migration runs its updates.
2
4
 
3
5
  DROP FUNCTION IF EXISTS compute_company_internal_heartbeat(bigint);
4
6