[ofbiz-framework] branch trunk updated: Improved: Have a status on agreement records (OFBIZ-10902)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ofbiz-framework] branch trunk updated: Improved: Have a status on agreement records (OFBIZ-10902)

jleroux@apache.org
This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 1b84668  Improved: Have a status on agreement records (OFBIZ-10902)
1b84668 is described below

commit 1b84668aafe2b3ffef40cb3157ec0cda310cc661
Author: Jacques Le Roux <[hidden email]>
AuthorDate: Mon Mar 15 19:32:35 2021 +0100

    Improved: Have a status on agreement records (OFBIZ-10902)
   
    Pre-amble
   
    Currently, unlike many other entities, the Agreement entity does not have the
    statusId field defined. Agreements, like the other entities, should have a
    status (values that help determine the phase of the lifespan beyond
    the start- and end date of the agreement), such as:
   
        Created
        In Progress
        Approved
        etc.
   
    Flows
        Happy flows:
            Happy flow a) created ->b) submitted (for review) -> c) reviewed ->
                       d) approved -> e) in effect -> f) concluded (ended)
            Same, with more flow: a) created ->b) submitted (for review) ->
                       c) reviewed -> d) adjusted -> e) reviewed -> f) approved ->
                       g) in effect -> h) concluded (ended)
        Unhappy flows:
            Unhappy flow: a) created ->b) submitted (for review) -> c) reviewed ->
                          d) cancelled
            Same, with more flow: a) created ->b) submitted (for review) ->
                          c) reviewed -> d) adjusted -> e) reviewed -> f) cancelled
        Prematurely ended flows:
            Nipped in the bud flow a) created  -> b) cancelled
        flows from approval (in effect or in execution) till the end-of-times
            a) approved -> b) in effect -> c) concluded (ended)
            a) approved -> b) in effect -> c) terminated (prematurely ended)
   
    Party Roles
   
    Following Party Roles are involved:
   
        Agreement Creator - the party (person) that creates, edit, updates and
                            submits the agreement for review
        Agreement Reviewer - the party (person) that reviews the agreement on its
                             merits and impact for the company/organisation
        Agreement Approver - the party (person) that, based on law, regulations
                             and/or business policies approves (or rejects) the
                             agreement
        Agreement Manager - the party (person) that manages the execution of terms
                            of the agreement after the approval till the end-of-times
        Agreement Owner - the Party (party group with roleTypeId INTERNAL_ORGANIZATIO,
                           and  and registered in PartyAcctgPreference) that is
                           legally bound by the agreement
   
    jleroux: this lacks demo data but can still be useful
   
    Thanks: Pierre Smits
---
 applications/datamodel/DATAMODEL_CHANGES.adoc      |  5 ++++-
 .../datamodel/entitydef/party-entitymodel.xml      | 22 ++++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/applications/datamodel/DATAMODEL_CHANGES.adoc b/applications/datamodel/DATAMODEL_CHANGES.adoc
index 74cc6e2..8843695 100644
--- a/applications/datamodel/DATAMODEL_CHANGES.adoc
+++ b/applications/datamodel/DATAMODEL_CHANGES.adoc
@@ -29,11 +29,12 @@ The following file contains information about the data model changes in the Apac
 == Changes with OFBiz Trunk (Upcoming Branch)
 
 === Entity Changes
-*Added 3 new entities*
+*Added new entities*
 
 . ProdPromoCodeContactMech
 . OrderDenylist
 . OrderDenylistType
+. AgreementStatus
 
 
 
@@ -49,6 +50,8 @@ The following file contains information about the data model changes in the Apac
 |=======================================================
 |Entity                 |Field   |Action |IsPK |Revision
 | GlXbrlClass | parentGlXbrlClassId | Added | No | 36a123a
+| Agreement | statusId | Added | No | da8817d
+
 |=======================================================
 If in the list above fields are mentioned where 'IsPK' = yes, we advice to follow steps below for a successful upgrade:
 
diff --git a/applications/datamodel/entitydef/party-entitymodel.xml b/applications/datamodel/entitydef/party-entitymodel.xml
index 66e4dd0..f294aed 100644
--- a/applications/datamodel/entitydef/party-entitymodel.xml
+++ b/applications/datamodel/entitydef/party-entitymodel.xml
@@ -75,6 +75,7 @@ under the License.
       <field name="thruDate" type="date-time"></field>
       <field name="description" type="description"></field>
       <field name="textData" type="very-long"></field>
+      <field name="statusId" type="id"></field>
       <prim-key field="agreementId"/>
       <relation type="one" fk-name="AGRMNT_PRODUCT" rel-entity-name="Product">
         <key-map field-name="productId"/>
@@ -363,6 +364,27 @@ under the License.
         <key-map field-name="roleTypeId"/>
       </relation>
     </entity>
+    <entity entity-name="AgreementStatus"
+            package-name="org.apache.ofbiz.party.agreement"
+            title="Agremeement Status">
+      <field name="agreementId" type="id"></field>
+      <field name="statusId" type="id"></field>
+      <field name="statusDate" type="date-time"></field>
+      <field name="comments" type="comment"></field>
+      <field name="changeByUserLoginId" type="id-vlong"></field>
+      <prim-key field="agreementId"/>
+      <prim-key field="statusId"/>
+      <prim-key field="statusDate"/>
+      <relation type="one" fk-name="AGRMNT_STTS_AGRMNT" rel-entity-name="Agreement">
+        <key-map field-name="agreementId"/>
+      </relation>
+      <relation type="one" fk-name="AGRMNT_STTS_STTS" rel-entity-name="StatusItem">
+        <key-map field-name="statusId"/>
+      </relation>
+      <relation type="one" fk-name="AGRMNT_STTS_USRLGN" title="ChangeBy" rel-entity-name="UserLogin">
+          <key-map field-name="changeByUserLoginId" rel-field-name="userLoginId"/>
+      </relation>
+    </entity>
     <entity entity-name="AgreementTerm"
             package-name="org.apache.ofbiz.party.agreement"
             title="Agreement Term">