gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-docs] 02/02: simplified DB-schema for policy_details and _fulfilm


From: gnunet
Subject: [taler-docs] 02/02: simplified DB-schema for policy_details and _fulfilments
Date: Tue, 11 Oct 2022 11:44:49 +0200

This is an automated email from the git hooks/post-receive script.

oec pushed a commit to branch master
in repository docs.

commit fa76fa66624b5b4cd57275aad67f159acf046b70
Author: Özgür Kesim <oec-taler@kesim.org>
AuthorDate: Tue Oct 11 11:44:41 2022 +0200

    simplified DB-schema for policy_details and _fulfilments
---
 design-documents/028-deposit-policies.rst | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/design-documents/028-deposit-policies.rst 
b/design-documents/028-deposit-policies.rst
index 38423d7..bbf0edc 100644
--- a/design-documents/028-deposit-policies.rst
+++ b/design-documents/028-deposit-policies.rst
@@ -79,7 +79,7 @@ TODO: Description
                 label=<<B>deposits</B>>
                 margin=20
                 deposits [
-                  label="...|<ref>policy_details_id\l|...|timestamp\l|..."
+                  label="...|<ref>policy_details_id 
(null)\l|...|timestamp\l|..."
                 ]
         }
 
@@ -87,7 +87,7 @@ TODO: Description
                 label=<<B>policy_details</B>>
                 margin=20
                 policy_details [
-                  label="<id>id\l|<hash>hash_code 
(unique)\l|deadline\l|commitment (amount)\l|accumulated_total (amount)\l|fee 
(amount)\l|transferable (amount)\l|fulfillment_state\l"
+                  label="<id>id\l|<hash>hash_code 
(unique)\l|deadline\l|commitment (amount)\l|accumulated_total (amount)\l|fee 
(amount)\l|transferable (amount)\l|fulfillment_state\l|<fid>fullfilment_id 
(null)\l"
                 ]
         }
 
@@ -101,7 +101,7 @@ TODO: Description
         }
 
         deposits:ref->policy_details:id [ label="n:1"; fontname="monospace" ];
-        policy_details:hash->policy_fulfillments:codes [ label="quasi m:1"; 
fontname="monospace"; dir=back; style=dashed];
+        policy_details:fid->policy_fulfillments:id [label="n:1"; 
fontname="monosapce" ];
    }
 
 
@@ -147,15 +147,20 @@ Invariants
 The following invariants need to be fulfilled and be checked by the auditor:
 
 - The fulfillment state of a policy is **Insufficient** IF AND ONLY IF the
-  amount in ``commitment`` is larger than the amount in ``accumulated_total``.
+  amount in ``policy_details.commitment`` is larger than the amount in
+  ``policy_details.accumulated_total``.
 
-- The sum of amounts in ``fee`` and ``transferable`` must be less or equal to
-  the amount in ``accumulated_total``.
+- The sum of amounts in ``policy_details.fee`` and
+  ``policy_details.transferable`` must be less or equal to the amount in
+  ``policy_details.accumulated_total``.
 
-- If the fulfillment state of a policy is **Success**, there MUST exists an
-  entry in the ``policy_details_fulfillment`` table for the corresponding
-  ``hash_code``.
+- Each hash code encoded in ``policy_fulfillments.policy_hash_codes`` MUST
+  refer to an existing ``policy_details.hash_code`` AND its ``.fulfillment_id``
+  MUST point to the same ``policy_fulfillments.id``.
 
+- Conversely: If a ``policy_details.fulfilment_id`` points to an entry in
+  ``policy_fulfillment``, the ``policy_details.hash_code`` MUST be present in
+  that entry's ``.policy_hash_codes``.
 
    
 

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]