Asset Tracking
Asset Tracking Use Cases
This document describes real-world scenarios for asset tracking in Global Watch, including creating assets, managing templates, and working with the asset catalog.
UC-201: Create Asset
Description
User creates a geolocated asset within a project. Assets represent physical items like trees, equipment, structures, or markers that need to be tracked.
Actors
- Primary: Project Member
- Secondary: Map System
Preconditions
- User is authenticated
- User has access to the project
- Project exists and is active
Postconditions
- Asset created with unique ID
- Asset location stored as geometry
- Asset visible on project map
- Usage tracking updated
Main Flow
- User navigates to project map
- User clicks "Add Asset" button
- User clicks on map to set location
- User enters asset details:
- Name: "Tree #1234"
- Type: Tree (from template)
- Description: Optional notes
- System validates asset data
- System creates asset record
- System updates map display
- Asset appears on map with marker
Alternative Flows
A1: Use Template
- User selects asset template
- Form fields pre-populated from template
- User modifies values as needed
- Continue from step 5 of main flow
A2: Use Catalog Item
- User selects template type
- User selects catalog item
- Form fields pre-populated from catalog
- User modifies specific values (e.g., actual measurements)
- Continue from step 5 of main flow
Business Rules
| ID | Rule |
|---|---|
| BR-AST-001 | Asset must have valid geometry |
| BR-AST-002 | Asset name required |
| BR-AST-003 | Template fields validated against schema |
UC-202: Create Asset Template
Description
Account owner creates a custom template for tracking specific types of assets. Templates define the fields and validation rules for assets.
Actors
- Primary: Account Owner/Admin
Preconditions
- User is authenticated
- User has account owner or admin role
- User is on account settings page
Postconditions
- Template created and available
- Template fields defined
- Template available for catalog items and assets
Main Flow
- User navigates to Account Settings → Templates
- User clicks "New Template"
- User enters template details:
- Name: "Water Source"
- Description: "Track water sources like rivers, lakes, and wells"
- Icon: "droplet"
- Color: "#3B82F6" (blue)
- User adds fields:
- Type (select): Options = ["River", "Lake", "Well", "Spring", "Pond"]
- Flow Rate (L/min) (number): Min = 0
- Quality (select): Options = ["Excellent", "Good", "Fair", "Poor"]
- Last Tested (date): Required = false
- Notes (text): Required = false
- User arranges field order via drag-and-drop
- User clicks "Save Template"
- Template appears in account templates list
Alternative Flows
A1: Duplicate Template Name
- User enters name that already exists
- System shows error: "A template with this name already exists"
- User enters different name
- Continue from step 4 of main flow
A2: Invalid Field Configuration
- User configures field incorrectly
- System shows validation error
- User corrects field configuration
- Continue from step 5 of main flow
Business Rules
| ID | Rule |
|---|---|
| BR-TPL-001 | Template name must be unique within account |
| BR-TPL-002 | Field names must be unique within template |
| BR-TPL-003 | Global templates cannot be modified |
| BR-TPL-004 | At least one field required |
Field Types
| Type | Description | Options |
|---|---|---|
text | Single-line text input | maxLength |
textarea | Multi-line text input | maxLength |
number | Numeric input | min, max, step |
select | Dropdown selection | options array |
date | Date picker | - |
boolean | Checkbox | - |
UC-203: Populate Catalog
Description
User adds items to the asset catalog for quick asset creation. Catalog items are pre-configured instances of templates.
Actors
- Primary: Team Member (with
projects.managepermission)
Preconditions
- User is authenticated
- User has
projects.managepermission - Template exists (global or account)
Postconditions
- Catalog item created
- Item available for asset creation
- Item grouped by template type
Main Flow
- User navigates to Account → Catalog
- User clicks "New Item"
- User selects template: "Tree"
- User enters item details:
- Name: "Eucalyptus grandis"
- Species: "Eucalyptus grandis"
- Scientific Name: "Eucalyptus grandis W.Hill"
- Family: "Myrtaceae"
- Origin: "Exotic"
- Height: 45
- DAP: 80
- User adds optional media:
- Thumbnail URL: Image for preview
- 3D Model URL: GLB file for 3D view
- User clicks "Save Item"
- Item appears in catalog under "Tree" category
Alternative Flows
A1: Duplicate Item Name
- User enters name that already exists
- System shows error: "An item with this name already exists"
- User enters different name
- Continue from step 5 of main flow
Business Rules
| ID | Rule |
|---|---|
| BR-CAT-001 | Item name must be unique within account |
| BR-CAT-002 | Item must reference valid template |
| BR-CAT-003 | Item data validated against template schema |
UC-204: Create Asset from Template
Description
User creates an asset using a pre-configured catalog item, with fields pre-populated from the catalog.
Actors
- Primary: Field Technician
Preconditions
- User is authenticated
- User has access to project
- Catalog item exists
Postconditions
- Asset created with template item link
- Asset data includes inherited and modified values
- Asset appears on project map
Main Flow
- User navigates to Project → Assets
- User clicks "New Asset"
- User enters basic details:
- Name: "Tree #1234"
- Location: (click on map)
- User goes to "Template" tab
- User selects template type: "Tree"
- User selects catalog item: "Eucalyptus grandis"
- Form fields pre-filled:
- Species: "Eucalyptus grandis"
- Scientific Name: "Eucalyptus grandis W.Hill"
- etc.
- User modifies specific values:
- Height: 38 (actual measured height)
- DAP: 65 (actual measured diameter)
- User clicks "Create Asset"
- Asset created with template item reference
Business Rules
| ID | Rule |
|---|---|
| BR-AST-004 | Asset data independent of catalog item |
| BR-AST-005 | Changes to catalog item don't affect existing assets |
| BR-AST-006 | Template item ID stored for reference |
UC-205: Override 3D Model
Description
User overrides the default 3D model for a specific asset with a custom model.
Actors
- Primary: Team Member (with asset edit permission)
Preconditions
- Asset exists and is linked to template item
- Template item has default 3D model
Postconditions
- Asset's 3D model URL updated
- Custom model displayed instead of default
- Template item's model unchanged
Main Flow
- User navigates to Project → Assets → [Asset]
- User clicks "Edit"
- User goes to "Template" tab
- User enters custom 3D model URL:
https://cdn.example.com/models/custom-tree-1234.glb
- User clicks "Save"
- Asset displays custom 3D model
Model Resolution Priority
1. Asset.model_3d_url (override) → Used if set
2. TemplateItem.model_3d_url (default) → Used if asset override is null
3. null → No 3D model availableUC-206: Search Catalog
Description
User searches for items in the asset catalog.
Actors
- Primary: Account Member
Preconditions
- User is authenticated
- Catalog contains items
Postconditions
- Search results displayed
- Results filtered by query and template
Main Flow
- User navigates to Account → Catalog
- User enters search query: "John Deere"
- Results filter in real-time
- User optionally filters by template: "Equipment"
- User clicks on item to view details
Search Behavior
- Searches item name
- Searches JSONB data fields
- Case-insensitive matching
- Partial word matching
Business Rules
| ID | Rule |
|---|---|
| BR-CAT-004 | Search debounced (300ms) |
| BR-CAT-005 | Results paginated for large catalogs |
| BR-CAT-006 | GIN index ensures fast JSONB search |
UC-207: Archive Catalog Item
Description
User archives an outdated catalog item while preserving it for historical reference.
Actors
- Primary: Account Owner
Preconditions
- User is authenticated
- User has account owner role
- Catalog item exists
Postconditions
- Item marked as archived
- Item hidden from default view
- Existing assets linked to item remain valid
Main Flow
Archive:
- User navigates to Account → Catalog
- User finds item to archive
- User clicks item menu (⋮)
- User selects "Archive"
- User confirms action
- Item hidden from default view
Restore:
- User toggles "Show Archived" filter
- User finds archived item
- User clicks item menu (⋮)
- User selects "Restore"
- User confirms action
- Item available again
Business Rules
| ID | Rule |
|---|---|
| BR-CAT-007 | Archived items hidden from default view |
| BR-CAT-008 | Archived items cannot be selected for new assets |
| BR-CAT-009 | Existing assets linked to archived items remain valid |
| BR-CAT-010 | Restored items become available again |
UC-208: Edit Template Fields
Description
Account owner adds or modifies fields in an existing custom template.
Actors
- Primary: Account Owner
Preconditions
- User is authenticated
- User has account owner role
- Custom template exists (not global)
Postconditions
- Template updated with new fields
- Existing catalog items retain data
- New field appears in forms
Main Flow
- User navigates to Account Settings → Templates
- User finds template to edit
- User clicks "Edit"
- User clicks "Add Field"
- User configures new field:
- Name: "Maintenance Date"
- Type: "date"
- Required: false
- User drags field to desired position
- User clicks "Save Template"
- Template updated
Important Notes
- Removing a field does not delete data from existing items
- Changing field type may cause validation issues
- Field order changes reflected in forms
Global Templates
Global Watch provides global templates that are available to all accounts:
| Template | Icon | Description |
|---|---|---|
| Tree | 🌳 | Track trees with species, height, diameter |
| Equipment | 🔧 | Track equipment and machinery |
| Structure | 🏗️ | Track buildings and structures |
| Marker | 📍 | Generic location markers |
Global templates:
- Cannot be edited or deleted
- Show "Global" badge in UI
- Available to all accounts automatically
Edge Cases
EC-1: Duplicate Template Name
Scenario: User tries to create template with existing name.
Expected Behavior:
- Form validation error displayed
- Template not created
- Error: "A template with this name already exists"
EC-2: Delete Template with Items
Scenario: User tries to delete template that has catalog items.
Expected Behavior:
- Confirmation dialog warns about existing items
- If confirmed, template soft-deleted
- Existing items remain but cannot create new ones
EC-3: Invalid Field Data
Scenario: User enters data that doesn't match field type.
Expected Behavior:
- Real-time validation error on field
- Form cannot be submitted
- Clear error message
EC-4: Large Catalog Search
Scenario: Catalog contains 10,000+ items.
Expected Behavior:
- Search debounced (300ms)
- Results paginated
- GIN index ensures fast search
- Loading indicator during search
EC-5: 3D Model URL Invalid
Scenario: User enters invalid 3D model URL.
Expected Behavior:
- URL format validated on save
- If URL inaccessible at runtime, fallback to 2D view
- Error logged but doesn't break asset display
Error Handling
Template Errors
| Error | Code | Message |
|---|---|---|
| Template not found | TEMPLATE_NOT_FOUND | "Template not found" |
| Name already exists | TEMPLATE_NAME_EXISTS | "A template with this name already exists" |
| Cannot modify global | GLOBAL_TEMPLATE_MODIFICATION | "Global templates cannot be modified" |
| Field validation failed | FIELD_VALIDATION_ERROR | "Invalid field configuration: {details}" |
| Duplicate field name | DUPLICATE_FIELD_NAME | "Field names must be unique" |
Catalog Item Errors
| Error | Code | Message |
|---|---|---|
| Item not found | ITEM_NOT_FOUND | "Catalog item not found" |
| Validation failed | ITEM_VALIDATION_ERROR | "Invalid data: {details}" |
| Item archived | ITEM_ARCHIVED | "Cannot modify archived item" |
| Name already exists | ITEM_NAME_EXISTS | "An item with this name already exists" |
Testing Checklist
Asset Creation
- Asset created with valid geometry
- Template fields populated correctly
- Catalog item pre-fills form
- Asset appears on map
- Usage tracking updated
Templates
- Custom template created
- Fields added and ordered
- Field validation works
- Global templates read-only
- Template deletion handled
Catalog
- Items created and listed
- Search works correctly
- Archive/restore works
- Items grouped by template
- Pagination for large catalogs
3D Models
- Default model from template item
- Override model on asset
- Fallback when model unavailable