#ifndef CALCULATE_PARKING_TICKETS_GLOBAL_H
#define CALCULATE_PARKING_TICKETS_GLOBAL_H

#include <QtCore/qglobal.h>

#if defined(CALCULATE_PARKING_TICKETS_LIBRARY)
#  define CALCULATE_PARKING_TICKETS_EXPORT Q_DECL_EXPORT
#else
#  define CALCULATE_PARKING_TICKETS_EXPORT Q_DECL_IMPORT
#endif

#include <cinttypes>
#include <ctime>

typedef time_t minute_t;

typedef struct price_t {
    uint32_t units;
    double netto;
    double brutto;
    double vat_percentage;
    double vat;
    bool valid;
} price_t;

static constexpr uint16_t const MIN_PER_DAY = 1440;
static constexpr uint16_t const MINUTES_PER_DAY = 1440;
static constexpr uint32_t const SECS_PER_DAY = 1440*60;

//struct TariffLine {
//    uint32_t line;
    // obere 11 bit: 2 bit week, 3 bit day, 11 bit minute
//};

struct TariffMinute {
    uint32_t price_units;
    uint32_t next_minute;
};

static constexpr uint16_t const WEEKS = 3;
static constexpr uint16_t const DAYS = 7;

static constexpr uint32_t const MAX_OFFSET = (uint32_t)sizeof(TariffMinute[3][7][1440]);
static constexpr uint32_t const UNDEFINED_NEXT_MINUTE = MAX_OFFSET;


#endif // CALCULATE_PARKING_TICKETS_GLOBAL_H
