Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

2.3 KB
Raw Blame
{
  "db_name": "PostgreSQL",
  "query": "\n            SELECT DISTINCT LOWER(a.email) AS \"email!\"\n            FROM call_records cr\n            JOIN call_meetings m ON m.id = cr.meeting_id\n            JOIN calendar_events e ON e.owner_id = m.user_id\n            JOIN calendar_event_attendees a ON a.event_id = e.id\n            WHERE cr.id = $1\n              AND (\n                  STRPOS(e.location, m.share_token) > 0\n                  OR STRPOS(e.description, m.share_token) > 0\n                  OR STRPOS(e.conference_url, m.share_token) > 0\n              )\n              -- Meeting links are reused, so only the event the call took\n              -- place in counts: it, or one of its occurrences, overlaps the\n              -- call. All-day dates are local to the event, so they match\n              -- calls within a day either side.\n              AND (\n                  (e.starts_at IS NOT NULL\n                      AND tstzrange(e.starts_at, e.ends_at) && tstzrange(cr.started_at, cr.ended_at))\n                  OR (e.start_date IS NOT NULL\n                      AND daterange(e.start_date, e.end_date) && daterange(\n                          (cr.started_at - interval '1 day')::date,\n                          (cr.ended_at + interval '1 day')::date,\n                          '[]'\n                      ))\n                  OR EXISTS (\n                      SELECT 1 FROM calendar_event_occurrences o\n                      WHERE o.event_id = e.id\n                        AND o.owner_id = e.owner_id\n                        AND NOT o.is_cancelled\n                        AND (\n                            o.timed_span && tstzrange(cr.started_at, cr.ended_at)\n                            OR o.day_span && daterange(\n                                (cr.started_at - interval '1 day')::date,\n                                (cr.ended_at + interval '1 day')::date,\n                                '[]'\n                            )\n                        )\n                  )\n              )\n            ",
  "describe": {
    "columns": [
      {
        "ordinal": 0,
        "name": "email!",
        "type_info": "Text"
      }
    ],
    "parameters": {
      "Left": [
        "Uuid"
      ]
    },
    "nullable": [
      null
    ]
  },
  "hash": "78f86ddcfb2f54eb4da88ea49e0824a1ec1519a46e112c2f18cb7a2f5540f22c"
}