Skip to content

Instantly share code, notes, and snippets.

@kudapara
Last active August 17, 2020 09:40
Show Gist options
  • Save kudapara/d80d7d0134ef5ae8a058e1f97896985c to your computer and use it in GitHub Desktop.
Save kudapara/d80d7d0134ef5ae8a058e1f97896985c to your computer and use it in GitHub Desktop.

Proposal for the new delivery system

  • Team backend. Can you please create endpoints with crud actions for deliveries.
  • The array bellow is an example of the collection of deliveries to be saved in the database.
  • These deliveries will be managed in tablero.
  • The deliveries will be scoped by realm

Checkout a demo of the new checkout

cons deliveries = [
  {
    title: "🌟 FreshNow delivery charge 🌟",
    description: "Deliver now (within 1 hour)",
    isAccountForHolders: true, //optional
    deliveryCities: [
      {
        Harare: {
          usingSuburbPricing: false,
          suburbs: [
            {
              name: 'Kambuzuma',
              prices: {
                'USD': 30,
                'ZWL': 3000
              }
            },
            {
              name: 'Belvedere',
              prices: {
                'USD': 5,
                'ZWL': 500
              }
            }
          ],
          prices: {
            'usd': 20,
            'pula': 100,
          },
          deliveryDays: {
            Monday: { from: "08:00", to: "14:00" },
            Tuesday: { from: "08:00", to: "14:00" },
            Wednesday: { from: "08:00", to: "14:00" },
            Thursday: { from: "08:00", to: "14:00" },
            Friday: { from: "08:00", to: "14:00" }
          },
          notAvailableDays: ["Saturday", "Sunday"],
          showCountDown: false,
          notAvailableTimes: [
            { from: "14:00", to: "23:00" },
            { from: "00:00", to: "09:00" }
          ], // will be overidden by the deliveryDays
          deliversIn: "2h", // only applies after a user selects the package during the valid time
          fixedDayDelivery: false,
          hoursBeforeOrderCanBeDelivered: 0
        }
      }
    ]
  }
]
@blessed-tawanda
Copy link

Proposal for the new delivery system

  • Team backend. Can you please create endpoints with crud actions for deliveries.
  • The array bellow is an example of the collection of deliveries to be saved in the database.
  • These deliveries will be managed in tablero.
  • The deliveries will be scoped by realm

Checkout a demo of the new checkout

