Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save blessed-tawanda/468e17aa1792c521141fcd1cb8177760 to your computer and use it in GitHub Desktop.
Save blessed-tawanda/468e17aa1792c521141fcd1cb8177760 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: {
          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