Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: actually allow saturday and sunday cutoff times per carrier #212

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/config/defaultConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ export const defaultConfiguration = (platform = DEFAULT_PLATFORM) => {
[CONFIG.DELIVERY_DAYS_WINDOW]: DEFAULT_DELIVERY_DAYS_WINDOW,
[CONFIG.DROP_OFF_DAYS]: [1, 2, 3, 4, 5],
[CONFIG.DROP_OFF_DELAY]: 0,
[CONFIG.SATURDAY_CUTOFF_TIME]: '16:00',
[CONFIG.SUNDAY_CUTOFF_TIME]: '15:30',

[CONFIG.PRICE_PACKAGE_TYPE_DIGITAL_STAMP]: DEFAULT_PRICE,
[CONFIG.PRICE_PACKAGE_TYPE_MAILBOX]: DEFAULT_PRICE,
Expand Down
9 changes: 9 additions & 0 deletions src/data/carrierFeatures.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const FEATURES_EVENING_DELIVERY = [
export const FEATURES_MONDAY_DELIVERY = [
CONFIG.ALLOW_MONDAY_DELIVERY,
CONFIG.SATURDAY_CUTOFF_TIME,
CONFIG.SUNDAY_CUTOFF_TIME,
];

/**
Expand Down Expand Up @@ -152,6 +153,14 @@ export const FEATURES_CUTOFF_TIME = [
CONFIG.CUTOFF_TIME,
];

export const FEATURES_SATURDAY_CUTOFF_TIME = [
CONFIG.SATURDAY_CUTOFF_TIME,
];

export const FEATURES_SUNDAY_CUTOFF_TIME = [
CONFIG.SUNDAY_CUTOFF_TIME,
];

/**
* Permission to have same day delivery.
*
Expand Down
2 changes: 2 additions & 0 deletions src/data/carriers/postNlCarrierConfiguration.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export class PostNlCarrierConfiguration extends AbstractCarrierConfiguration {
FEATURES.FEATURES_DROP_OFF_DAYS,
FEATURES.FEATURES_DROP_OFF_DELAY,
FEATURES.FEATURES_CUTOFF_TIME,
FEATURES.FEATURES_SUNDAY_CUTOFF_TIME,
FEATURES.FEATURES_SATURDAY_CUTOFF_TIME,
],
[SENDMYPARCEL]: [
FEATURES.FEATURES_DELIVERY,
Expand Down
4 changes: 2 additions & 2 deletions src/data/keys/configKeys.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ export const settingsWithCarrierOverride = [
ALLOW_SIGNATURE,
CUTOFF_TIME,
CUTOFF_TIME_SAME_DAY,
SUNDAY_CUTOFF_TIME,
SATURDAY_CUTOFF_TIME,
DELIVERY_DAYS_WINDOW,
DROP_OFF_DAYS,
DROP_OFF_DELAY,
Expand All @@ -125,6 +123,8 @@ export const settingsWithCarrierOverride = [
PRICE_SAME_DAY_DELIVERY,
PRICE_SIGNATURE,
PRICE_STANDARD_DELIVERY,
SATURDAY_CUTOFF_TIME,
SUNDAY_CUTOFF_TIME,
];

/**
Expand Down
1 change: 1 addition & 0 deletions src/data/locales/nl/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export const config = {
[CONFIG.LOCALE]: DEFAULT_LOCALE,
[CONFIG.ALLOW_MONDAY_DELIVERY]: true,
[CONFIG.SATURDAY_CUTOFF_TIME]: '16:00',
[CONFIG.SUNDAY_CUTOFF_TIME]: '15:30',
};
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ Object {
Array [
"allowMondayDelivery",
"saturdayCutoffTime",
"sundayCutoffTime",
],
Array [
"allowPickupLocations",
Expand All @@ -560,6 +561,12 @@ Object {
Array [
"cutoffTime",
],
Array [
"sundayCutoffTime",
],
Array [
"saturdayCutoffTime",
],
],
},
"getDefaultRequestParameters": Array [
Expand Down Expand Up @@ -598,6 +605,7 @@ Object {
Array [
"allowMondayDelivery",
"saturdayCutoffTime",
"sundayCutoffTime",
],
Array [
"allowPickupLocations",
Expand All @@ -622,6 +630,12 @@ Object {
Array [
"cutoffTime",
],
Array [
"sundayCutoffTime",
],
Array [
"saturdayCutoffTime",
],
],
}
`;
Expand Down
Loading