
superkassa-core is the core multi-project Kotlin Multiplatform (KMP) library for the Superkassa fiscal cash register system. It implements all business rules, data validation, domain entities, and use cases, separated into three distinct modules:
core-domain: Pure Kotlin Multiplatform domain entities (Receipt, KkmInfo, ShiftInfo) and port definitions (StoragePort, ClockPort, DeliveryPort).core-data: Implementations of storage backing, OFD communication orchestration, retry policies, and lease locking.core-presentation: Presentation layer facade (SuperkassaApi) that exposes the core system functions to client applications.To use the unified core KMP module in your Multiplatform or JVM Gradle build:
dependencies {
// For Multiplatform targets
implementation("io.github.texport:superkassa-core:1.0.3")
// Or for JVM-only targets (like server)
implementation("io.github.texport:superkassa-core-jvm:1.0.3")
}The iOS target is packaged as a unified SuperkassaCore binary XCFramework distributed via Swift Package Manager. Add the package reference to your Package.swift:
dependencies: [
.package(url: "https://github.com/texport/superkassa-core", from: "1.0.3")
]superkassa-core — это основная мультипроектная библиотека Kotlin Multiplatform (KMP) для фискальной системы Superkassa. Она реализует все бизнес-правила, валидацию данных, доменные сущности и сценарии использования (Use Cases), разделенные на три модуля:
core-domain: Чистые сущности предметной области KMP (Receipt, KkmInfo, ShiftInfo) и интерфейсы портов (StoragePort, ClockPort, DeliveryPort).core-data: Реализации портов хранения, отправки документов в ОФД, политик повторных попыток и межпроцессных блокировок.core-presentation: Фасад презентационного слоя (SuperkassaApi), предоставляющий методы интеграции ядра с внешними клиентами.Подключите единый KMP модуль в зависимости вашего Gradle-проекта:
dependencies {
// Для мультиплатформенных (KMP) проектов
implementation("io.github.texport:superkassa-core:1.0.3")
// Для классических JVM-проектов (например, сервер)
implementation("io.github.texport:superkassa-core-jvm:1.0.3")
}Для iOS-проектов ядро скомпилировано в бинарный фреймворк SuperkassaCore.xcframework и распространяется через Swift Package Manager. Добавьте зависимость в ваш Package.swift:
dependencies: [
.package(url: "https://github.com/texport/superkassa-core", from: "1.0.3")
]Here is a quick example of how to initialize and interact with SuperkassaApi in your application:
import io.github.texport.superkassa.core.presentation.api.SuperkassaApi
import io.github.texport.superkassa.core.presentation.api.model.KkmInitDirectRequest
import io.github.texport.superkassa.core.presentation.api.model.ReceiptSellRequest
import io.github.texport.superkassa.core.presentation.api.model.ReceiptItemDto
import io.github.texport.superkassa.core.presentation.api.model.ReceiptPaymentDto
// Retrieve the API implementation (e.g., via dependency injection)
val api: SuperkassaApi = ...
// 1. Initialize a physical KKM (Direct)
val kkm = api.initKkm(
pin = "1234",
request = KkmInitDirectRequest(
ofdId = "kazakhtelecom",
ofdEnvironment = "prod",
ofdSystemId = "sys-12345",
ofdToken = "token-abc-123",
kkmKgdId = "123456789012",
factoryNumber = "SWK-0001",
manufactureYear = 2026
)
)
// 2. Register a cashier sell receipt
val sellResult = api.createSellReceipt(
kkmId = kkm.id,
pin = "1111",
request = ReceiptSellRequest(
items = listOf(
ReceiptItemDto(
name = "Фискальный товар",
price = 1500.0,
quantity = 1L,
vatGroup = "VAT_12",
measureUnitCode = "796"
)
),
payments = listOf(
ReceiptPaymentDto(type = "CASH", sum = 1500.0)
),
idempotencyKey = "unique-receipt-key-1"
)
)
println("Receipt registered successfully with ticket number: ${sellResult.ticketNumber}")The project follows a strict Clean Architecture boundary design:
@Serializable annotations).core-domain.SuperkassaApi. All serialization logic and API request/response structures are declared here as decoupled DTOs (e.g. UserRoleDto, TaxRegimeDto), preventing serialization libraries or annotations from leaking into the domain layer.superkassa-core is the core multi-project Kotlin Multiplatform (KMP) library for the Superkassa fiscal cash register system. It implements all business rules, data validation, domain entities, and use cases, separated into three distinct modules:
core-domain: Pure Kotlin Multiplatform domain entities (Receipt, KkmInfo, ShiftInfo) and port definitions (StoragePort, ClockPort, DeliveryPort).core-data: Implementations of storage backing, OFD communication orchestration, retry policies, and lease locking.core-presentation: Presentation layer facade (SuperkassaApi) that exposes the core system functions to client applications.To use the unified core KMP module in your Multiplatform or JVM Gradle build:
dependencies {
// For Multiplatform targets
implementation("io.github.texport:superkassa-core:1.0.3")
// Or for JVM-only targets (like server)
implementation("io.github.texport:superkassa-core-jvm:1.0.3")
}The iOS target is packaged as a unified SuperkassaCore binary XCFramework distributed via Swift Package Manager. Add the package reference to your Package.swift:
dependencies: [
.package(url: "https://github.com/texport/superkassa-core", from: "1.0.3")
]superkassa-core — это основная мультипроектная библиотека Kotlin Multiplatform (KMP) для фискальной системы Superkassa. Она реализует все бизнес-правила, валидацию данных, доменные сущности и сценарии использования (Use Cases), разделенные на три модуля:
core-domain: Чистые сущности предметной области KMP (Receipt, KkmInfo, ShiftInfo) и интерфейсы портов (StoragePort, ClockPort, DeliveryPort).core-data: Реализации портов хранения, отправки документов в ОФД, политик повторных попыток и межпроцессных блокировок.core-presentation: Фасад презентационного слоя (SuperkassaApi), предоставляющий методы интеграции ядра с внешними клиентами.Подключите единый KMP модуль в зависимости вашего Gradle-проекта:
dependencies {
// Для мультиплатформенных (KMP) проектов
implementation("io.github.texport:superkassa-core:1.0.3")
// Для классических JVM-проектов (например, сервер)
implementation("io.github.texport:superkassa-core-jvm:1.0.3")
}Для iOS-проектов ядро скомпилировано в бинарный фреймворк SuperkassaCore.xcframework и распространяется через Swift Package Manager. Добавьте зависимость в ваш Package.swift:
dependencies: [
.package(url: "https://github.com/texport/superkassa-core", from: "1.0.3")
]Here is a quick example of how to initialize and interact with SuperkassaApi in your application:
import io.github.texport.superkassa.core.presentation.api.SuperkassaApi
import io.github.texport.superkassa.core.presentation.api.model.KkmInitDirectRequest
import io.github.texport.superkassa.core.presentation.api.model.ReceiptSellRequest
import io.github.texport.superkassa.core.presentation.api.model.ReceiptItemDto
import io.github.texport.superkassa.core.presentation.api.model.ReceiptPaymentDto
// Retrieve the API implementation (e.g., via dependency injection)
val api: SuperkassaApi = ...
// 1. Initialize a physical KKM (Direct)
val kkm = api.initKkm(
pin = "1234",
request = KkmInitDirectRequest(
ofdId = "kazakhtelecom",
ofdEnvironment = "prod",
ofdSystemId = "sys-12345",
ofdToken = "token-abc-123",
kkmKgdId = "123456789012",
factoryNumber = "SWK-0001",
manufactureYear = 2026
)
)
// 2. Register a cashier sell receipt
val sellResult = api.createSellReceipt(
kkmId = kkm.id,
pin = "1111",
request = ReceiptSellRequest(
items = listOf(
ReceiptItemDto(
name = "Фискальный товар",
price = 1500.0,
quantity = 1L,
vatGroup = "VAT_12",
measureUnitCode = "796"
)
),
payments = listOf(
ReceiptPaymentDto(type = "CASH", sum = 1500.0)
),
idempotencyKey = "unique-receipt-key-1"
)
)
println("Receipt registered successfully with ticket number: ${sellResult.ticketNumber}")The project follows a strict Clean Architecture boundary design:
@Serializable annotations).core-domain.SuperkassaApi. All serialization logic and API request/response structures are declared here as decoupled DTOs (e.g. UserRoleDto, TaxRegimeDto), preventing serialization libraries or annotations from leaking into the domain layer.