ForSURE.categorylist.models.features

Feature model for the categorylist database.

Features Module

The Features module provides API endpoints for managing item features. Features are additional metadata and properties that can be attached to items, providing country-specific, report-specific, or PRO-specific information beyond the standard item data.

Overview

Features extend items with additional context-specific data. Each feature:

  • Belongs to an item (identified by item UUID)
  • Belongs to a revision
  • Can be country-specific
  • Can be report-type specific
  • Contains additional data fields (data_local and data_external)
  • Has a name/type identifier

Features are useful for:

  • Storing country-specific reporting requirements
  • Adding PRO-specific information
  • Maintaining additional metadata per item
  • Supporting multi-country reporting scenarios

Main Use Cases

1. Get Item Features

Retrieve all features for a specific item:

  • List all features associated with an item
  • Filter by country if needed
  • Paginated results

Endpoint: GET /features/{revision_uuid}/{item_uuid}

2. Create Features

Add new features to items:

  • Create a single feature
  • Bulk create features for multiple items
  • Specify country, report type, and data

Endpoints:

  • POST /features/simple/{revision_uuid}/{item_uuid} - Create single feature
  • POST /features/bulk/{revision_uuid} - Bulk create features

3. Update Features

Modify existing features:

  • Update feature data
  • Sync feature data from external sources

Endpoints:

  • PUT /features/{revision_uuid}/{feature_id} - Update feature
  • POST /features/{revision_uuid}/{item_uuid}/{feature_id}/sync - Sync feature

4. Delete Features

Remove features from items:

  • Delete by feature ID

Endpoint: DELETE /features/{revision_uuid}/{item_uuid}/{feature_id}

5. Merge Item Data

Get merged data combining item data and feature data:

  • Useful for viewing complete item information
  • Merges data from base revision and current revision
  • Includes feature data

Endpoint: GET /features/{sku}/merge

6. Search Features

Search across features:

  • Find features matching criteria
  • Filter by various properties

Endpoint: GET /features/search

7. Feature Statistics

Get statistics about features:

  • Count features by type
  • Aggregate information

Endpoint: GET /features/stats

Feature Data Structure

Features contain two data dictionaries:

  • data_local: Local/internal data for the feature
  • data_external: External data (e.g., from PRO systems)

Both can contain column values similar to item data.

Key Features

  • Country-Specific: Features can be scoped to specific countries
  • Report-Specific: Features can be associated with report types
  • Bulk Operations: Create multiple features at once
  • Data Merging: Combine item and feature data for complete view
  • Sync Capability: Synchronize feature data from external sources

Permissions

Most endpoints require CATEGORYLIST_SUGGEST-EDIT permission. Some read operations may require CATEGORYLIST_VIEW permission.

  • Items: Features are attached to items
  • Revisions: Features belong to revisions
  • Labels: Feature data uses the same column structure as items