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.

Files changed (64) hide show
  1. {trex-model-1.5.21 → trex-model-1.5.23}/PKG-INFO +1 -1
  2. {trex-model-1.5.21 → trex-model-1.5.23}/setup.py +1 -1
  3. {trex-model-1.5.21 → trex-model-1.5.23}/trex_model.egg-info/PKG-INFO +1 -1
  4. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/helper/reward_transaction_helper.py +29 -24
  5. {trex-model-1.5.21 → trex-model-1.5.23}/LICENSE +0 -0
  6. {trex-model-1.5.21 → trex-model-1.5.23}/MANIFEST.in +0 -0
  7. {trex-model-1.5.21 → trex-model-1.5.23}/README.md +0 -0
  8. {trex-model-1.5.21 → trex-model-1.5.23}/setup.cfg +0 -0
  9. {trex-model-1.5.21 → trex-model-1.5.23}/trex_model.egg-info/SOURCES.txt +0 -0
  10. {trex-model-1.5.21 → trex-model-1.5.23}/trex_model.egg-info/dependency_links.txt +0 -0
  11. {trex-model-1.5.21 → trex-model-1.5.23}/trex_model.egg-info/requires.txt +0 -0
  12. {trex-model-1.5.21 → trex-model-1.5.23}/trex_model.egg-info/top_level.txt +0 -0
  13. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/__init__.py +0 -0
  14. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/conf.py +0 -0
  15. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/__init__.py +0 -0
  16. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/__init__.py +0 -0
  17. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/admin_models.py +0 -0
  18. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/analytic_models.py +0 -0
  19. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/app_models.py +0 -0
  20. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/coporate_models.py +0 -0
  21. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/customer_model_helpers.py +0 -0
  22. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/customer_models.py +0 -0
  23. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/fb_subsriber_models.py +0 -0
  24. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/helper/__init__.py +0 -0
  25. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/helper/reward_model_helpers.py +0 -0
  26. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/import_models.py +0 -0
  27. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/inventory_model.py +0 -0
  28. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/loyalty_models.py +0 -0
  29. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/lucky_draw_models.py +0 -0
  30. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/marketing_models.py +0 -0
  31. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/membership_models.py +0 -0
  32. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/merchant_models.py +0 -0
  33. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/merchant_promotion_models.py +0 -0
  34. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/message_model_helper.py +0 -0
  35. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/message_models.py +0 -0
  36. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/model_decorators.py +0 -0
  37. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/ndb_models.py +0 -0
  38. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/pos_models.py +0 -0
  39. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/prepaid_models.py +0 -0
  40. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/product_models.py +0 -0
  41. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/program_models.py +0 -0
  42. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/rating_models.py +0 -0
  43. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/recruit_models.py +0 -0
  44. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/redeem_models.py +0 -0
  45. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/redemption_catalogue_models.py +0 -0
  46. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/referral_program_model.py +0 -0
  47. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/reward_models.py +0 -0
  48. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/spending_base_program_model.py +0 -0
  49. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/system_models.py +0 -0
  50. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/task_models.py +0 -0
  51. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/test_models.py +0 -0
  52. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/transaction_models.py +0 -0
  53. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/user_models.py +0 -0
  54. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/datastore/voucher_models.py +0 -0
  55. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/merchant_helpers.py +0 -0
  56. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/model_decorator.py +0 -0
  57. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/models/prepaid_helpers.py +0 -0
  58. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/pos_conf.py +0 -0
  59. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/program_conf.py +0 -0
  60. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/utils/__init__.py +0 -0
  61. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/utils/gcloud/__init__.py +0 -0
  62. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/utils/gcloud/datastore_util.py +0 -0
  63. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/utils/model/__init__.py +0 -0
  64. {trex-model-1.5.21 → trex-model-1.5.23}/trexmodel/utils/model/model_util.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trex-model
3
- Version: 1.5.21
3
+ Version: 1.5.23
4
4
  Summary: TRex database module package
5
5
  Home-page: https://bitbucket.org/lokjac/trex-model
6
6
  Author: Jack Lok
@@ -3,7 +3,7 @@ with open("README.md", "r") as fh:
3
3
  long_description = fh.read()
4
4
  setuptools.setup(
5
5
  name='trex-model',
6
- version='1.5.21',
6
+ version='1.5.23',
7
7
  author="Jack Lok",
8
8
  author_email="sglok77@gmail.com",
9
9
  description="TRex database module package",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: trex-model
3
- Version: 1.5.21
3
+ Version: 1.5.23
4
4
  Summary: TRex database module package
5
5
  Home-page: https://bitbucket.org/lokjac/trex-model
6
6
  Author: Jack Lok
@@ -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
- user_this_year_birth_date = datetime(year=current_year, month=user_acct.birth_date.month, day=user_acct.birth_date.day)
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
- for customer_acct in customer_acct_list:
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
- logger.debug('merchant_acct(%s) birthday_program_configurations_list=%s', merchant_acct.brand_name, birthday_program_configurations_list)
66
+ customer_acct_list = Customer.list_by_user_account(user_acct)
69
67
 
70
- for program_configuration in birthday_program_configurations_list:
71
-
72
- #program_start_date = datetime.strptime(program_configuration.get('start_date'), '%d-%m-%Y')
73
- #program_end_date = datetime.strptime(program_configuration.get('end_date'), '%d-%m-%Y')
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('program(%s) is_dob_match=%s', program_configuration.get('label'), is_dob_match)
73
+ logger.debug('merchant_acct(%s) birthday_program_configurations_list=%s', merchant_acct.brand_name, birthday_program_configurations_list)
84
74
 
85
- if is_dob_match:
86
- _giveaway_birthday_reward_to_customer(
87
- customer_acct, program_configuration, transact_datetime, merchant_acct, is_test_account=user_acct.is_test_account)
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