Skip to main content

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, and slug, jointly unique as (line_oa_id, slug)
  • description, thumbnail, sort_order
  • status (enum ContentCategoryStatus) — active / inactive / delete
  • FK line_oa_idline_oa.id, with soft delete via deleted_date
  • 1 : N relations to content_subcategory, content_page, and content_link

content_subcategory (model ContentSubcategory)

  • category_idcontent_category.id (ON DELETE CASCADE), unique on (category_id, slug)
  • multi-level nesting through parent_id, content_subcategory_id, and level (default 2)
  • the remaining fields mirror the parent category: uuid, name, slug, thumbnail, sort_order, status

A collection link that filters articles by condition.

  • token VARCHAR(64) unique — the key used in the public URL, alongside a unique uuid
  • filter conditions: category_id, subcategory_id, published_date_from, published_date_to, and audience_ids JSONB
  • name, description, status, and click_count (BIGINT)
  • FK line_oa_idline_oa.id, with soft delete via deleted_date / deleted_by
  • indexes on (token), (line_oa_id), (status), (category_id), (subcategory_id)
  • prisma/schema.prisma:1197 — model ContentCategory
  • prisma/schema.prisma:1231 — model ContentSubcategory
  • prisma/schema.prisma:1273 — model ContentLink
  • schema-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, checks audience_ids, then increments click_count

Related domains: Content Pages, Audience