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

Refactor instant delivery provider to return new object structure #51

Closed
mirgj opened this issue Feb 14, 2022 · 2 comments
Closed

Refactor instant delivery provider to return new object structure #51

mirgj opened this issue Feb 14, 2022 · 2 comments
Labels
effort:medium Needs fair amount of effort to accomplish this task priority:medium This item will be prioritised over items with low priority refactor This item contains refactoring

Comments

@mirgj
Copy link
Contributor

mirgj commented Feb 14, 2022

Refactor instant delivery provider to return orders as list of segments that can also have mixed pick-up/drop-off. The same structure will be used for same day delivery

{
  jobId: '',
  driverId: '', // only for instant delivery
  driverIdentity: '', // only for instant delivery
  route: {
    distance: {
      value: 1152,
      unit: 'm', // meter
    },
    time: {
      value: 1160,
      unit: 'sec' //seconds
    },
    pointsEncoded: 'cxl_cBqwvnS|Dy@ogFyxmAf`IsnA|CjFzCsHluD_k@hi@ljL', //as per path polyline
  },
  segments: [
    {
      orderId: '',
      index: 1,
      from: { lat: 1, long: 2 },
      to: { lat: 1, long: 2 },
      segmentType: 'TO_ORIGIN',
      route: {
        distance: {
          value: 1152,
          unit: 'm', // meter
        },
        time: {
          value: 1160,
          unit: 'sec' //seconds
        },
        pointsEncoded: 'cxl_cBqwvnS|Dy@ogFyxmAf`IsnA|CjFzCsHluD_k@hi@ljL', //as per path polyline
      },
    },
    {
      orderId: '',
      index: 2,
      from: { lat: 1, long: 2 },
      to: { lat: 1, long: 2 },
      segmentType: 'TO_DESTINATION',
      route: {
        distance: {
          value: 478,
          unit: 'm', // meter
        },
        time: {
          value: 68,
          unit: 'sec' //seconds
        },
        pointsEncoded: '_p~iF~ps|U_ulLnnqC_mqNvxq`@, //as per path polyline
      },
    },
  ],
}
@mirgj mirgj added priority:medium This item will be prioritised over items with low priority refactor This item contains refactoring effort:medium Needs fair amount of effort to accomplish this task labels Feb 14, 2022
@mirgj mirgj changed the title Refactor instant delivery provider to return segments Refactor instant delivery provider to return new object structure Feb 14, 2022
@sperka
Copy link
Contributor

sperka commented Mar 20, 2022

closed by #107

@sperka sperka closed this as completed Mar 20, 2022
@mirgj
Copy link
Contributor Author

mirgj commented Mar 21, 2022

reopening since this has to track also the backend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:medium Needs fair amount of effort to accomplish this task priority:medium This item will be prioritised over items with low priority refactor This item contains refactoring
Projects
None yet
Development

No branches or pull requests

2 participants