Skip to content

Move Configuration DAO to Mongoose - #83

Open
AustinSMueller wants to merge 2 commits into
prisma-to-mongoose-migrationfrom
mongoose-configuration
Open

Move Configuration DAO to Mongoose#83
AustinSMueller wants to merge 2 commits into
prisma-to-mongoose-migrationfrom
mongoose-configuration

Conversation

@AustinSMueller

@AustinSMueller AustinSMueller commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Migrate Configuration DAO from Prisma to Mongoose

@relativeci

relativeci Bot commented Jul 23, 2026

Copy link
Copy Markdown

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

⚠️ Baseline job is missing

Warning

Bundle contains 54 duplicate packages – View duplicate packages

Bundle metrics  no changes
                 Current
#273
     Baseline
No change  Initial JS 877.16KiB -
No change  Initial CSS 0B -
No change  Cache Invalidation 0% -
No change  Chunks 74 -
No change  Assets 117 -
No change  Modules 9159 -
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
#273
     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-configurationProject 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

This PR migrates configuration data access from the Prisma-backed DAO to a Mongoose-backed DAO, updating service logic and tests to support Mongo-style _id fields while keeping Prisma-style id compatibility for consumers.

Changes:

  • Replace Prisma-based ConfigurationDAO / OMB configuration lookup with Mongoose model + MongooseGenericDAO inheritance.
  • Add a Mongoose Configuration model (including PBAC Defaults nested schemas) for configuration documents.
  • Add/adjust unit tests to validate ID normalization behavior and updated DAO wiring.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
apps/backend/services/configurationService.js Updates PBAC nested permission/notification ID normalization to support _id-based Mongoose documents.
apps/backend/dao/configuration.js Switches configuration DAO implementation to extend MongooseGenericDAO using the new Configuration model.
apps/backend/dao/omb.js Replaces direct Prisma access with ConfigurationDAO.findByType(OMB_INFO).
apps/backend/mongoose/models/configuration.js Adds a Mongoose schema/model for configuration documents, including PBAC Defaults nested structures.
apps/backend/test/dao/dao.configuration.test.js Updates DAO tests to mock Mongoose model methods and validate normalized id/_id.
apps/backend/test/dao/dao.omb.test.js Updates OMB DAO tests to mock ConfigurationDAO instead of Prisma.
apps/backend/test/services/configurationService.getPBACByRoles.test.js Adds coverage for PBAC nested ID normalization for both _id and id shapes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/backend/services/configurationService.js
Comment thread apps/backend/test/services/configurationService.getPBACByRoles.test.js Outdated
@AustinSMueller
AustinSMueller requested a review from n2iw July 23, 2026 20:24
@AustinSMueller
AustinSMueller marked this pull request as ready for review July 23, 2026 20:24
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