Skip to content

Conversation

garrrikkotua
Copy link
Contributor

@garrrikkotua garrrikkotua commented Aug 1, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at 18fe75e

This pull request adds crowd analytics functionality to the backend by sending product data to a Segment workspace and a custom API endpoint. It introduces a new configuration interface and object, a new function to track analytics events, a new function to add product data, and a new method to query tenant information. It also modifies the custom environment variables file and the index.ts file.

🤖 Generated by Copilot at 18fe75e

We send our data to the crowd
With axios and Segment
We enrich it with our plan and trial
We are the crowd analytics segment

Why

How

🤖 Generated by Copilot at 18fe75e

  • Add crowd analytics feature to send product data to a third-party API (link, link, link, link, link, link, link, link)
  • Define crowd analytics configuration variables in custom-environment-variables.json and configTypes.ts (link, link)
  • Assign crowd analytics configuration object from environment variables in index.ts (link, link)
  • Create a function to add product data to the crowd analytics tenant workspace in addProductDataToCrowdTenant.ts (link)
    • Import axios, crowd analytics configuration object, and user and tenant repositories (link)
    • Define constants and an interface for the product data (link)
    • Check if crowd analytics feature is enabled and configuration variables are valid (link)
    • Fetch user and tenant information from the repositories and construct an object that matches the crowd analytics API schema (link, link)
    • Send a POST request to the crowd analytics endpoint with the object and the authorization header (link)
  • Call the add product data function inside the track function in track.ts (link, link)
    • Pass the user id, tenant id, event name, timestamp, and properties as arguments (link)
    • Import the add product data function (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screehshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@garrrikkotua garrrikkotua merged commit 18fe75e into main Aug 2, 2023
@garrrikkotua garrrikkotua deleted the feature/send-analytics-to-crowd-tenant branch August 2, 2023 08:11
@garrrikkotua garrrikkotua restored the feature/send-analytics-to-crowd-tenant branch August 2, 2023 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant