Skip to content

Commit

Permalink
feat(deliveryType): support UPS express delivery type (#124)
Browse files Browse the repository at this point in the history
Fixes INT-659
  • Loading branch information
FreekVR authored Nov 18, 2024
1 parent 2427222 commit d7d3513
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/__snapshots__/exports.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -658,9 +658,11 @@ exports[`module exports > exposes the correct data from index 1`] = `
"2": "standard",
"3": "evening",
"4": "pickup",
"7": "express",
},
"DELIVERY_TYPE_NAMES_TO_IDS": {
"evening": 3,
"express": 7,
"morning": 1,
"pickup": 4,
"standard": 2,
Expand All @@ -670,13 +672,16 @@ exports[`module exports > exposes the correct data from index 1`] = `
"2": "Standard",
"3": "Evening",
"4": "Pickup",
"7": "Express",
"Evening": 3,
"Express": 7,
"Morning": 1,
"Pickup": 4,
"Standard": 2,
},
"DeliveryTypeName": {
"Evening": "evening",
"Express": "express",
"Morning": "morning",
"Pickup": "pickup",
"Standard": "standard",
Expand Down
5 changes: 5 additions & 0 deletions src/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,11 @@ exports[`module exports > exposes the correct data from index 1`] = `
"2": "standard",
"3": "evening",
"4": "pickup",
"7": "express",
},
"DELIVERY_TYPE_NAMES_TO_IDS": {
"evening": 3,
"express": 7,
"morning": 1,
"pickup": 4,
"standard": 2,
Expand All @@ -628,13 +630,16 @@ exports[`module exports > exposes the correct data from index 1`] = `
"2": "Standard",
"3": "Evening",
"4": "Pickup",
"7": "Express",
"Evening": 3,
"Express": 7,
"Morning": 1,
"Pickup": 4,
"Standard": 2,
},
"DeliveryTypeName": {
"Evening": "evening",
"Express": "express",
"Morning": "morning",
"Pickup": "pickup",
"Standard": "standard",
Expand Down
4 changes: 4 additions & 0 deletions src/types/deliveryType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export enum DeliveryTypeId {
Standard = 2,
Evening = 3,
Pickup = 4,
Express = 7,
}

/** @see https://myparcelnl.github.io/api/#6_A_2 */
Expand All @@ -14,6 +15,7 @@ export enum DeliveryTypeName {
Standard = 'standard',
Evening = 'evening',
Pickup = 'pickup',
Express = 'express',
}

export type DeliveryTypeNameOrId = DeliveryTypeName | DeliveryTypeId;
Expand All @@ -27,11 +29,13 @@ export const DELIVERY_TYPE_NAMES_TO_IDS = {
[DeliveryTypeName.Standard]: DeliveryTypeId.Standard,
[DeliveryTypeName.Evening]: DeliveryTypeId.Evening,
[DeliveryTypeName.Pickup]: DeliveryTypeId.Pickup,
[DeliveryTypeName.Express]: DeliveryTypeId.Express,
} as const;

export const DELIVERY_TYPE_IDS_TO_NAMES = {
[DeliveryTypeId.Morning]: DeliveryTypeName.Morning,
[DeliveryTypeId.Standard]: DeliveryTypeName.Standard,
[DeliveryTypeId.Evening]: DeliveryTypeName.Evening,
[DeliveryTypeId.Pickup]: DeliveryTypeName.Pickup,
[DeliveryTypeId.Express]: DeliveryTypeName.Express,
} as const;

0 comments on commit d7d3513

Please sign in to comment.