The DocumentDescriberCE
annotation is used exclusively for document entity classes to define the registers affected by the document and automatically generate the corresponding movements (postings) in those registers.
infoRegisters: Array<KClass<*>>
(Default: emptyArray()
)
Defines the information registers associated with the document.accumulationRegistersIncome: Array<KClass<*>>
(Default: emptyArray()
)
Specifies the accumulation registers for incoming (income) movements.accumulationRegistersExpense: Array<KClass<*>>
(Default: emptyArray()
)
Specifies the accumulation registers for outgoing (expense) movements.documentType: Int
(Default: 0
)
A unique identifier that helps differentiate documents affecting the same registers but in different ways.
@DocumentDescriberCE(
infoRegisters = [InventoryRegister::class],
accumulationRegistersIncome = [StockRegister::class],
accumulationRegistersExpense = [SalesRegister::class],
documentType = 1
)
data class SalesInvoice(
@PrimaryKey val id: Int,
val date: String,
val customerId: Int
)
✅ Automated register movements – No need for manual SQL queries to update registers.
✅ Supports multiple registers – A document can modify both accumulation and information registers.
✅ Distinguishes between document types – Allows different documents to interact with the same registers without conflicts.
This annotation simplifies document processing and movement automation, making business logic implementation more efficient. 🚀