trex-model 1.5.21__tar.gz → 1.5.23__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of trex-model might be problematic. Click here for more details.
- {trex-model-1.5.21 → trex-model-1.5.23}/PKG-INFO +1 -1
- {trex-model-1.5.21 → trex-model-1.5.23}/setup.py +1 -1
- {trex-model-1.5.21 → trex-model-1.5.23}/trex_model.egg-info/PKG-INFO +1 -1
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/helper/reward_transaction_helper.py +29 -24
- {trex-model-1.5.21 → trex-model-1.5.23}/LICENSE +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/MANIFEST.in +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/README.md +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/setup.cfg +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trex_model.egg-info/SOURCES.txt +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trex_model.egg-info/dependency_links.txt +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trex_model.egg-info/requires.txt +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trex_model.egg-info/top_level.txt +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/__init__.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/conf.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/__init__.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/__init__.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/admin_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/analytic_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/app_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/coporate_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/customer_model_helpers.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/customer_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/fb_subsriber_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/helper/__init__.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/helper/reward_model_helpers.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/import_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/inventory_model.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/loyalty_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/lucky_draw_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/marketing_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/membership_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/merchant_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/merchant_promotion_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/message_model_helper.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/message_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/model_decorators.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/ndb_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/pos_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/prepaid_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/product_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/program_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/rating_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/recruit_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/redeem_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/redemption_catalogue_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/referral_program_model.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/reward_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/spending_base_program_model.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/system_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/task_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/test_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/transaction_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/user_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/voucher_models.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/merchant_helpers.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/model_decorator.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/prepaid_helpers.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/pos_conf.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/program_conf.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/utils/__init__.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/utils/gcloud/__init__.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/utils/gcloud/datastore_util.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/utils/model/__init__.py +0 -0
- {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/utils/model/model_util.py +0 -0
|
@@ -51,40 +51,45 @@ logger = logging.getLogger('helper')
|
|
|
51
51
|
|
|
52
52
|
@model_transactional(desc='check_user_joined_merchant_birthday_reward')
|
|
53
53
|
def check_user_joined_merchant_birthday_reward(user_acct):
|
|
54
|
+
user_this_year_birth_date = None
|
|
54
55
|
transact_datetime = datetime.utcnow()
|
|
55
|
-
customer_acct_list = Customer.list_by_user_account(user_acct)
|
|
56
|
-
|
|
57
56
|
current_year = transact_datetime.year
|
|
58
|
-
today = transact_datetime.today()
|
|
57
|
+
#today = transact_datetime.today()
|
|
59
58
|
|
|
60
|
-
|
|
59
|
+
if user_acct.birth_date is not None:
|
|
60
|
+
user_this_year_birth_date = datetime(year=current_year, month=user_acct.birth_date.month, day=user_acct.birth_date.day)
|
|
61
61
|
|
|
62
62
|
logger.debug('user_this_year_birth_date=%s', user_this_year_birth_date)
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
merchant_acct = customer_acct.registered_merchant_acct
|
|
66
|
-
birthday_program_configurations_list = list_merchant_birthday_program_configuration(merchant_acct)
|
|
64
|
+
if user_this_year_birth_date:
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
customer_acct_list = Customer.list_by_user_account(user_acct)
|
|
69
67
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
#is_program_still_valid = today>=program_start_date and today<=program_end_date
|
|
76
|
-
|
|
77
|
-
#logger.debug('program(%s) is_program_still_valid=%s', program_configuration.get('label'), is_program_still_valid)
|
|
78
|
-
|
|
79
|
-
#if is_program_still_valid:
|
|
80
|
-
|
|
81
|
-
is_dob_match = _is_user_dob_match_program(user_this_year_birth_date, transact_datetime, program_configuration)
|
|
68
|
+
|
|
69
|
+
for customer_acct in customer_acct_list:
|
|
70
|
+
merchant_acct = customer_acct.registered_merchant_acct
|
|
71
|
+
birthday_program_configurations_list = list_merchant_birthday_program_configuration(merchant_acct)
|
|
82
72
|
|
|
83
|
-
logger.debug('
|
|
73
|
+
logger.debug('merchant_acct(%s) birthday_program_configurations_list=%s', merchant_acct.brand_name, birthday_program_configurations_list)
|
|
84
74
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
75
|
+
for program_configuration in birthday_program_configurations_list:
|
|
76
|
+
|
|
77
|
+
#program_start_date = datetime.strptime(program_configuration.get('start_date'), '%d-%m-%Y')
|
|
78
|
+
#program_end_date = datetime.strptime(program_configuration.get('end_date'), '%d-%m-%Y')
|
|
79
|
+
|
|
80
|
+
#is_program_still_valid = today>=program_start_date and today<=program_end_date
|
|
81
|
+
|
|
82
|
+
#logger.debug('program(%s) is_program_still_valid=%s', program_configuration.get('label'), is_program_still_valid)
|
|
83
|
+
|
|
84
|
+
#if is_program_still_valid:
|
|
85
|
+
|
|
86
|
+
is_dob_match = _is_user_dob_match_program(user_this_year_birth_date, transact_datetime, program_configuration)
|
|
87
|
+
|
|
88
|
+
logger.debug('program(%s) is_dob_match=%s', program_configuration.get('label'), is_dob_match)
|
|
89
|
+
|
|
90
|
+
if is_dob_match:
|
|
91
|
+
_giveaway_birthday_reward_to_customer(
|
|
92
|
+
customer_acct, program_configuration, transact_datetime, merchant_acct, is_test_account=user_acct.is_test_account)
|
|
88
93
|
|
|
89
94
|
|
|
90
95
|
def _is_user_dob_match_program(user_this_year_birth_date, transact_datetime, program_configuration):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/customer_model_helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/helper/reward_model_helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/merchant_promotion_models.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/redemption_catalogue_models.py
RENAMED
|
File without changes
|
{trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/referral_program_model.py
RENAMED
|
File without changes
|
|
File without changes
|
{trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/spending_base_program_model.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|