Capacity planner block
An Airtable Block which helps you plan how to allocate capacity from consumers to producers, and create a schedule of.
An airtable what?
An Airtable Block is a custom, resuable web application that you can run inside of an Airtable base to visualize, manipulate and process data from that base.
Terminology
- consumer - an entity described by: "name" (a string value), "need" (an integer value), and "times" (one or more day-of-week/time-of-day pairs)
- producer - an entity described by: "name" (a string value), "capacity" (an integer value), "price" (a floating point number), and "times" (one or more day-of-week/time-of-day pairs)
- shift - a day of the week and a meal time, e.g. "Tuesday lunch"
This block was initially developed for use by volunteer organizers during the covid-19 pandemic to plan weekly schedules for meal deliveries from restaurants to hospitals. In this context, "consumers" were hospitals with delivery times and "producers" were restaurants with shifts. Capacity in this context was measured in the number of meals a restaurants could deliver to a hospital.
Time zones
This application interprets all dates in terms of Coordinated Universal Time (UTC).
How to run this block
- Duplicate the Capacity Planning Example Base.
- Create a new custom block your new base.
- Clone this repository and install the block CLI.
- Instead of running
block init
add runblock remote-add <KEY_FROM_INIT> <YOUR_REMOTE_NAME>
to be able to develop this block on your copy of the example base. - From the root of your new block, run
block run --remote <YOUR_REMOTE_NAME>
. - Paste the uri that it gives you into the 'edit block' input back on airtable.com.
How to run the automated tests
After cloning this repository, install the dependencies with the following command:
npm install
Then, execute the following command to run the tests:
npm test
If you want to use a debugger chrome://inspect/ and click "Open dedicated
DevTools for Node" and then run node --inspect --experimental-modules $(npm bin)/_mocha --ui tdd test
.
How to release this block
In order to deploy the code to the Blocks running on airtable.com, project maintainers should follow these steps:
-
Obtain the appropriate Airtable Custom Block configuration file(s) which describe the Block instances which are intended to be updated
-
Merge the Git repository's
dev
branch into themain
branch. This can be done with the following commands:git checkout main git merge --no-ff dev
-
Create a Git tag for the merge commit. For instance, to create a Git tag named "x.x.x", run the following command:
git tag x.x.x
-
Push the new tag to the remote repository. For instance, to push a Git tag named "x.x.x" to a remote named "upstream", run the following command:
git push upstream x.x.x
-
Use the process which is documented on the Airtable.com Block developer guide for deploying the Block
Conduct
All contributors are expected to adhere to the project's code of conduct,
available in the file named CODE_OF_CONDUCT.md
.
License
Copyright 2020 Bocoup under the MIT Expat license.