Batch Creation & Collection Management

This document outlines the architecture for two powerful, related features: Batch Creation for rapid object capture, and Collections for flexible, user-defined grouping and bulk operations.

1. Core Concepts

1.1. Batch

A Batch is a temporary, system-managed group of objects created through the “Batch Create” workflow. It is designed for speed.

  • Characteristics: Objects in a batch are initially created with a minimal set of data:
    • An image (or multiple images).
    • A mandatory inside relationship to a parent container.
    • A default owner (determined by user settings).
    • A system status of unprocessed.
  • Lifecycle: A batch is a transient concept. Once all objects within it are processed (i.e., have their names/descriptions filled in and their status changed from unprocessed), the “batch” itself effectively ceases to exist.

1.2. Collection

A Collection is a persistent, user-managed group of objects. It is designed for organization and performing bulk actions.

  • Characteristics:
    • A Collection has its own name and owner.
    • It can contain any number of objects, regardless of their location, owner, or status.
    • An object can belong to multiple collections.
  • Data Model: A Collection will be a distinct node in Neo4j (e.g., :Collection) connected to objects via a relationship (e.g., IN_COLLECTION).

2. Use Case Details

2.1. Batch Create Objects (UC-501)

This workflow is optimized for rapid capture on a mobile device.

Flow:

  1. Initiation: The user selects a container space in the UI (via dashboard, search, or scanning a tag). This sets the context for where the new objects will be located.
  2. Camera Mode: The application opens the camera.
  3. Capture Loop:
    • The user takes a picture.
    • The UI presents two main options: “Store as new object” and “Add another picture” (to the current object).
    • If “Store as new object,” the client app stores the image locally and prepares a new object stub in memory. It then immediately re-opens the camera for the next object.
    • This loop continues until the user explicitly exits camera mode by pressing a “Done” button.
  4. Background Sync:
    • As objects are created on the client, a background process begins uploading the images to Supabase Storage and sending GraphQL mutations to create the Object nodes in the backend.
    • This ensures the UI remains fast and responsive, and the process is resilient to network interruptions.

2.2. Configure Default Ownership (UC-102)

In the user’s settings page, a new section for “Default Ownership” will be available.

  • Options:
    1. Me: Assign to the user’s personal account.
    2. Organization: A dropdown lists all organizations the user is a member of.
    3. Container’s Owner (Default): Assign ownership to whoever owns the container the object is being placed in.

2.3. Process Unfinished Objects (UC-502)

This workflow is optimized for desktop use, allowing for efficient data entry.

Flow:

  1. Access: The user navigates to a view that shows all objects with the unprocessed status. This could be a dedicated “Inbox” or a filter on the main object list.
  2. Processing UI:
    • The user selects an object to process.
    • An “edit” view appears, showing the object’s picture(s).
    • The user can input a Name and Description.
    • AI Assistance: An “Auto-describe” button will be available. When clicked, it sends the object’s primary image to an AI service, which returns a suggested Name and Description for the user to accept or edit.
    • The user can manage statuses as normal.
  3. Workflow Actions: The view contains three actions:
    • Cancel: Discard changes and return to the list.
    • Save: Save changes and return to the list. The unprocessed status is removed.
    • Save & Next: Saves the current object and immediately loads the next object from the unprocessed list, allowing for extremely fast data entry.

2.4. Collections Management (UC-503 & UC-504)

Creating and Populating a Collection:

  • Users can create a new, empty Collection from a main menu.
  • From any object view, a user can select “Add to Collection,” which lets them choose an existing collection or create a new one.

Performing Bulk Actions:

  • A user can navigate to a specific Collection’s page.
  • This page will display all contained objects.
  • At the top of the page will be a “Bulk Actions” menu with options like:
    1. Move all objects: Prompts the user to select a new container space. A single backend job then updates the inside relationship for all objects in the collection.
    2. Change ownership: Prompts the user to select a new owner (another user or organization). A backend job updates the ownership records in Supabase for all objects in the collection.