Designer Assignment
Overview
Section titled “Overview”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.
Participants
Section titled “Participants”| Actor | Ontological type | Role |
|---|---|---|
| Staff user (Creative lead) | Person (CCO) bearing Creative Role | Assigns/unassigns tags to designers, reviews Measurement Data |
| Dashboard API Worker | EngineeredSystem (IOF) | Serves Agent Role Assignment CRUD and Measurement Data queries |
| PlanetScale | EngineeredSystem (IOF) | IBE store for Agent Role Assignments, computes aggregates |
Data flow
Section titled “Data flow”[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
API endpoints
Section titled “API endpoints”| Method | Path | Description |
|---|---|---|
GET | /api/designers | All Agents (Persons bearing Designer Role) with assigned tags and aggregated Measurement Data |
GET | /api/designers/names | List of unique Agent names |
POST | /api/designers/assign | Create Agent Role Assignment (tag → designer) |
DELETE | /api/designers/unassign | Remove an Agent Role Assignment |
DELETE | /api/designers/:designerName | Delete Agent and all their Role Assignments |
Agent list response DTO
Section titled “Agent list response DTO”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;}Measurement Data computation
Section titled “Measurement Data computation”Agent performance Measurement Data is computed by joining:
agent_role_assignment— which tags belong to which Person bearing Designer Rolematerial_artifact— which MaterialArtifacts have those tags (viatagsJSONB Quality)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.
Database table
Section titled “Database table”[CCO: agent_in | BFO: has_role — Person bearing Designer Role assigned to tag]
| Column | Type | Constraint |
|---|---|---|
id | UUID | Primary key |
designer_name | VARCHAR(255) | Person (CCO) name |
tag_name | VARCHAR(255) | Tag ICE identifier |
assigned_at | TIMESTAMPTZ | Default now() |
| UNIQUE (designer_name, tag_name) |
Acceptance criteria
Section titled “Acceptance criteria”- 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