Intranet · Files management

A shared document library with folders, where each file or folder is published to a role audience (all / commerce / management) or to specific stores, and can be downloaded by the audiences allowed to see it.

AreaIntranet
Routesintranet.files · intranet.files.index · intranet.files.new · intranet.files.edit · intranet.files.show
Centre modulesintranet
Staff levelsroot · admin · manager · scmanager · storeManager · commerce
Modelscommerce · intranet-file
UI labeltitle.header.files / menu.navbar.intranet.file.index
Coverage5 use cases · 2 happy · 7 failure

Known issues (1)

How it works

Visibility is the core concept: enums/intranet-file-roles defines three audiences and, for each, which staff levels may assign it — only admin/manager/scmanager can publish to all or management, while commerce is additionally assignable by commerce-level users. canSelectRole reflects this. The model validates conditionally through helper predicates: fileUrl is required only when the entry is not a directory (isNotDirectory), and commerces only when the file targets specific stores (isToCommerces); roles has both a presence rule and an inclusion rule over ['management','commerce','owner','all'] — note owner is accepted here but is not one of the three enum options offered in the UI. Navigation state lives in the explore-files service (changeFolder), and folder creation reports folder.success-created.

Use cases

Why someone opens this (5)

  • Publishing the centre’s operating manual to all stores.
  • Sharing a confidential document with management only.
  • Sending a specific contract to one store.
  • Organising documents into folders by year or topic.
  • A store downloading the forms it needs.

Path map

flowchart LR
    F(["Files management"]):::feat
    F --> H1["Document published to all stores"]:::ok
    F --> H2["Store-specific document"]:::ok
    F -.-> X1["Name missing"]:::bad
    F -.-> X2["No file attached"]:::bad
    F -.-> X3["No role selected"]:::bad
    F -.-> X4["Store-targeted file with no stores"]:::bad
    F -.-> X5["Upload rejected"]:::bad
    F -.-> X6["Role not assignable by this user"]:::bad
    F -.-> X7["Download not permitted"]:::bad
    classDef feat fill:#26688f,stroke:#26688f,color:#ffffff,font-weight:bold
    classDef ok fill:#e3f1ea,stroke:#0d6b42,color:#0d4a2e
    classDef bad fill:#f7e6e2,stroke:#9a2d1c,color:#6e1f13

Happy paths

Document published to all stores

  1. Manager creates a folder (folder.success-created) and opens it.
  2. Uploads a file, names it and selects the all role.
  3. Validation passes (name and file URL present, role valid).
  4. Stores see the file in their library and download it.

Store-specific document

  1. Manager sets the audience to specific stores and selects them.
  2. commerces presence rule is satisfied and the file saves.
  3. Only the selected stores see it.

Failure paths

QA checklist

Tick these off while regression-testing this feature. The boxes are plain Markdown, so progress is visible in git diffs.

  • ✅ Document published to all stores
  • ✅ Store-specific document
  • ⛔ Name missing
  • ⛔ No file attached
  • ⛔ No role selected
  • ⛔ Store-targeted file with no stores
  • ⛔ Upload rejected
  • ⛔ Role not assignable by this user
  • ⛔ Download not permitted

Implementation


Generated from doc/feature-inventory.json · id intranet-files · commit 276788ca6