Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: create demoenvironment on post customer #362

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

sinatragianpaolo
Copy link
Contributor

@sinatragianpaolo sinatragianpaolo commented Nov 26, 2024

Pull Request: Refactor Customer Creation with Unguess Class

Summary

This PR introduces a new Unguess class for interacting with the Unguess API and refactors the POST /customers endpoint to delegate operations to the API's /workspaces endpoint.


Changes

1. New Unguess Class

  • Encapsulates the logic for interacting with the Unguess API.
  • Provides methods for authentication and posting data.

2. Refactored POST /customers

  • Delegates customer creation to the Unguess API's /workspaces endpoint.
  • Simplifies backend logic for better maintainability.

Summary of the earlier episodes on UNGUESS API

3. Unguess API /workspaces Endpoint

  • Adds a demo environment for new customers.
  • Assigns customers to three predefined hardcoded campaigns:
    • TA Campaign (ID: 5434):
      Includes campaigns, use cases, use case groups, user tasks, candidates, bugs, and bug media.
    • Functional Campaign (ID: 7916):
      Similar structure to TA campaigns.
    • UX Campaign (ID: 7961):
      Extends Functional Campaigns with observations, questions, reports, tags, tag types, tag links, insights, sentiments, UX data, videos, transcripts, and translations.

Copy link

github-actions bot commented Nov 26, 2024

Tests difference:

@coveralls
Copy link
Collaborator

coveralls commented Nov 26, 2024

Coverage Status

coverage: 77.503% (+0.01%) from 77.493%
when pulling 0545405 on UN-431-demo-env
into 0f27d45 on develop.

- Added unguessApi object to the config file
- Added basePath, username, and password properties to the unguessApi object
- These properties are used for authentication with the Unguess API

createDemoEnvironment function removed

- Removed the createDemoEnvironment function from the createDemoEnvironment/index.ts file
- This function was no longer being used and was causing unnecessary complexity in the code

unguessPostCustomer function added

- Added the unguessPostCustomer function to the unguessPostCustomer/index.ts file
- This function is responsible for authenticating with the Unguess API and posting customer data
- It takes the userId and company as parameters and returns the id and name of the created customer
Refactor the postCustomer method in the Unguess class to use the fetch API instead of axios for making HTTP requests. This change improves the code's performance and reduces the number of dependencies.
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.

2 participants