Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#273: Add timestamps for all models #413

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

Oliviier-dev
Copy link
Contributor

@Oliviier-dev Oliviier-dev commented Nov 5, 2024

PR Description

This PR introduces timestamps (createdAt and updatedAt fields) for all models across the codebase, ensuring that each document's creation and modification times are automatically recorded and managed by Mongoose.

Description of tasks that were expected to be completed

  • Added { timestamps: true } to each model schema to enable automatic creation of createdAt and updatedAt fields.
  • Ensured consistency across models by applying timestamps in a standardized way.

Functionality

The timestamps provide metadata for each document, helping track when entries are created and updated.

How has this been tested?

Clone this repo, cd into it and checkout the branch fx-add-timestamps then:

  • Add new documents to the database for any model and inspect the fields.
  • Update existing documents and check that updatedAt is updated accordingly.

PR Checklist:

  • Add timestamps (createdAt and updatedAt) to all models.
  • Verify that timestamp fields work as expected during document creation and update.

Track PR

Trello Link (#273 )

Screenshots (If appropriate)

(Images)

@codecov-commenter
Copy link

codecov-commenter commented Nov 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (develop@ba775e7). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #413   +/-   ##
==========================================
  Coverage           ?   16.58%           
==========================================
  Files              ?       89           
  Lines              ?     3558           
  Branches           ?     1019           
==========================================
  Hits               ?      590           
  Misses             ?     2959           
  Partials           ?        9           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Oliviier-dev Oliviier-dev added WIP Work in progress fighters Team labels Nov 5, 2024
@Oliviier-dev Oliviier-dev self-assigned this Nov 5, 2024
@Oliviier-dev Oliviier-dev changed the title #273: Add timestamps for all fields #273: Add timestamps for all models Nov 5, 2024
@Oliviier-dev Oliviier-dev linked an issue Nov 5, 2024 that may be closed by this pull request
@Oliviier-dev Oliviier-dev added Needs Reviews A pull request need reviews to be merged and removed WIP Work in progress labels Nov 7, 2024
Copy link
Contributor

@niyobertin niyobertin left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fighters Team Needs Reviews A pull request need reviews to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timestamps for all fields
6 participants