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(server): add customAttributes to Entity #6063

Conversation

yuval-hazaz
Copy link
Member

@yuval-hazaz yuval-hazaz commented May 20, 2023

part of: #5989

PR Details

The first PR for the epic - add the server-side functionality for Entity.CustomAttrbute

🤖 Generated by Copilot at 2e23e5f

Summary

🏷️🛠️🧪

This pull request adds support for custom attributes on entities and entity versions in the app builder. It modifies the Prisma schema, the database migrations, the GraphQL schema, the TypeScript models, the service and resolver files, and the input and output classes to include a customAttributes field as a string. It also updates the test files to cover the new functionality.

customAttributes
add new dimensions to Entity
autumn of data

Walkthrough

  • Add customAttributes columns to Entity and EntityVersion tables in the database to store custom attributes as text (link)
  • Add customAttributes fields to Entity and EntityVersion models in the Prisma schema to map the columns and generate TypeScript types and queries (link, link)
  • Add customAttributes field to Entity class in the TypeScript code and the GraphQL schema to represent the entity model and allow users to query and mutate the custom attributes as a string (link, link)
  • Add customAttributes field to EntityVersion class in the TypeScript code and the GraphQL schema to represent the entity version model and allow users to query and mutate the custom attributes as a string (link, link)
  • Add customAttributes field to various input types in the GraphQL schema to enable filtering, sorting, creating, and updating entities and entity versions by their custom attributes (link, link, link, link, link, link)
  • Add customAttributes field to various input classes and interfaces in the TypeScript code to match the GraphQL schema and pass the user input to the Prisma methods (link, link, link, link, link, link, link, link, link)
  • Add customAttributes field to various output arrays and interfaces in the TypeScript code to request and return the custom attributes from the Prisma methods (link, link, link, link)
  • Add customAttributes field to various queries and mutations in the resolver test files to provide, request, and assert the custom attributes in the test cases (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Add example custom attributes to various mock objects and inputs in the service and resolver test files to mock and assert the entity and entity version data in the test cases (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)

PR Checklist

  • Tests for the changes have been added
  • npm test doesn't throw any error

IMPORTANT: Please review the CONTRIBUTING.md file for detailed contributing guidelines.

@nx-cloud
Copy link

nx-cloud bot commented May 20, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 4234ecc. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 8 targets

Sent with 💌 from NxCloud.

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.

As User - I want to set custom attributes on the entity level
2 participants