Content Categories & Link Collections
Overview
This part of the content system handles classification: top-level categories
(content_category), subcategories that can nest several levels deep
(content_subcategory), and link collections (content_link).
A link collection is a single link that, when opened, renders a list of articles matching a set of filter conditions. It works well as a rich menu button — for example a "This month's promotions" button whose contents change over time without ever editing the menu itself.
Core Data Structure
content_category (model ContentCategory)
uuid(unique),name, andslug, jointly unique as(line_oa_id, slug)description,thumbnail,sort_orderstatus(enumContentCategoryStatus) —active/inactive/delete- FK
line_oa_id→line_oa.id, with soft delete viadeleted_date 1 : Nrelations tocontent_subcategory,content_page, andcontent_link
content_subcategory (model ContentSubcategory)
category_id→content_category.id(ON DELETE CASCADE), unique on(category_id, slug)- multi-level nesting through
parent_id,content_subcategory_id, andlevel(default 2) - the remaining fields mirror the parent category:
uuid,name,slug,thumbnail,sort_order,status
content_link (model ContentLink)
A collection link that filters articles by condition.
tokenVARCHAR(64) unique — the key used in the public URL, alongside a uniqueuuid- filter conditions:
category_id,subcategory_id,published_date_from,published_date_to, andaudience_idsJSONB name,description,status, andclick_count(BIGINT)- FK
line_oa_id→line_oa.id, with soft delete viadeleted_date/deleted_by - indexes on
(token),(line_oa_id),(status),(category_id),(subcategory_id)
Related Files
prisma/schema.prisma:1197— modelContentCategoryprisma/schema.prisma:1231— modelContentSubcategoryprisma/schema.prisma:1273— modelContentLinkschema-dumps/2026-07-24/schema.sql:1247,:1564,:1290
Connections to Other Services
- cms-api-go — category management, including drag-to-reorder via
sort_order, and creating link collections - client-api-go — the public article listing opened from
content_link.token: filters articles by the stored conditions, checksaudience_ids, then incrementsclick_count
Related domains: Content Pages, Audience