feat : add data model for OOO request feature#77
feat : add data model for OOO request feature#77RishiChaubey31 wants to merge 5 commits intomainfrom
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Summary by CodeRabbit
WalkthroughThe README for the OOO Request Firestore model was updated to reflect a revised public JSON schema: several fields were renamed, a new type field was added, and example payloads were updated. Timing fields remain. No source code or control-flow changes are included. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
ooo-request/README.md (3)
37-37: Rename headings to “status” (field was renamed from state).Keep terminology consistent with the schema.
Apply this diff:
-#### Example for PENDING state +#### Example for PENDING status -#### Example for APPROVED state +#### Example for APPROVED status -#### Example for REJECTED state +#### Example for REJECTED statusAlso applies to: 55-55, 73-73
1-16: Plan for backward compatibility and data migration.Field renames impact queries, indexes, security rules, and any clients/functions expecting userId/state/lastUpdatedBy/message. Introduce a migration/backfill and transitional reads.
- Keep old fields readable for a deprecation window or add a Cloud Function to backfill new fields on write.
- Update Security Rules to reference requestedBy/status/lastModifiedBy.
- Review Composite Indexes involving renamed fields.
- Communicate the change with a versioned schema note in this README.
I can draft a migration checklist if helpful.
Also applies to: 24-34, 37-90
1-90: Replace deprecateduserIdwithrequestedByin the REJECTED example and align legacy fields across the repo
- In ooo-request/README.md (line 78), change
"userId": "…"to"requestedBy": "…"to match the schema- Audit other modules for occurrences of
userId,state,message, andlastUpdatedByand update them to the current field names or ensure backward-compatibility
♻️ Duplicate comments (1)
ooo-request/README.md (1)
21-34: Minor style: add period after “etc.” and tighten phrasing.LanguageTool flags this; the diff in the table comment above already addresses it.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
ooo-request/README.md(5 hunks)
🧰 Additional context used
🪛 LanguageTool
ooo-request/README.md
[grammar] ~24-~24: Use correct spacing
Context: ...d of the user who created the request. | | status | String | The sta...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~24-~24: Use correct spacing
Context: ...ho created the request. | | status | String | The state o...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~25-~25: There might be a mistake here.
Context: ...s | String | The state of the request like APPROVED, REJECTED, PENDING. | | f...
(QB_NEW_EN_OTHER)
[grammar] ~25-~25: Insert the missing word
Context: ...e of the request like APPROVED, REJECTED, PENDING. | | from | Timestamp ...
(QB_NEW_EN_OTHER_ERROR_IDS_32)
[grammar] ~26-~26: Use correct spacing
Context: ...for the start date of the OOO request. | | until | Timestamp | Unix ti...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~26-~26: Use correct spacing
Context: ...he start date of the OOO request. | | until | Timestamp | Unix timest...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~27-~27: Use correct spacing
Context: ...ate of the OOO request. | | until | Timestamp | Unix timestamp for the en...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~27-~27: Use correct spacing
Context: ...p for the end date of the OOO request. | | reason | String | The rea...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~27-~27: Use correct spacing
Context: ...he end date of the OOO request. | | reason | String | The reason ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~28-~28: Use correct spacing
Context: ...tring | The reason for the request. | | createdAt | Timestamp | Unix ti...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~28-~28: Use correct spacing
Context: ...equest. | | createdAt | Timestamp | Unix timest...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~29-~29: Use correct spacing
Context: ... for the creation time of the request. | | updatedAt | Timestamp | Unix ti...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~29-~29: Use correct spacing
Context: ...he creation time of the request. | | updatedAt | Timestamp | Unix timest...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~30-~30: Use correct spacing
Context: ...r the last update time of the request. | | lastModifiedBy| String | The id ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~30-~30: Use correct spacing
Context: ...he last update time of the request. | | lastModifiedBy| String | The id of t...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~31-~31: There might be a mistake here.
Context: ...ser who processed the request | | comment | String | The reason...
(QB_NEW_EN)
[grammar] ~32-~32: Use correct spacing
Context: ...e reason for the APPROVED or REJECTED. | | type | String | The typ...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~32-~32: Use correct spacing
Context: ...PPROVED or REJECTED. | | type | String | The type of...
(QB_NEW_EN_OTHER_ERROR_IDS_5)
[grammar] ~33-~33: There might be a mistake here.
Context: ...| String | The type of request being sent like OOO, Onboarding etc | ### Exam...
(QB_NEW_EN_OTHER)
[style] ~33-~33: In American English, abbreviations like “etc.” require a period.
Context: ...request being sent like OOO, Onboarding etc | ### Example data #### Example fo...
(ETC_PERIOD)
[grammar] ~33-~33: There might be a problem here.
Context: ...uest being sent like OOO, Onboarding etc | ### Example data #### Example for PENDING s...
(QB_NEW_EN_MERGED_MATCH)
🔇 Additional comments (2)
ooo-request/README.md (2)
60-70: Approved example looks consistent with the new schema.
26-27: Consider aligning the “Timestamp” type label with actual representation.Examples use Unix epoch milliseconds (Number). If that’s the contract, label the Type as Number (ms since epoch) to avoid confusion with Firestore’s Timestamp object.
Do you want me to update the table/types accordingly?
Also applies to: 29-30
|
@RishiChaubey31 Please improve PR title |
Co-authored-by: Mayank Bansal <mayankbansal125@gmail.com>
Co-authored-by: Mayank Bansal <mayankbansal125@gmail.com>
| | id | String | Unique identifier for the document. | | ||
| | userId | String | The id of the user who created the request. | | ||
| | state | String | The state of the request like APPROVED, REJECTED, PENDING. | | ||
| | requestedBy | String | UID of the user who created the request. | |
There was a problem hiding this comment.
unique ID of the user creating the request
| "comment": "String | null", | ||
| "createdAt": "Timestamp", | ||
| "requestedBy":"String", | ||
| "updatedAt": "Timestamp", |
There was a problem hiding this comment.
updatedAt type will be also "Timestamp | null"
There was a problem hiding this comment.
please confirm if updatedAt is null during creation, if yes then use null here
There was a problem hiding this comment.
No updatedAt is not null during creation
Date: 28-08-2025
Developer Name: Rishi Chaubey
Issue Ticket Number
Description
Documentation Updated?
Under Feature Flag
Database Changes
Breaking Changes
Development Tested?
Screenshots
Screenshot 1
Test Coverage
Screenshot 1
Additional Notes