Modifying Saved Data - best place to do it
 
Forums / SmartComponent Library - Developer Forum / Modifying Saved Data - best place to do it

Modifying Saved Data - best place to do it

1 posts, 0 answered
  1. Roger Blanchard
    Roger Blanchard avatar
    413 posts
    Registered:
    29 Jun 2018
    11 Sep 2019
    Link to this post
    We have a table called RebateCustomer that keeps track of how many items were purchased for a particular manufacturer rebate program. When the number of items reaches a certain threshold it gets reset back to 0 and starts over. I am wondering the best place to do this? I am thinking either SaveChanges in the BE or the eRebateCustomerModifyBeginTrans in the DataAccess class. I am leaning towards eRebateCustomerModifyBeginTrans as I have access to the Before buffer as well.

    For example,

    If you buy 12 of an item you get an electronic coupon emailed to you that is worth the average selling price of the 12 items that were purchased. If the customer has purchased 11 and then buys 3 in the same transaction the count would go to 14. On the backend I would adjust the item count to 2 and create the ecoupon for the customer.

    Is the DataAccess class the best place to handle this?
1 posts, 0 answered