wip: finish converting some more projects
This commit is contained in:
10
Habittodo.Model/Storage/Enums/TodoAction.cs
Normal file
10
Habittodo.Model/Storage/Enums/TodoAction.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Habittodo.Model.Storage.Enums
|
||||
{
|
||||
public enum TodoAction
|
||||
{
|
||||
Add = 1,
|
||||
Update = 2,
|
||||
Complete = 3,
|
||||
Delete = 4
|
||||
}
|
||||
}
|
||||
8
Habittodo.Model/Storage/Enums/TodoApp.cs
Normal file
8
Habittodo.Model/Storage/Enums/TodoApp.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Habittodo.Model.Storage.Enums
|
||||
{
|
||||
public enum TodoApp
|
||||
{
|
||||
Habitica = 1,
|
||||
Todoist = 2
|
||||
}
|
||||
}
|
||||
25
Habittodo.Model/Storage/HabitTodoLink.cs
Normal file
25
Habittodo.Model/Storage/HabitTodoLink.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Microsoft.Azure.Cosmos.Table;
|
||||
|
||||
namespace Habittodo.Model.Storage
|
||||
{
|
||||
public class HabitTodoLink : TableEntity
|
||||
{
|
||||
public HabitTodoLink() { }
|
||||
|
||||
public HabitTodoLink(string userId, string habiticaId, string todoistId, string habiticaParentId = null)
|
||||
{
|
||||
PartitionKey = userId;
|
||||
RowKey = habiticaId;
|
||||
HabiticaParentId = habiticaParentId;
|
||||
TodoistId = todoistId;
|
||||
}
|
||||
|
||||
public string HabiticaParentId { get; set; }
|
||||
public string TodoistId { get; set; }
|
||||
|
||||
public TodoHabitLink Reverse()
|
||||
{
|
||||
return new TodoHabitLink(PartitionKey, TodoistId, RowKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
Habittodo.Model/Storage/TodoChange.cs
Normal file
22
Habittodo.Model/Storage/TodoChange.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Habittodo.Model.Storage.Enums;
|
||||
using Microsoft.Azure.Cosmos.Table;
|
||||
|
||||
namespace Habittodo.Model.Storage
|
||||
{
|
||||
/* TODO: Rework structure */
|
||||
public class TodoChange : TableEntity
|
||||
{
|
||||
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; }
|
||||
public string JsonTodo { get; set; }
|
||||
}
|
||||
}
|
||||
25
Habittodo.Model/Storage/TodoHabitLink.cs
Normal file
25
Habittodo.Model/Storage/TodoHabitLink.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Microsoft.Azure.Cosmos.Table;
|
||||
|
||||
namespace Habittodo.Model.Storage
|
||||
{
|
||||
public class TodoHabitLink : TableEntity
|
||||
{
|
||||
public TodoHabitLink() { }
|
||||
|
||||
public TodoHabitLink(string userId, string todoistId, string habiticaId, string todoistParentId = null)
|
||||
{
|
||||
PartitionKey = userId;
|
||||
RowKey = todoistId;
|
||||
TodoistParentId = todoistParentId;
|
||||
HabiticaId = habiticaId;
|
||||
}
|
||||
|
||||
public string TodoistParentId { get; set; }
|
||||
public string HabiticaId { get; set; }
|
||||
|
||||
public HabitTodoLink Reverse(string habiticaParentId = null)
|
||||
{
|
||||
return new HabitTodoLink(PartitionKey, HabiticaId, RowKey, habiticaParentId);
|
||||
}
|
||||
}
|
||||
}
|
||||
15
Habittodo.Model/Storage/TodoistSync.cs
Normal file
15
Habittodo.Model/Storage/TodoistSync.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using Microsoft.Azure.Cosmos.Table;
|
||||
|
||||
namespace Habittodo.Model.Storage
|
||||
{
|
||||
public class TodoistSync : TableEntity
|
||||
{
|
||||
public TodoistSync() { }
|
||||
|
||||
public TodoistSync(string userId, string syncToken)
|
||||
{
|
||||
PartitionKey = userId;
|
||||
RowKey = syncToken;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user