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:
parent
57c40d9f07
commit
dae1cd484e
5 changed files with 240 additions and 83 deletions
43
docs/database_schema.md
Normal file
43
docs/database_schema.md
Normal 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue