Skip to content

Conversation

@jeydinpham
Copy link
Contributor

I made this PR so we can differentiate between active and inactive officers, instead of having all present AND past officers be in one giant directory. This PR adds support for archiving and unarchiving officer documents, allowing officers to be moved between the default officers and the new archived collection in Firestore. This PR closes #21.

New Archive/Unarchive Functionality:

  • Added new endpoints: POST /archiveOfficer and POST /unarchiveOfficer to move officer records between the officer and archived collections, updating the isActive field accordingly. Error handling is included for missing IDs, not found, and already-archived/active cases.
  • Updated documentation to describe the new archive/unarchive endpoints, their behavior, error responses, and how to retrieve archived officers.

API Changes for Archived Officers:

  • Modified getOfficers, getOfficer, updateOfficer, and deleteOfficer endpoints to accept an optional archived=true query parameter, allowing operations on archived officers in addition to active ones.
  • Updated API documentation to reflect the new archived query parameter for relevant endpoints.

@jeydinpham jeydinpham added this to the MVP milestone Jan 3, 2026
@jeydinpham jeydinpham requested a review from LukeSultzer January 3, 2026 06:40
@jeydinpham jeydinpham self-assigned this Jan 3, 2026
Copilot AI review requested due to automatic review settings January 3, 2026 06:40
@jeydinpham jeydinpham added Good First Issue Good for newcomers Type: Documentation Improvements or additions to documentation Type: Feature Request New feature or request labels Jan 3, 2026
Copy link
Contributor

Copilot AI left a comment

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 implements an archive/unarchive system for officers to differentiate between active and inactive officers. Instead of maintaining all officers in a single collection, the system now supports moving officers between the officer (active) and archived (inactive) collections while tracking their status with the isActive field.

  • Added two new endpoints (archiveOfficer and unarchiveOfficer) to move officers between collections with transaction-based consistency
  • Extended existing CRUD endpoints to support an optional archived=true query parameter for operations on archived officers
  • Updated deployment configuration and documentation to reflect the new functionality

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/functions/archiveOfficer.ts New endpoint to move officers from officer to archived collection with isActive=false
src/functions/unarchiveOfficer.ts New endpoint to move officers from archived to officer collection with isActive=true
src/functions/getOfficers.ts Added support for archived=true query parameter to retrieve archived officers
src/functions/getOfficer.ts Added support for archived=true query parameter to retrieve a specific archived officer
src/functions/updateOfficer.ts Added support for archived=true query parameter to update archived officers
src/functions/deleteOfficer.ts Added support for archived=true query parameter to delete archived officers
src/functions/index.ts Exports the new archive and unarchive functions
src/index.ts Registers the new archive and unarchive HTTP endpoints and exports them
tests/deploy.ts Includes new archive/unarchive handlers in the local dev server
cloudbuild.yaml Adds new functions to the deployment pipeline
README.md Documents the new archive/unarchive endpoints in the local development guide
API_DOCUMENTATION.md Comprehensive documentation of archive/unarchive endpoints and the archived query parameter

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

I removed an extra paragraph that wasn't meant to be committed

Co-authored-by: Copilot <[email protected]>
@jeydinpham jeydinpham removed this from the MVP milestone Jan 3, 2026
@jeydinpham jeydinpham marked this pull request as draft January 4, 2026 08:00
@jeydinpham
Copy link
Contributor Author

I need to make archiving NOT mark an officer as inactive, acmutd/officer-database#9 adds that separate functionality

@LukeSultzer LukeSultzer marked this pull request as ready for review January 4, 2026 17:53
@jeydinpham jeydinpham merged commit 1b38261 into main Jan 5, 2026
@jeydinpham jeydinpham deleted the feat/archive-accounts branch January 5, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Good First Issue Good for newcomers Type: Documentation Improvements or additions to documentation Type: Feature Request New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Deactivate Account

3 participants