UNPKG

@springtree/eva-core

Version:
102 lines (89 loc) 3.83 kB
declare module EVA.Carrier.Paazl { export namespace Errors { export namespace Paazl { export const ShippingMethodNotConfigured = 'Paazl:ShippingMethodNotConfigured'; export const MissingShippingAddress = 'Paazl:MissingShippingAddress'; export const InvalidShippingOption = 'Paazl:InvalidShippingOption'; export const SelectAddress = 'Paazl:SelectAddress'; export const InvalidAddress = 'Paazl:InvalidAddress'; export const SelectDeliveryDate = 'Paazl:SelectDeliveryDate'; export const InvalidDeliveryDate = 'Paazl:InvalidDeliveryDate'; } } export interface PaazlGetShippingOptionsForOrderResponse { Result: PaazlShippingOption[]; Error: EVA.Core.ServiceError; } export interface PaazlShippingOption { Type: string; Carrier: string; Description: string; Price?: number; DisplayPrice?: number; PartOfDay: string; DayOfWeek: string; DeliveryDateDetails: PaazlDeliveryDateDetail[]; Addresses: PaazlShippingAddress[]; ShippingMethod: EVA.Core.ShippingMethodDto; } export interface PaazlDeliveryDateDetail { Day?: string; Period: PaazlPeriod; } export interface PaazlPeriod { From?: string; Till?: string; } export interface PaazlShippingAddress { Type: string; Code: string; StreetAndHouseNumber: string; ZipCode: string; City: string; CountryID: string; Latitude?: number; Longitude?: number; Distance?: number; Price?: number; DisplayPrice?: number; AdditionalInfo: string; OpeningHours: PaazlOpeningHours[]; } export interface PaazlOpeningHours { DayOfWeek: number; AlwaysOpen: boolean; Period: PaazlPeriod; } /** * Returns a list of the available shipping options configured in Paazl, taking an `OrderID`. The related order needs to have a Shipping Address * set. The parameter `ExtendedDeliveryDateDetails` toggles the `Period` value contents of the `DeliveryDateDetails` property in the response. * * This data should be presented to the user, so that a choice can be made between the available options. When the option represents a * "pick-up point", the user should additionally be able to select the desired address for delivery, of which the available options are also * included in above return data. * * :watch: Any `Day` mentioned is a date without time, and so it's timezone is irrelevant. Any `From` and `Till` time is in local time to the * receipient or pick-up point, and needs to be presented to the user and saved with the `PaazlUpdateShippingOptionsForOrder` without any timezone * conversion. */ export interface PaazlGetShippingOptionsForOrder { OrderID: number; ExtendedDeliveryDateDetails: boolean; } /** * The user choice should be passed to the `PaazlUpdateShippingOptionsForOrder` service, using the same OrderID as before, and the selected * `PaazlShippingOption` as previously returned by the first service. When not using a pickup point service, leave the `Address` array empty when * returning it. When using a pickup point service, return the array with a single element. * * This service is a wrapper around various other services; * * * `SetShippingMethod` service to set the entire order to specified shipping method (property `Type` will be mapped to an EVA shipping method) * * `UpdateOrderAddresses` service to set the pickup point address as `ShippingAddress` (in case of a pickup point selection) * * `SetDeliveryOrderData` service to store the additional delivery data for the order * * And it will recalculate the shipping costs, based on this new selection */ export interface PaazlUpdateShippingOptionsForOrder { OrderID: number; ShippingOption?: PaazlShippingOption; } }