internal 1.1.17__py3-none-any.whl → 1.1.19__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.

internal/base_config.py CHANGED
@@ -13,11 +13,11 @@ class BaseConfig(BaseSettings):
13
13
  # Request
14
14
  REQUEST_VERIFY_SSL: bool = False
15
15
  REQUEST_PROXY: str = ''
16
- REQUEST_RETRY_COUNT: int = 2
16
+ REQUEST_RETRY_COUNT: int = 1
17
17
  REQUEST_RETRY_DELAY_INITIAL_SECONDS: float = 1.0
18
18
  REQUEST_RETRY_DELAY_FACTOR: float = 1.5
19
19
  REQUEST_RETRY_DELAY_RANDOM_JITTER_MIN: float = 0.0
20
- REQUEST_RETRY_DELAY_RANDOM_JITTER_MAX: float = 0.5
20
+ REQUEST_RETRY_DELAY_RANDOM_JITTER_MAX: float = 0.3
21
21
  REQUEST_CONN_POOL_TIMEOUT: float = 5.0
22
22
  REQUEST_CONN_TIMEOUT: float = 5.0
23
23
  REQUEST_WRITE_TIMEOUT: float = 5.0
internal/utils.py CHANGED
@@ -85,3 +85,22 @@ async def mask_name(input_string: str, start_index: int = 1, end_index: int = No
85
85
  masked_part = mask_char * (end_index - start_index)
86
86
 
87
87
  return visible_part_start + masked_part + visible_part_end
88
+
89
+
90
+ def get_dealer_by_organization_id(organization_id: str) -> str:
91
+ """
92
+ 將組織代碼為 3 段(例如 'BMW_LONGDER_NH')時,裁切為前兩段('BMW_LONGDER')。
93
+ 否則回傳原本的 organization_id。
94
+ """
95
+ if not organization_id or not isinstance(organization_id, str):
96
+ return organization_id
97
+
98
+ parts = organization_id.strip().split("_")
99
+
100
+ if len(parts) < 2:
101
+ raise ValueError("organization_id is invalid")
102
+
103
+ if len(parts) >= 3:
104
+ return "_".join(parts[:2])
105
+
106
+ return organization_id
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: internal
3
- Version: 1.1.17
3
+ Version: 1.1.19
4
4
  Summary:
5
5
  Author: Ray
6
6
  Author-email: ray@cruisys.com
@@ -1,5 +1,5 @@
1
1
  internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- internal/base_config.py,sha256=VcU1B1Obh1jGa9d2WDXu0doF0TuQdBYgL_TCaO_rLnk,2605
2
+ internal/base_config.py,sha256=jLhcnkV45YxRSiGqlsFH0rpZqQ1zeNwcs5om2Ln1l9w,2605
3
3
  internal/base_factory.py,sha256=ZzXow5iKXyiZqFy815Jy-S4_spNCoyLPVz637deie7w,10441
4
4
  internal/cache_redis.py,sha256=YMsrUXHd-wKjsjsboD79Y-ciBBowzT6aAjdJZ36-yEY,697
5
5
  internal/common_enum/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -32,8 +32,8 @@ internal/middleware/log_request.py,sha256=01UeoCsjv38U0kZQwRqEspSbEUJDCb-WUN1TPr
32
32
  internal/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
33
  internal/model/base_model.py,sha256=hxleV8fYNvFgUoYmCv_inEP3kA4tD4HhCBCNFVK8SZg,5509
34
34
  internal/model/operate.py,sha256=QSM6yXYXpJMwrqkUGEWZLrEBaUgqHwVHY_Fi4S42hKc,3190
35
- internal/utils.py,sha256=i6YZdiXsiWnOjRdlJ6afNCGpyMe3Uo9mhm3xlQBy3Ls,2824
35
+ internal/utils.py,sha256=u__MpSFscUlzIpkrxc8eLMveUv1eufKOA9MSQ90gsfk,3369
36
36
  internal/validator_utils.py,sha256=CqjaVFoAu5MqvBG_AkTP-r7AliWawtUWB851USj4moI,1519
37
- internal-1.1.17.dist-info/METADATA,sha256=2njog32L4UhekcI3jLlMUHatoI3F7hkf1GayJ6NSyjU,939
38
- internal-1.1.17.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
39
- internal-1.1.17.dist-info/RECORD,,
37
+ internal-1.1.19.dist-info/METADATA,sha256=cr1Fkd3FBsyl9Ni7b8qcPk5Lvnr5gPAmVXpMekUU9Pw,939
38
+ internal-1.1.19.dist-info/WHEEL,sha256=RaoafKOydTQ7I_I3JTrPCg6kUmTgtm4BornzOqyEfJ8,88
39
+ internal-1.1.19.dist-info/RECORD,,