Lewis/dynamic field fix - #70
Merged
Merged
Conversation
- Added new fields module with CRUD operations for custom fields. - Introduced tools for creating, updating, archiving, and listing fields. - Integrated field management into existing entities (companies, contacts, deals) for enhanced data handling. - Updated contracts and services to support bulk operations for fields. - Enhanced error handling and validation for field operations.
- Updated AgentTriggerService to include entity in field backfill method for improved logging and task management. - Refactored CompaniesService, ContactsService, and DealsService to utilize transactions for field updates, ensuring consistency and error handling. - Modified field handling in FieldsService to support new field value types and improved error translation. - Enhanced test cases to cover new field management features and ensure robust functionality. - Updated UI components to reflect changes in field management and improve user experience.
# Conflicts: # apps/api/src/agent/agent-trigger.service.ts # apps/api/src/companies/companies.service.ts # apps/api/src/contacts/contacts.service.ts # apps/api/src/deals/deals.contracts.ts # apps/api/src/deals/deals.router.ts # apps/api/src/deals/deals.service.ts # apps/api/src/fields/fields.contracts.ts # apps/api/src/fields/fields.service.ts # apps/api/src/generated/server.ts # apps/api/test/bulk.spec.ts # apps/api/test/fields.spec.ts # apps/app/components/crm/bulk-actions.tsx # apps/app/components/crm/fields/field-columns.tsx # apps/app/components/crm/fields/field-editor.tsx # apps/app/components/crm/fields/fields-copy.ts # apps/app/components/crm/fields/fields-list.tsx # apps/app/components/crm/fields/record-fields.tsx # apps/app/components/crm/inline-field.tsx # apps/app/components/crm/record-sheet/company-sheet.tsx # apps/app/components/crm/record-sheet/contact-sheet.tsx # apps/app/components/crm/record-sheet/deal-sheet.tsx # apps/app/lib/trpc/cache.ts # docs/plan/dynamic-fields-build.md # docs/plan/dynamic-fields.md # packages/db/prisma/schema.prisma # packages/db/src/fields-shape.ts # packages/db/src/fields.ts # packages/db/test/fields.spec.ts # packages/ui/src/components/data-table.tsx # packages/ui/src/components/sortable-list.tsx # packages/ui/src/hooks/use-table-selection.ts
- Updated FieldsService to allow passing a TransactionClient for database operations, enhancing flexibility in transaction management. - Modified field rendering logic in field-columns component to support SELECT type fields with options. - Enhanced fields-list component to include query client for better state management during field reordering. - Refactored SortableList component to simplify drag-and-drop functionality and improve performance. - Adjusted use-table-selection hook to ensure consistent key generation for row IDs.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by cubic
Fixes dynamic field handling end-to-end, adds USER field support with validation, and makes field operations fully transactional. Also scopes agent backfill by entity and adds DB indexes and a user FK for better integrity and performance.
New Features
Migration
fieldValue(companyId,contactId,dealId,optionId,userId) and a FKfieldValue.userId→user(ON DELETE SET NULL).userIdvalues before enforcing the FK.Written for commit c3b54bb. Summary will update on new commits.