-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from TunNetCom/FixAndUpgrade
Upgrade azure contracts , add table to time log
- Loading branch information
Showing
42 changed files
with
930 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...gService/TimeLogService.Application/Feature/UserAction/Commands/AddUser/AddUserCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
namespace TimeLogService.Application.Feature.UserAction.Commands.AddUser; | ||
|
||
public record class AddUserCommand(UserProfile UserProfile) : IRequest; |
14 changes: 14 additions & 0 deletions
14
...e/TimeLogService.Application/Feature/UserAction/Commands/AddUser/AddUserCommandHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using TimeLogService.Domain.Interfaces.Repositories; | ||
|
||
namespace TimeLogService.Application.Feature.UserAction.Commands.AddUser | ||
{ | ||
public class AddUserCommandHandler(IRepository<User> repository) : IRequestHandler<AddUserCommand> | ||
{ | ||
private readonly IRepository<User> _repository = repository; | ||
|
||
public async Task Handle(AddUserCommand request, CancellationToken cancellationToken) | ||
{ | ||
await _repository.AddAsync(request.UserProfile); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/TimeLogService/TimeLogService.DataBase/TimeLogService.Database.refactorlog
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Operations Version="1.0" xmlns="http://schemas.microsoft.com/sqlserver/dac/Serialization/2012/02"> | ||
<Operation Name="Rename Refactor" Key="9ccea88e-7173-493c-bd00-e62b93839a91" ChangeDateTime="09/15/2024 17:13:43"> | ||
<Property Name="ElementName" Value="[dbo].[Project].[visibility]" /> | ||
<Property Name="ElementType" Value="SqlSimpleColumn" /> | ||
<Property Name="ParentElementName" Value="[dbo].[Project]" /> | ||
<Property Name="ParentElementType" Value="SqlTable" /> | ||
<Property Name="NewName" Value="Visibility" /> | ||
</Operation> | ||
</Operations> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/TimeLogService/TimeLogService.DataBase/dbo/Tables/AionTimeSubscription.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CREATE TABLE [dbo].[AionTimeSubscription] | ||
( | ||
[Id] INT IDENTITY (1, 1) PRIMARY KEY NOT NULL, | ||
[SubsecriptionDate] DATETIME NULL, | ||
[ExpirationDate] DATETIME NULL, | ||
[OrganizationId] INT NOT NULL, | ||
|
||
CONSTRAINT FKOrganizationSubscription | ||
FOREIGN KEY (OrganizationId) | ||
REFERENCES [dbo].[Organization] (Id) | ||
ON DELETE CASCADE | ||
ON UPDATE CASCADE, | ||
) |
13 changes: 13 additions & 0 deletions
13
src/TimeLogService/TimeLogService.DataBase/dbo/Tables/AionTimeSubscriptionHistory.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CREATE TABLE [dbo].[AionTimeSubscriptionHistory] | ||
( | ||
[Id] INT NOT NULL PRIMARY KEY, | ||
[SubscriptionId] int NOT NULL, | ||
[SubscriptionDate] DATE NOT NULL, | ||
|
||
CONSTRAINT FKSubscriptionSubscriptionHistory | ||
FOREIGN KEY (SubscriptionId) | ||
REFERENCES [dbo].[AionTimeSubscription] (Id) | ||
ON DELETE CASCADE | ||
ON UPDATE CASCADE, | ||
|
||
) |
12 changes: 11 additions & 1 deletion
12
src/TimeLogService/TimeLogService.DataBase/dbo/Tables/Organization.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/TimeLogService/TimeLogService.DataBase/dbo/Tables/User.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
CREATE TABLE [dbo].[User] | ||
( | ||
[Id] INT IDENTITY (1, 1) PRIMARY KEY NOT NULL, | ||
[UserId] NVARCHAR(100) NOT NULL UNIQUE, | ||
[EmailAddress] VARCHAR(50) NOT NULL, | ||
[PublicAlias] NVARCHAR(100) NOT NULL, | ||
[CoreRevision] INT NOT NULL, | ||
[TimeStamp] DATETIME NOT NULL, | ||
[Revision] INT NOT NULL | ||
) |
14 changes: 14 additions & 0 deletions
14
src/TimeLogService/TimeLogService.Domain/Models/dbo/AionTimeSubscription.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace TimeLogService.Domain.Models; | ||
|
||
public partial class AionTimeSubscription : BaseEntity | ||
{ | ||
public DateTime? SubsecriptionDate { get; set; } | ||
|
||
public DateTime? ExpirationDate { get; set; } | ||
|
||
public int OrganizationId { get; set; } | ||
|
||
public virtual IReadOnlyCollection<AionTimeSubscriptionHistory>? AionTimeSubscriptionHistories { get; set; } // = new List<AionTimeSubscriptionHistory>(); | ||
|
||
public virtual Organization? Organization { get; set; } | ||
} |
10 changes: 10 additions & 0 deletions
10
src/TimeLogService/TimeLogService.Domain/Models/dbo/AionTimeSubscriptionHistory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace TimeLogService.Domain.Models; | ||
|
||
public partial class AionTimeSubscriptionHistory : BaseEntity | ||
{ | ||
public int SubscriptionId { get; set; } | ||
|
||
public DateTime SubscriptionDate { get; set; } | ||
|
||
public virtual AionTimeSubscription? Subscription { get; set; } | ||
} |
22 changes: 13 additions & 9 deletions
22
src/TimeLogService/TimeLogService.Domain/Models/dbo/Organization.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
namespace TimeLogService.Domain.Models.Dbo; | ||
namespace TimeLogService.Domain.Models; | ||
|
||
public partial class Organization : BaseEntity | ||
{ | ||
private readonly List<Project> _projects; | ||
public string UserId { get; set; } = null!; | ||
|
||
protected Organization(string name) | ||
{ | ||
Name = name; | ||
_projects = []; | ||
} | ||
public string Name { get; set; } = null!; | ||
|
||
public IReadOnlyCollection<Project> Projects => _projects.AsReadOnly(); | ||
public string AccountId { get; set; } = null!; | ||
|
||
public string Name { get; private set; } | ||
public Uri AccountUri { get; set; } = null!; | ||
|
||
public bool IsAionTimeApproved { get; set; } | ||
|
||
public virtual IReadOnlyCollection<AionTimeSubscription>? AionTimeSubscriptions { get; set; } | ||
|
||
public virtual IReadOnlyCollection<Project>? Projects { get; set; } | ||
|
||
public virtual User? User { get; set; } | ||
} |
18 changes: 13 additions & 5 deletions
18
src/TimeLogService/TimeLogService.Domain/Models/dbo/Project.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
namespace TimeLogService.Domain.Models.Dbo; | ||
namespace TimeLogService.Domain.Models; | ||
|
||
public partial class Project : BaseEntity | ||
{ | ||
public int OrganizationId { get; set; } | ||
|
||
public virtual Organization? Organization { get; set; } | ||
public string ProjectId { get; set; } = null!; | ||
|
||
#pragma warning disable CA2227 // Collection properties should be read only | ||
public virtual ICollection<WorkItem>? WorkItems { get; set; } | ||
#pragma warning restore CA2227 // Collection properties should be read only | ||
public string Name { get; set; } = null!; | ||
|
||
public string? State { get; set; } | ||
|
||
public int? Revision { get; set; } | ||
|
||
public string? Visibility { get; set; } | ||
|
||
public DateTime? LastUpdateTime { get; set; } | ||
|
||
public string Url { get; set; } = null!; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/TimeLogService/TimeLogService.Domain/Models/dbo/User.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace TimeLogService.Domain.Models; | ||
|
||
public partial class User : BaseEntity | ||
{ | ||
public string UserId { get; set; } = null!; | ||
|
||
public string EmailAddress { get; set; } = null!; | ||
|
||
public string PublicAlias { get; set; } = null!; | ||
|
||
public int CoreRevision { get; set; } | ||
|
||
public DateTime TimeStamp { get; set; } | ||
|
||
public int Revision { get; set; } | ||
|
||
public virtual IReadOnlyCollection<Organization>? Organizations { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/TimeLogService/TimeLogService.Domain/Models/dbo/WorkItemHistory.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/TimeLogService/TimeLogService.Domain/Models/dbo/WorkItemTimeLog.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.