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: Embedded Documents (a.k.a Subdocuments) #19

Closed
12 tasks
AlexStormwood opened this issue Sep 2, 2024 · 1 comment · Fixed by #18
Closed
12 tasks

feat: Embedded Documents (a.k.a Subdocuments) #19

AlexStormwood opened this issue Sep 2, 2024 · 1 comment · Fixed by #18
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@AlexStormwood
Copy link
Contributor

AlexStormwood commented Sep 2, 2024

This feature mostly already exists in v0.4.4. This issue is for tracking progress for this feature in the TypeScript rewrite of this package.

Tests to confirm this feature should be:

Golden Path Tests

  • An Embedded Document should successfully create data per the Embedded Document's structure, where all data provided to create the document and its embedded documents are valid.
  • An Embedded Document should successfully create data per the Embedded Document's structure, where any field that was not provided a value but has a default rule should create with the default data.
  • An Embedded Document should successfully create data per the Embedded Document's structure, where a field that has a type of another Document should store only the Document ID in its database entry.
  • An Embedded Document that inherits from another Embedded Document-based class should adhere to all fields/rules/constraints/etc defined in the parent class.
  • An Embedded Document that inherits from another Embedded Document-based class should be able to override all fields/rules/constraints/etc defined in the parent class.

Error-Handling Tests

  • An Embedded Document should throw an error when creating data where the Embedded Document fields are not meeting their defined required constraint.
  • An Embedded Document should throw an error when creating data where the Embedded Document fields are not meeting their defined unique constraint.
  • An Embedded Document should throw an error when creating data where the Embedded Document fields are not meeting their defined type constraint.
  • An Embedded Document should throw an error when creating data where the Embedded Document fields are not meeting their defined min constraint.
  • An Embedded Document should throw an error when creating data where the Embedded Document fields are not meeting their defined max constraint.
  • An Embedded Document should throw an error when creating data where the Embedded Document fields are not meeting their defined choices constraint.
  • An Embedded Document should throw an error when creating data where the Embedded Document fields are not meeting their defined validate constraint.
@AlexStormwood AlexStormwood added this to the v1.0.0 milestone Sep 2, 2024
@AlexStormwood AlexStormwood self-assigned this Sep 2, 2024
@AlexStormwood AlexStormwood linked a pull request Sep 2, 2024 that will close this issue
@AlexStormwood AlexStormwood added the enhancement New feature or request label Sep 2, 2024
@AlexStormwood
Copy link
Contributor Author

Not sure that this is needed, given that all EmbeddedDocument and Document functionality both stem from BaseDocument - and the Document tests are passing perfectly fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant