Skip to content

Commit b053f80

Browse files
author
CIS Guru
committed
Phase 2.6 In-App Notifications UI
1 parent 3330b47 commit b053f80

7 files changed

Lines changed: 982 additions & 2 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
using Aquiis.SimpleStart.Shared.Components.Account;
3+
using Aquiis.SimpleStart.Application.Services;
4+
using Aquiis.SimpleStart.Shared.Services;
5+
using Aquiis.SimpleStart.Infrastructure.Data;
6+
7+
namespace Aquiis.SimpleStart.Application.Services.Workflows
8+
{
9+
public enum AccountStatus
10+
{
11+
Created,
12+
Active,
13+
Locked,
14+
Closed
15+
}
16+
public class AccountWorkflowService : BaseWorkflowService, IWorkflowState<AccountStatus>
17+
{
18+
public AccountWorkflowService(ApplicationDbContext context,
19+
UserContextService userContext,
20+
NotificationService notificationService)
21+
: base(context, userContext)
22+
{
23+
}
24+
// Implementation of the account workflow service
25+
public string GetInvalidTransitionReason(AccountStatus fromStatus, AccountStatus toStatus)
26+
{
27+
throw new NotImplementedException();
28+
}
29+
30+
public List<AccountStatus> GetValidNextStates(AccountStatus currentStatus)
31+
{
32+
throw new NotImplementedException();
33+
}
34+
35+
public bool IsValidTransition(AccountStatus fromStatus, AccountStatus toStatus)
36+
{
37+
throw new NotImplementedException();
38+
}
39+
}
40+
}

Aquiis.SimpleStart/Features/Notifications/Pages/NotificationCenter.razor

Lines changed: 470 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@page "/notifications/preferences"
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
using Aquiis.SimpleStart.Core.Entities;
2+
3+
namespace Aquiis.SimpleStart.Infrastructure.Services;
4+
5+
/// <summary>
6+
/// Provides centralized mapping between entity types and their navigation routes.
7+
/// This ensures consistent URL generation across the application when navigating to entity details.
8+
/// </summary>
9+
public static class EntityRouteHelper
10+
{
11+
private static readonly Dictionary<string, string> RouteMap = new()
12+
{
13+
{ "Lease", "/propertymanagement/leases/view" },
14+
{ "Payment", "/propertymanagement/payments/view" },
15+
{ "Invoice", "/propertymanagement/invoices/view" },
16+
{ "Maintenance", "/propertymanagement/maintenance/view" },
17+
{ "Application", "/propertymanagement/applications" },
18+
{ "Property", "/propertymanagement/properties/edit" },
19+
{ "Tenant", "/propertymanagement/tenants/view" },
20+
{ "Prospect", "/PropertyManagement/ProspectiveTenants" }
21+
};
22+
23+
/// <summary>
24+
/// Gets the full navigation route for a given entity type and ID.
25+
/// </summary>
26+
/// <param name="entityType">The type of entity (e.g., "Lease", "Payment", "Maintenance")</param>
27+
/// <param name="entityId">The unique identifier of the entity</param>
28+
/// <returns>The full route path including the entity ID, or "/" if the entity type is not mapped</returns>
29+
public static string GetEntityRoute(string? entityType, Guid entityId)
30+
{
31+
if (string.IsNullOrWhiteSpace(entityType))
32+
{
33+
return "/";
34+
}
35+
36+
if (RouteMap.TryGetValue(entityType, out var route))
37+
{
38+
return $"{route}/{entityId}";
39+
}
40+
41+
// Fallback to home if entity type not found
42+
return "/";
43+
}
44+
45+
/// <summary>
46+
/// Checks if a route mapping exists for the given entity type.
47+
/// </summary>
48+
/// <param name="entityType">The type of entity to check</param>
49+
/// <returns>True if a route mapping exists, false otherwise</returns>
50+
public static bool HasRoute(string? entityType)
51+
{
52+
return !string.IsNullOrWhiteSpace(entityType) && RouteMap.ContainsKey(entityType);
53+
}
54+
55+
/// <summary>
56+
/// Gets all supported entity types that have route mappings.
57+
/// </summary>
58+
/// <returns>A collection of supported entity type names</returns>
59+
public static IEnumerable<string> GetSupportedEntityTypes()
60+
{
61+
return RouteMap.Keys;
62+
}
63+
}

0 commit comments

Comments
 (0)