Skip to content

Designer Assignment

The designer assignment system links Persons (CCO) bearing the Designer Role (BFO) to product tags via the CCO agent_in relation, then aggregates Measurement Data (IAO) per Agent. This enables the Creative team to understand which designers’ work is generating the strongest sales performance.

Goal: Attribute sales Measurement Data to individual Persons bearing Designer Roles via their Agent Role Assignments.

ActorOntological typeRole
Staff user (Creative lead)Person (CCO) bearing Creative RoleAssigns/unassigns tags to designers, reviews Measurement Data
Dashboard API WorkerEngineeredSystem (IOF)Serves Agent Role Assignment CRUD and Measurement Data queries
PlanetScaleEngineeredSystem (IOF)IBE store for Agent Role Assignments, computes aggregates

[CCO: agent_in relation | BFO: has_role | IAO: Measurement Data aggregation per Agent]

sequenceDiagram
    participant User as Creative Lead (Person bearing Role)
    participant API as Dashboard API (EngineeredSystem)
    participant DB as PlanetScale (IBE Store)

    User->>API: POST /designers/assign { designerName, tagName }
    API->>DB: INSERT agent_role_assignment
    DB-->>API: { id, designerName, tagName }
    API-->>User: Agent Role Assignment created

    User->>API: GET /designers
    API->>DB: JOIN agent_role_assignment + material_artifact + sales_measurement_dataset
    DB-->>API: Agents with tags and Measurement Data
    API-->>User: Aggregated Agent performance
MethodPathDescription
GET/api/designersAll Agents (Persons bearing Designer Role) with assigned tags and aggregated Measurement Data
GET/api/designers/namesList of unique Agent names
POST/api/designers/assignCreate Agent Role Assignment (tag → designer)
DELETE/api/designers/unassignRemove an Agent Role Assignment
DELETE/api/designers/:designerNameDelete Agent and all their Role Assignments
interface AgentWithMeasurementData {
designerName: string; // Person (CCO) name
tags: Array<{
tagName: string;
tagId: string;
assignedAt: string;
totalUnits: number; // Ratio Measurement: lifetime sales
units30d: number; // Ratio Measurement: 30-day window
productCount: number; // MaterialArtifact count
}>;
totalUnits: number; // Aggregated Measurement Data
units30d: number;
totalProducts: number;
}

Agent performance Measurement Data is computed by joining:

  1. agent_role_assignment — which tags belong to which Person bearing Designer Role
  2. material_artifact — which MaterialArtifacts have those tags (via tags JSONB Quality)
  3. sales_measurement_dataset — Ratio Measurement Data for those MaterialArtifacts

The aggregation sums totalUnits, units30d, and counts distinct MaterialArtifacts per tag, then rolls up to per-Agent totals.

[CCO: agent_in | BFO: has_role — Person bearing Designer Role assigned to tag]

ColumnTypeConstraint
idUUIDPrimary key
designer_nameVARCHAR(255)Person (CCO) name
tag_nameVARCHAR(255)Tag ICE identifier
assigned_atTIMESTAMPTZDefault now()
UNIQUE (designer_name, tag_name)
  • Creating an Agent Role Assignment produces a unique (designer, tag) association
  • Duplicate assignment (same Agent + tag) is rejected gracefully
  • Agent list includes correct aggregated Measurement Data from sales_measurement_dataset
  • Deleting an Agent removes all their Role Assignments
  • Unassigning a tag updates the Agent’s Measurement Data totals on next query