Migrate Batch DAOs to Mongoose - #91
Merged
Merged
Conversation
#283 Bundle Size — 12.87MiB (+100%).Warning Bundle contains 54 duplicate packages – View duplicate packages Bundle metrics
|
| Current #283 |
Baseline | |
|---|---|---|
878.22KiB |
- |
|
0B |
- |
|
0% |
- |
|
74 |
- |
|
117 |
- |
|
9161 |
- |
|
0 |
- |
|
0% |
- |
|
320 |
- |
|
53 |
- |
Bundle size by type no changes
| Current #283 |
Baseline | |
|---|---|---|
10.35MiB (+100%) |
- | |
1.72MiB (+100%) |
- | |
805.07KiB (+100%) |
- | |
18KiB (+100%) |
- |
Bundle analysis report Branch mongoose-batch Project dashboard
Generated by RelativeCI Documentation Report issue
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the backend Batch data access layer from the Prisma-based DAO to a Mongoose-backed DAO/model, aligning Batch persistence with the project’s existing Mongoose infrastructure while keeping service-level behavior consistent.
Changes:
- Added a Mongoose
Batchmodel/schema and switchedBatchDAOto extendMongooseGenericDAO. - Updated
BatchService.listBatchesto pass Mongoose-style pagination/sort options to the DAO and tightened the corresponding unit test expectations. - Expanded DAO error-handling tests to mock Mongoose query behavior (lean/select/sort/limit chains) and added coverage for success-path mapping.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| lib/db-driver/database-constants.js | Adds BATCH_COLLECTION constant for shared DB collection naming. |
| apps/backend/services/batch-service.js | Adapts listBatches to pass Mongoose-friendly query options to the DAO. |
| apps/backend/mongoose/models/batch.js | Introduces Mongoose schema/model for batch documents (including embedded file schema). |
| apps/backend/dao/batch.js | Re-implements Batch DAO operations using Mongoose queries and mapping. |
| apps/backend/test/services/batch.service.test.js | Updates expectations for new findMany/count argument shapes. |
| apps/backend/test/dao/dao.batch.error-handling.test.js | Refactors mocks/tests from Prisma to Mongoose and adds success-path assertions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- when a page size is set to 0 Mongoose will treat this as an unlimited page size. This update to the Generic Mongoose DAO will instead return an empty page of results
AustinSMueller
marked this pull request as ready for review
July 27, 2026 18:55
n2iw
approved these changes
Jul 28, 2026
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.
No description provided.