Details
-
Type: Bug
-
Status: Closed
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: Jamestown 2.3.0
-
Component/s: None
-
Labels:None
-
Sprint:Sprint 8, Sprint 9
Description
I believe this is a bug in SAPI's order service/deployment service helper. When we delete campaigns the budget accrual is supposed to change (the accrual stays active for today and paused for tomorrow with no end date, see AML-2404). This only happens if campaigns are deleted by pressing the "Terminate Order" button in the UI. If a campaign is deleted by swapping the BA + BL out for a new one the budget accrual for the deleted campaign(s) is not updated.
To reproduce:
1. Create an order with 1 BA + BL and deploy
2. Edit the order and swap the current BA + BL out for a new one
3. Check the database, Even though the campaign is deleted, the budget accrual status was never updated
mysql> SELECT * FROM `st-tracker`.admaxCampaignBudgetAccrualStatus join `st-tracker`.admaxCampaigns ac on admaxCampaignID = ac.id where description like 'dd35b201-b2f3-4eaa-8f40-41386fccdc2c%';
id | admaxCampaignID | startDate | endDate | status | id | identifier | description | accountID | campaignGroupingID | status |
1757 | 1140 | 2013-11-26 | NULL | active | 1140 | 3679 | dd35b201-b2f3-4eaa-8f40-41386fccdc2c_10536_57_3679 | 594 | 0 | Active |
1756 | 1139 | 2013-11-26 | NULL | active | 1139 | 3677 | dd35b201-b2f3-4eaa-8f40-41386fccdc2c_10911_57_3677 | 594 | 0 | Deleted |
4. Terminate the order and check the db again. The accrual status was only changed for the second campaign that was deleted.
mysql> SELECT * FROM `st-tracker`.admaxCampaignBudgetAccrualStatus join `st-tracker`.admaxCampaigns ac on admaxCampaignID = ac.id where description like 'dd35b201-b2f3-4eaa-8f40-41386fccdc2c%';
id | admaxCampaignID | startDate | endDate | status | id | identifier | description | accountID | campaignGroupingID | status |
1757 | 1140 | 2013-11-26 | NULL | paused | 1140 | 3679 | dd35b201-b2f3-4eaa-8f40-41386fccdc2c_10536_57_3679 | 594 | 0 | Deleted |
1756 | 1139 | 2013-11-26 | NULL | active | 1139 | 3677 | dd35b201-b2f3-4eaa-8f40-41386fccdc2c_10911_57_3677 | 594 | 0 | Deleted |
However, if you create an order and terminate it the budget accrual statuses get updated
1. Create an order and deploy
mysql> SELECT * FROM `st-tracker`.admaxCampaignBudgetAccrualStatus join `st-tracker`.admaxCampaigns ac on admaxCampaignID = ac.id where description like '22456cdf-5c4a-4cb5-aef4-4dad08ea55a9%';
id | admaxCampaignID | startDate | endDate | status | id | identifier | description | accountID | campaignGroupingID | status |
1758 | 1141 | 2013-11-26 | NULL | active | 1141 | 3682 | 22456cdf-5c4a-4cb5-aef4-4dad08ea55a9_10375_28_3682 | 595 | 0 | Active |
1759 | 1142 | 2013-11-26 | NULL | active | 1142 | 3683 | 22456cdf-5c4a-4cb5-aef4-4dad08ea55a9_11261_2_3683 | 595 | 0 | Active |
1760 | 1143 | 2013-11-26 | NULL | active | 1143 | 3684 | 22456cdf-5c4a-4cb5-aef4-4dad08ea55a9_11262_2_3684 | 595 | 0 | Active |
2. Terminate the order
mysql> SELECT * FROM `st-tracker`.admaxCampaignBudgetAccrualStatus join `st-tracker`.admaxCampaigns ac on admaxCampaignID = ac.id where description like '22456cdf-5c4a-4cb5-aef4-4dad08ea55a9%';
id | admaxCampaignID | startDate | endDate | status | id | identifier | description | accountID | campaignGroupingID | status |
1758 | 1141 | 2013-11-26 | NULL | paused | 1141 | 3682 | 22456cdf-5c4a-4cb5-aef4-4dad08ea55a9_10375_28_3682 | 595 | 0 | Deleted |
1759 | 1142 | 2013-11-26 | NULL | paused | 1142 | 3683 | 22456cdf-5c4a-4cb5-aef4-4dad08ea55a9_11261_2_3683 | 595 | 0 | Deleted |
1760 | 1143 | 2013-11-26 | NULL | paused | 1143 | 3684 | 22456cdf-5c4a-4cb5-aef4-4dad08ea55a9_11262_2_3684 | 595 | 0 | Deleted |