karrio-sapient 2025.5rc1__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.
- karrio/mappers/sapient/__init__.py +3 -0
- karrio/mappers/sapient/mapper.py +69 -0
- karrio/mappers/sapient/proxy.py +87 -0
- karrio/mappers/sapient/settings.py +36 -0
- karrio/plugins/sapient/__init__.py +20 -0
- karrio/providers/sapient/__init__.py +18 -0
- karrio/providers/sapient/error.py +28 -0
- karrio/providers/sapient/pickup/__init__.py +4 -0
- karrio/providers/sapient/pickup/cancel.py +57 -0
- karrio/providers/sapient/pickup/create.py +87 -0
- karrio/providers/sapient/pickup/update.py +87 -0
- karrio/providers/sapient/shipment/__init__.py +9 -0
- karrio/providers/sapient/shipment/cancel.py +57 -0
- karrio/providers/sapient/shipment/create.py +247 -0
- karrio/providers/sapient/units.py +638 -0
- karrio/providers/sapient/utils.py +122 -0
- karrio/schemas/sapient/__init__.py +0 -0
- karrio/schemas/sapient/error_response.py +16 -0
- karrio/schemas/sapient/pickup_request.py +10 -0
- karrio/schemas/sapient/pickup_response.py +9 -0
- karrio/schemas/sapient/shipment_requests.py +125 -0
- karrio/schemas/sapient/shipment_response.py +24 -0
- karrio_sapient-2025.5rc1.dist-info/METADATA +45 -0
- karrio_sapient-2025.5rc1.dist-info/RECORD +27 -0
- karrio_sapient-2025.5rc1.dist-info/WHEEL +5 -0
- karrio_sapient-2025.5rc1.dist-info/entry_points.txt +2 -0
- karrio_sapient-2025.5rc1.dist-info/top_level.txt +3 -0
@@ -0,0 +1,638 @@
|
|
1
|
+
import karrio.lib as lib
|
2
|
+
import karrio.core.units as units
|
3
|
+
import karrio.core.models as models
|
4
|
+
|
5
|
+
|
6
|
+
class LabelType(lib.StrEnum):
|
7
|
+
"""Carrier specific label type"""
|
8
|
+
|
9
|
+
PDF = "PDF"
|
10
|
+
PNG = "PNG"
|
11
|
+
ZPL203DPI = "ZPL203DPI"
|
12
|
+
ZPL300DPI = "ZPL300DPI"
|
13
|
+
|
14
|
+
""" Unified Label type mapping """
|
15
|
+
|
16
|
+
ZPL = ZPL300DPI
|
17
|
+
|
18
|
+
|
19
|
+
class CustomsContentType(lib.StrEnum):
|
20
|
+
gift = "Gift"
|
21
|
+
commercial_sample = "Commercial Sample"
|
22
|
+
documents = "Documents"
|
23
|
+
sale_of_goods = "Sale of Goods"
|
24
|
+
return_of_goods = "Return of Goods"
|
25
|
+
mixed_content = "Mixed Content"
|
26
|
+
other = "Other"
|
27
|
+
|
28
|
+
""" Unified Customs content type mapping """
|
29
|
+
|
30
|
+
sample = commercial_sample
|
31
|
+
merchandise = sale_of_goods
|
32
|
+
return_merchandise = return_of_goods
|
33
|
+
|
34
|
+
|
35
|
+
class PackagingType(lib.StrEnum):
|
36
|
+
"""Carrier specific packaging type"""
|
37
|
+
|
38
|
+
Letter = "Letter"
|
39
|
+
LargeLetter = "LargeLetter"
|
40
|
+
Parcel = "Parcel"
|
41
|
+
PrintedPapers = "PrintedPapers"
|
42
|
+
|
43
|
+
""" Unified Packaging type mapping """
|
44
|
+
envelope = Letter
|
45
|
+
pak = LargeLetter
|
46
|
+
tube = Parcel
|
47
|
+
pallet = Parcel
|
48
|
+
small_box = Parcel
|
49
|
+
medium_box = Parcel
|
50
|
+
your_packaging = Parcel
|
51
|
+
|
52
|
+
|
53
|
+
class ShippingService(lib.StrEnum):
|
54
|
+
"""Carrier specific services"""
|
55
|
+
|
56
|
+
# fmt: off
|
57
|
+
sapient_royal_mail_hm_forces_mail = "BF1"
|
58
|
+
sapient_royal_mail_hm_forces_signed_for = "BF2"
|
59
|
+
sapient_royal_mail_hm_forces_special_delivery_500 = "BF7"
|
60
|
+
sapient_royal_mail_hm_forces_special_delivery_1000 = "BF8"
|
61
|
+
sapient_royal_mail_hm_forces_special_delivery_2500 = "BF9"
|
62
|
+
sapient_royal_mail_international_business_personal_correspondence_max_sort_residue_ll = "BG1"
|
63
|
+
sapient_royal_mail_international_business_mail_ll_max_sort_residue_standard = "BG2"
|
64
|
+
sapient_royal_mail_international_business_personal_correspondence_max_sort_residue_l = "BP1"
|
65
|
+
sapient_royal_mail_international_business_mail_l_max_sort_residue_standard = "BP2"
|
66
|
+
sapient_royal_mail_international_business_printed_matter_packet = "BPI"
|
67
|
+
sapient_royal_mail_1st_class = "BPL1"
|
68
|
+
sapient_royal_mail_2nd_class = "BPL2"
|
69
|
+
sapient_royal_mail_1st_class_signed_for = "BPR1"
|
70
|
+
sapient_royal_mail_2nd_class_signed_for = "BPR2"
|
71
|
+
sapient_royal_mail_international_business_parcel_priority_country_priced_boxable = "BXB"
|
72
|
+
sapient_royal_mail_international_business_parcel_tracked_country_priced_boxable_extra_comp = "BXC"
|
73
|
+
sapient_royal_mail_international_business_parcel_priority_country_priced_boxable_ddp = "BXD"
|
74
|
+
sapient_royal_mail_international_business_parcel_tracked_country_priced_boxable_ddp = "BXE"
|
75
|
+
sapient_royal_mail_international_business_parcel_tracked_country_priced_boxable = "BXF"
|
76
|
+
sapient_royal_mail_24_standard_signed_for_parcel_daily_rate_service = "CRL1"
|
77
|
+
sapient_royal_mail_48_standard_signed_for_parcel_daily_rate_service = "CRL2"
|
78
|
+
sapient_royal_mail_international_business_parcels_zero_sort_priority = "DE4"
|
79
|
+
sapient_royal_mail_international_business_parcels_zero_sort_priority_DE = "DE6"
|
80
|
+
sapient_royal_mail_de_import_standard_24_parcel = "DEA"
|
81
|
+
sapient_royal_mail_de_import_standard_24_parcel_DE = "DEB"
|
82
|
+
sapient_royal_mail_de_import_standard_24_ll = "DEC"
|
83
|
+
sapient_royal_mail_de_import_standard_48_ll = "DED"
|
84
|
+
sapient_royal_mail_de_import_to_eu_tracked_signed_ll = "DEE"
|
85
|
+
sapient_royal_mail_de_import_to_eu_max_sort_ll = "DEG"
|
86
|
+
sapient_royal_mail_de_import_to_eu_tracked_parcel = "DEI"
|
87
|
+
sapient_royal_mail_de_import_to_eu_tracked_signed_parcel = "DEJ"
|
88
|
+
sapient_royal_mail_de_import_to_eu_tracked_high_vol_ll = "DEK"
|
89
|
+
sapient_royal_mail_de_import_to_eu_max_sort_parcel = "DEM"
|
90
|
+
sapient_royal_mail_international_business_mail_ll_country_priced_priority = "DG4"
|
91
|
+
sapient_royal_mail_international_business_personal_correspondence_l_priority_untracked = "DP3"
|
92
|
+
sapient_royal_mail_international_business_mail_ll_country_sort_priority = "DP6"
|
93
|
+
sapient_royal_mail_international_business_parcels = "DW1"
|
94
|
+
sapient_royal_mail_international_business_parcels_tracked_country_priced_extra_territorial_office_of_exchange = "ETA"
|
95
|
+
sapient_royal_mail_international_business_parcels_tracked_signed_country_priced_extra_territorial_office_of_exchange = "ETB"
|
96
|
+
sapient_royal_mail_international_business_parcels_zero_sort_priority_extra_territorial_office_of_exchange = "ETC"
|
97
|
+
sapient_royal_mail_international_business_mail_tracked_ll_country_priced_extra_territorial_office_of_exchange = "ETD"
|
98
|
+
sapient_royal_mail_international_business_mail_tracked_signed_ll_country_priced_extra_territorial_office_of_exchange = "ETE"
|
99
|
+
sapient_royal_mail_international_business_mail_ll_country_priced_priority_extra_territorial_office_of_exchange = "ETF"
|
100
|
+
sapient_royal_mail_international_tracked_parcels_0_30kg_extra_territorial_office_of_exchange_e = "ETG"
|
101
|
+
sapient_royal_mail_international_tracked_parcels_0_30kg_extra_comp_extra_territorial_office_of_exchange_e = "ETH"
|
102
|
+
sapient_royal_mail_international_tracked_parcels_0_30kg_extra_territorial_office_of_exchange_c = "ETI"
|
103
|
+
sapient_royal_mail_international_tracked_parcels_0_30kg_extra_comp_extra_territorial_office_of_exchange_c = "ETJ"
|
104
|
+
sapient_royal_mail_international_business_personal_correspondence_l_priority_untracked_extra_territorial_office_of_exchange = "ETK"
|
105
|
+
sapient_royal_mail_international_business_personal_correspondence_l_tracked_high_vol_country_priced_extra_territorial_office_of_exchange = "ETL"
|
106
|
+
sapient_royal_mail_international_business_personal_correspondence_l_tracked_signed_high_vol_country_priced_extra_territorial_office_of_exchange = "ETM"
|
107
|
+
sapient_royal_mail_international_business_personal_correspondence_signed_l_high_vol_country_priced_extra_territorial_office_of_exchange = "ETN"
|
108
|
+
sapient_royal_mail_international_business_personal_correspondence_ll_country_sort_priority_extra_territorial_office_of_exchange = "ETO"
|
109
|
+
sapient_royal_mail_international_business_personal_correspondence_tracked_ll_high_vol_extra_comp_country_priced_extra_territorial_office_of_exchange = "ETP"
|
110
|
+
sapient_royal_mail_international_business_personal_correspondence_tracked_signed_ll_high_vol_extra_comp_country_priced_extra_territorial_office_of_exchange = "ETQ"
|
111
|
+
sapient_royal_mail_international_business_personal_correspondence_signed_ll_extra_compensation_country_priced_extra_territorial_office_of_exchange = "ETR"
|
112
|
+
sapient_royal_mail_24_standard_signed_for_large_letter_flat_rate_service = "FS1"
|
113
|
+
sapient_royal_mail_48_standard_signed_for_large_letter_flat_rate_service = "FS2"
|
114
|
+
sapient_royal_mail_24_presorted_ll = "FS7"
|
115
|
+
sapient_royal_mail_48_presorted_ll = "FS8"
|
116
|
+
sapient_royal_mail_international_tracked_parcels_0_30kg = "HVB"
|
117
|
+
sapient_royal_mail_international_business_tracked_express_npc = "HVD"
|
118
|
+
sapient_royal_mail_international_tracked_parcels_0_30kg_extra_comp = "HVE"
|
119
|
+
sapient_royal_mail_international_tracked_parcels_0_30kg_c_prio = "HVK"
|
120
|
+
sapient_royal_mail_international_tracked_parcels_0_30kg_xcomp_c_prio = "HVL"
|
121
|
+
sapient_royal_mail_international_business_parcels_zone_sort_priority_service = "IE1"
|
122
|
+
sapient_royal_mail_international_business_mail_large_letter_zone_sort_priority = "IG1"
|
123
|
+
sapient_royal_mail_international_business_mail_large_letter_zone_sort_priority_machine = "IG4"
|
124
|
+
sapient_royal_mail_international_business_mail_letters_zone_sort_priority = "IP1"
|
125
|
+
sapient_royal_mail_import_de_tracked_returns_24 = "ITA"
|
126
|
+
sapient_royal_mail_import_de_tracked_returns_48 = "ITB"
|
127
|
+
sapient_royal_mail_import_de_tracked_24_letter_boxable_high_volume = "ITC"
|
128
|
+
sapient_royal_mail_import_de_tracked_48_letter_boxable_high_volume = "ITD"
|
129
|
+
sapient_royal_mail_import_de_tracked_48_letter_boxable = "ITE"
|
130
|
+
sapient_royal_mail_import_de_tracked_24_letter_boxable = "ITF"
|
131
|
+
sapient_royal_mail_import_de_tracked_48_high_volume = "ITL"
|
132
|
+
sapient_royal_mail_import_de_tracked_24_high_volume = "ITM"
|
133
|
+
sapient_royal_mail_import_de_tracked_24 = "ITN"
|
134
|
+
sapient_royal_mail_de_import_to_eu_signed_parcel = "ITR"
|
135
|
+
sapient_royal_mail_import_de_tracked_48 = "ITS"
|
136
|
+
sapient_royal_mail_international_business_parcels_print_direct_priority = "MB1"
|
137
|
+
sapient_royal_mail_international_business_parcels_print_direct_standard = "MB2"
|
138
|
+
sapient_royal_mail_international_business_parcels_signed_extra_compensation_country_priced = "MP0"
|
139
|
+
sapient_royal_mail_international_business_parcels_tracked_zone_sort = "MP1"
|
140
|
+
sapient_royal_mail_international_business_parcels_tracked_extra_comp_zone_sort = "MP4"
|
141
|
+
sapient_royal_mail_international_business_parcels_signed_zone_sort = "MP5"
|
142
|
+
sapient_royal_mail_international_business_parcels_signed_extra_compensation_zone_sort = "MP6"
|
143
|
+
sapient_royal_mail_international_business_parcels_tracked_country_priced = "MP7"
|
144
|
+
sapient_royal_mail_international_business_parcels_tracked_extra_comp_country_priced = "MP8"
|
145
|
+
sapient_royal_mail_international_business_parcels_signed_country_priced = "MP9"
|
146
|
+
sapient_royal_mail_international_business_mail_tracked_high_vol_country_priced = "MPL"
|
147
|
+
sapient_royal_mail_international_business_mail_tracked_signed_high_vol_country_priced = "MPM"
|
148
|
+
sapient_royal_mail_international_business_mail_signed_high_vol_country_priced = "MPN"
|
149
|
+
sapient_royal_mail_international_business_mail_tracked_high_vol_extra_comp_country_priced = "MPO"
|
150
|
+
sapient_royal_mail_international_business_mail_tracked_signed_high_vol_extra_comp_country_priced = "MPP"
|
151
|
+
sapient_royal_mail_international_business_parcel_tracked_boxable_country_priced = "MPR"
|
152
|
+
sapient_royal_mail_international_business_parcels_tracked_signed_zone_sort = "MTA"
|
153
|
+
sapient_royal_mail_international_business_parcels_tracked_signed_extra_compensation_zone_sort = "MTB"
|
154
|
+
sapient_royal_mail_international_business_mail_tracked_signed_zone_sort = "MTC"
|
155
|
+
sapient_royal_mail_international_business_parcels_tracked_signed_country_priced = "MTE"
|
156
|
+
sapient_royal_mail_international_business_parcels_tracked_signed_extra_compensation_country_priced = "MTF"
|
157
|
+
sapient_royal_mail_international_business_mail_tracked_signed_country_priced = "MTG"
|
158
|
+
sapient_royal_mail_international_business_mail_tracked_zone_sort = "MTI"
|
159
|
+
sapient_royal_mail_international_business_mail_tracked_country_priced = "MTK"
|
160
|
+
sapient_royal_mail_international_business_mail_signed_zone_sort = "MTM"
|
161
|
+
sapient_royal_mail_international_business_mail_signed_country_priced = "MTO"
|
162
|
+
sapient_royal_mail_international_business_mail_signed_extra_compensation_country_priced = "MTP"
|
163
|
+
sapient_royal_mail_international_business_parcels_tracked_direct_ireland_country = "MTS"
|
164
|
+
sapient_royal_mail_international_business_parcels_tracked_signed_ddp = "MTV"
|
165
|
+
sapient_royal_mail_international_standard_on_account = "OLA"
|
166
|
+
sapient_royal_mail_international_economy_on_account = "OLS"
|
167
|
+
sapient_royal_mail_international_signed_on_account = "OSA"
|
168
|
+
sapient_royal_mail_international_signed_on_account_extra_comp = "OSB"
|
169
|
+
sapient_royal_mail_international_tracked_on_account = "OTA"
|
170
|
+
sapient_royal_mail_international_tracked_on_account_extra_comp = "OTB"
|
171
|
+
sapient_royal_mail_international_tracked_signed_on_account = "OTC"
|
172
|
+
sapient_royal_mail_international_tracked_signed_on_account_extra_comp = "OTD"
|
173
|
+
sapient_royal_mail_48_ll_flat_rate = "PK0"
|
174
|
+
sapient_royal_mail_24_standard_signed_for_parcel_sort8_flat_rate_service = "PK1"
|
175
|
+
sapient_royal_mail_48_standard_signed_for_parcel_sort8_flat_rate_service = "PK2"
|
176
|
+
sapient_royal_mail_24_standard_signed_for_parcel_sort8_daily_rate_service = "PK3"
|
177
|
+
sapient_royal_mail_48_standard_signed_for_parcel_sort8_daily_rate_service = "PK4"
|
178
|
+
sapient_royal_mail_24_presorted_p = "PK7"
|
179
|
+
sapient_royal_mail_48_presorted_p = "PK8"
|
180
|
+
sapient_royal_mail_24_ll_flat_rate = "PK9"
|
181
|
+
sapient_royal_mail_rm24_presorted_p_annual_flat_rate = "PKB"
|
182
|
+
sapient_royal_mail_rm48_presorted_p_annual_flat_rate = "PKD"
|
183
|
+
sapient_royal_mail_rm48_presorted_ll_annual_flat_rate = "PKK"
|
184
|
+
sapient_royal_mail_rm24_presorted_ll_annual_flat_rate = "PKM"
|
185
|
+
sapient_royal_mail_24_standard_signed_for_packetpost_flat_rate_service = "PPF1"
|
186
|
+
sapient_royal_mail_48_standard_signed_for_packetpost_flat_rate_service = "PPF2"
|
187
|
+
sapient_royal_mail_parcelpost_flat_rate_annual = "PPJ1"
|
188
|
+
sapient_royal_mail_parcelpost_flat_rate_annual_PPJ = "PPJ2"
|
189
|
+
sapient_royal_mail_rm24_ll_annual_flat_rate = "PPS"
|
190
|
+
sapient_royal_mail_rm48_ll_annual_flat_rate = "PPT"
|
191
|
+
sapient_royal_mail_international_business_personal_correspondence_max_sort_l = "PS5"
|
192
|
+
sapient_royal_mail_international_business_mail_large_letter_max_sort_priority_service = "PS7"
|
193
|
+
sapient_royal_mail_international_business_mail_letters_max_sort_standard = "PSA"
|
194
|
+
sapient_royal_mail_international_business_mail_large_letter_max_sort_standard_service = "PSB"
|
195
|
+
sapient_royal_mail_48_sort8p_annual_flat_rate = "RM0"
|
196
|
+
sapient_royal_mail_24_ll_daily_rate = "RM1"
|
197
|
+
sapient_royal_mail_24_p_daily_rate = "RM2"
|
198
|
+
sapient_royal_mail_48_ll_daily_rate = "RM3"
|
199
|
+
sapient_royal_mail_48_p_daily_rate = "RM4"
|
200
|
+
sapient_royal_mail_24_p_flat_rate = "RM5"
|
201
|
+
sapient_royal_mail_48_p_flat_rate = "RM6"
|
202
|
+
sapient_royal_mail_24_sort8_ll_annual_flat_rate = "RM7"
|
203
|
+
sapient_royal_mail_24_sort8_p_annual_flat_rate = "RM8"
|
204
|
+
sapient_royal_mail_48_sort8_ll_annual_flat_rate = "RM9"
|
205
|
+
sapient_royal_mail_special_delivery_guaranteed_by_1pm_750 = "SD1"
|
206
|
+
sapient_royal_mail_special_delivery_guaranteed_by_1pm_1000 = "SD2"
|
207
|
+
sapient_royal_mail_special_delivery_guaranteed_by_1pm_2500 = "SD3"
|
208
|
+
sapient_royal_mail_special_delivery_guaranteed_by_9am_750 = "SD4"
|
209
|
+
sapient_royal_mail_special_delivery_guaranteed_by_9am_1000 = "SD5"
|
210
|
+
sapient_royal_mail_special_delivery_guaranteed_by_9am_2500 = "SD6"
|
211
|
+
sapient_royal_mail_special_delivery_guaranteed_by_1pm_id_750 = "SDA"
|
212
|
+
sapient_royal_mail_special_delivery_guaranteed_by_1pm_id_1000 = "SDB"
|
213
|
+
sapient_royal_mail_special_delivery_guaranteed_by_1pm_id_2500 = "SDC"
|
214
|
+
sapient_royal_mail_special_delivery_guaranteed_by_9am_id_750 = "SDE"
|
215
|
+
sapient_royal_mail_special_delivery_guaranteed_by_9am_id_1000 = "SDF"
|
216
|
+
sapient_royal_mail_special_delivery_guaranteed_by_9am_id_2500 = "SDG"
|
217
|
+
sapient_royal_mail_special_delivery_guaranteed_by_1pm_age_750 = "SDH"
|
218
|
+
sapient_royal_mail_special_delivery_guaranteed_by_1pm_age_1000 = "SDJ"
|
219
|
+
sapient_royal_mail_special_delivery_guaranteed_by_1pm_age_2500 = "SDK"
|
220
|
+
sapient_royal_mail_special_delivery_guaranteed_by_9am_age_750 = "SDM"
|
221
|
+
sapient_royal_mail_special_delivery_guaranteed_by_9am_age_1000 = "SDN"
|
222
|
+
sapient_royal_mail_special_delivery_guaranteed_by_9am_age_2500 = "SDQ"
|
223
|
+
sapient_royal_mail_special_delivery_guaranteed_age_750 = "SDV"
|
224
|
+
sapient_royal_mail_special_delivery_guaranteed_age_1000 = "SDW"
|
225
|
+
sapient_royal_mail_special_delivery_guaranteed_age_2500 = "SDX"
|
226
|
+
sapient_royal_mail_special_delivery_guaranteed_id_750 = "SDY"
|
227
|
+
sapient_royal_mail_special_delivery_guaranteed_id_1000 = "SDZ"
|
228
|
+
sapient_royal_mail_special_delivery_guaranteed_id_2500 = "SEA"
|
229
|
+
sapient_royal_mail_special_delivery_guaranteed_750 = "SEB"
|
230
|
+
sapient_royal_mail_special_delivery_guaranteed_1000 = "SEC"
|
231
|
+
sapient_royal_mail_special_delivery_guaranteed_2500 = "SED"
|
232
|
+
sapient_royal_mail_1st_class_standard_signed_for_letters_daily_rate_service = "STL1"
|
233
|
+
sapient_royal_mail_2nd_class_standard_signed_for_letters_daily_rate_service = "STL2"
|
234
|
+
sapient_royal_mail_tracked_24_high_volume_signature_age = "TPA"
|
235
|
+
sapient_royal_mail_tracked_48_high_volume_signature_age = "TPB"
|
236
|
+
sapient_royal_mail_tracked_24_signature_age = "TPC"
|
237
|
+
sapient_royal_mail_tracked_48_signature_age = "TPD"
|
238
|
+
sapient_royal_mail_tracked_48_high_volume_signature_no_signature = "TPL"
|
239
|
+
sapient_royal_mail_tracked_24_high_volume_signature_no_signature = "TPM"
|
240
|
+
sapient_royal_mail_tracked_24_signature_no_signature = "TPN"
|
241
|
+
sapient_royal_mail_tracked_48_signature_no_signature = "TPS"
|
242
|
+
sapient_royal_mail_tracked_letter_boxable_48_high_volume_signature_no_signature = "TRL"
|
243
|
+
sapient_royal_mail_tracked_letter_boxable_24_high_volume_signature_no_signature = "TRM"
|
244
|
+
sapient_royal_mail_tracked_letter_boxable_24_signature_no_signature = "TRN"
|
245
|
+
sapient_royal_mail_tracked_letter_boxable_48_signature_no_signature = "TRS"
|
246
|
+
sapient_royal_mail_tracked_returns_24 = "TSN"
|
247
|
+
sapient_royal_mail_tracked_returns_48 = "TSS"
|
248
|
+
sapient_royal_mail_international_business_parcels_zero_sort_priority_WE = "WE1"
|
249
|
+
sapient_royal_mail_international_business_mail_large_letter_zero_sort_priority = "WG1"
|
250
|
+
sapient_royal_mail_international_business_mail_large_letter_zero_sort_priority_machine = "WG4"
|
251
|
+
sapient_royal_mail_international_business_mail_letters_zero_sort_priority = "WP1"
|
252
|
+
# fmt: on
|
253
|
+
|
254
|
+
@classmethod
|
255
|
+
def carrier(cls, value: str) -> dict:
|
256
|
+
return next((_ for _ in SAPIENT_CARRIERS if _["alias"] in value), None)
|
257
|
+
|
258
|
+
@classmethod
|
259
|
+
def carrier_code(cls, value: str) -> str:
|
260
|
+
return (cls.carrier(value) or {}).get("CarrierCode")
|
261
|
+
|
262
|
+
@classmethod
|
263
|
+
def carrier_alias(cls, value: str) -> str:
|
264
|
+
return (cls.carrier(value) or {}).get("alias")
|
265
|
+
|
266
|
+
|
267
|
+
class ShippingOption(lib.Enum):
|
268
|
+
"""Carrier specific options"""
|
269
|
+
|
270
|
+
# sapient_option = lib.OptionEnum("code")
|
271
|
+
sapient_CL1 = lib.OptionEnum("CL1", float)
|
272
|
+
sapient_CL2 = lib.OptionEnum("CL2", float)
|
273
|
+
sapient_CL3 = lib.OptionEnum("CL3", float)
|
274
|
+
sapient_CL4 = lib.OptionEnum("CL4", float)
|
275
|
+
sapient_CL5 = lib.OptionEnum("CL5", float)
|
276
|
+
sapient_signed = lib.OptionEnum("Signed", bool)
|
277
|
+
sapient_SMS = lib.OptionEnum("SMS", bool)
|
278
|
+
sapient_email = lib.OptionEnum("Email", bool)
|
279
|
+
sapient_localcollect = lib.OptionEnum("LocalCollect", bool)
|
280
|
+
sapient_customs_email = lib.OptionEnum("CustomsEmail")
|
281
|
+
sapient_customs_phone = lib.OptionEnum("CustomsPhone")
|
282
|
+
sapient_safeplace_location = lib.OptionEnum("Safeplace")
|
283
|
+
|
284
|
+
""" Custom options """
|
285
|
+
sapient_ebay_vtn = lib.OptionEnum("EbayVtn")
|
286
|
+
sapient_container_id = lib.OptionEnum("ContainerId")
|
287
|
+
sapient_business_transaction_type = lib.OptionEnum("BusinessTransactionType")
|
288
|
+
|
289
|
+
""" Unified Option type mapping """
|
290
|
+
insurance = sapient_CL1
|
291
|
+
signature_confirmation = sapient_signed
|
292
|
+
hold_at_location = sapient_localcollect
|
293
|
+
|
294
|
+
|
295
|
+
def shipping_options_initializer(
|
296
|
+
options: dict,
|
297
|
+
package_options: units.ShippingOptions = None,
|
298
|
+
) -> units.ShippingOptions:
|
299
|
+
"""
|
300
|
+
Apply default values to the given options.
|
301
|
+
"""
|
302
|
+
|
303
|
+
if package_options is not None:
|
304
|
+
options.update(package_options.content)
|
305
|
+
|
306
|
+
def items_filter(key: str) -> bool:
|
307
|
+
return key in ShippingOption # type: ignore
|
308
|
+
|
309
|
+
return units.ShippingOptions(options, ShippingOption, items_filter=items_filter)
|
310
|
+
|
311
|
+
|
312
|
+
class TrackingStatus(lib.Enum):
|
313
|
+
on_hold = ["on_hold"]
|
314
|
+
delivered = ["delivered"]
|
315
|
+
in_transit = ["in_transit"]
|
316
|
+
delivery_failed = ["delivery_failed"]
|
317
|
+
delivery_delayed = ["delivery_delayed"]
|
318
|
+
out_for_delivery = ["out_for_delivery"]
|
319
|
+
ready_for_pickup = ["ready_for_pickup"]
|
320
|
+
|
321
|
+
|
322
|
+
SAPIENT_CARRIERS = [
|
323
|
+
{
|
324
|
+
"CarrierCode": "DX",
|
325
|
+
"Name": "DX",
|
326
|
+
"Description": "DX – provides create shipment, print labels, print manifest, and view item tracking sent via the DX network.",
|
327
|
+
"alias": "dx",
|
328
|
+
},
|
329
|
+
{
|
330
|
+
"CarrierCode": "EVRI",
|
331
|
+
"Name": "EVRi",
|
332
|
+
"Description": "Produces labels for shipments sent via the Evri network.",
|
333
|
+
"alias": "evri",
|
334
|
+
},
|
335
|
+
{
|
336
|
+
"CarrierCode": "RM",
|
337
|
+
"Name": "Royal Mail",
|
338
|
+
"Description": "Produces labels, required documentation, billing management for shipments sent via the Royal Mail network.",
|
339
|
+
"alias": "royalmail",
|
340
|
+
},
|
341
|
+
{
|
342
|
+
"CarrierCode": "UPS",
|
343
|
+
"Name": "UPS",
|
344
|
+
"Description": "Provides shipping labels, tracking services, and comprehensive shipping solutions for shipments sent via the UPS network.",
|
345
|
+
"alias": "ups",
|
346
|
+
},
|
347
|
+
{
|
348
|
+
"CarrierCode": "YODEL",
|
349
|
+
"Name": "Yodel",
|
350
|
+
"Description": "Produces labels, PDF manifests, Pre-advice files for shipments sent via the Yodel network.",
|
351
|
+
"alias": "yodel",
|
352
|
+
},
|
353
|
+
]
|
354
|
+
|
355
|
+
CUSTOM_OPTIONS = [
|
356
|
+
ShippingOption.sapient_ebay_vtn.name,
|
357
|
+
ShippingOption.sapient_container_id.name,
|
358
|
+
ShippingOption.sapient_business_transaction_type.name,
|
359
|
+
]
|
360
|
+
|
361
|
+
SERVICES_DATA = [
|
362
|
+
["BF1", "HM Forces Mail"],
|
363
|
+
["BF2", "HM Forces Signed For"],
|
364
|
+
["BF7", "HM Forces Special Delivery (£500)"],
|
365
|
+
["BF8", "HM Forces Special Delivery (£1000)"],
|
366
|
+
["BF9", "HM Forces Special Delivery (£2500)"],
|
367
|
+
["BG1", "International Business Personal Correspondence Max Sort Residue (LL)"],
|
368
|
+
["BG2", "International Business Mail (LL) Max Sort Residue Standard"],
|
369
|
+
["BP1", "International Business Personal Correspondence Max Sort Residue (L)"],
|
370
|
+
["BP2", "International Business Mail (L) Max Sort Residue Standard"],
|
371
|
+
["BPI", "International Business Printed Matter Packet"],
|
372
|
+
["BPL1", "Royal Mail 1st Class"],
|
373
|
+
["BPL2", "Royal Mail 2nd Class"],
|
374
|
+
["BPR1", "Royal Mail 1st Class Signed For"],
|
375
|
+
["BPR2", "Royal Mail 2nd Class Signed For"],
|
376
|
+
["BXB", "International Business Parcel Priority Country Priced Boxable"],
|
377
|
+
["BXC", "International Business Parcel Tracked Country Priced Boxable Extra Comp"],
|
378
|
+
["BXD", "International Business Parcel Priority Country Priced Boxable DDP "],
|
379
|
+
["BXE", "International Business Parcel Tracked Country Priced Boxable DDP"],
|
380
|
+
["BXF", "International Business Parcel Tracked Country Priced Boxable"],
|
381
|
+
["CRL1", "Royal Mail 24 Standard/Signed For (Parcel - Daily Rate Service)"],
|
382
|
+
["CRL2", "Royal Mail 48 Standard/Signed For (Parcel - Daily Rate Service)"],
|
383
|
+
["DE4", "International Business Parcels Zero Sort Priority"],
|
384
|
+
["DE6", "International Business Parcels Zero Sort Priority"],
|
385
|
+
["DEA", "DE Import Standard 24 Parcel"],
|
386
|
+
["DEB", "DE Import Standard 24 Parcel"],
|
387
|
+
["DEC", "DE Import Standard 24 (LL)"],
|
388
|
+
["DED", "DE Import Standard 48 (LL)"],
|
389
|
+
["DEE", "DE Import to EU Tracked & Signed (LL)"],
|
390
|
+
["DEG", "DE Import to EU Max Sort (LL)"],
|
391
|
+
["DEI", "DE Import to EU Tracked Parcel"],
|
392
|
+
["DEJ", "DE Import to EU Tracked & Signed Parcel"],
|
393
|
+
["DEK", "DE Import to EU Tracked High Vol (LL)"],
|
394
|
+
["DEM", "DE Import to EU Max Sort Parcel"],
|
395
|
+
["DG4", "International Business Mail (LL) Country Priced Priority"],
|
396
|
+
["DP3", "International Business Personal Correspondence (L) Priority Untracked"],
|
397
|
+
["DP6", "International Business Mail (LL) Country Sort Priority"],
|
398
|
+
["DW1", "International Business Parcels"],
|
399
|
+
[
|
400
|
+
"ETA",
|
401
|
+
"International Business Parcels Tracked Country Priced Extra-Territorial Office of Exchange",
|
402
|
+
],
|
403
|
+
[
|
404
|
+
"ETB",
|
405
|
+
"International Business Parcels Tracked & Signed Country Priced Extra-Territorial Office of Exchange",
|
406
|
+
],
|
407
|
+
[
|
408
|
+
"ETC",
|
409
|
+
"International Business Parcels Zero Sort Priority Extra-Territorial Office of Exchange",
|
410
|
+
],
|
411
|
+
[
|
412
|
+
"ETD",
|
413
|
+
"International Business Mail Tracked (LL) Country Priced Extra-Territorial Office of Exchange",
|
414
|
+
],
|
415
|
+
[
|
416
|
+
"ETE",
|
417
|
+
"International Business Mail Tracked & Signed (LL) Country Priced Extra-Territorial Office of Exchange",
|
418
|
+
],
|
419
|
+
[
|
420
|
+
"ETF",
|
421
|
+
"International Business Mail (LL) Country Priced Priority Extra-Territorial Office of Exchange",
|
422
|
+
],
|
423
|
+
[
|
424
|
+
"ETG",
|
425
|
+
"International Tracked Parcels 0-30kg Extra-Territorial Office of Exchange - E",
|
426
|
+
],
|
427
|
+
[
|
428
|
+
"ETH",
|
429
|
+
"International Tracked Parcels 0-30kg Extra Comp Extra-Territorial Office of Exchange E",
|
430
|
+
],
|
431
|
+
[
|
432
|
+
"ETI",
|
433
|
+
"International Tracked Parcels 0-30kg Extra-Territorial Office of Exchange - C",
|
434
|
+
],
|
435
|
+
[
|
436
|
+
"ETJ",
|
437
|
+
"International Tracked Parcels 0-30kg Extra Comp Extra-Territorial Office of Exchange C",
|
438
|
+
],
|
439
|
+
[
|
440
|
+
"ETK",
|
441
|
+
"International Business Personal Correspondence (L) Priority Untracked Extra-Territorial Office of Exchange",
|
442
|
+
],
|
443
|
+
[
|
444
|
+
"ETL",
|
445
|
+
"International Business Personal Correspondence (L) Tracked High Vol. Country Priced Extra-Territorial Office of Exchange",
|
446
|
+
],
|
447
|
+
[
|
448
|
+
"ETM",
|
449
|
+
"International Business Personal Correspondence (L) Tracked & Signed High Vol. Country Priced Extra-Territorial Office of Exchange",
|
450
|
+
],
|
451
|
+
[
|
452
|
+
"ETN",
|
453
|
+
"International Business Personal Correspondence Signed (L) High Vol. Country Priced Extra-Territorial Office of Exchange",
|
454
|
+
],
|
455
|
+
[
|
456
|
+
"ETO",
|
457
|
+
"International Business Personal Correspondence (LL) Country Sort Priority Extra-Territorial Office of Exchange",
|
458
|
+
],
|
459
|
+
[
|
460
|
+
"ETP",
|
461
|
+
"International Business Personal Correspondence Tracked (LL) High Vol. Extra Comp Country Priced Extra-Territorial Office of Exchange",
|
462
|
+
],
|
463
|
+
[
|
464
|
+
"ETQ",
|
465
|
+
"International Business Personal Correspondence Tracked & Signed (LL) High Vol. Extra Comp Country Priced Extra-Territorial Office of Exchange",
|
466
|
+
],
|
467
|
+
[
|
468
|
+
"ETR",
|
469
|
+
"International Business Personal Correspondence Signed (LL) Extra Compensation Country Priced Extra-Territorial Office of Exchange",
|
470
|
+
],
|
471
|
+
["FS1", "Royal Mail 24 Standard/Signed For Large Letter (Flat Rate Service)"],
|
472
|
+
["FS2", "Royal Mail 48 Standard/Signed For Large Letter (Flat Rate Service)"],
|
473
|
+
["FS7", "Royal Mail 24 (Presorted) (LL)"],
|
474
|
+
["FS8", "Royal Mail 48 (Presorted) (LL)"],
|
475
|
+
["HVB", "International Tracked Parcels 0-30kg"],
|
476
|
+
["HVD", "International Business Tracked Express NPC"],
|
477
|
+
["HVE", "International Tracked Parcels 0-30kg Extra Comp"],
|
478
|
+
["HVK", "International Tracked Parcels 0-30kg C Prio"],
|
479
|
+
["HVL", "International Tracked Parcels 0-30kg XComp C Prio"],
|
480
|
+
["IE1", "International Business Parcels Zone Sort Priority Service"],
|
481
|
+
["IG1", "International Business Mail Large Letter Zone Sort Priority"],
|
482
|
+
["IG4", "International Business Mail Large Letter Zone Sort Priority Machine"],
|
483
|
+
["IP1", "International Business Mail Letters Zone Sort Priority"],
|
484
|
+
["ITA", "Import DE Tracked Returns 24"],
|
485
|
+
["ITB", "Import DE Tracked Returns 48"],
|
486
|
+
["ITC", "Import DE Tracked 24 Letter-boxable High Volume"],
|
487
|
+
["ITD", "Import DE Tracked 48 Letter-boxable High Volume"],
|
488
|
+
["ITE", "Import DE Tracked 48 Letter-boxable"],
|
489
|
+
["ITF", "Import DE Tracked 24 Letter-boxable"],
|
490
|
+
["ITL", "Import DE Tracked 48 High Volume"],
|
491
|
+
["ITM", "Import DE Tracked 24 High Volume"],
|
492
|
+
["ITN", "Import DE Tracked 24"],
|
493
|
+
["ITR", "DE Import to EU Signed Parcel"],
|
494
|
+
["ITS", "Import DE Tracked 48"],
|
495
|
+
["MB1", "International Business Parcels Print Direct Priority"],
|
496
|
+
["MB2", "International Business Parcels Print Direct Standard"],
|
497
|
+
["MP0", "International Business Parcels Signed Extra Compensation Country Priced"],
|
498
|
+
["MP1", "International Business Parcels Tracked Zone Sort"],
|
499
|
+
["MP4", "International Business Parcels Tracked Extra Comp Zone Sort"],
|
500
|
+
["MP5", "International Business Parcels Signed Zone Sort"],
|
501
|
+
["MP6", "International Business Parcels Signed Extra Compensation Zone Sort"],
|
502
|
+
["MP7", "International Business Parcels Tracked Country Priced"],
|
503
|
+
["MP8", "International Business Parcels Tracked Extra Comp Country Priced"],
|
504
|
+
["MP9", "International Business Parcels Signed Country Priced"],
|
505
|
+
["MPL", "International Business Mail Tracked High Vol. Country Priced"],
|
506
|
+
["MPM", "International Business Mail Tracked & Signed High Vol. Country Priced"],
|
507
|
+
["MPN", "International Business Mail Signed High Vol. Country Priced"],
|
508
|
+
["MPO", "International Business Mail Tracked High Vol. Extra Comp Country Priced"],
|
509
|
+
[
|
510
|
+
"MPP",
|
511
|
+
"International Business Mail Tracked & Signed High Vol. Extra Comp Country Priced",
|
512
|
+
],
|
513
|
+
["MPR", "International Business Parcel Tracked Boxable Country Priced"],
|
514
|
+
["MTA", "International Business Parcels Tracked & Signed Zone Sort"],
|
515
|
+
[
|
516
|
+
"MTB",
|
517
|
+
"International Business Parcels Tracked & Signed Extra Compensation Zone Sort",
|
518
|
+
],
|
519
|
+
["MTC", "International Business Mail Tracked & Signed Zone Sort"],
|
520
|
+
["MTE", "International Business Parcels Tracked & Signed Country Priced"],
|
521
|
+
[
|
522
|
+
"MTF",
|
523
|
+
"International Business Parcels Tracked & Signed Extra Compensation Country Priced",
|
524
|
+
],
|
525
|
+
["MTG", "International Business Mail Tracked & Signed Country Priced"],
|
526
|
+
["MTI", "International Business Mail Tracked Zone Sort"],
|
527
|
+
["MTK", "International Business Mail Tracked Country Priced"],
|
528
|
+
["MTM", "International Business Mail Signed Zone Sort"],
|
529
|
+
["MTO", "International Business Mail Signed Country Priced"],
|
530
|
+
["MTP", "International Business Mail Signed Extra Compensation Country Priced"],
|
531
|
+
["MTS", "International Business Parcels Tracked Direct Ireland Country"],
|
532
|
+
["MTV", "International Business Parcels Tracked & Signed DDP"],
|
533
|
+
["OLA", "International Standard On Account"],
|
534
|
+
["OLS", "International Economy On Account"],
|
535
|
+
["OSA", "International Signed On Account"],
|
536
|
+
["OSB", "International Signed On Account Extra Comp"],
|
537
|
+
["OTA", "International Tracked On Account"],
|
538
|
+
["OTB", "International Tracked On Account Extra Comp"],
|
539
|
+
["OTC", "International Tracked & Signed On Account"],
|
540
|
+
["OTD", "International Tracked & Signed On Account Extra Comp"],
|
541
|
+
["PK0", "Royal Mail 48 (LL) Flat Rate"],
|
542
|
+
["PK1", "Royal Mail 24 Standard/Signed For (Parcel - Sort8 - Flat Rate Service)"],
|
543
|
+
["PK2", "Royal Mail 48 Standard/Signed For (Parcel - Sort8 - Flat Rate Service)"],
|
544
|
+
["PK3", "Royal Mail 24 Standard/Signed For (Parcel - Sort8 - Daily Rate Service)"],
|
545
|
+
["PK4", "Royal Mail 48 Standard/Signed For (Parcel - Sort8 - Daily Rate Service)"],
|
546
|
+
["PK7", "Royal Mail 24 (Presorted) (P)"],
|
547
|
+
["PK8", "Royal Mail 48 (Presorted) (P)"],
|
548
|
+
["PK9", "Royal Mail 24 (LL) Flat Rate"],
|
549
|
+
["PKB", "RM24 (Presorted) (P) Annual Flat Rate"],
|
550
|
+
["PKD", "RM48 (Presorted) (P) Annual Flat Rate"],
|
551
|
+
["PKK", "RM48 (Presorted) (LL) Annual Flat Rate"],
|
552
|
+
["PKM", "RM24 (Presorted) (LL) Annual Flat Rate"],
|
553
|
+
["PPF1", "Royal Mail 24 Standard/Signed For (Packetpost- Flat Rate Service)"],
|
554
|
+
["PPF2", "Royal Mail 48 Standard/Signed For (Packetpost- Flat Rate Service)"],
|
555
|
+
["PPJ1", "Parcelpost Flat Rate (Annual)"],
|
556
|
+
["PPJ2", "Parcelpost Flat Rate (Annual)"],
|
557
|
+
["PPS", "RM24 (LL) Annual Flat Rate"],
|
558
|
+
["PPT", "RM48 (LL) Annual Flat Rate"],
|
559
|
+
["PS5", "International Business Personal Correspondence Max Sort (L)"],
|
560
|
+
["PS7", "International Business Mail Large Letter Max Sort Priority Service"],
|
561
|
+
["PSA", "International Business Mail Letters Max Sort Standard"],
|
562
|
+
["PSB", "International Business Mail Large Letter Max Sort Standard Service"],
|
563
|
+
["RM0", "Royal Mail 48 (Sort8)(P) Annual Flat Rate"],
|
564
|
+
["RM1", "Royal Mail 24 (LL) Daily Rate"],
|
565
|
+
["RM2", "Royal Mail 24 (P) Daily Rate"],
|
566
|
+
["RM3", "Royal Mail 48 (LL) Daily Rate"],
|
567
|
+
["RM4", "Royal Mail 48 (P) Daily Rate"],
|
568
|
+
["RM5", "Royal Mail 24 (P) Flat Rate"],
|
569
|
+
["RM6", "Royal Mail 48 (P) Flat Rate"],
|
570
|
+
["RM7", "Royal Mail 24 (SORT8) (LL) Annual Flat Rate"],
|
571
|
+
["RM8", "Royal Mail 24 (SORT8) (P) Annual Flat Rate"],
|
572
|
+
["RM9", "Royal Mail 48 (SORT8) (LL) Annual Flat Rate"],
|
573
|
+
["SD1", "Special Delivery Guaranteed By 1PM (£750)"],
|
574
|
+
["SD2", "Special Delivery Guaranteed By 1PM (£1000)"],
|
575
|
+
["SD3", "Special Delivery Guaranteed By 1PM (£2500)"],
|
576
|
+
["SD4", "Special Delivery Guaranteed By 9AM (£750)"],
|
577
|
+
["SD5", "Special Delivery Guaranteed By 9AM (£1000)"],
|
578
|
+
["SD6", "Special Delivery Guaranteed By 9AM (£2500)"],
|
579
|
+
["SDA", "Special Delivery Guaranteed By 1PM (ID) (£750)"],
|
580
|
+
["SDB", "Special Delivery Guaranteed By 1PM (ID) (£1000)"],
|
581
|
+
["SDC", "Special Delivery Guaranteed By 1PM (ID) (£2500)"],
|
582
|
+
["SDE", "Special Delivery Guaranteed By 9AM (ID) (£750)"],
|
583
|
+
["SDF", "Special Delivery Guaranteed By 9AM (ID) (£1000)"],
|
584
|
+
["SDG", "Special Delivery Guaranteed By 9AM (ID) (£2500)"],
|
585
|
+
["SDH", "Special Delivery Guaranteed By 1PM (AGE) (£750)"],
|
586
|
+
["SDJ", "Special Delivery Guaranteed By 1PM (AGE) (£1000)"],
|
587
|
+
["SDK", "Special Delivery Guaranteed By 1PM (AGE) (£2500)"],
|
588
|
+
["SDM", "Special Delivery Guaranteed By 9AM (AGE) (£750)"],
|
589
|
+
["SDN", "Special Delivery Guaranteed By 9AM (AGE) (£1000)"],
|
590
|
+
["SDQ", "Special Delivery Guaranteed By 9AM (AGE) (£2500)"],
|
591
|
+
["SDV", "Special Delivery Guaranteed (AGE) (£750)"],
|
592
|
+
["SDW", "Special Delivery Guaranteed (AGE) (£1000)"],
|
593
|
+
["SDX", "Special Delivery Guaranteed (AGE) (£2500)"],
|
594
|
+
["SDY", "Special Delivery Guaranteed (ID) (£750)"],
|
595
|
+
["SDZ", "Special Delivery Guaranteed (ID) (£1000)"],
|
596
|
+
["SEA", "Special Delivery Guaranteed (ID) (£2500)"],
|
597
|
+
["SEB", "Special Delivery Guaranteed (£750)"],
|
598
|
+
["SEC", "Special Delivery Guaranteed (£1000)"],
|
599
|
+
["SED", "Special Delivery Guaranteed (£2500)"],
|
600
|
+
["STL1", "Royal Mail 1st Class Standard/Signed For (Letters - Daily Rate service)"],
|
601
|
+
["STL2", "Royal Mail 2nd Class Standard/Signed For (Letters - Daily Rate service)"],
|
602
|
+
["TPA", "Tracked 24 High Volume Signature (AGE)"],
|
603
|
+
["TPB", "Tracked 48 High Volume Signature (AGE)"],
|
604
|
+
["TPC", "Tracked 24 Signature (AGE)"],
|
605
|
+
["TPD", "Tracked 48 Signature (AGE)"],
|
606
|
+
["TPL", "Tracked 48 High Volume Signature / No Signature"],
|
607
|
+
["TPM", "Tracked 24 High Volume Signature / No Signature"],
|
608
|
+
["TPN", "Tracked 24 Signature / No Signature"],
|
609
|
+
["TPS", "Tracked 48 Signature / No Signature"],
|
610
|
+
["TRL", "Tracked Letter-Boxable 48 High Volume Signature / No Signature"],
|
611
|
+
["TRM", "Tracked Letter-Boxable 24 High Volume Signature / No Signature"],
|
612
|
+
["TRN", "Tracked Letter-Boxable 24 Signature / No Signature"],
|
613
|
+
["TRS", "Tracked Letter-Boxable 48 Signature / No Signature"],
|
614
|
+
["TSN", "Tracked Returns 24"],
|
615
|
+
["TSS", "Tracked Returns 48"],
|
616
|
+
["WE1", "International Business Parcels Zero Sort Priority"],
|
617
|
+
["WG1", "International Business Mail Large Letter Zero Sort Priority"],
|
618
|
+
["WG4", "International Business Mail Large Letter Zero Sort Priority Machine"],
|
619
|
+
["WP1", "International Business Mail Letters Zero Sort Priority"],
|
620
|
+
]
|
621
|
+
|
622
|
+
DEFAULT_SERVICES = [
|
623
|
+
models.ServiceLevel(
|
624
|
+
service_name=__,
|
625
|
+
service_code=ShippingService.map(_).name_or_key,
|
626
|
+
carrier_service_code=_,
|
627
|
+
currency="GBP",
|
628
|
+
domicile=not "International" in __,
|
629
|
+
international="International" in __,
|
630
|
+
zones=[models.ServiceZone(rate=2.80)],
|
631
|
+
)
|
632
|
+
for _, __ in SERVICES_DATA
|
633
|
+
]
|
634
|
+
|
635
|
+
ShippingCarrier = lib.Enum(
|
636
|
+
"ShippingCarrier",
|
637
|
+
{carrier["alias"]: carrier["CarrierCode"] for carrier in SAPIENT_CARRIERS},
|
638
|
+
)
|