amoraitis / TodoList

Simple todo-list app built with asp.net core mvc
MIT License
157 stars 126 forks source link

Add ability to show holidays in calendar view. #75

Open amoraitis opened 4 years ago

amoraitis commented 4 years ago

Is your feature request related to a problem? Please describe. The user will have the ability to import holidays as tasks to the monthly calendar view.

Describe the solution you'd like Add a new Model class under TodoList/TodoList.Core/Models/: This will need a new migration for the new UserPreferences table.

class UserPreferences
// In iso-3166 format. 1 for now. _In the future create a config value to support multiple countries._
+ UserId: Guid[Key. 1-1 relationship to ApplicationUser.Id]
+ HolidaysInCountry : string

Use Calendarific which offers 1000 free requests/month.

A clear and concise description of any alternative solutions or features you've considered.

Add an HttpClient. Preferably create an IHolidaysCalendarService interface and an implementation of that at HolidaysCalendarService. Investiagate what methods we will need.

Create front-end code that updates the preferences. In the Calendar view or in the user's account menu(add as user preferences tab). This will automatically attach all holidays when navigating to calendar if UserPreferences.HolidaysInCountries is not null in the DB. So, TodosController.Home() Action will also return a list of holidays to be presented. Prepare the View to show the new Data in the same way the existing TODOs do.

Additional context

Holidays response as documented here: Create this under TodoList/TodoList.Core/Responses/

namespace TodoList.Core.Responses
{
    using System;
    using System.Collections.Generic;

    using System.Globalization;
    using Newtonsoft.Json;
    using Newtonsoft.Json.Converters;

    public partial class HolidaysResponse
    {
        [JsonProperty("meta")]
        public Meta Meta { get; set; }

        [JsonProperty("response")]
        public Response Response { get; set; }
    }

    public partial class Meta
    {
        [JsonProperty("code")]
        public long Code { get; set; }
    }

    public partial class Response
    {
        [JsonProperty("holidays")]
        public Holiday[] Holidays { get; set; }
    }

    public partial class Holiday
    {
        [JsonProperty("name")]
        public string Name { get; set; }

        [JsonProperty("description")]
        public string Description { get; set; }

        [JsonProperty("date")]
        public Date Date { get; set; }

        [JsonProperty("type")]
        public string[] Type { get; set; }
    }

    public partial class Date
    {
        [JsonProperty("iso")]
        public DateTimeOffset Iso { get; set; }

        [JsonProperty("datetime")]
        public Datetime Datetime { get; set; }
    }

    public partial class Datetime
    {
        [JsonProperty("year")]
        public long Year { get; set; }

        [JsonProperty("month")]
        public long Month { get; set; }

        [JsonProperty("day")]
        public long Day { get; set; }
    }
}
gabrielatricak commented 4 years ago

Hi I would like to work on this. Can I be assigned to this?

amoraitis commented 4 years ago

Hi I would like to work on this. Can I be assigned to this?

Yes, thanks. Let me know if you have any questions.

gdhumal commented 3 years ago

Is this closed? I can have a look at it if it is still open?

amoraitis commented 3 years ago

Please take it @gdhumal

prasadtelkikar commented 2 years ago

@amoraitis , @gdhumal is this issue still open for contribution?

amoraitis commented 2 years ago

@amoraitis , @gdhumal is this issue still open for contribution?

@prasadtelkikar Yes, you can take it.

hc-codes commented 1 year ago

@amoraitis is this issue still open for contribution. If yes, can I get more information on what exactly is needed in terms of user experience.

amoraitis commented 12 months ago

@hc-codes Just a calendar view of tasks. You can generate the experience you like.

gabyslaw commented 6 months ago

Hi @amoraitis, Is this still open? if yes, can you assign to me, give me the details and assist check the this restcountries url as it seems to have broken.

If no, can I get a list of currently open issues that can be looked into.

Thanks.

amoraitis commented 4 months ago

Hi @amoraitis, Is this still open? if yes, can you assign to me, give me the details and assist check the this restcountries url as it seems to have broken.

If no, can I get a list of currently open issues that can be looked into.

Thanks.

@gabyslaw you can use an export from this url https://public.opendatasoft.com/explore/dataset/countries-codes/table/