svn commit: r1805961 - in /ofbiz/ofbiz-framework/trunk/applications: datamodel/entitydef/marketing-entitymodel.xml marketing/servicedef/services.xml

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

svn commit: r1805961 - in /ofbiz/ofbiz-framework/trunk/applications: datamodel/entitydef/marketing-entitymodel.xml marketing/servicedef/services.xml

nmalin
Author: nmalin
Date: Wed Aug 23 21:23:16 2017
New Revision: 1805961

URL: http://svn.apache.org/viewvc?rev=1805961&view=rev
Log:
Improved: Manage life span of marketing related entites (OFBIZ-9550)
Add life span attributes (fromDate, thruDate) on entities :
1) MarketingCampaignPrice
2) MarketingCampaignPromo
3) MarketingCampaignRole
Complete related CRUD service with align service name on the best pratice for consistency.
The previous service name has been set as deprecated :
* addPromoToMarketingCampaign replace by createMarketingCampaignPromo
* removePromoFromMarketingCampaign replace by deleteMarketingCampaignPromo
* addPriceRuleToMarketingCampaign replace by createMarketingCampaignPrice
* removePriceRuleFromMarketingCampaign replace by deleteMarketingCampaignPrice
These service has been deprecated with release information Upcoming Release to align with Jira ofbiz version
Thanks to Suraj Khurana to suggest this improvement.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/marketing-entitymodel.xml
    ofbiz/ofbiz-framework/trunk/applications/marketing/servicedef/services.xml

Modified: ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/marketing-entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/marketing-entitymodel.xml?rev=1805961&r1=1805960&r2=1805961&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/marketing-entitymodel.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/marketing-entitymodel.xml Wed Aug 23 21:23:16 2017
@@ -94,8 +94,11 @@ under the License.
             title="Marketing Campaign Price Entity">
       <field name="marketingCampaignId" type="id"></field>
       <field name="productPriceRuleId" type="id"></field>
+      <field name="fromDate" type="date-time"/>
+      <field name="thruDate" type="date-time"/>
       <prim-key field="marketingCampaignId"/>
       <prim-key field="productPriceRuleId"/>
+      <prim-key field="fromDate"/>
       <relation type="one" fk-name="MKTGCPN_PRICE_MC" rel-entity-name="MarketingCampaign">
         <key-map field-name="marketingCampaignId"/>
       </relation>
@@ -108,8 +111,11 @@ under the License.
             title="Marketing Campaign Promo Entity">
       <field name="marketingCampaignId" type="id"></field>
       <field name="productPromoId" type="id"></field>
+      <field name="fromDate" type="date-time"/>
+      <field name="thruDate" type="date-time"/>
       <prim-key field="marketingCampaignId"/>
       <prim-key field="productPromoId"/>
+      <prim-key field="fromDate"/>
       <relation type="one" fk-name="MKTGCPN_PROMO_MC" rel-entity-name="MarketingCampaign">
         <key-map field-name="marketingCampaignId"/>
       </relation>
@@ -123,9 +129,12 @@ under the License.
       <field name="marketingCampaignId" type="id"></field>
       <field name="partyId" type="id"></field>
       <field name="roleTypeId" type="id"></field>
+      <field name="fromDate" type="date-time"/>
+      <field name="thruDate" type="date-time"/>
       <prim-key field="marketingCampaignId"/>
       <prim-key field="partyId"/>
       <prim-key field="roleTypeId"/>
+      <prim-key field="fromDate"/>
       <relation type="one" fk-name="MKTGCPN_ROLE_MC" rel-entity-name="MarketingCampaign">
         <key-map field-name="marketingCampaignId"/>
       </relation>

Modified: ofbiz/ofbiz-framework/trunk/applications/marketing/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/marketing/servicedef/services.xml?rev=1805961&r1=1805960&r2=1805961&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/marketing/servicedef/services.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/marketing/servicedef/services.xml Wed Aug 23 21:23:16 2017
@@ -45,23 +45,70 @@ under the License.
 
     <!-- MarketingCampaignPrice Services -->
     <service name="addPriceRuleToMarketingCampaign" default-entity-name="MarketingCampaignPrice" engine="entity-auto" invoke="create" auth="true">
