Skip to content

Issue #000000 Feat: Custom Fields & Form Library Documents#255

Open
vaibhavsTekdi wants to merge 3 commits intotekdi:aspire-leadersfrom
vaibhavsTekdi:vs-form-field-library-docs
Open

Issue #000000 Feat: Custom Fields & Form Library Documents#255
vaibhavsTekdi wants to merge 3 commits intotekdi:aspire-leadersfrom
vaibhavsTekdi:vs-form-field-library-docs

Conversation

@vaibhavsTekdi
Copy link
Collaborator

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Apr 30, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (9)
  • master
  • main
  • dev
  • feat/*
  • feat-*
  • release-*
  • Shiksha-2.0
  • youth-management
  • east-africa-ym

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@sonarqubecloud
Copy link

@coolbung
Copy link
Member

coolbung commented May 8, 2025

My comments

  1. What all are we building is not very evident. The way I see there's these atleast
    1.1. npm module for microservices -- this will be added to all microservices; it installs the necessary DB schema; microservice needs to integrate the npm module with the entities (eg: cohorts & cohort members); which capabilities & API endpoints does the npm module expose ?
    1.2 form builder (how does the form builder integrate with the fields ?)
    1.3 form rendering

  2. Not clear how the fields and form submissions are linked. Right now it seems that forms & form submissions are not linked to fields in any way (there is a fieldValues as well as submissions table). Form builder is just a layer on top of fields i.e. it defines how the fields are ordered / laid out. The storage of the form data should happen in the fieldvalues, rather than submissions.

  3. Seems that "EAV (Multiple Columns by Type)" has been chosen as the preferred way to store values. Have we thought through
    3.1 How will the field values come out in the read API will it be fields.age.value or fields.age.numberValue? If latter how will the frontend determine the field type ?
    3.2 Will the filtering code be easy since there are so many value columns ?
    3.3 Is there any impact on table size since each row will have many empty columns

@vaibhavsTekdi
Copy link
Collaborator Author

  1. What all are we building is not very evident. The way I see there's these atleast
    1.1. npm module for microservices -- this will be added to all microservices; it installs the necessary DB schema; microservice needs to integrate the npm module with the entities (eg: cohorts & cohort members); which capabilities & API endpoints does the npm module expose ?

Yes, the npm module is designed to install only the required database schema specific to the microservice where it is integrated. We will include only the database schemas necessary for the respective microservice.
However, entities such as cohorts and cohort members can still be extended by the consuming microservice based on its own business requirements, similar to how they are currently extendable.

1.2 form builder (how does the form builder integrate with the fields ?)

We are leveraging RJSF (React JSON Schema Form) for the form builder.
- Admin users will select a cohort ID and then define the form fields.
- Once the form is designed and submitted, the system will generate and save a JSON schema that complies with the existing form and field storage structures.

1.3 form rendering

Forms stored as JSON schemas will be rendered using RJSF, ensuring consistency with how the form was originally built.

  1. Not clear how the fields and form submissions are linked. Right now it seems that forms & form submissions are not linked to fields in any way (there is a fieldValues as well as submissions table). Form builder is just a layer on top of fields i.e. it defines how the fields are ordered / laid out. The storage of the form data should happen in the fieldvalues, rather than submissions.

Currently, the form builder acts as a configuration layer on top of fields, defining the order and layout of the fields.
The submitted data will be stored in the fieldValues table, not in the form submissions table itself.
a. The Forms Table holds the definition of the form (its structure).
b. The FormSubmissions Table records metadata about the submission (such as applicant info and submission status like draft or final).
c. The FieldValues Table stores the actual field data submitted by the user.
This approach is similar to UCM where:
a. ucm_type holds form metadata.
b. ucm_data records submission instances.
c. field_values stores submitted data.

  1. Seems that "EAV (Multiple Columns by Type)" has been chosen as the preferred way to store values. Have we thought through

Yes. We have chosen the EAV (Entity-Attribute-Value) model with multiple typed columns (text, number, date, etc.) for storing field values.

3.1 How will the field values come out in the read API will it be fields.age.value or fields.age.numberValue? If latter how will the frontend determine the field type ?

The Read API will return data in the format fields.age.value rather than exposing the internal column names like fields.age.numberValue.
The backend will be responsible for mapping the correct value from the corresponding typed column based on the field type.

3.2 Will the filtering code be easy since there are so many value columns ?

Having typed columns makes SQL-level filtering straightforward since filters can be applied directly to specific columns.
Indexes can be created on these typed columns to improve performance.
However, the API logic must:
a. Determine the field type from the Fields Table.
b. Dynamically apply the correct column filter based on the field type.
While SQL filtering is easy, API filtering requires moderate effort due to this dynamic resolution. Long-term scalability and performance are positively impacted by this design.

3.3 Is there any impact on table size since each row will have many empty columns

PostgreSQL uses TOAST (The Oversized-Attribute Storage Technique) and NULL bitmap optimization. NULL columns consume very little space, typically just 1 or 2 bits in a row-level NULL bitmap. So, we can safely proceed with the current multi-column strategy without a significant storage increase.

@vijaykhollam, please add your comments if needed.

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