Skip to content

Migrate Batch DAOs to Mongoose - #91

Merged
n2iw merged 2 commits into
prisma-to-mongoose-migrationfrom
mongoose-batch
Jul 28, 2026
Merged

Migrate Batch DAOs to Mongoose#91
n2iw merged 2 commits into
prisma-to-mongoose-migrationfrom
mongoose-batch

Conversation

@AustinSMueller

Copy link
Copy Markdown
Contributor

No description provided.

@relativeci

relativeci Bot commented Jul 27, 2026

Copy link
Copy Markdown

#283 Bundle Size — 12.87MiB (+100%).

⚠️ Baseline job is missing

Warning

Bundle contains 54 duplicate packages – View duplicate packages

Bundle metrics  no changes
                 Current
#283
     Baseline
No change  Initial JS 878.22KiB -
No change  Initial CSS 0B -
No change  Cache Invalidation 0% -
No change  Chunks 74 -
No change  Assets 117 -
No change  Modules 9161 -
No change  Duplicate Modules 0 -
No change  Duplicate Code 0% -
No change  Packages 320 -
No change  Duplicate Packages 53 -
Bundle size by type  no changes
                 Current
#283
     Baseline
No change  JS 10.35MiB (+100%) -
No change  IMG 1.72MiB (+100%) -
No change  Fonts 805.07KiB (+100%) -
No change  CSS 18KiB (+100%) -

Bundle analysis reportBranch mongoose-batchProject dashboard


Generated by RelativeCIDocumentationReport issue

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Batch model/schema and switched BatchDAO to extend MongooseGenericDAO.
  • Updated BatchService.listBatches to 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.

Comment thread apps/backend/services/batch-service.js
- 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
AustinSMueller marked this pull request as ready for review July 27, 2026 18:55
@AustinSMueller
AustinSMueller requested a review from n2iw July 27, 2026 18:55
@n2iw
n2iw merged commit d4e2b66 into prisma-to-mongoose-migration Jul 28, 2026
15 checks passed
@n2iw
n2iw deleted the mongoose-batch branch July 28, 2026 14:26
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.

3 participants