Refactor 'PeriodInfo' data type
Currently PeriodInfo data type on backend is represented by sum of records. It is not type safe and can produce runtime errors. It would be better to create a separate data type which contains specific data for each period kind and use it in the PeriodInfo.