Search…
Air Discount Scheme

About

Generates discount codes that can be used for booking domestic flights online.
There are certain precondition to be eligible for a discount. They are:
  • The person's legal domicile needs to be in a predefined set of towns outside
    the capital (We fetch postal codes from Þjóðskrá to validate if user is
    eligible).

URLs

API

The API is used by airlines to verify the discount code validity and get basic booking info about the user.
The airlines that have access to this api are Icelandair, Ernir and Norlandair. Historically some flights were booked for Norlandair through Icelandair, those flights are marked with the Icelandair airline but have a cooperation field with Norlandair.
1
yarn start air-discount-scheme-api
Copied!

Backend

The admin frontend has a view over the bookings that have been registered in the system. This is mainly for Vegagerðin.
Admin
1
yarn start air-discount-scheme-backend
Copied!

Web

The user frontend has information about the initiative, legal terms and a way for users to get their discount codes.
Dev
1
yarn start air-discount-scheme-web
Copied!

Integrations

  • Þjóðskrá: To be able to verify the persons legal domicile,
    give the airlines basic information about the person and fetch a persons
    relations to show the discount codes for related children.

Development

To get started developing this project, go ahead and:
  1. 1.
    Fetch the environment secrets:
1
yarn get-secrets air-discount-scheme --reset
Copied!
  1. 1.
    Start the resources with docker-compose:
1
docker-compose -f apps/air-discount-scheme/backend/docker-compose.base.yml -f apps/air-discount-scheme/backend/docker-compose.dev.yml up
Copied!
  1. 1.
    Start the front end:
1
yarn start air-discount-scheme-web
Copied!
  1. 1.
    Start the graphql api:
1
yarn start air-discount-scheme-api
Copied!
  1. 1.
    Start the backend api:
1
yarn start air-discount-scheme-backend
Copied!
Navigate to localhost:4200 for the website or localhost:4248/api/swagger/ for the airline api.

Admin

To access the Admin UI, you'll need to add your Icelandic National ID to the comma separated environment variable DEVELOPERS (.env.secret) and restart the api.
1
export DEVELOPERS=1234567890
Copied!

Shortcuts

Because of the short timeline this assignment had, there were few shortcuts taken that can be improved upon:
  • The authentication is pretty primitive, the IDP is still in development at
    the time of this writing so we needed to use static api keys.
  • The deployment pipeline is outside of the islandis main pipeline.
  • The graphql api is separate of the main graphql api of islandis.

Project owner

Code owners and maintainers

Last modified 8mo ago