trex-model 1.5.10__tar.gz → 1.5.11__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.10 → trex-model-1.5.11}/PKG-INFO +1 -1
- {trex-model-1.5.10 → trex-model-1.5.11}/setup.py +1 -1
- {trex-model-1.5.10 → trex-model-1.5.11}/trex_model.egg-info/PKG-INFO +1 -1
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/helper/reward_transaction_helper.py +4 -3
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/message_model_helper.py +25 -19
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/message_models.py +4 -7
- {trex-model-1.5.10 → trex-model-1.5.11}/LICENSE +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/MANIFEST.in +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/README.md +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/setup.cfg +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trex_model.egg-info/SOURCES.txt +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trex_model.egg-info/dependency_links.txt +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trex_model.egg-info/requires.txt +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trex_model.egg-info/top_level.txt +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/__init__.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/conf.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/__init__.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/__init__.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/admin_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/analytic_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/app_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/coporate_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/customer_model_helpers.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/customer_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/fb_subsriber_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/helper/__init__.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/helper/reward_model_helpers.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/import_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/inventory_model.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/loyalty_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/lucky_draw_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/marketing_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/membership_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/merchant_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/model_decorators.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/ndb_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/pos_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/prepaid_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/product_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/program_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/rating_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/recruit_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/redeem_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/redemption_catalogue_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/referral_program_model.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/reward_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/spending_base_program_model.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/system_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/task_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/test_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/transaction_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/user_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/voucher_models.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/merchant_helpers.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/model_decorator.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/prepaid_helpers.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/pos_conf.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/program_conf.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/utils/__init__.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/utils/gcloud/__init__.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/utils/gcloud/datastore_util.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/utils/model/__init__.py +0 -0
- {trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/utils/model/model_util.py +0 -0
|
@@ -1238,7 +1238,8 @@ def _giveaway_birthday_reward_to_customer(customer, program_configuration, trans
|
|
|
1238
1238
|
else:
|
|
1239
1239
|
logger.debug('Skip, because it is test user account')
|
|
1240
1240
|
|
|
1241
|
-
logger.debug('------> Customer(%s) entitled before (%s)
|
|
1241
|
+
logger.debug('------> Customer(%s) entitled before (%s)', customer.name, program_desc)
|
|
1242
|
+
logger.debug('------> remarks=%s', remarks)
|
|
1242
1243
|
|
|
1243
1244
|
if is_entitled_before == False:
|
|
1244
1245
|
transaction_details = create_non_sales_system_transaction(customer, transact_datetime=transact_datetime, remarks=remarks)
|
|
@@ -1249,11 +1250,11 @@ def _giveaway_birthday_reward_to_customer(customer, program_configuration, trans
|
|
|
1249
1250
|
program_configuration_list = [program_configuration],
|
|
1250
1251
|
)
|
|
1251
1252
|
Customer.update_customer_entitled_birthday_reward_summary(customer, program_key)
|
|
1252
|
-
create_transaction_message(transaction_details, remarks=
|
|
1253
|
+
create_transaction_message(transaction_details, remarks=remarks, message_category=conf.MESSAGE_CATEGORY_BIRTHDAY)
|
|
1253
1254
|
else:
|
|
1254
1255
|
logger.info('Customer(%s) have entitled birthday reward (%s) on year %d', customer.name, program_desc, this_year)
|
|
1255
1256
|
except:
|
|
1256
|
-
logger.error('Failed to process for customer=%s', customer.name)
|
|
1257
|
+
logger.error('Failed to process for customer=%s, due to %s', customer.name, get_tracelog())
|
|
1257
1258
|
|
|
1258
1259
|
@model_transactional(desc="giveaway_membership_reward_to_customer")
|
|
1259
1260
|
def giveaway_membership_reward_to_customer(customer, program_configuration, transact_datetime, merchant_acct ):
|
|
@@ -253,8 +253,31 @@ def __create_entiled_message_from_customer_transaction(customer_transaction, rem
|
|
|
253
253
|
|
|
254
254
|
messages_for_json_list = []
|
|
255
255
|
|
|
256
|
+
header_message_list = [
|
|
257
|
+
{
|
|
258
|
+
'type': 'image',
|
|
259
|
+
'value': {
|
|
260
|
+
'url': 'https://storage.googleapis.com/augmigo-image-storage/app/customer-rewards-min.png',
|
|
261
|
+
'height': 100,
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
'type': 'image',
|
|
267
|
+
'value': {
|
|
268
|
+
'url': 'https://storage.googleapis.com/augmigo-image-storage/app/congratulations-min.png',
|
|
269
|
+
'height': 80,
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
},
|
|
273
|
+
]
|
|
274
|
+
|
|
256
275
|
if is_not_empty(remarks):
|
|
257
|
-
|
|
276
|
+
header_message_list.append({
|
|
277
|
+
'type' : 'text',
|
|
278
|
+
'value' : remarks,
|
|
279
|
+
'font-size' : 20,
|
|
280
|
+
})
|
|
258
281
|
|
|
259
282
|
for message in entitled_messages_list:
|
|
260
283
|
message_list.append('<li class="pt-2">{message}</li>'.format(message=message))
|
|
@@ -267,24 +290,7 @@ def __create_entiled_message_from_customer_transaction(customer_transaction, rem
|
|
|
267
290
|
return {
|
|
268
291
|
'type' : 'json',
|
|
269
292
|
'content' : {
|
|
270
|
-
'header':
|
|
271
|
-
{
|
|
272
|
-
'type': 'image',
|
|
273
|
-
'value': {
|
|
274
|
-
'url': 'https://storage.googleapis.com/augmigo-image-storage/app/customer-rewards-min.png',
|
|
275
|
-
'height': 100,
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
'type': 'image',
|
|
281
|
-
'value': {
|
|
282
|
-
'url': 'https://storage.googleapis.com/augmigo-image-storage/app/congratulations-min.png',
|
|
283
|
-
'height': 80,
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
},
|
|
287
|
-
],
|
|
293
|
+
'header':header_message_list,
|
|
288
294
|
'title':[
|
|
289
295
|
{
|
|
290
296
|
'type':'text',
|
|
@@ -10,12 +10,9 @@ from trexmodel.models.datastore.user_models import User
|
|
|
10
10
|
from datetime import datetime
|
|
11
11
|
import logging
|
|
12
12
|
from trexconf import conf
|
|
13
|
-
from trexmodel.conf import MESSAGE_STATUS_SET, MESSAGE_STATUS_NEW, MESSAGE_CATEGORY_SYSTEM,\
|
|
14
|
-
MESSAGE_STATUS_READ, MESSAGE_CATEGORIES, MESSAGE_CATEGORY_ANNOUNCEMENT
|
|
15
13
|
from trexmodel.models.datastore.transaction_models import CustomerTransaction
|
|
16
14
|
from trexmodel.models.datastore.redeem_models import RedemptionCatalogueTransaction,\
|
|
17
15
|
CustomerRedemption
|
|
18
|
-
from trexmodel.models.datastore.customer_models import Customer
|
|
19
16
|
|
|
20
17
|
|
|
21
18
|
logger = logging.getLogger('model')
|
|
@@ -38,11 +35,11 @@ class Message(BaseNModel, DictModel):
|
|
|
38
35
|
message_to = ndb.KeyProperty(name="message_to", kind=User)
|
|
39
36
|
source_key = ndb.StringProperty(required=False)
|
|
40
37
|
title = ndb.StringProperty(required=True)
|
|
41
|
-
message_category = ndb.StringProperty(required=True, default=MESSAGE_CATEGORY_SYSTEM, choices=MESSAGE_CATEGORIES)
|
|
38
|
+
message_category = ndb.StringProperty(required=True, default=conf.MESSAGE_CATEGORY_SYSTEM, choices=conf.MESSAGE_CATEGORIES)
|
|
42
39
|
message_content = ndb.JsonProperty(required=True, indexed=False)
|
|
43
40
|
message_data = ndb.JsonProperty(required=True, indexed=False)
|
|
44
41
|
message_from = ndb.StringProperty(required=False)
|
|
45
|
-
status = ndb.StringProperty(required=True, default=MESSAGE_STATUS_NEW, choices=MESSAGE_STATUS_SET)
|
|
42
|
+
status = ndb.StringProperty(required=True, default=conf.MESSAGE_STATUS_NEW, choices=conf.MESSAGE_STATUS_SET)
|
|
46
43
|
created_datetime = ndb.DateTimeProperty(required=True, auto_now_add=True)
|
|
47
44
|
read_datetime = ndb.DateTimeProperty(required=False)
|
|
48
45
|
email_sent_datetime = ndb.DateTimeProperty(required=False)
|
|
@@ -76,7 +73,7 @@ class Message(BaseNModel, DictModel):
|
|
|
76
73
|
|
|
77
74
|
|
|
78
75
|
@staticmethod
|
|
79
|
-
def create(user_acct, source_key=None, message_to=None, title=None, message_type=MESSAGE_CATEGORY_ANNOUNCEMENT, message_content={}):
|
|
76
|
+
def create(user_acct, source_key=None, message_to=None, title=None, message_type=conf.MESSAGE_CATEGORY_ANNOUNCEMENT, message_content={}):
|
|
80
77
|
Message(
|
|
81
78
|
parent = user_acct.create_ndb_key(),
|
|
82
79
|
source_key = source_key,
|
|
@@ -93,7 +90,7 @@ class Message(BaseNModel, DictModel):
|
|
|
93
90
|
if message:
|
|
94
91
|
user_acct = message.user_acct_entity
|
|
95
92
|
logger.debug('found message title=%s', message.title)
|
|
96
|
-
message.status = MESSAGE_STATUS_READ
|
|
93
|
+
message.status = conf.MESSAGE_STATUS_READ
|
|
97
94
|
message.read_datetime = datetime.utcnow()
|
|
98
95
|
message.put()
|
|
99
96
|
'''
|
|
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.10 → trex-model-1.5.11}/trexmodel/models/datastore/customer_model_helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trex-model-1.5.10 → trex-model-1.5.11}/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
|
|
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.10 → trex-model-1.5.11}/trexmodel/models/datastore/redemption_catalogue_models.py
RENAMED
|
File without changes
|
{trex-model-1.5.10 → trex-model-1.5.11}/trexmodel/models/datastore/referral_program_model.py
RENAMED
|
File without changes
|
|
File without changes
|
{trex-model-1.5.10 → trex-model-1.5.11}/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
|