ForSURE.categorylist.models.labels

Label model for the categorylist database.

Labels Module

The Labels module provides API endpoints for managing label definitions, which are the underlying structure that defines columns in a categorylist. Labels contain metadata about columns including their types, countries, report types, and PRO associations.

Overview

Labels are the foundation of the categorylist structure. They define:

  • Column definitions: What columns are available and their properties
  • Column metadata: Type (GENERAL, COUNTRY, etc.), country, report type, PRO
  • Column ordering: Organization and user-specific display preferences

While the Columns module provides simplified operations, the Labels module gives you full control over the label structure and metadata.

Main Use Cases

1. Get Labels

Retrieve all labels (column definitions) for a revision:

  • Get complete label structure with all metadata
  • Get current column order configuration

Endpoint: GET /revisions/{revision_uuid}/labels

2. Update Labels

Update the entire label structure for a revision:

  • Replace all labels with a new set
  • Update column order preferences
  • Modify label metadata

Endpoint: PUT /revisions/{revision_uuid}/labels

3. Get Label Options

Retrieve available label/column options that can be used:

  • Based on selected PROs (Product Registration Organizations)
  • Returns all possible columns that can be added to a categorylist

Endpoint: GET /labels/options

Label Types

Labels can be of different types:

  • GENERAL: General product information (e.g., SKU, Product Name, Weight)
  • COUNTRY: Country-specific information (e.g., country-specific reporting requirements)
  • GENERAL_PACKAGING: General packaging information
  • UNMAPPED: Custom columns not mapped to standard templates

Column Order Configuration

The column order configuration allows you to:

  • Set organization-wide default column order
  • Set user-specific column orders (overrides organization default)
  • Configure which order types are allowed (ORGANIZATION, USER, or both)

Key Features

  • Complete Control: Full access to label structure and metadata
  • PRO-Based Options: Available labels depend on selected PROs
  • Flexible Ordering: Support for organization and user-level preferences
  • Metadata Rich: Labels include country, report type, PRO, and unit information

Permissions

All endpoints require the CATEGORYLIST_SUGGEST-EDIT permission.

  • Columns: Simplified column management built on top of labels
  • Items: Items use labels to structure their data
  • Revisions: Labels belong to specific revisions