This repository contains two Azure Functions used for working with our Trello availability cards
This is a pretty straightforward service which takes a timestamp as formated by Outlook and returns a textual format for the Monday of that week. For example:
2019-03-24T10:30:00.0000000+00:00
Would return
Monday 18th
This is a slightly more complex function, it accepts the body of a card from Trello that looks something like:
Monday
08:30 - 09:00
09:00 - 09:30
Tuesday
08:30 - 09:00
09:00 - 09:30
Wednesday
08:30 - 09:00
09:00 - 09:30
Thursday
08:30 - 09:00
09:00 - 09:30
Friday
08:30 - 09:00
09:00 - 09:30
and a few details from a calendar event; startTime, endTime and Subject.
The Function will then return an updated card with any overlapping times removed. For example if we took the above example and an Outlook event which had a startTime of Monday 09:00 and end Time Monday 09:25. The card would be returned updated with the 09:00 - 09:30 slot removed.
Monday
08:30 - 09:00
Tuesday
08:30 - 09:00
09:00 - 09:30
Wednesday
08:30 - 09:00
09:00 - 09:30
Thursday
08:30 - 09:00
09:00 - 09:30
Friday
08:30 - 09:00
09:00 - 09:30
The format of a 'card' needs to be quite specific unfortunately as we have to serialise them into objects.
Once you've followed the pre-requisites here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-first-java-maven you can debug the function on your machine
mvn clean package
mvn azure-functions:run
These functions were written using Test Driven Development, unit tests are probably the best way to understand how the code works - see src/test/java/com/function/*
- Won't work for events which span more than one day