| cmd | ||
| .gitignore | ||
| config.example.toml | ||
| go.mod | ||
| go.sum | ||
| main.go | ||
| README.md | ||
| sauna-create-dates.sh | ||
Sauna-Create-Dates
This is a CLI to automatically generate Subevents in the Pretix-System. It also deactivates all events in the past.
Usage
./sauna-create-dates --date 2021-11-15
or give it a custom configuration file:
./sauna-create-dates --date 2021-11-15 --config ./config.toml
or just deactivate the past events:
./sauna-create-dates deactivate
to just generate the new events use:
./sauna-create-dates --date 2021-11-15 --no-deactivate
Configuration
The main configuration is done in a TOML-file (in $HOME/.sauna-create-dates.toml or in the path given by you)
The first block is general information about your pretix server:
[pretix]
api_key = "XXXXXXXX"
server = "https://XXXX"
organizer = "XXXXX"
You have to generate an API_Key and enter the root-URL of your Server. Additionally you have to enter the Slug (short-form) of the organizer.
Next is the Event-Block. Here you can generate subevents also for multiple events.
[events]
[events.<slug>]
start_time = "17h0m0s"
duration = "1h"
pause_time = "15m"
people_per_shift = 4
presale_start = 6 # days in advance
names = ["Saunagang leicht (💦)", "Saunagang mittel (💦💦)", "Saunagang stark (💦💦💦)"]
repeat = 2 # times
location = "HaDiKo, Haus K5, Kellergeschoss"
latitude = 49.01986
longitude = 8.423898
product_id = 7
For each event you want to create subevents for you have to create a new sub-block with the event slug of that event.
You have to define when you want to start your subevent series with the start_time.
The duration defines how long one sub event should last.
pause_time defines how long to wait after a subevent before starting the next one.
people_per_shift defines how many tickets are being sold per subevent.
presale_start defines how many days in advance the presale should start.
The names array defines what names the subevents get.
repeat defines how often the subevents, given via the name-Key, should be created.
In the end |names| \cdot repeat subevents will be created.
In the example given above, 6 subevents will be created.
location, latitude and longitude define additional information on where the subevents take place.
product_id defines the ID of the product that should be associated with that event.
API Key
The API Key needs the permission Can change event settings to create and deactivate the subevents and Can change product settings to create the quotas.