Adds SFRA 6.0

This commit is contained in:
Isaac Vallee
2021-12-21 10:57:31 -08:00
parent d04eb5dd16
commit 823c7608c3
1257 changed files with 137087 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
function getCurrentBasket() {
return {
defaultShipment: {
shippingAddress: {
firstName: 'Amanda',
lastName: 'Jones',
address1: '65 May Lane',
address2: '',
city: 'Allston',
postalCode: '02135',
countryCode: { value: 'us' },
phone: '617-555-1234',
stateCode: 'MA',
setFirstName: function (firstNameInput) { this.firstName = firstNameInput; },
setLastName: function (lastNameInput) { this.lastName = lastNameInput; },
setAddress1: function (address1Input) { this.address1 = address1Input; },
setAddress2: function (address2Input) { this.address2 = address2Input; },
setCity: function (cityInput) { this.city = cityInput; },
setPostalCode: function (postalCodeInput) { this.postalCode = postalCodeInput; },
setStateCode: function (stateCodeInput) { this.stateCode = stateCodeInput; },
setCountryCode: function (countryCodeInput) { this.countryCode.value = countryCodeInput; },
setPhone: function (phoneInput) { this.phone = phoneInput; }
}
},
totalGrossPrice: {
value: 250.00
}
};
}
module.exports = {
getCurrentBasket: getCurrentBasket
};

View File

@@ -0,0 +1,73 @@
var ArrayList = require('../../../mocks/dw.util.Collection');
var defaultShippingMethod =
{
description: 'Order received within 7-10 business days',
displayName: 'Ground',
ID: '001',
custom: {
estimatedArrivalTime: '7-10 Business Days'
}
};
function createShipmentShippingModel() {
return {
applicableShippingMethods: new ArrayList([
{
description: 'Order received within 7-10 business days',
displayName: 'Ground',
ID: '001',
custom: {
estimatedArrivalTime: '7-10 Business Days'
}
},
{
description: 'Order received in 2 business days',
displayName: '2-Day Express',
ID: '002',
shippingCost: '$0.00',
custom: {
estimatedArrivalTime: '2 Business Days'
}
}
]),
getApplicableShippingMethods: function () {
return new ArrayList([
{
description: 'Order received within 7-10 business days',
displayName: 'Ground',
ID: '001',
custom: {
estimatedArrivalTime: '7-10 Business Days'
}
},
{
description: 'Order received in 2 business days',
displayName: '2-Day Express',
ID: '002',
shippingCost: '$0.00',
custom: {
estimatedArrivalTime: '2 Business Days'
}
}
]);
},
getShippingCost: function () {
return {
amount: {
valueOrNull: 7.99
}
};
}
};
}
module.exports = {
getDefaultShippingMethod: function () {
return defaultShippingMethod;
},
getShipmentShippingModel: function (shipment) {
return createShipmentShippingModel(shipment);
}
};