Product



Got it—simple CRUD for Product. Here’s a minimal, implementation-ready spec that fits your Modelling → Products sub-menu and routing ( /modelling → Products ) and reuses the Sprint-1 shell/components.
1) DB (PostgreSQL) — minimal table
CREATE TABLE mes_product (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
sku TEXT NOT NULL UNIQUE,
name TEXT NOT NULL,
product_type TEXT NOT NULL CHECK (product_type IN ('FG','WIP','RM')), -- Finished/WIP/Raw
status TEXT NOT NULL DEFAULT 'active' CHECK (status IN ('active','inactive')),
meta JSONB NOT NULL DEFAULT '{}'::jsonb, -- simple key/value metadata
image_url TEXT, -- store file in S3, keep URL here
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT now()
);
CREATE INDEX ON mes_product (name);
CREATE INDEX ON mes_product (product_type, status);
2) Named Queries / Endpoints
List (with search & paging):
-- :search text, :limit int, :offset int SELECT id, sku, name, product_type, status, image_url, updated_at FROM mes_product WHERE (:search IS NULL OR sku ILIKE '%'||:search||'%' OR name ILIKE '%'||:search||'%') ORDER BY updated_at DESC LIMIT :limit OFFSET :offset;
Get by id:
SELECT * FROM mes_product WHERE id = :id;
Create:
INSERT INTO mes_product (sku, name, product_type, status, meta, image_url) VALUES (:sku, :name, :product_type, COALESCE(:status,'active'), COALESCE(:meta,'{}'::jsonb), :image_url) RETURNING *;Update:
UPDATE mes_product SET sku=:sku, name=:name, product_type=:product_type, status=:status, meta=COALESCE(:meta,'{}'::jsonb), image_url=:image_url, updated_at=now() WHERE id=:id RETURNING *;Delete (hard delete; switch to soft if you prefer):
DELETE FROM mes_product WHERE id=:id;
3) Ignition Perspective (simple UI)
Use your Sprint-1 Page Shell + Sidebar + Top Sub-Nav with a “Products” tab under Modelling.
/modelling/products (List View)
Search box (binds to :search), table with columns: Image, SKU, Name, Type, Status, Updated.
Buttons: New, Edit, Delete.
Pagination (limit/offset).
/modelling/products/:id (Form)
Fields: SKU, Name, Product Type (FG/WIP/RM), Status (active/inactive), Metadata (JSON textarea), Image (upload → returns URL).
Actions: Save, Cancel.
4) Roles (minimal)
Operator: read-only list & detail.
Planner/Manager: create/edit/delete.
SuperAdmin: full access.
(Map via your Sprint-1 role model and route guards).
5) Accept/Done
Can create, read (list + detail), update, delete a Product.
Search by SKU/Name and paginate.
Works inside /modelling navigation and breadcrumbs; Products tab present.
Uses your shell/theme (Light/Dark) without orphan colors.
If you want, I can trim this further to a one-pager handoff or drop in a ready-to-paste Named Query bundle for Perspective.