trex-model 1.6.10__tar.gz → 1.6.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.6.10 → trex_model-1.6.11}/PKG-INFO +1 -1
- {trex_model-1.6.10 → trex_model-1.6.11}/setup.py +1 -1
- {trex_model-1.6.10 → trex_model-1.6.11}/trex_model.egg-info/PKG-INFO +1 -1
- {trex_model-1.6.10 → trex_model-1.6.11}/trex_model.egg-info/SOURCES.txt +1 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/merchant_models.py +11 -1
- trex_model-1.6.11/trexmodel/models/datastore/support_models.py +32 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/transaction_models.py +22 -6
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/merchant_helpers.py +10 -6
- {trex_model-1.6.10 → trex_model-1.6.11}/LICENSE +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/MANIFEST.in +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/README.md +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/setup.cfg +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trex_model.egg-info/dependency_links.txt +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trex_model.egg-info/requires.txt +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trex_model.egg-info/top_level.txt +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/conf.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/admin_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/analytic_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/app_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/coporate_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/customer_model_helpers.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/customer_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/fb_subsriber_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/helper/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/helper/reward_model_helpers.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/helper/reward_transaction_helper.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/helper/sales_transaction_helpers.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/import_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/inventory_model.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/loyalty_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/lucky_draw_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/marketing_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/membership_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/merchant_promotion_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/message_model_helper.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/message_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/model_decorators.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/ndb_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/partnership_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/pos_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/prepaid_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/product_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/program_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/rating_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/recruit_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/redeem_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/redemption_catalogue_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/referral_program_model.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/reward_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/spending_base_program_model.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/system_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/task_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/test_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/user_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/voucher_models.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/model_decorator.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/prepaid_helpers.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/pos_conf.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/program_conf.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/utils/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/utils/gcloud/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/utils/gcloud/datastore_util.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/utils/model/__init__.py +0 -0
- {trex_model-1.6.10 → trex_model-1.6.11}/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
|
|
@@ -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):
|
|
@@ -15,6 +15,7 @@ def construct_merchant_acct_info(merchant_acct, referrer_code=None):
|
|
|
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
|
|
|
20
21
|
outlet_list = Outlet.list_by_merchant_acct(merchant_acct)
|
|
@@ -229,6 +230,7 @@ def construct_setting_by_outlet(outlet, device_setting=None, is_pos_device=False
|
|
|
229
230
|
'account_code' : merchant_acct.account_code,
|
|
230
231
|
'currency' : merchant_acct.currency_code,
|
|
231
232
|
'locale' : merchant_acct.locale,
|
|
233
|
+
'gmt_hour' : merchant_acct.gmt_hour,
|
|
232
234
|
}
|
|
233
235
|
|
|
234
236
|
logger.info('is_pos_device=%s', is_pos_device)
|
|
@@ -287,11 +289,12 @@ def construct_setting_by_outlet(outlet, device_setting=None, is_pos_device=False
|
|
|
287
289
|
'is_rounding_required' : d.is_rounding_required,
|
|
288
290
|
})
|
|
289
291
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
292
|
+
if is_pos_device:
|
|
293
|
+
account_settings['assigned_service_charge_setup'] = outlet.service_charge_settings
|
|
294
|
+
account_settings['assigned_tax_setup'] = outlet.assigned_tax_setup
|
|
295
|
+
account_settings['dinning_table_list'] = outlet.assigned_dinning_table_list
|
|
296
|
+
account_settings['show_dinning_table_occupied'] = outlet.show_dinning_table_occupied
|
|
297
|
+
account_settings['payment_methods'] = pos_payment_method_json
|
|
295
298
|
|
|
296
299
|
|
|
297
300
|
outlet_details = {
|
|
@@ -305,7 +308,8 @@ def construct_setting_by_outlet(outlet, device_setting=None, is_pos_device=False
|
|
|
305
308
|
'email' : outlet.email,
|
|
306
309
|
'phone' : outlet.office_phone,
|
|
307
310
|
'website' : merchant_acct.website or '',
|
|
308
|
-
|
|
311
|
+
'industry_type' : merchant_acct.industry,
|
|
312
|
+
'gmt_hour' : merchant_acct.gmt_hour,
|
|
309
313
|
}
|
|
310
314
|
|
|
311
315
|
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.11}/trexmodel/models/datastore/customer_model_helpers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{trex_model-1.6.10 → trex_model-1.6.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
|
{trex_model-1.6.10 → trex_model-1.6.11}/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.11}/trexmodel/models/datastore/redemption_catalogue_models.py
RENAMED
|
File without changes
|
{trex_model-1.6.10 → trex_model-1.6.11}/trexmodel/models/datastore/referral_program_model.py
RENAMED
|
File without changes
|
|
File without changes
|
{trex_model-1.6.10 → trex_model-1.6.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
|