Skip to content

Clarify asset department/location vs holder department semantics #97

@jnes0824

Description

@jnes0824

Background

On the asset detail page, after assigning an asset to a newly created holder, the page still shows the asset's original Department / Location. For example, after assigning AST-2026-00013 to a new user, the detail page still shows the demo-seeded values 資訊維運部 / 新竹 Fab12 行政樓.

This does not appear to be a simple API routing issue or an incorrect backend join. The current data model stores separate fields for users and assets:

  • users.department: the user's organization department
  • assets.department: the asset's owning/using department
  • assets.location: the asset's physical/storage location
  • There is currently no users.location field

The asset assignment flow currently updates the holder, status, and assignment date. It does not synchronize assets.department or assets.location from the assigned user.

Why this needs discussion

The UI currently labels these fields simply as Department / Location. Users may interpret them as the current holder's department/location, while the current API/design docs suggest they are asset-level fields.

This creates confusion:

  1. A newly registered user has a department, but the asset detail page may show a different department after assignment.
  2. Reassigning an asset changes the holder but leaves the asset department/location unchanged.
  3. It is not obvious whether the detail page is displaying asset attributes or holder attributes.

Current documentation signals

The current docs appear to favor keeping asset department and user department as separate concepts:

  • FR-13 lists location / responsible person / department as asset detail attributes.
  • The database design includes both users.department and assets.department/assets.location.
  • User registration accepts department but not location.
  • Asset registration/update accepts location and department.
  • Asset assignment only specifies responsible_person_id, assignment_date, and version; it does not require synchronizing asset department/location.

Possible directions to discuss

No decision has been made yet. Possible directions include:

  1. Keep the data model separate and clarify UI labels

    • Rename Department / Location to Asset Department / Asset Location.
    • Optionally display Holder Department separately.
  2. Default asset department from holder department during assignment, but allow override

    • The assign modal could prefill asset department from the selected holder.
    • Keep assets.department for cross-department loans, shared assets, inventory ownership, and audit/asset-accounting scenarios.
  3. Collapse the semantics and only use holder department

    • Simpler, but weakens support for asset ownership, inventory, shared equipment, cross-department borrowing, and audits.
    • It also does not solve location because there is no users.location field today.

Recommendation before implementation

This should be clarified as a product/data-semantics decision before changing backend behavior. Key questions:

  • Should the asset detail page's Department represent asset department or holder department?
  • Should both be displayed?
  • Should asset location remain an asset-level attribute?
  • Should the assignment flow ask the manager to confirm or update asset department/location?

Acceptance criteria

To be defined after the product direction is chosen.

Metadata

Metadata

Assignees

Labels

backendquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions