-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add configurable local timezone to user profile for accurate calendar…
… scheduling (#51) ### Summary & Motivation Introduce a user-configurable windows timezone field within the user profile to ensure that meetings are scheduled accurately in the organizer's local time zone. This enhancement allows the system to capture and utilize both the user's timezone and timestamp when creating meetings, helping avoid potential time discrepancies due to timezone offsets. Internally, this approach standardizes the management of timezone information, enabling seamless conversion to UTC offsets when needed. Additionally, this PR consolidates all `AccountManagement` system internal calls under `AccountManagementClient`, centralizing the API interactions and reducing coupling within the system. ### Atomic Changes - Move all `AccountManagement` system internal calls to the `AccountManagementClient` - Store local IANA time zone in user domain and use it for meeting creation - Add timezone as field to edit in `UserProfile` ### Checklist - [x] I have added a Label to the pull-request - [x] I have added tests, and done manual regression tests - [x] I have updated the documentation, if necessary
- Loading branch information
1 parent
7136d51
commit f2159b7
Showing
28 changed files
with
342 additions
and
129 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
4 changes: 2 additions & 2 deletions
4
...ement/Core/Database/DatabaseMigrations.cs → ...seMigrations/20241007_InitialMigration.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
14 changes: 14 additions & 0 deletions
14
...on/account-management/Core/Database/DatabaseMigrations/20241102_AddUserLocalTimeZoneId.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 Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace PlatformPlatform.AccountManagement.Database.DatabaseMigrations; | ||
|
||
[DbContext(typeof(AccountManagementDbContext))] | ||
[Migration("20241102_AddUserLocalTimeZoneId")] | ||
public sealed class AddUserLocalTimeZoneId : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.AddColumn<string>("LocalTimeZoneId", "Users", "nvarchar(50)", nullable: true); | ||
} | ||
} |
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
25 changes: 25 additions & 0 deletions
25
application/account-management/Core/Users/Queries/GetTimezones.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,25 @@ | ||
using JetBrains.Annotations; | ||
using PlatformPlatform.SharedKernel.Cqrs; | ||
using TimeZoneConverter; | ||
|
||
namespace PlatformPlatform.AccountManagement.Users.Queries; | ||
|
||
[PublicAPI] | ||
public sealed record GetTimeZonesQuery : IRequest<Result<GetTimeZoneDto>>; | ||
|
||
[PublicAPI] | ||
public sealed record GetTimeZoneDto(TimeZoneDto[] TimeZones); | ||
|
||
[PublicAPI] | ||
public sealed record TimeZoneDto(string Id, string DisplayName); | ||
|
||
public sealed class GetTimeZonesHandler : IRequestHandler<GetTimeZonesQuery, Result<GetTimeZoneDto>> | ||
{ | ||
public async Task<Result<GetTimeZoneDto>> Handle(GetTimeZonesQuery request, CancellationToken cancellationToken) | ||
{ | ||
var knownTimeZones = TZConvert.KnownWindowsTimeZoneIds.Select(TZConvert.GetTimeZoneInfo); | ||
var timeZones = knownTimeZones.OrderBy(t => t.BaseUtcOffset).Select(t => new TimeZoneDto(t.Id, t.DisplayName)).ToArray(); | ||
|
||
return await Task.FromResult(new GetTimeZoneDto(timeZones)); | ||
} | ||
} |
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
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
Oops, something went wrong.