Skip to content

feat: update user data model to include OOO periods and idle window t…#79

Open
vinit717 wants to merge 1 commit intomainfrom
doc/add-user-status-model-fields
Open

feat: update user data model to include OOO periods and idle window t…#79
vinit717 wants to merge 1 commit intomainfrom
doc/add-user-status-model-fields

Conversation

@vinit717
Copy link
Member

@vinit717 vinit717 commented Mar 10, 2026

Date: 10-03-2026

Developer Name: @vinit717

Issue Ticket Number

Description

Added new fields

  • idleWindowStartedAt (number | null)
    When the current idle window started (e.g. task completed). Set on ACTIVE -> IDLE; reset to null on -> ACTIVE. Single source of truth for “idle from” so the window survives OOO.

  • lastOooFrom (number | null)
    Start of the most recent completed OOO interval. Kept for backward compatibility and for “last OOO” display/APIs.

  • lastOooUntil (number | null)
    End of the most recent completed OOO interval. Same as above.

  • oooPeriods (array of { from: number, until: number })
    History of completed OOO intervals in the current idle window. Used to subtract all OOO days when computing “idle 7d+”. Supports multiple OOO periods; overlaps are merged so we never double-subtract. Optional: you could derive this from an event log, but storing it on the doc keeps reads simple and avoids N+1 or extra collections.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1

Test Coverage

Screenshot 1

Additional Notes

@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

Walkthrough

The Firestore user status document schema in the README has been expanded to include four new fields: idleWindowStartedAt, lastOooFrom, lastOooUntil, and oooPeriods. These fields support tracking user idle windows and out-of-office periods.

Changes

Cohort / File(s) Summary
User Status Schema Documentation
users-status/README.md
Added four new top-level properties to the Firestore user status data model: idleWindowStartedAt, lastOooFrom, lastOooUntil, and oooPeriods to track idle and out-of-office information.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Hops with delight, whiskers twitching with glee!
New fields have sprouted in schemas so free!
OOO periods tracked, idle windows defined,
The status doc grows, more features aligned!
Documentation blooms—what a marvelous sight!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: updating the user data model with OOO periods and idle window tracking fields.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly relates to the changeset - it documents the addition of OOO periods and idle window fields to the user status data model.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch doc/add-user-status-model-fields

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@users-status/README.md`:
- Around line 25-28: Add a new "Fields" section in users-status/README.md near
the schema that documents each new field: idleWindowStartedAt, lastOooFrom,
lastOooUntil, and oooPeriods; for each field include Type (explicitly state
Number is a Unix timestamp in milliseconds | null), a one-line Description
(e.g., idleWindowStartedAt = when an idle window was initiated;
lastOooFrom/lastOooUntil = start/end of most recent OOO period; oooPeriods =
array history of {from, until}), Population rules (when and how the app sets
each field — e.g., auto-calculated on status change, updated/appended when OOO
is approved), and a brief Migration strategy describing how existing documents
will be backfilled (e.g., default nulls, compute lastOoo* from historical OOO
events, append to oooPeriods) and where these updates run (migration script or
service).
- Around line 25-28: The timestamp fields idleWindowStartedAt, lastOooFrom,
lastOooUntil and the oooPeriods entries are declared as Number/Number|null and
an object with Number fields; change them to use the existing TimeStamp type for
consistency with the schema (i.e., idleWindowStartedAt: TimeStamp | null,
lastOooFrom: TimeStamp | null, lastOooUntil: TimeStamp | null, and oooPeriods:
Array<{ from: TimeStamp, until: TimeStamp }>), updating any related
docs/comments or examples that reference these fields (idleWindowStartedAt,
lastOooFrom, lastOooUntil, oooPeriods) to reflect the TimeStamp type.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3a1a8b99-0db2-4dbb-b47e-887b9ce1585d

📥 Commits

Reviewing files that changed from the base of the PR and between 0d03546 and 5a06264.

📒 Files selected for processing (1)
  • users-status/README.md

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.

1 participant