No description
Find a file
2023-12-04 22:09:27 +01:00
cmd feat: Automatically deactivate the past events when generating new ones 2021-11-10 16:39:31 +01:00
.gitignore feat: first draft of config 2021-11-03 14:49:34 +01:00
config.example.toml feat: Read additional information from the config file 2021-11-09 13:58:21 +01:00
go.mod feat: Generate first set of Events 2021-11-07 17:45:21 +01:00
go.sum feat: Started Cobra Project, Parsing Config 2021-11-03 15:53:43 +01:00
main.go feat: Started Cobra Project, Parsing Config 2021-11-03 15:53:43 +01:00
README.md feat: Update documentation regarding deactivation 2021-11-10 16:39:42 +01:00
sauna-create-dates.sh added helper script for cron 2023-12-04 22:09:27 +01:00

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.