Skip to content

Commit

Permalink
fix(carriers): update bol naming (#70)
Browse files Browse the repository at this point in the history
* Name change bol.com>bol

* changed api name back to bol.com

* made sure test run okay

* changed index spec file

* Added BolCom back, added deprecation comment

* added deprecated tag

* Fixed BolCom deprecation correctly in carriernames/ids

* fixed unit test

* docs: improve deprecation comments

---------

Co-authored-by: Edie Lemoine <[email protected]>
  • Loading branch information
Vincentvanleeuwen and EdieLemoine authored Oct 26, 2023
1 parent 8b8fe05 commit 6b8f28c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/__snapshots__/exports.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,7 @@ exports[`module exports > exposes the correct data from index 1`] = `
"7": "BolCom",
"8": "Ups",
"9": "DhlForYou",
"Bol": 7,
"BolCom": 7,
"Bpost": 2,
"CheapCargo": 3,
Expand All @@ -627,6 +628,7 @@ exports[`module exports > exposes the correct data from index 1`] = `
"Ups": 8,
},
"CarrierName": {
"Bol": "bol.com",
"BolCom": "bol.com",
"Bpost": "bpost",
"CheapCargo": "cheapcargo",
Expand Down
6 changes: 3 additions & 3 deletions src/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,10 @@ exports[`module exports > exposes the correct data from index 1`] = `
"4": "Dpd",
"5": "Instabox",
"6": "Dhl",
"7": "BolCom",
"7": "bol",
"8": "Ups",
"9": "DhlForYou",
"BolCom": 7,
"Bol": 7,
"Bpost": 2,
"CheapCargo": 3,
"Dhl": 6,
Expand All @@ -587,7 +587,7 @@ exports[`module exports > exposes the correct data from index 1`] = `
"Ups": 8,
},
"CarrierName": {
"BolCom": "bol.com",
"Bol": "bol.com",
"Bpost": "bpost",
"CheapCargo": "cheapcargo",
"Dhl": "dhl",
Expand Down
8 changes: 6 additions & 2 deletions src/types/carrier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export enum CarrierId {
Dpd = 4,
Instabox = 5,
Dhl = 6,
Bol = 7,
// @deprecated Use CarrierId.Bol instead. Will be removed in the next major version
BolCom = 7,
Ups = 8,
DhlForYou = 9,
Expand All @@ -21,6 +23,8 @@ export enum CarrierName {
Dpd = 'dpd',
Instabox = 'instabox',
Dhl = 'dhl',
Bol = 'bol.com',
// @deprecated Use CarrierName.Bol instead. Will be removed in the next major version
BolCom = 'bol.com',
Ups = 'ups',
DhlForYou = 'dhlforyou',
Expand All @@ -41,7 +45,7 @@ export const CARRIER_NAMES_TO_IDS = {
[CarrierName.Dpd]: CarrierId.Dpd,
[CarrierName.Instabox]: CarrierId.Instabox,
[CarrierName.Dhl]: CarrierId.Dhl,
[CarrierName.BolCom]: CarrierId.BolCom,
[CarrierName.Bol]: CarrierId.Bol,
[CarrierName.Ups]: CarrierId.Ups,
[CarrierName.DhlForYou]: CarrierId.DhlForYou,
[CarrierName.DhlParcelConnect]: CarrierId.DhlParcelConnect,
Expand All @@ -55,7 +59,7 @@ export const CARRIER_IDS_TO_NAMES = {
[CarrierId.Dpd]: CarrierName.Dpd,
[CarrierId.Instabox]: CarrierName.Instabox,
[CarrierId.Dhl]: CarrierName.Dhl,
[CarrierId.BolCom]: CarrierName.BolCom,
[CarrierId.Bol]: CarrierName.Bol,
[CarrierId.Ups]: CarrierName.Ups,
[CarrierId.DhlForYou]: CarrierName.DhlForYou,
[CarrierId.DhlParcelConnect]: CarrierName.DhlParcelConnect,
Expand Down

0 comments on commit 6b8f28c

Please sign in to comment.