Skip to content

globallogicuki/trello-availability-microservices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

trello-interview-availability

This repository contains two Azure Functions used for working with our Trello availability cards

GetWeekStartDate.java

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

UpdateCardBody.java

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

A note on formatting

The format of a 'card' needs to be quite specific unfortunately as we have to serialise them into objects.

Debugging the function locally

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

Unit tests

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/*

Known Limitations

  1. Won't work for events which span more than one day

About

Two microservices used by Microsoft Flow for updating Trello cards

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages