aa765bbb48
- contracts/schema/migrations/0002_categories_v2.sql: server migration 0002 rebuilds categories with the 14-key default_key CHECK, inserts housing, insurance, children and fees with server_versions taken from the global sequence, sets schema_version 2. server-v1.sql unchanged. - contracts/category-keywords.csv: the keyword table of the suggestion (148 entries, from docs/ux). - contracts/test-vectors/suggest_category.json: 65 Kotlin-only cases of CS-4 to CS-6. - contracts/examples/E-1-health: schema_version 2. - tools/contracts-check.py: reference suggestCategory, keyword-table checks, 0002 load checks on a fresh and an in-use database, plain icon/color check, new icon and colour tokens. - android/domain: suggestCategory (CS-4 to CS-6, code points, platform NFC and categories through UnicodeText), vector runner for suggest_category, eight vector files. - server/crates/kvitt-domain/tests/vectors.rs: suggest_category is Kotlin-only. The OpenAPI DefaultCategoryKey extension and the two new category examples are held back until the server's wire types know the new keys (M12b). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
21 lines
994 B
Kotlin
21 lines
994 B
Kotlin
// :domain — the pure rules of SPEC §14.5 (split, balances, allocation, settlement check, analytics).
|
|
plugins {
|
|
id("kvitt.jvm.library")
|
|
}
|
|
|
|
dependencies {
|
|
api(project(":core:model"))
|
|
testImplementation(libs.kotlinx.serialization.json)
|
|
}
|
|
|
|
// The shared test vectors (SPEC §14.5.5) are copied from the repository's contracts/ folder into the test resources.
|
|
// A missing file is not tolerated: VectorFilesTest fails unless exactly the eight files of §14.5.5 are present.
|
|
val testVectorsRoot = layout.buildDirectory.dir("generated/test-vectors")
|
|
val copyTestVectors = tasks.register<Sync>("copyTestVectors") {
|
|
description = "Copies contracts/test-vectors/*.json into the :domain test resources."
|
|
from(layout.projectDirectory.dir("../../contracts/test-vectors")) { include("*.json") }
|
|
into(testVectorsRoot.map { it.dir("test-vectors") })
|
|
}
|
|
sourceSets.named("test") { resources.srcDir(testVectorsRoot) }
|
|
tasks.named("processTestResources") { dependsOn(copyTestVectors) }
|