Add ER diagram and schema docs, enhance tx validation

Added ER.svg and database_schema.md to document the logical data model. Refactored and extended transaction validation in blockchain/abci.go to enforce ID prefix rules, entity existence, and uniqueness for promises, commitments, commiters, and beneficiaries. Updated lbc_sdk dependency version in go.mod and go.sum.
This commit is contained in:
Gregory Bednov 2025-08-10 22:39:28 +03:00
commit dae1cd484e
5 changed files with 240 additions and 83 deletions

1
docs/ER.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

43
docs/database_schema.md Normal file
View file

@ -0,0 +1,43 @@
# Логическая модель данных
![[ER.svg]]
<details>
@startuml
entity Promise {
* ID: uuid
--
* text: text
* due: datetime
BeneficiaryID: uuid
ParentPromiseID: uuid
}
entity Beneficiary {
* ID: uuid
--
* name: string
}
entity Commitment {
* ID: uuid
--
PromiseID: int
CommiterID: int
due: datetime
}
entity Commiter {
* ID: int
--
* name: string
}
Commitment }|--|| Promise : belongs to
Commitment }|--|| Commiter : made by
Promise }o--|| Beneficiary : has
Promise }--o Promise : parent of
@enduml
</details>