Fleshed out the table storage service and started syncing logic
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Storage
|
||||
namespace Habitica.Todoist.Integration.Model.Storage.Enum
|
||||
{
|
||||
public enum TodoAction
|
||||
{
|
||||
@@ -2,7 +2,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Storage
|
||||
namespace Habitica.Todoist.Integration.Model.Storage.Enum
|
||||
{
|
||||
public enum TodoApp
|
||||
{
|
||||
@@ -1,12 +1,26 @@
|
||||
using System;
|
||||
using Microsoft.Azure.Cosmos.Table;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Storage
|
||||
{
|
||||
public class HabitTodoLink
|
||||
public class HabitTodoLink : TableEntity
|
||||
{
|
||||
public string HabiticaId { get; set; }
|
||||
public HabitTodoLink() { }
|
||||
|
||||
public HabitTodoLink(string userId, string habiticaId, string todoistId)
|
||||
{
|
||||
PartitionKey = userId;
|
||||
RowKey = habiticaId;
|
||||
TodoistId = todoistId;
|
||||
}
|
||||
|
||||
public string TodoistId { get; set; }
|
||||
|
||||
public TodoHabitLink Reverse()
|
||||
{
|
||||
return new TodoHabitLink(PartitionKey, TodoistId, RowKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
using System;
|
||||
using Habitica.Todoist.Integration.Model.Storage.Enum;
|
||||
using Microsoft.Azure.Cosmos.Table;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Storage
|
||||
{
|
||||
public class TodoChange
|
||||
/* TODO: Rework structure */
|
||||
public class TodoChange : TableEntity
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public TodoChange() { }
|
||||
|
||||
public TodoChange(string userId, string todoId)
|
||||
{
|
||||
PartitionKey = userId;
|
||||
RowKey = todoId;
|
||||
}
|
||||
|
||||
public TodoApp Application { get; set; }
|
||||
public TodoAction Action { get; set; }
|
||||
public bool Applied { get; set; }
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
using System;
|
||||
using Microsoft.Azure.Cosmos.Table;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Storage
|
||||
{
|
||||
public class TodoHabitLink
|
||||
public class TodoHabitLink : TableEntity
|
||||
{
|
||||
public string TodoistId { get; set; }
|
||||
public TodoHabitLink() { }
|
||||
|
||||
public TodoHabitLink(string userId, string todoistId, string habiticaId)
|
||||
{
|
||||
PartitionKey = userId;
|
||||
RowKey = todoistId;
|
||||
HabiticaId = habiticaId;
|
||||
}
|
||||
|
||||
public string HabiticaId { get; set; }
|
||||
|
||||
public HabitTodoLink Reverse()
|
||||
{
|
||||
return new HabitTodoLink(PartitionKey, HabiticaId, RowKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
using System;
|
||||
using Microsoft.Azure.Cosmos.Table;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habitica.Todoist.Integration.Model.Storage
|
||||
{
|
||||
public class TodoistSync
|
||||
public class TodoistSync : TableEntity
|
||||
{
|
||||
public string SyncToken { get; set; }
|
||||
public TodoistSync() { }
|
||||
|
||||
public TodoistSync(string userId, string syncToken)
|
||||
{
|
||||
PartitionKey = userId;
|
||||
RowKey = syncToken;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user