proto: add OrgUnitStatus enum and status/deleted fields#185
Conversation
Add OrgUnitStatus enum (Active=0, Deleted=1) for org-unit soft-delete support. Add status field to OrgUnitsListEntry and OrgUnitGetResp, and deleted timestamp field to OrgUnitGetResp. Closes #179
Signed-off-by: Prabhjot Singh Sethi <prabhjot.sethi@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
WalkthroughAdds an OrgUnit Soft-Delete Status
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
dev-arya23
left a comment
There was a problem hiding this comment.
What I verified
- Proto enum convention:
OrgUnitStatususes PascalCase values (Active = 0,Deleted = 1) — consistent with the existingApiKeyDef.Statusenum inmyaccount.proto(Active = 0,Expired = 1,Disabled = 2). Verified at source. - Package-level enum placement: Placing the enum at package level (not nested inside a message) is the right call since it's referenced by two different messages (
OrgUnitsListEntry.statusandOrgUnitGetResp.status). Reusable and clean. - Field number safety: New fields use previously unused numbers —
statusat field 6 on bothOrgUnitsListEntryandOrgUnitGetResp,deletedat field 7 onOrgUnitGetResp. No wire-compatibility issues; existing clients will ignore unknown fields per standard proto3 behaviour. - Asymmetric field exposure:
deletedtimestamp only onGetResp(notListEntry) is a sound design — list callers needstatusfor filtering but the exact deletion timestamp is a detail-view concern. - Generated code consistency:
org-unit.pb.goandapidocs.swagger.jsonare consistent with the.protodefinitions — enum types registered, dependency indexes updated, swagger$refentries correct.
Clean, well-scoped proto-first change. LGTM.
Summary
Adds proto definitions required for org-unit soft-delete (issue #179):
OrgUnitStatusenum —Active = 0,Deleted = 1(PascalCase, consistent with existingApiKeyDef.Statusconvention)OrgUnitsListEntry.status(field 6) — exposes status in list responses so internal callers can see deleted OUsOrgUnitGetResp.status(field 6) — exposes status in get responsesOrgUnitGetResp.deleted(field 7) —int64unix timestamp recording when the OU was soft-deleted (0if active)Design decisions
ApiKeyDef.Statuspatterndeletedonly onGetResp, not onListEntrymyaccount.protoWire compatibility
All new fields use previously unused field numbers (6, 7). Existing clients that don't know about these fields will simply ignore them (standard proto3 behaviour). No breaking changes.
Closes #179
Summary by CodeRabbit
New Features
Bug Fixes