trex-model 1.6.10__tar.gz → 1.6.12__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.6.10 → trex_model-1.6.12}/PKG-INFO +1 -1
- {trex_model-1.6.10 → trex_model-1.6.12}/setup.py +1 -1
- {trex_model-1.6.10 → trex_model-1.6.12}/trex_model.egg-info/PKG-INFO +1 -1
- {trex_model-1.6.10 → trex_model-1.6.12}/trex_model.egg-info/SOURCES.txt +1 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/customer_models.py +8 -3
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/merchant_models.py +11 -1
- trex_model-1.6.12/trexmodel/models/datastore/support_models.py +32 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/transaction_models.py +22 -6
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/merchant_helpers.py +81 -64
- {trex_model-1.6.10 → trex_model-1.6.12}/LICENSE +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/MANIFEST.in +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/README.md +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/setup.cfg +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trex_model.egg-info/dependency_links.txt +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trex_model.egg-info/requires.txt +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trex_model.egg-info/top_level.txt +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/conf.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/admin_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/analytic_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/app_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/coporate_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/customer_model_helpers.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/fb_subsriber_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/helper/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/helper/reward_model_helpers.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/helper/reward_transaction_helper.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/helper/sales_transaction_helpers.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/import_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/inventory_model.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/loyalty_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/lucky_draw_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/marketing_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/membership_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/merchant_promotion_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/message_model_helper.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/message_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/model_decorators.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/ndb_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/partnership_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/pos_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/prepaid_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/product_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/program_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/rating_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/recruit_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/redeem_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/redemption_catalogue_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/referral_program_model.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/reward_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/spending_base_program_model.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/system_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/task_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/test_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/user_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/voucher_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/model_decorator.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/prepaid_helpers.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/pos_conf.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/program_conf.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/utils/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/utils/gcloud/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/utils/gcloud/datastore_util.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/utils/model/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/utils/model/model_util.py +0 -0
|
@@ -48,6 +48,7 @@ trexmodel/models/datastore/redemption_catalogue_models.py
|
|
|
48
48
|
trexmodel/models/datastore/referral_program_model.py
|
|
49
49
|
trexmodel/models/datastore/reward_models.py
|
|
50
50
|
trexmodel/models/datastore/spending_base_program_model.py
|
|
51
|
+
trexmodel/models/datastore/support_models.py
|
|
51
52
|
trexmodel/models/datastore/system_models.py
|
|
52
53
|
trexmodel/models/datastore/task_models.py
|
|
53
54
|
trexmodel/models/datastore/test_models.py
|
|
@@ -84,7 +84,7 @@ class Customer(BaseNModel, DictModel, FullTextSearchable):
|
|
|
84
84
|
'entitled_birthday_reward_summary', 'tier_membership_key',
|
|
85
85
|
'registered_outlet_key', 'merchant_account_key',
|
|
86
86
|
'registered_datetime', 'modified_datetime',
|
|
87
|
-
'registered_user_acct','referral_code',
|
|
87
|
+
'registered_user_acct','referral_code', 'is_referred_by_friend',
|
|
88
88
|
|
|
89
89
|
]
|
|
90
90
|
|
|
@@ -157,7 +157,11 @@ class Customer(BaseNModel, DictModel, FullTextSearchable):
|
|
|
157
157
|
def tier_membership_entity(self):
|
|
158
158
|
if self.tier_membership:
|
|
159
159
|
return MerchantTierMembership.fetch(self.tier_membership.urlsafe())
|
|
160
|
-
|
|
160
|
+
|
|
161
|
+
@property
|
|
162
|
+
def is_referred_by_friend(self):
|
|
163
|
+
return self.referrer_code is not None and is_not_empty(self.referrer_code)
|
|
164
|
+
|
|
161
165
|
@staticmethod
|
|
162
166
|
def update_KPI(customer_acct, tags_list=None, memberships_list=None, tier_membership_key=None):
|
|
163
167
|
if isinstance(tags_list, string_types):
|
|
@@ -380,7 +384,7 @@ class Customer(BaseNModel, DictModel, FullTextSearchable):
|
|
|
380
384
|
customer.put()
|
|
381
385
|
|
|
382
386
|
@classmethod
|
|
383
|
-
def create_from_user(cls, outlet, user_acct, merchant_reference_code=None, merchant_acct=None):
|
|
387
|
+
def create_from_user(cls, outlet, user_acct, merchant_reference_code=None, merchant_acct=None, referrer_code=None):
|
|
384
388
|
registered_merchant_acct = outlet.merchant_acct_entity if merchant_acct is None else merchant_acct
|
|
385
389
|
created_customer = cls(
|
|
386
390
|
parent=user_acct.create_ndb_key(),
|
|
@@ -396,6 +400,7 @@ class Customer(BaseNModel, DictModel, FullTextSearchable):
|
|
|
396
400
|
birth_date_date_str = user_acct.birth_date_date_str,
|
|
397
401
|
birth_day_in_year = user_acct.birth_day_in_year,
|
|
398
402
|
merchant_reference_code = merchant_reference_code,
|
|
403
|
+
referrer_code = referrer_code,
|
|
399
404
|
merchant_acct = registered_merchant_acct.create_ndb_key()
|
|
400
405
|
)
|
|
401
406
|
|
|
@@ -174,7 +174,7 @@ class MerchantAcct(MerchantMin):
|
|
|
174
174
|
'gmt_hour' : self.gmt_hour,
|
|
175
175
|
'account_plan' : self.account_plan,
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
|
|
178
178
|
@property
|
|
179
179
|
def product_package(self):
|
|
180
180
|
if self.account_plan:
|
|
@@ -1854,6 +1854,16 @@ class Outlet(BusinessEntity, FullTextSearchable):
|
|
|
1854
1854
|
outlet.is_headquarter = is_headquarter
|
|
1855
1855
|
outlet.put()
|
|
1856
1856
|
|
|
1857
|
+
def to_brief_dict(self):
|
|
1858
|
+
return {
|
|
1859
|
+
'outlet_name' : self.name,
|
|
1860
|
+
'company_name' : self.company_name,
|
|
1861
|
+
'business_reg_no' : self.business_reg_no,
|
|
1862
|
+
'address' : self.address,
|
|
1863
|
+
'email' : self.email,
|
|
1864
|
+
'office_phone' : self.office_phone,
|
|
1865
|
+
}
|
|
1866
|
+
|
|
1857
1867
|
@staticmethod
|
|
1858
1868
|
def list_by_merchant_acct(merchant_acct):
|
|
1859
1869
|
return Outlet.query(ancestor = merchant_acct.create_ndb_key()).fetch(limit=model_conf.MAX_FETCH_RECORD)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'''
|
|
2
|
+
Created on 28 Jul 2025
|
|
3
|
+
|
|
4
|
+
@author: jacklok
|
|
5
|
+
'''
|
|
6
|
+
|
|
7
|
+
from trexmodel.models.datastore.ndb_models import BaseNModel, DictModel
|
|
8
|
+
from google.cloud import ndb
|
|
9
|
+
import logging
|
|
10
|
+
|
|
11
|
+
#logger = logging.getLogger('model')
|
|
12
|
+
logger = logging.getLogger('target_debug')
|
|
13
|
+
|
|
14
|
+
class SupportReportBase(BaseNModel, DictModel):
|
|
15
|
+
activation_code = ndb.StringProperty(required=False)
|
|
16
|
+
platform = ndb.StringProperty(required=True)
|
|
17
|
+
error_message = ndb.TextProperty(required=False)
|
|
18
|
+
stack_trace = ndb.TextProperty(required=False)
|
|
19
|
+
reported_datetime = ndb.DateTimeProperty(required=True, auto_now=True)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class ErrorReport(SupportReportBase):
|
|
24
|
+
|
|
25
|
+
@staticmethod
|
|
26
|
+
def create(platform, error_message, activation_code=None, stack_trace=None, ):
|
|
27
|
+
ErrorReport(
|
|
28
|
+
activation_code = activation_code,
|
|
29
|
+
platform = platform,
|
|
30
|
+
error_message = error_message,
|
|
31
|
+
stack_trace = stack_trace,
|
|
32
|
+
).put()
|
|
@@ -188,13 +188,29 @@ class SalesTransaction(BaseNModel, DictModel):
|
|
|
188
188
|
return customer_transaction
|
|
189
189
|
|
|
190
190
|
@classmethod
|
|
191
|
-
def list_outlet_transaction(cls, transact_outlet, offset=0, limit=conf.PAGINATION_SIZE, start_cursor=None, return_with_cursor=False, reverse_order=True):
|
|
192
|
-
if
|
|
193
|
-
|
|
191
|
+
def list_outlet_transaction(cls, transact_outlet, enquiry_date=None, offset=0, limit=conf.PAGINATION_SIZE, start_cursor=None, return_with_cursor=False, reverse_order=True):
|
|
192
|
+
if enquiry_date:
|
|
193
|
+
enquiry_datetime = datetime.combine(enquiry_date, datetime.min.time())
|
|
194
|
+
next_enquiry_datetime = enquiry_datetime + timedelta(days=1)
|
|
195
|
+
query = cls.query(ndb.AND(
|
|
196
|
+
cls.transact_datetime >= enquiry_datetime,
|
|
197
|
+
cls.transact_datetime < next_enquiry_datetime,
|
|
198
|
+
cls.transact_outlet==transact_outlet.create_ndb_key())
|
|
199
|
+
)
|
|
200
|
+
if reverse_order:
|
|
201
|
+
query = query.order(-cls.transact_datetime)
|
|
202
|
+
else:
|
|
203
|
+
query = query.order(cls.transact_datetime)
|
|
204
|
+
|
|
205
|
+
return cls.list_all_with_condition_query(query, offset=offset, limit=limit, start_cursor=start_cursor, return_with_cursor=return_with_cursor)
|
|
194
206
|
else:
|
|
195
|
-
query = cls.query(ndb.AND(cls.transact_outlet==transact_outlet.create_ndb_key())).order(cls.transact_datetime)
|
|
196
|
-
|
|
197
|
-
|
|
207
|
+
query = cls.query(ndb.AND(cls.transact_outlet==transact_outlet.create_ndb_key())).order(-cls.transact_datetime)
|
|
208
|
+
if reverse_order:
|
|
209
|
+
query = query.order(-cls.transact_datetime)
|
|
210
|
+
else:
|
|
211
|
+
query = query.order(cls.transact_datetime)
|
|
212
|
+
|
|
213
|
+
return cls.list_all_with_condition_query(query, offset=offset, limit=limit, start_cursor=start_cursor, return_with_cursor=return_with_cursor)
|
|
198
214
|
|
|
199
215
|
@classmethod
|
|
200
216
|
def count_outlet_transaction(cls, transact_outlet, limit=conf.MAX_FETCH_RECORD):
|
|
@@ -10,29 +10,30 @@ from trexlib.utils.crypto_util import aes_encrypt_json
|
|
|
10
10
|
|
|
11
11
|
logger = logging.getLogger('helper')
|
|
12
12
|
|
|
13
|
-
def construct_merchant_acct_info(merchant_acct, referrer_code=None):
|
|
13
|
+
def construct_merchant_acct_info(merchant_acct, referrer_code=None, read_minimum=False):
|
|
14
14
|
account_settings = {
|
|
15
15
|
'account_code' : merchant_acct.account_code,
|
|
16
16
|
'currency' : merchant_acct.currency_code,
|
|
17
17
|
'locale' : merchant_acct.locale,
|
|
18
|
+
'gmt_hour' : merchant_acct.gmt_hour,
|
|
18
19
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
if read_minimum==False:
|
|
21
|
+
outlet_list = Outlet.list_by_merchant_acct(merchant_acct)
|
|
22
|
+
outlet_json_list = []
|
|
23
|
+
for o in outlet_list:
|
|
24
|
+
if o.is_physical_store:
|
|
25
|
+
outlet_info = construct_outlet_info(o)
|
|
26
|
+
outlet_info['industry_type'] = merchant_acct.industry
|
|
27
|
+
outlet_json_list.append(outlet_info)
|
|
27
28
|
|
|
29
|
+
if read_minimum==False:
|
|
30
|
+
banner_file_listing = BannerFile.list_by_merchant_acct(merchant_acct)
|
|
31
|
+
banner_listing = []
|
|
32
|
+
if banner_file_listing:
|
|
33
|
+
for banner_file in banner_file_listing:
|
|
34
|
+
banner_listing.append(banner_file.banner_file_public_url)
|
|
35
|
+
|
|
28
36
|
|
|
29
|
-
banner_file_listing = BannerFile.list_by_merchant_acct(merchant_acct)
|
|
30
|
-
banner_listing = []
|
|
31
|
-
if banner_file_listing:
|
|
32
|
-
for banner_file in banner_file_listing:
|
|
33
|
-
banner_listing.append(banner_file.banner_file_public_url)
|
|
34
|
-
|
|
35
|
-
|
|
36
37
|
invoice_no_generation = InvoiceNoGeneration.getByMerchantAcct(merchant_acct)
|
|
37
38
|
|
|
38
39
|
if invoice_no_generation:
|
|
@@ -40,49 +41,55 @@ def construct_merchant_acct_info(merchant_acct, referrer_code=None):
|
|
|
40
41
|
'invoice_no_generators' : invoice_no_generation.generators_list,
|
|
41
42
|
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
if read_minimum==False:
|
|
45
|
+
referral_program_settings = None
|
|
46
|
+
if merchant_acct.program_settings is not None:
|
|
47
|
+
referral_program_settings = merchant_acct.program_settings.get('referral_program', {})
|
|
46
48
|
|
|
47
49
|
|
|
48
50
|
|
|
49
|
-
merchant_news_list=[]
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
merchant_news_list = merchant_acct.published_news_configuration['news']
|
|
53
|
-
|
|
54
|
-
for news in merchant_news_list:
|
|
55
|
-
logger.debug('news public url=%s', news.get('news_public_url'))
|
|
52
|
+
merchant_news_list=[]
|
|
56
53
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
if read_minimum==False:
|
|
55
|
+
if merchant_acct.published_news_configuration:
|
|
56
|
+
merchant_news_list = merchant_acct.published_news_configuration['news']
|
|
57
|
+
|
|
58
|
+
for news in merchant_news_list:
|
|
59
|
+
logger.debug('news public url=%s', news.get('news_public_url'))
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
if read_minimum==False:
|
|
62
|
+
published_redemption_catalogue_configuration = merchant_acct.published_redemption_catalogue_configuration
|
|
63
|
+
catalogues_list = []
|
|
64
|
+
if published_redemption_catalogue_configuration:
|
|
65
|
+
catalogues_list = published_redemption_catalogue_configuration.get('catalogues')
|
|
66
|
+
|
|
67
|
+
if len(catalogues_list)>0:
|
|
68
|
+
for catalogue in catalogues_list:
|
|
69
|
+
catalogue['items'] = __resolve_catalogue_items_details(catalogue.get('items'), merchant_acct.published_voucher_configuration.get('vouchers'))
|
|
70
|
+
|
|
66
71
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
72
|
+
if read_minimum==False:
|
|
73
|
+
partner_redemption_catalogue_configuration = merchant_acct.partner_redemption_catalogue_configuration
|
|
74
|
+
|
|
75
|
+
if partner_redemption_catalogue_configuration:
|
|
76
|
+
partner_catalogues_list = partner_redemption_catalogue_configuration.get('catalogues')
|
|
77
|
+
|
|
78
|
+
if len(partner_catalogues_list)>0:
|
|
79
|
+
for catalogue in partner_catalogues_list:
|
|
80
|
+
catalogue['from_partner'] = True
|
|
81
|
+
partner_merchant_account = MerchantAcct.get_or_read_from_cache(catalogue['merchant_acct_key'])
|
|
82
|
+
catalogue['items'] = __resolve_catalogue_items_details(catalogue.get('items'), partner_merchant_account.published_voucher_configuration.get('vouchers'))
|
|
71
83
|
|
|
72
|
-
|
|
73
|
-
for catalogue in partner_catalogues_list:
|
|
74
|
-
catalogue['from_partner'] = True
|
|
75
|
-
partner_merchant_account = MerchantAcct.get_or_read_from_cache(catalogue['merchant_acct_key'])
|
|
76
|
-
catalogue['items'] = __resolve_catalogue_items_details(catalogue.get('items'), partner_merchant_account.published_voucher_configuration.get('vouchers'))
|
|
77
|
-
|
|
78
|
-
catalogues_list.extend(partner_catalogues_list)
|
|
84
|
+
catalogues_list.extend(partner_catalogues_list)
|
|
79
85
|
|
|
80
86
|
partner_merchants_list = []
|
|
81
87
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
if read_minimum==False:
|
|
89
|
+
approved_partner_merchant_configuration = merchant_acct.approved_partner_merchant_configuration
|
|
90
|
+
if approved_partner_merchant_configuration and approved_partner_merchant_configuration.get('partners'):
|
|
91
|
+
partner_merchants_list = list(approved_partner_merchant_configuration.get('partners').values())
|
|
92
|
+
|
|
86
93
|
|
|
87
94
|
|
|
88
95
|
info = {
|
|
@@ -135,6 +142,12 @@ def construct_merchant_acct_info(merchant_acct, referrer_code=None):
|
|
|
135
142
|
referrer_code = referrer_code,
|
|
136
143
|
)
|
|
137
144
|
|
|
145
|
+
referrer_merchant_and_friend_code = conf.REFERRER_MERCHANT_AND_FRIEND_CODE.format(
|
|
146
|
+
#referrer_data = encrypted_referrer_data
|
|
147
|
+
merchant_acct_code = merchant_acct.account_code,
|
|
148
|
+
referrer_code = referrer_code,
|
|
149
|
+
)
|
|
150
|
+
|
|
138
151
|
logger.debug('refer_a_friend_deep_link=%s', refer_a_friend_deep_link)
|
|
139
152
|
|
|
140
153
|
refer_a_friend_message = refer_a_friend_message.format(
|
|
@@ -145,16 +158,17 @@ def construct_merchant_acct_info(merchant_acct, referrer_code=None):
|
|
|
145
158
|
logger.debug('refer_a_friend_message=%s', refer_a_friend_message)
|
|
146
159
|
|
|
147
160
|
info['referral_program_settings'] = {
|
|
148
|
-
'program_count'
|
|
149
|
-
'referrer_promote_title'
|
|
150
|
-
'referrer_promote_desc'
|
|
151
|
-
'referrer_promote_image'
|
|
152
|
-
'referee_promote_title'
|
|
153
|
-
'referee_promote_desc'
|
|
154
|
-
'referee_promote_image'
|
|
155
|
-
'refer_a_friend_url'
|
|
156
|
-
'refer_a_friend_message'
|
|
157
|
-
'refer_a_friend_deep_link'
|
|
161
|
+
'program_count' : merchant_acct.effective_referral_program_count,
|
|
162
|
+
'referrer_promote_title' : referral_program_settings.get('referrer_promote_title'),
|
|
163
|
+
'referrer_promote_desc' : referral_program_settings.get('referrer_promote_desc'),
|
|
164
|
+
'referrer_promote_image' : referral_program_settings.get('referrer_promote_image', conf.REFERRAL_DEFAULT_PROMOTE_IMAGE),
|
|
165
|
+
'referee_promote_title' : referral_program_settings.get('referee_promote_title'),
|
|
166
|
+
'referee_promote_desc' : referral_program_settings.get('referee_promote_desc'),
|
|
167
|
+
'referee_promote_image' : referral_program_settings.get('referee_promote_image'),
|
|
168
|
+
'refer_a_friend_url' : refer_a_friend_url,
|
|
169
|
+
'refer_a_friend_message' : refer_a_friend_message,
|
|
170
|
+
'refer_a_friend_deep_link' : refer_a_friend_deep_link,
|
|
171
|
+
'referrer_merchant_and_friend_code' : referrer_merchant_and_friend_code,
|
|
158
172
|
}
|
|
159
173
|
|
|
160
174
|
|
|
@@ -229,6 +243,7 @@ def construct_setting_by_outlet(outlet, device_setting=None, is_pos_device=False
|
|
|
229
243
|
'account_code' : merchant_acct.account_code,
|
|
230
244
|
'currency' : merchant_acct.currency_code,
|
|
231
245
|
'locale' : merchant_acct.locale,
|
|
246
|
+
'gmt_hour' : merchant_acct.gmt_hour,
|
|
232
247
|
}
|
|
233
248
|
|
|
234
249
|
logger.info('is_pos_device=%s', is_pos_device)
|
|
@@ -287,11 +302,12 @@ def construct_setting_by_outlet(outlet, device_setting=None, is_pos_device=False
|
|
|
287
302
|
'is_rounding_required' : d.is_rounding_required,
|
|
288
303
|
})
|
|
289
304
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
305
|
+
if is_pos_device:
|
|
306
|
+
account_settings['assigned_service_charge_setup'] = outlet.service_charge_settings
|
|
307
|
+
account_settings['assigned_tax_setup'] = outlet.assigned_tax_setup
|
|
308
|
+
account_settings['dinning_table_list'] = outlet.assigned_dinning_table_list
|
|
309
|
+
account_settings['show_dinning_table_occupied'] = outlet.show_dinning_table_occupied
|
|
310
|
+
account_settings['payment_methods'] = pos_payment_method_json
|
|
295
311
|
|
|
296
312
|
|
|
297
313
|
outlet_details = {
|
|
@@ -305,7 +321,8 @@ def construct_setting_by_outlet(outlet, device_setting=None, is_pos_device=False
|
|
|
305
321
|
'email' : outlet.email,
|
|
306
322
|
'phone' : outlet.office_phone,
|
|
307
323
|
'website' : merchant_acct.website or '',
|
|
308
|
-
|
|
324
|
+
'industry_type' : merchant_acct.industry,
|
|
325
|
+
'gmt_hour' : merchant_acct.gmt_hour,
|
|
309
326
|
}
|
|
310
327
|
|
|
311
328
|
program_configurations = {
|
|
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.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/customer_model_helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trex_model-1.6.10 → trex_model-1.6.12}/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
|
{trex_model-1.6.10 → trex_model-1.6.12}/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
|
|
File without changes
|
{trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/redemption_catalogue_models.py
RENAMED
|
File without changes
|
{trex_model-1.6.10 → trex_model-1.6.12}/trexmodel/models/datastore/referral_program_model.py
RENAMED
|
File without changes
|
|
File without changes
|
{trex_model-1.6.10 → trex_model-1.6.12}/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
|