refactor(statistics): deprecate EntranceStatistics.zone_name in favor of camera_group #200
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#200
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Follow-up from #99 and PR #168 review pass 1.
EntranceStatistics.zone_name(and related DB/service fields) conflicts with CONTEXT.md's glossary, where "Zone" is explicitly in the avoid-list for camera groupings:zone_namewas preserved in PR #168 for backwards compatibility with frontend API contracts and documented as:"Legacy name: the camera's Camera Group; not a domain Zone."
This issue tracks deprecating or aliasing
zone_nametocamera_groupacross the database, Pydantic schemas, and frontend adapters (app.js,command_deck_adapter.js).gabogg referenced this issue2026-10-02 15:04:12 +00:00
Back to
needs-triage(2026-10-02). PR #168's second review (r21) found an open design point: shouldzone_namebe deprecated with an alias, or removed in favour ofcamera_group? It also found no acceptance criterion. Note:zone_nameholds the Camera Group name only when HikCentral returns one; otherwise it is guessed from the camera name, with the default'General'. Settle these, then restoreready-for-agent.Agent Brief
Category: enhancement (refactor)
Summary: Replace the camera's
zone_namewith its Camera Group name everywhere it is served or shown, and stop writingzone_name.Delivery: fixed inside PR #168, as part of its pass-2 fixes, and closed by it (maintainer, 2026-10-02).
Current behavior:
zone_namestring. When HikCentral returns a people-counting group, discovery copies the group's name into it. In the fallback discovery from camera names, it is a guess from keywords in the camera's name. The database default is'General'.resource_group_code, which links to the registered group'sresource_group_name.zone_nameis served by the camera and entrance response models (includingEntranceStatistics) and shown in the admin camera lists and search, the command deck camera list, and the statistics entrances table, labelled with the i18n keyoccupancy.zoneLabel._Avoid_: Zone, portal group.Desired behavior:
zone_nameservescamera_group: str | Noneinstead: the name of the camera's linked Camera Group, ornullwhen the camera has no group (fallback discovery, or Empty/Unlisted group states). No alias, no deprecation period. Backend and frontend change together, since the only consumer is this repo's frontend.zone_nameand drops the keyword-based zone guess. Direction inference from the camera name stays.cameraGroupLabel, in EN and ES.counting_cameras.zone_namecolumn stays in the table, unused, marked legacy in the schema code. Dropping it is a separate low-priority cleanup (see below).docs/api/README.mddescribescamera_group, and any OpenAPI field description uses the glossary term.Key interfaces:
EntranceStatistics:zone_name: str→camera_group: str | None.resource_group_codeto its group's name.CountingCameraItemand the discovery upsert: nozone_nameinput.Acceptance criteria:
zone_name, apart from the legacy column definition.camera_group: null, and the UI shows the localized "no camera group" text in EN and ES.zone_name, and no zone is guessed from the camera name. Direction inference is unchanged, with a test.docs/api/README.mddocumentcamera_groupwith Camera Group wording.camera_group, plus a grouped case and an ungrouped case.Out of scope:
zone_namecolumn. That is a separate low-priority issue.The follow-up cleanup the brief mentions (dropping the unused
zone_namecolumn) is tracked in #209. It is low priority and blocked by this issue.