Skip to content

Mongoose srf submission - #113

Closed
AustinSMueller wants to merge 5 commits into
prisma-to-mongoose-migrationfrom
mongoose-srf-submission
Closed

Mongoose srf submission#113
AustinSMueller wants to merge 5 commits into
prisma-to-mongoose-migrationfrom
mongoose-srf-submission

Conversation

@AustinSMueller

Copy link
Copy Markdown
Contributor

No description provided.

- renamed application to submission request and migrated the application DAO from using Prisma to using Mongoose
- Application to Submission Request renaming for constants, verifier, DAO, helpers, and core services
- update the dependent services after submission request rename

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 submission-request persistence from the legacy Prisma Application path to a Mongoose-backed implementation while retaining existing GraphQL operation names.

Changes:

  • Adds the Mongoose submission-request model, DAO, verifier, and tests.
  • Rewires services, notifications, cron jobs, and approved-study integration.
  • Removes legacy Application DAO/verifier code and updates terminology.

Reviewed changes

Copilot reviewed 56 out of 58 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
apps/backend/verifier/submission-request-verifier.js Adds SRF validation.
apps/backend/verifier/application-verifier.js Removes legacy verifier.
apps/backend/utility/study-abbrev-helpers.js Updates SRF terminology.
apps/backend/test/utility/utility.service.test.js Renames utility tests.
apps/backend/test/services/user.updateUserInstitution.test.js Updates collection mock.
apps/backend/test/services/user.updateMyUser.test.js Updates collection mock.
apps/backend/test/services/user.requestAccess.test.js Updates collection mock.
apps/backend/test/services/user.listUsers.test.js Updates collection mock.
apps/backend/test/services/user.listActiveDCPs.test.js Updates collection mock.
apps/backend/test/services/user.listActiveCurators.test.js Updates collection mock.
apps/backend/test/services/user.isUserPrimaryContact.test.js Updates collection mock.
apps/backend/test/services/user.grantToken.test.js Updates collection mock.
apps/backend/test/services/user.getUsersByNotifications.test.js Updates collection mock.
apps/backend/test/services/user.getUsersByIDs.test.js Updates constructor documentation.
apps/backend/test/services/user.getUser.test.js Updates collection mock.
apps/backend/test/services/user.getFedLeads.test.js Updates collection mock.
apps/backend/test/services/user.getDCPs.test.js Updates collection mock.
apps/backend/test/services/user.getCollaboratorsByStudyID.test.js Updates collection mock.
apps/backend/test/services/user.getAdminPBACUsers.test.js Updates collection mock.
apps/backend/test/services/user.getAdmin.test.js Updates collection mock.
apps/backend/test/services/user.editUser.test.js Updates collection mock.
apps/backend/test/services/user.disableInactiveUsers.test.js Updates collection mock.
apps/backend/test/services/user.checkForInactiveUsers.test.js Updates collection mock.
apps/backend/test/services/submission-request.remindSubmissionRequestSubmission.test.js Migrates reminder tests.
apps/backend/test/services/submission-request.deleteInactiveSubmissionRequests.test.js Migrates cleanup tests.
apps/backend/test/services/program.service.test.js Uses the new DAO.
apps/backend/test/services/notify-user.test.js Renames notification tests.
apps/backend/test/services/approved-studies.test.js Updates SRF integration tests.
apps/backend/test/services/approved-studies-notification-error-handling.test.js Migrates notification mocks.
apps/backend/test/graphql-queries/save-application.test.js Uses the SRF service.
apps/backend/test/graphql-queries/batch-job.test.js Migrates batch-job setup.
apps/backend/test/dao/submission-request.update.test.js Tests Mongoose updates.
apps/backend/test/dao/submission-request.revision-prune.test.js Tests revision pruning.
apps/backend/test/dao/submission-request.reopen.test.js Tests revision reopening.
apps/backend/test/dao/submission-request.batch-lookups.test.js Tests batch lookups.
apps/backend/test/dao/dao.submission-request.test.js Adds core DAO tests.
apps/backend/test/dao/dao.application.test.js Removes Prisma DAO tests.
apps/backend/test/dao/application.revision-prune.test.js Removes legacy tests.
apps/backend/test/dao/application.reopen.test.js Removes legacy tests.
apps/backend/test/dao/application.batch-lookups.test.js Removes legacy tests.
apps/backend/services/utility.js Renames empty-SRF helper.
apps/backend/services/user.js Renames constructor dependency.
apps/backend/services/submission.js Uses SRF ownership lookups.
apps/backend/services/program-service.js Updates SRF organizations.
apps/backend/services/notify-user.js Renames SRF notifications.
apps/backend/services/approved-studies.js Uses the SRF DAO.
apps/backend/routers/graphql-router.js Routes GraphQL to SRF methods.
apps/backend/mongoose/models/submission-request.js Defines the Mongoose schema.
apps/backend/domain/history-event.js Updates terminology.
apps/backend/dao/utils/orm-converter.js Deprecates the Prisma converter.
apps/backend/dao/submission-request.js Adds Mongoose SRF persistence.
apps/backend/dao/approvedStudy.js Renames linked-ID lookup.
apps/backend/dao/application.js Removes the Prisma DAO.
apps/backend/constants/submission-request-constants.js Updates status terminology.
apps/backend/constants/error-constants.js Renames SRF errors.
apps/backend/app.js Migrates cron wiring.

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

Comment on lines +41 to +44
_id: { type: String },
name: { type: String },
},
{ versionKey: false }
Comment on lines +298 to +304
await this.updateMany(
{ _id: sourceId },
{
nextRevisionId: replaceExistingLink ? previousNextRevisionID : null,
updatedAt: getCurrentTime(),
}
);
Comment on lines +343 to +345
} catch (error) {
console.error('Error getting getInactiveSubmissionRequest:', error);
return [];
const batchService = new BatchService(s3Service, config.sqs_loader_queue, mockAwsService, config.prod_url, mockFetchDataModelInfo);
const emailParams = {url: config.emails_url, officialEmail: config.official_email, inactiveDays: config.inactive_application_days, remindDay: config.remind_application_days};
const dataInterface = new Application(logCollection, applicationCollection, null, submissionService, batchService, userService, dbService, notificationsService, emailParams, null, null, null, null);
const dataInterface = new SubmissionRequest(logCollection, submissionRequestCollection, null, submissionService, batchService, userService, dbService, notificationsService, emailParams, null, null, null, null);
@AustinSMueller
AustinSMueller deleted the mongoose-srf-submission branch August 10, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants