{
    "manifestVersion": "2.0",
    "routes": [
        {
            "type": "page",
            "path": "waves",
            "component": "fc.page",
            "nav": {
                "label": "i18n:fc.sf.ui.waves.index.nav",
                "icon": "store",
                "badge": {
                    "queryName": "fulfilments",
                    "variables": {
                        "fromLocation": {
                            "ref": "{{activeLocation.ref}}"
                        },
                        "status": [
                            "AWAITING_WAVE"
                        ]
                    }
                }
            },
            "props": {
                "title": "i18n:fc.sf.ui.waves.index.wavesList.title",
                "actions": {
                    "primary": [
                        {
                            "type": "userAction",
                            "label": "i18n:fc.sf.ui.wave.createWave.createWaveByExpiry",
                            "name": "CreateWaveByExpiry",
                            "extensions": {
                                "postSubmit": {
                                    "type": "navigate",
                                    "link": "/waves/{{wavesInProgress.edges.0.node.id}}"
                                }
                            }
                        },
                        {
                            "type": "userAction",
                            "label": "i18n:fc.sf.ui.wave.createWave.createWave",
                            "name": "WaveCreate",
                            "extensions": {
                                "postSubmit": {
                                    "type": "navigate",
                                    "link": "/waves/{{wavesInProgress.edges.0.node.id}}"
                                }
                            }
                        },
                        {
                            "type": "userAction",
                            "label": "i18n:fc.sf.ui.wave.createWave.createCustomWave",
                            "name": "CreateWaveByUserSelection",
                            "extensions": {
                                "action": {
                                    "type": "navigate",
                                    "link": "/waves/create"
                                }
                            }
                        }
                    ]
                }
            },
            "data": {
                "query": "query ($ordersAwaitingPickFromLocationRef: String!, $ordersAwaitingPickStatus: [String]!, $wavesInProgressLocationRef: String!, $_wavesInProgressStatus: [String]!, $wavesCompletedStatus: [String]!, $wavesCompletedUpdatedOn: DateTime!, $locationId: ID!) {  locationById(id: $locationId) {    ref  }  dashboardFulfilments: fulfilments(    first: 999    fromLocation: {ref: $ordersAwaitingPickFromLocationRef}    status: $ordersAwaitingPickStatus  ) {    edges {      node {        id      }    }    pageInfo {      hasNextPage    }  }  dashboardWavesInProgress: waves(    first: 999    processingLocation: {ref: $wavesInProgressLocationRef}    status: $_wavesInProgressStatus  ) {    edges {      node {        id      }    }    pageInfo {      hasNextPage    }  }  dashboardWavesCompleted: waves(    first: 999    processingLocation: {ref: $wavesInProgressLocationRef}    status: $wavesCompletedStatus    updatedOn: {from: $wavesCompletedUpdatedOn}  ) {    edges {      node {        id      }    }    pageInfo {      hasNextPage    }  }  fulfilments(    fromLocation: {ref: $ordersAwaitingPickFromLocationRef}    status: $ordersAwaitingPickStatus  ) {    edges {      node {        id        ref        order {          ref          totalPrice          customer {            firstName            lastName          }        }        expiryTime        deliveryType      }    }  }  wavesInProgress: waves(    processingLocation: {ref: $wavesInProgressLocationRef}    status: $_wavesInProgressStatus  ) {    edges {      node {        id        ref        status        location {          id          ref        }      }    }  }  wavesCompleted: waves(    processingLocation: {ref: $wavesInProgressLocationRef}    status: $wavesCompletedStatus    updatedOn: {from: $wavesCompletedUpdatedOn}  ) {    edges {      node {        id        ref        updatedOn        status        location {          id          ref        }      }    }    pageInfo {      hasNextPage    }  }  waveCreateSetting: settings(name: \"fc.mystique.store.feature.wave.create\") {    edges {      node {        lobValue      }    }  }}",
                "variables": {
                    "locationId": "{{activeLocation.id}}",
                    "ordersAwaitingPickFromLocationRef": "{{activeLocation.ref}}",
                    "ordersAwaitingPickStatus": [
                        "AWAITING_WAVE"
                    ],
                    "wavesInProgressLocationRef": "{{activeLocation.ref}}",
                    "_wavesInProgressStatus": [
                        "PICK",
                        "PACK",
                        "DISPATCH"
                    ],
                    "wavesCompletedStatus": [
                        "COMPLETE"
                    ],
                    "wavesCompletedUpdatedOn": "{{dateStringFormatter (dateAdd day=-1) 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]' _locale='en'}}"
                }
            },
            "descendants": [
                {
                    "component": "fc.dashboard.threshold",
                    "dataSource": "dashboardFulfilments",
                    "props": {
                        "label": "i18n:fc.sf.ui.waves.detail.dashboard.ordersAwaitingPick.title",
                        "value": "{{edges.length}}",
                        "thresholdLow": 1,
                        "thresholdHigh": 10,
                        "width": "third",
                        "link": "#/waves/list/awaiting-pick"
                    }
                },
                {
                    "component": "fc.dashboard.threshold",
                    "dataSource": "dashboardWavesInProgress",
                    "props": {
                        "label": "i18n:fc.sf.wave.inprogress.detail.title",
                        "value": "{{edges.length}}",
                        "thresholdLow": 1,
                        "thresholdHigh": 3,
                        "width": "third",
                        "link": "#/waves/list/in-progress"
                    }
                },
                {
                    "component": "fc.dashboard.threshold",
                    "dataSource": "dashboardWavesCompleted",
                    "props": {
                        "label": "i18n:fc.sf.wave.completed.detail.title",
                        "value": "{{edges.length}}",
                        "thresholdLow": 0,
                        "thresholdHigh": 1000000,
                        "width": "third",
                        "link": "#/waves/list/completed"
                    }
                },
                {
                    "component": "fc.tabs.card",
                    "props": {
                        "noCard": true,
                        "layouts": [
                            {
                                "label": "i18n:fc.sf.ui.waves.detail.dashboard.ordersAwaitingPick.title"
                            },
                            {
                                "label": "i18n:fc.sf.wave.inprogress.detail.title"
                            },
                            {
                                "label": "i18n:fc.sf.wave.completed.detail.title"
                            }
                        ]
                    },
                    "descendants": [
                        {
                            "component": "fc.list",
                            "dataSource": "fulfilments",
                            "props": {
                                "filter": {
                                    "enabled": true,
                                    "exclude": [
                                        "deliveryType",
                                        "eta"
                                    ]
                                },
                                "attributes": [
                                    {
                                        "label": "i18n:fc.sf.ui.waves.detail.list.fulfilments.column.customer.heading",
                                        "value": "{{node.order.customer.firstName}} {{node.order.customer.lastName}}"
                                    },
                                    {
                                        "label": "i18n:fc.sf.ui.waves.detail.list.fulfilments.column.order.heading",
                                        "value": "{{node.order.ref}}"
                                    },
                                    {
                                        "label": "i18n:fc.sf.ui.waves.detail.list.fulfilments.column.fulfilmentRef.heading",
                                        "value": "{{node.ref}}"
                                    },
                                    {
                                        "label": "i18n:fc.gql.order.items.totalPrice.label",
                                        "value": "{{node.order.totalPrice}}"
                                    },
                                    {
                                        "label": "i18n:fc.sf.ui.wave.index.card.create.list.column.timeRemaining.heading",
                                        "value": "{{relativeDateFromNow node.expiryTime}}"
                                    }
                                ]
                            }
                        },
                        {
                            "component": "fc.list",
                            "dataSource": "wavesInProgress",
                            "props": {
                                "filter": {
                                    "enabled": true,
                                    "exclude": [
                                        "workflowRef",
                                        "workflowVersion",
                                        "Name",
                                        "locationRef"
                                    ]
                                },
                                "attributes": [
                                    {
                                        "label": "i18n:fc.sf.ui.waves.index.list.column.id.heading",
                                        "value": "{{node.id}}",
                                        "link": "#/waves/{{node.id}}"
                                    },
                                    {
                                        "label": "i18n:fc.sf.ui.waves.index.list.column.ref.heading",
                                        "value": "{{node.ref}}"
                                    },
                                    {
                                        "label": "i18n:fc.sf.ui.waves.index.list.column.location.heading",
                                        "value": "{{node.location.ref}}"
                                    },
                                    {
                                        "label": "i18n:fc.sf.ui.waves.index.list.column.status.heading",
                                        "value": "{{node.status}}"
                                    }
                                ]
                            }
                        },
                        {
                            "component": "fc.list",
                            "dataSource": "wavesCompleted",
                            "props": {
                                "filter": {
                                    "enabled": true,
                                    "exclude": [
                                        "workflowRef",
                                        "workflowVersion",
                                        "status",
                                        "type",
                                        "locationRef",
                                        "updatedOn",
                                        "name"
                                    ]
                                },
                                "attributes": [
                                    {
                                        "label": "i18n:fc.sf.ui.waves.index.list.column.id.heading",
                                        "value": "{{node.id}}",
                                        "link": "#/waves/{{node.id}}"
                                    },
                                    {
                                        "label": "i18n:fc.sf.ui.waves.index.list.column.ref.heading",
                                        "value": "{{node.ref}}"
                                    },
                                    {
                                        "label": "i18n:fc.sf.ui.waves.index.list.column.location.heading",
                                        "value": "{{node.location.ref}}"
                                    },
                                    {
                                        "label": "i18n:fc.sf.ui.waves.index.list.column.status.heading",
                                        "value": "{{node.status}}"
                                    }
                                ]
                            }
                        }
                    ]
                },
                {
                    "component": "fc.page.refresh"
                }
            ]
        },
        {
            "type": "page",
            "path": "waves/:id",
            "fullScreen": true,
            "component": "fc.page.wizard",
            "props": {
                "title": "{{i18n \"fc.type.wave\"}} {{waveById.id}}",
                "actions": true,
                "closePath": "waves",
                "steps": [
                    {
                        "title": "i18n:fc.sf.ui.waves.wizard.step.pick.title",
                        "icon": "MdShoppingBasket",
                        "action": {
                            "name": "PickConfirmAndWaveComplete",
                            "config": {
                                "noSuccessMessage": false,
                                "extension": {
                                    "postSubmit": {
                                        "type": "navigate",
                                        "link": "pack"
                                    }
                                }
                            }
                        },
                        "condition": {
                            "value": "{{waveById.status}}",
                            "matches": "PICK"
                        },
                        "descendants": [
                            {
                                "component": "fc.page.section.header",
                                "descendants": [
                                    {
                                        "component": "fc.button.print.download",
                                        "props": {
                                            "label": "i18n:fc.sf.ui.waves.detail.action.pickList.download.label",
                                            "href": "/api/v4.1/wave/{{waveById.id}}/pickingList",
                                            "filename": "wave-picklist-{{waveById.id}}.pdf"
                                        }
                                    }
                                ]
                            },
                            {
                                "component": "fc.page.wizard.action",
                                "props": {
                                    "width": "full",
                                    "noCard": true
                                }
                            }
                        ]
                    }
                ]
            },
            "data": {
                "query": "query ($id: ID!) {  waveById(id: $id) {    id    ref    status    location {      id      ref    }  }}",
                "variables": {
                    "id": "{{params.id}}"
                }
            }
        },
        {
            "type": "page",
            "path": "waves/create",
            "fullScreen": true,
            "component": "fc.page.wizard",
            "props": {
                "actions": true,
                "closePath": "waves",
                "steps": [
                    {
                        "title": "i18n:fc.sf.ui.wave.createWave.createCustomWave",
                        "icon": "MdShoppingBasket",
                        "action": {
                            "name": "CreateWaveByUserSelection",
                            "config": {
                                "noSuccessMessage": false,
                                "extension": {
                                    "postSubmit": {
                                        "type": "navigate",
                                        "link": "/waves/{{wavesInProgress.edges.0.node.id}}"
                                    }
                                }
                            }
                        },
                        "descendants": [
                            {
                                "component": "fc.page.wizard.summary",
                                "props": {
                                    "noCard": true,
                                    "width": 5,
                                    "sticky": true
                                }
                            },
                            {
                                "component": "fc.page.wizard.action",
                                "props": {
                                    "width": 7
                                }
                            }
                        ]
                    }
                ]
            },
            "data": {
                "query": "query ($locationRef: String!, $status: [String]!, $locationId: ID!) { locationById(id: $locationId) { ref } wavesInProgress: waves(processingLocation: {ref: $locationRef}, status: $status) { edges { node { id ref status location { id ref } } } } }",
                "variables": {
                    "locationId": "{{activeLocation.id}}",
                    "locationRef": "{{activeLocation.ref}}",
                    "status": [
                        "PICK"
                    ]
                }
            }
        }
    ]
}