Skip to content

Kanban Card Annotations

Feature Request

Description

The User should be able to add or edit notes for a Kanban Card from the API. This capability should later be exposed in the UI.

Specification

  1. The Kanban Card should have a notes field of size 8192 characters that can be null.
  2. The notes field should be initialized when the Kanban Card is created with the first non-null value of the following:
    1. The notes field of the KanbanCardInput provided in the API request.
    2. The cardNotesDefault field of the Item identified by theItemReference of the Kanban Card Input.
    3. The notes field of the Item identified by the ItemReference of the Kanban Card Input.
      If none of the above values are non-null, the notes field should be initialized to null.
  3. The notes field should be updated when the Kanban Card is updated with the value of the notes field of the KanbanCardInput provided in the API request.
  4. A specific endpoint should be added to the Kanban Card API Endpoint to update the notes field of the Kanban Card without updating any other field of the Kanban Card.

Implementation

API Layer (HomeEndpoint.kt, Model.kt):

  • The KanbanCardInput data class now includes a notes field, allowing clients to provide notes when creating a new card.
  • The toEntity function (previously toItem) has been updated to map this new notes field to the KanbanCard.Entity.

Service Layer (KanbanCardService.kt, LifecycleImpl.kt, PrintLifecycleImpl.kt, ServiceImpl.kt):

  • The newCard function signature in KanbanCardService has been modified to accept a KanbanCard payload directly, simplifying the creation process.
  • The LifecycleImpl and PrintLifecycleImpl have been updated to correctly handle the new notes field when card states are updated.
  • The main ServiceImpl now populates the notes field when creating a new card, either from the provided payload or by using the default notes from the associated item.

Business Logic (KanbanCard.kt, KanbanCardPrinter.kt):

  • The KanbanCardInfo interface and its implementations (KanbanCard.Entity, KanbanCardDetails) now include a notes property.
  • The KanbanCardPrinter class has been updated to use the new notes field from the card. If the card’s notes are empty, it falls back to using the default notes from the item details, ensuring that a relevant note is always available for printing.

Persistence Layer (KanbanCardPersistence.kt):

  • The KANBAN_CARD_TABLE has been updated with a new notes column, defined as a memo (long text) type.
  • The KanbanCardRecord now includes a notes property, and the persistence logic has been updated to save and retrieve this new field from the database.
  • Several fields have been updated to use more modern type definitions (naturalIdentifier, enumerated), improving type safety and consistency.

Database (V006__add_notes_field.sql):

  • A new Flyway database migration has been added to create the notes column in the kanban_card table.

Other Changes

  • The API Endpoint has been refactored to use the new Endpoint DSL capabilities of common-module 6.0.0.

Tests:

  • Unit and integration tests across the feature (OrderFromCardsServiceTest.kt, KanbanCardPrinterTest.kt, KanbanUniverseTest.kt, etc.) have been updated to include the new notes field.
  • ModuleTest updated to new endpoint specification, KanbanCardEndpointTest checks the expected routes are there.

Copyright: © Arda Systems 2025-2026, All rights reserved

Comments