Komoot integration
Some of the health goals (e.g. "Fit in deiner Umgebung) are run in cooperation with an external partner, "komoot", offering the user access to route suggestions and the possibility to receive a trial komoot premium membership.
The following page offers an outline on how the integration is implemented.
Voucher assignement and redemption process
Komoot provides a CSV file with vouchers for AOK. They can be imported into the database using the following query:
\copy fedreg_k.komoot_vouchers\(voucher_code) FROM '[pathto]/[vouchers]csv' delimiter ',' CSV HEADER ;
Every user is eligible for a limited number of vouchers every year, defined in the helmchart of the mixedgoals service. If the user has not used his vouchers in the given calendar year yet, he can be assigned a voucher.
When the endpoint to assign a voucher is called, it is first checked if there is a voucher in the komoot_voucher db table with user_id
being assigned and reddem_tp
being null
, in which case this voucher is being returned. If this is not the case a voucher will be returned that has user_id, assigned_tp, redeemed_tp and removed_tp
equal to null
.
No direct communication between komoot and navida backend systems is possible. Also, komoot cannot provide a response for the navida app whether the voucher has been successfully redeemed. Instead of that, komoot provides AOK CSV files with assigned voucher codes, which can be used to update the komoot_voucher db table accordingly.
Kommot redirection URLs
-
https://komoot.com/de-de/discover/start_from_current_location/tours?sport=jogging&min_length=10000&max_length=15000&max_distance=10000&utm_source=aokplus&utm_medium=app&utm_campaign=find-routes
A URL to redirect the user to the komoot app/browser to search for route suggestions based on user's location, where:
- sport - the type of route to search for
- min_length - minimum length of the route [m]
- max_length - maximum length of the route [m]
- max_distance - max distance of the route from users location [m]
- utm_source, utm_medium, utm_campaign - parameters needed by komoot to identify the partnership
-
https://www.komoot.com/g?code=VOUCHERCODE&utm_source=aokplus&utm_medium=app&utm_campain=premium-trial
A URL to redirect the user to redeem the premium trial voucher, where:
- code - voucher code
- utm_source, utm_medium, utm_campain - same as above
Schema of the komoot_voucher table in the NAVIDA database
Data type | Default value | Notice | |
---|---|---|---|
id | NUMBER, PRIMARY KEY | NOT NULL | unique autoincremented number |
VOUCHER_CODE | VARCHAR, UNIQUE | NOT NULL | unique voucher code delivered by komoot |
ASSIGNED_TP | DATETIME | NULL | timestamp at which the voucher is assigned to the user |
REDEEM_TP | DATETIME | NULL | the date and time after the user used the voucher. (url voucher-redeemed was called) |
USER_ID | NUMBER, FOREIGN KEY to table user | NULL | the user which are redeemed the voucher code |
CREATED_TP | DATETIME | NOW() | timestamp at which the data record was created |
UPDATED_TP | DATETIME | NULL | timestamp at which the data record was updated |
DELETED_TP | DATETIME | NULL | timestamp at which the data record was deleted |