+        <deprecated since="Upcoming Release" use-instead="createMarketingCampaignPrice">
+            Renaming service to respect service name best practice
+        </deprecated>
+        <implements service="createMarketingCampaignPrice"/>
+    </service>
+    <service name="createMarketingCampaignPrice" default-entity-name="MarketingCampaignPrice" engine="entity-auto" invoke="create" auth="true">
         <description>Add PriceRule to MarketingCampaign</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="removePriceRuleFromMarketingCampaign" default-entity-name="MarketingCampaignPrice" engine="entity-auto" invoke="delete" auth="true">
+            <deprecated since="Upcoming Release" use-instead="deleteMarketingCampaignPrice">
+                Renaming service to respect service name best practice
+            </deprecated>
+        <implements service="deleteMarketingCampaignPrice"/>
+    </service>
+    <service name="updateMarketingCampaignPrice" default-entity-name="MarketingCampaignPrice" engine="entity-auto" invoke="update" auth="true">
+        <description>Update PriceRule to MarketingCampaign</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+    <service name="deleteMarketingCampaignPrice" default-entity-name="MarketingCampaignPrice" engine="entity-auto" invoke="delete" auth="true">
         <description>Remove PriceRule from MarketingCampaign</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
+    <service name="expireMarketingCampaignPrice" default-entity-name="MarketingCampaignPrice" engine="entity-auto" invoke="expire" auth="true">
+        <description>Expire PriceRule to MarketingCampaign</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
 
     <!-- MarketingCampaignPromo Services -->
     <service name="addPromoToMarketingCampaign" default-entity-name="MarketingCampaignPromo" engine="entity-auto" invoke="create" auth="true">
+        <deprecated since="Upcoming Release" use-instead="createMarketingCampaignPromo">
+            Renaming service to respect service name best practice
+        </deprecated>
+        <implements service="createMarketingCampaignPromo"/>
+    </service>
+    <service name="createMarketingCampaignPromo" default-entity-name="MarketingCampaignPromo" engine="entity-auto" invoke="create" auth="true">
         <description>Add Promo to MarketingCampaign</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
     <service name="removePromoFromMarketingCampaign" default-entity-name="MarketingCampaignPromo" engine="entity-auto" invoke="delete" auth="true">
-        <description>Remove Promo from MarketingCampaign</description>
+        <deprecated since="Upcoming Release" use-instead="deleteMarketingCampaignPromo">
+            Renaming service to respect service name best practice
+        </deprecated>
+        <implements service="deleteMarketingCampaignPromo"/>
+    </service>
+    <service name="updateMarketingCampaignPromo" default-entity-name="MarketingCampaignPromo" engine="entity-auto" invoke="update" auth="true">
+        <description>Update Promo to MarketingCampaign</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+    <service name="deleteMarketingCampaignPromo" default-entity-name="MarketingCampaignPromo" engine="entity-auto" invoke="delete" auth="true">
+        <description>Remove Promo to MarketingCampaign</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
+    <service name="expireMarketingCampaignPromo" default-entity-name="MarketingCampaignPromo" engine="entity-auto" invoke="expire" auth="true">
+        <description>Expire Promo from MarketingCampaign</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
+
     <service name="signUpForContactList" engine="java"
             location="org.apache.ofbiz.marketing.marketing.MarketingServices" invoke="signUpForContactList" auth="false">
         <description>Signs an input email up for a ContactList with _NA_ party using the system userLogin.
@@ -96,7 +143,16 @@ under the License.
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
-    <service name="deleteMarketingCampaignRole" default-entity-name="MarketingCampaignRole" engine="entity-auto"  invoke="delete" auth="true">
+    <service name="updateMarketingCampaignRole" default-entity-name="MarketingCampaignRole" engine="entity-auto" invoke="update" auth="true">
+        <description>Update Role to Campaign</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+    <service name="expireMarketingCampaignRole" default-entity-name="MarketingCampaignRole" engine="entity-auto" invoke="expire" auth="true">
+        <description>Expire Role from Campaign</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
+    <service name="deleteMarketingCampaignRole" default-entity-name="MarketingCampaignRole" engine="entity-auto" invoke="delete" auth="true">
         <description>Remove Role from Campaign</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>