cons deliveries = [
  {
    title: "🌟 FreshNow delivery charge 🌟",
    description: "Deliver now (within 1 hour)",
    isAccountForHolders: true, //optional
    deliveryCities: [
      {
        Harare: {
          prices: {
            'usd': 20,
            'pula': 100,
          },
          deliveryDays: {
            Monday: { from: "08:00", to: "14:00" },
            Tuesday: { from: "08:00", to: "14:00" },
            Wednesday: { from: "08:00", to: "14:00" },
            Thursday: { from: "08:00", to: "14:00" },
            Friday: { from: "08:00", to: "14:00" }
          },
          notAvailableDays: ["Saturday", "Sunday"],
          showCountDown: false,
          notAvailableTimes: [
            { from: "14:00", to: "23:00" },
            { from: "00:00", to: "09:00" }
          ], // will be overidden by the deliveryDays
          deliversIn: "2h", // only applies after a user selects the package during the valid time
          fixedDayDelivery: false,
          hoursBeforeOrderCanBeDelivered: 0
        }
      }
    ]
  },
  {
    title: "Platinum delivery charge",
    description: "Thursday 9 July",
    deliveryCities: [
      {
        Harare: {
          price: 8,
          deliveryDays: {
            Monday: { from: "08:00", to: "14:00" },
            Tuesday: { from: "08:00", to: "14:00" },
            Wednesday: { from: "08:00", to: "14:00" },
            Thursday: { from: "08:00", to: "14:00" },
            Friday: { from: "08:00", to: "14:00" }
          },
          notAvailableDays: [],
          showCountDown: false,
          notAvailableTimes: [], // will be overidden by the deliveryDays
          deliversIn: "24h", // only applies after a user selects the package during the valid time
          fixedDayDelivery: false,
          hoursBeforeOrderCanBeDelivered: 0
        }
      },
      {
        Norton: {
          price: 6,
          deliveryDays: { Thursday: { from: "08:00", to: "14:00" } },
          notAvailableDays: ["Monday"],
          showCountDown: false,
          notAvailableTimes: [], // will be overidden by the deliveryDays
          deliversIn: "24h", // only applies after a user selects the package during the valid time
          fixedDayDelivery: false,
          hoursBeforeOrderCanBeDelivered: 24
        }
      },
      {
        Kwekwe: {
          price: 6,
          deliveryDays: { Monday: { from: "08:00", to: "14:00" } },
          notAvailableDays: ["Monday"],
          showCountDown: false,
          notAvailableTimes: [], // will be overidden by the deliveryDays
          deliversIn: "24h", // only applies after a user selects the package during the valid time
          fixedDayDelivery: false,
          hoursBeforeOrderCanBeDelivered: 24
        }
      },
      {
        Gweru: {
          price: 8,
          deliveryDays: { Thursday: { from: "08:00", to: "14:00" } },
          notAvailableDays: [],
          showCountDown: false,
          notAvailableTimes: [], // will be overidden by the deliveryDays
          deliversIn: "24h", // only applies after a user selects the package during the valid time
          fixedDayDelivery: false,
          hoursBeforeOrderCanBeDelivered: 24
        }
      }
    ]
  },
  {
    title: "Priority delivery charge",
    description: "Friday 10 July",
    deliveryCities: [
      {
        Harare: {
          price: 5,
          deliveryDays: {
            Monday: { from: "08:00", to: "14:00" },
            Tuesday: { from: "08:00", to: "14:00" },
            Wednesday: { from: "08:00", to: "14:00" },
            Thursday: { from: "08:00", to: "14:00" },
            Friday: { from: "08:00", to: "14:00" }
          },
          notAvailableDays: [],
          showCountDown: false,
          notAvailableTimes: [], // will be overidden by the deliveryDays
          deliversIn: "48h", // only applies after a user selects the package during the valid time
          fixedDayDelivery: false,
          hoursBeforeOrderCanBeDelivered: 0
        }
      },
      {
        Norton: {
          price: 11,
          deliveryDays: { Thursday: { from: "08:00", to: "14:00" } },
          notAvailableDays: [],
          showCountDown: false,
          notAvailableTimes: [], // will be overidden by the deliveryDays
          deliversIn: "48h", // only applies after a user selects the package during the valid time
          fixedDayDelivery: false,
          hoursBeforeOrderCanBeDelivered: 24
        }
      },
      {
        Kwekwe: {
          price: 12,
          deliveryDays: { Wednesday: { from: "08:00", to: "14:00" } },
          notAvailableDays: [],
          showCountDown: false,
          notAvailableTimes: [], // will be overidden by the deliveryDays
          deliversIn: "48h", // only applies after a user selects the package during the valid time
          fixedDayDelivery: false,
          hoursBeforeOrderCanBeDelivered: 12
        }
      },
      {
        Gweru: {
          price: 12,
          deliveryDays: { Thursday: { from: "08:00", to: "14:00" } },
          notAvailableDays: [],
          showCountDown: false,
          notAvailableTimes: [], // will be overidden by the deliveryDays
          deliversIn: "48h", // only applies after a user selects the package during the valid time
          fixedDayDelivery: false,
          hoursBeforeOrderCanBeDelivered: 24
        }
      }
    ]
  },
  {
    title: "Free Delivery (Harare)",
    description: "Friday 10 July",
    deliveryCities: [
      {
        Harare: {
          price: 0,
          deliveryDays: {
            Monday: { from: "08:00", to: "14:00" },
            Tuesday: { from: "08:00", to: "14:00" },
            Wednesday: { from: "08:00", to: "14:00" },
            Thursday: { from: "08:00", to: "14:00" },
            Friday: { from: "08:00", to: "14:00" }
          },
          notAvailableDays: [],
          showCountDown: false,
          notAvailableTimes: [], // will be overidden by the deliveryDays
          deliversIn: "72h", // only applies after a user selects the package during the valid time
          fixedDayDelivery: false,
          hoursBeforeOrderCanBeDelivered: 0
        }
      }
    ]
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment