internal 1.0.127__py3-none-any.whl → 1.0.129__py3-none-any.whl

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 internal might be problematic. Click here for more details.

@@ -3,8 +3,8 @@ from enum import Enum
3
3
 
4
4
  class EventCodeEnum(str, Enum):
5
5
  MANUAL_CANCEL_SERVICE_TICKET = "manual_cancel_service_ticket"
6
- MANUAL_TRACING_START_SERVICE_TICKET = "manual_tracking_start_service_ticket"
7
- MANUAL_TRACING_STOP_SERVICE_TICKET = "manual_tracking_stop_service_ticket"
6
+ MANUAL_TRACING_START_SERVICE_TICKET = "manual_tracing_start_service_ticket"
7
+ MANUAL_TRACING_STOP_SERVICE_TICKET = "manual_tracing_stop_service_ticket"
8
8
  MANUAL_CREATE_SERVICE_TICKET = "manual_create_service_ticket"
9
9
  MANUAL_IMPORT_RESERVATION_SMWS = "manual_import_reservation_smws"
10
10
  MANUAL_MODIFY_USER_SERVICE_TICKET = "manual_modify_user_service_ticket"
@@ -58,7 +58,7 @@ class VinLengthOrFormatException(InternalBaseException):
58
58
 
59
59
  class PhoneFormatException(InternalBaseException):
60
60
  code = "error_phone_format"
61
- message = "Phone only allow numeric"
61
+ message = "Phone only allow start with 09 and add 8 digits"
62
62
 
63
63
  def __init__(self, message: str = None, **kwargs):
64
64
  _message = message or self.message
@@ -74,6 +74,15 @@ class DateFormatException(InternalBaseException):
74
74
  super().__init__(status.HTTP_422_UNPROCESSABLE_ENTITY, self.code, _message, **kwargs)
75
75
 
76
76
 
77
+ class EMailFormatException(InternalBaseException):
78
+ code = "error_email_format"
79
+ message = "Email format error"
80
+
81
+ def __init__(self, message: str = None, **kwargs):
82
+ _message = message or self.message
83
+ super().__init__(status.HTTP_422_UNPROCESSABLE_ENTITY, self.code, _message, **kwargs)
84
+
85
+
77
86
  class LineUidNullPointException(InternalBaseException):
78
87
  code = "error_line_uid_not_be_null"
79
88
  message = "Line uid can not be null"
@@ -1,7 +1,7 @@
1
1
  import re
2
2
 
3
3
  from .exception.app_exception import PlateNoFormatException, VinLengthOrFormatException, PhoneFormatException, \
4
- DateFormatException
4
+ DateFormatException, EMailFormatException
5
5
  from .utils import sanitize_plate_no
6
6
 
7
7
 
@@ -29,7 +29,7 @@ def verify_phone(value: str, is_require: bool = False):
29
29
  raise PhoneFormatException()
30
30
 
31
31
  if value:
32
- if not re.match(r'^\d+$', value):
32
+ if not re.match(r'^09\d{8}$', value):
33
33
  raise PhoneFormatException()
34
34
 
35
35
 
@@ -40,3 +40,12 @@ def verify_date(value: str, is_require: bool = False):
40
40
  if value:
41
41
  if not re.match(r'^\d{4}-\d{2}-\d{2}$', value):
42
42
  raise DateFormatException()
43
+
44
+
45
+ def verify_mail(value: str, is_require: bool = False):
46
+ if is_require and not value:
47
+ raise EMailFormatException()
48
+
49
+ if value:
50
+ if not re.match(r'^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$', value):
51
+ raise EMailFormatException()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: internal
3
- Version: 1.0.127
3
+ Version: 1.0.129
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -6,7 +6,7 @@ internal/common_enum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
6
6
  internal/common_enum/contact_type.py,sha256=7QkTQ71UxpaT1YHI40FpjmLz3r-UbRU-sd0m5ajH1as,142
7
7
  internal/common_enum/description_type.py,sha256=kGwkFQh6dMnjDl6ipWYpA-qbNRrhEpnPq3NleTsNwwk,118
8
8
  internal/common_enum/device_code.py,sha256=lDTqRmP8zl6-k62HCsRehNAKCTXxH6WltZnvijy8Ijc,223
9
- internal/common_enum/event_code.py,sha256=UNEPeMyCs8c6cfTfZMExo6oQSFgeiYngD4hG1VW_VM0,1962
9
+ internal/common_enum/event_code.py,sha256=XjceRiGEKkIH92XcKret2oErmnllxRNo_YoEYI6xoZc,1960
10
10
  internal/common_enum/lpr_direction.py,sha256=glCGSkcXHUB6_p2jO_7IdEHycyFVhu0vHDDDXbFJ174,113
11
11
  internal/common_enum/notify_type.py,sha256=p01d9ODiJ9vDpFBJ55bhu7WOyO7Te3slToOhvFKxQbk,188
12
12
  internal/common_enum/operator_type.py,sha256=XfHwGDsuOG6-ajitDoRuLFLT1LhHKoXXzFRW4e5vmJ8,173
@@ -15,7 +15,7 @@ internal/common_enum/websocket_channel.py,sha256=BIhdE2z_xF3lgStS8GiaS5M8BXm4_g3
15
15
  internal/const.py,sha256=d-F_tJ8GvxR1GwhEsqAt92XBwU53RAq8sZSGwWenb7o,1173
16
16
  internal/database.py,sha256=1u53JnFJ0jvP7H4HPY2faA2ABdPQ8SlsZigYmQAPktI,2470
17
17
  internal/exception/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- internal/exception/app_exception.py,sha256=z7BGD0iw0VW5rczQb-sjnfxk1O_E6CPWMnBUfddU-0g,3467
18
+ internal/exception/app_exception.py,sha256=4HE1BrXBuMTuukwEYJhz_gxS6eIqHpSBFB99J62BHJ0,3803
19
19
  internal/exception/base_exception.py,sha256=8ctp525A3up9mZrHCq_-Jj0hWr_4NfZsXGg1e4ftVuQ,473
20
20
  internal/exception/internal_exception.py,sha256=DDJg2tZtbcy4xlAhinJNzntSU1HcpGZ_XFP_perMzzo,2957
21
21
  internal/ext/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -33,7 +33,7 @@ internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
33
  internal/model/base_model.py,sha256=NWjysNOp2MfXvAHGFqaQA_l8ZfTFvJbXQPUPuOXN_2g,5361
34
34
  internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
35
35
  internal/utils.py,sha256=i6YZdiXsiWnOjRdlJ6afNCGpyMe3Uo9mhm3xlQBy3Ls,2824
36
- internal/validator_utils.py,sha256=5ZLcNIgw1hvkYOj1f6gS9AYxe7Y3ufW9FyDxUS7FsMQ,1226
37
- internal-1.0.127.dist-info/METADATA,sha256=yUniTCqIZwoCzUVf7564BFtGpY7nt8Fla6tcgIn1gUE,809
38
- internal-1.0.127.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
39
- internal-1.0.127.dist-info/RECORD,,
36
+ internal/validator_utils.py,sha256=CqjaVFoAu5MqvBG_AkTP-r7AliWawtUWB851USj4moI,1519
37
+ internal-1.0.129.dist-info/METADATA,sha256=A8-BySfVWAKQFYezTq7vUcw3lRtzlpfYS9m35TnH4tM,809
38
+ internal-1.0.129.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
39
+ internal-1.0.129.dist-info/RECORD,,