Conversation
There was a problem hiding this comment.
Pull request overview
Introduces a new Unity.AI module scaffold into the Unity GrantManager solution, wiring initial project references and EF Core configuration to prepare for future AI-related features.
Changes:
- Added new
Unity.AImodule projects (Domain.Shared, Application.Contracts, Application, Web) with localization + permissions scaffolding. - Hooked AI model configuration into the tenant DbContext and added project references from the main app to the new module.
- Added an EF Core migration intended to establish an
AIschema.
Reviewed changes
Copilot reviewed 43 out of 44 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| applications/Unity.GrantManager/src/Unity.GrantManager.Web/Unity.GrantManager.Web.csproj | Adds reference to AI Web module project |
| applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Unity.GrantManager.EntityFrameworkCore.csproj | Adds reference to AI Application project |
| applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/HostMigrations/GrantManagerDbContextModelSnapshot.cs | Updates host model snapshot (includes non-AI model changes) |
| applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/HostMigrations/20260306195601_AISchema.cs | New migration to ensure AI schema |
| applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/Migrations/HostMigrations/20260306195601_AISchema.Designer.cs | Auto-generated migration designer/model |
| applications/Unity.GrantManager/src/Unity.GrantManager.EntityFrameworkCore/EntityFrameworkCore/GrantTenantDbContext.cs | Calls modelBuilder.ConfigureAI() for tenant DB |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Unity.AI.Web.csproj | New AI Web layer project |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Properties/launchSettings.json | Local launch profile for AI web project |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/Pages/_ViewImports.cshtml | Razor imports for AI web pages |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/FodyWeavers.xsd | Fody weaver schema for AI web project |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/FodyWeavers.xml | Fody weaver config for AI web project |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/AIWebModule.cs | ABP module definition for AI Web |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Web/AIWebAutoMapperProfile.cs | Placeholder AutoMapper profile for AI Web |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/Unity.AI.Shared.csproj | New AI Domain.Shared project |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/Localization/AIResource.cs | Defines AI localization resource |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/Localization/AI/en.json | English localization strings for AI permissions |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/FodyWeavers.xsd | Fody weaver schema for AI Domain.Shared project |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/FodyWeavers.xml | Fody weaver config for AI Domain.Shared project |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/AISharedModule.cs | ABP module definition for AI Domain.Shared |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Domain.Shared/AIErrorCodes.cs | Placeholder error code constants |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/Unity.AI.Application.csproj | New AI Application project |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/FodyWeavers.xsd | Fody weaver schema for AI Application project |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/FodyWeavers.xml | Fody weaver config for AI Application project |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/EntityFrameworkCore/IAIDbContext.cs | Defines EF Core DbContext interface for AI |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/EntityFrameworkCore/AIEntityFrameworkCoreModule.cs | Registers AI DbContext in a dedicated ABP module |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/EntityFrameworkCore/AIDbContextModelCreatingExtensions.cs | Adds ConfigureAI() model builder extension |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/EntityFrameworkCore/AIDbContext.cs | AI AbpDbContext implementation |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/Domain/AIDbProperties.cs | AI schema/connection string constants |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/AIApplicationModule.cs | ABP module definition for AI Application |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/AIApplicationAutoMapperProfile.cs | Placeholder AutoMapper profile for AI Application |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application/AIAppService.cs | Base ApplicationService class with AI localization |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/Unity.AI.Application.Contracts.csproj | New AI Application.Contracts project |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/Permissions/AIPermissions.cs | Defines AI permission constants |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/Permissions/AIPermissionDefinitionProvider.cs | Registers AI permissions with ABP |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/FodyWeavers.xsd | Fody weaver schema for AI Application.Contracts |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/FodyWeavers.xml | Fody weaver config for AI Application.Contracts |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/AIRemoteServiceConsts.cs | Remote service constants for AI |
| applications/Unity.GrantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/AIApplicationContractsModule.cs | ABP module definition for AI Application.Contracts |
| applications/Unity.GrantManager/modules/Unity.AI/common.props | Module-wide build properties + Fody package refs |
| applications/Unity.GrantManager/modules/Unity.AI/NuGet.Config | Module-local NuGet config |
| applications/Unity.GrantManager/modules/Unity.AI/.prettierrc | Module-local Prettier settings |
| applications/Unity.GrantManager/modules/Unity.AI/.gitignore | Module-local gitignore |
| applications/Unity.GrantManager/modules/Unity.AI/.gitattributes | Linguist vendoring for libs |
| applications/Unity.GrantManager/Unity.GrantManager.sln | Adds AI projects to the solution |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| protected override void Up(MigrationBuilder migrationBuilder) | ||
| { | ||
| migrationBuilder.EnsureSchema(name: "AI"); | ||
| } |
There was a problem hiding this comment.
AISchema is created as a HostMigration for GrantManagerDbContext (Default connection string), but the AI module’s AIDbProperties.ConnectionStringName is Tenant and GrantTenantDbContext is calling modelBuilder.ConfigureAI(). If AI tables are intended to live in the tenant database (like Payments/Flex/Reporting), this migration should be generated under Migrations/TenantMigrations (or the AI schema/connection string should be adjusted to match the host DB).
| <ProjectReference Include="..\..\modules\Unity.AI\src\Unity.AI.Web\Unity.AI.Web.csproj" /> | ||
| <ProjectReference Include="..\..\modules\Unity.SharedKernel\Unity.SharedKernel.csproj" /> | ||
| <ProjectReference Include="..\..\modules\Unity.Theme.UX2\src\Unity.Theme.UX2\Unity.AspNetCore.Mvc.UI.Theme.UX2.csproj" /></ItemGroup> |
There was a problem hiding this comment.
The solution references Unity.AI.Web, but ABP modules are only activated when included via [DependsOn] from the root module (e.g., GrantManagerWebModule). If this is meant to be enabled at runtime, add AIWebModule to the root module dependency list; otherwise this reference will compile but none of the module configuration/services will be registered.
| typeof(AIApplicationContractsModule), | ||
| typeof(AbpDddApplicationModule), | ||
| typeof(AbpAutoMapperModule), | ||
| typeof(AbpTenantManagementDomainModule) |
There was a problem hiding this comment.
AIEntityFrameworkCoreModule (which registers AIDbContext) is never pulled into the module dependency graph (no [DependsOn] references found). This means AIDbContext won’t be registered unless another root module explicitly depends on it. Consider adding typeof(AIEntityFrameworkCoreModule) to this module’s [DependsOn] list (pattern used by ReportingApplicationModule) or registering the DbContext directly in AIApplicationModule.
| typeof(AbpTenantManagementDomainModule) | |
| typeof(AbpTenantManagementDomainModule), | |
| typeof(AIEntityFrameworkCoreModule) |
| public static class AIPermissions | ||
| { | ||
| public const string GroupName = "AI"; | ||
|
|
||
| public static class Default | ||
| { | ||
| public const string Management = GroupName + ".Management"; | ||
| } | ||
| } |
There was a problem hiding this comment.
For consistency with other modules’ permission constants (e.g., NotificationsPermissions, FlexPermissions, ReportingPermissions), add a GetAll() helper that returns ReflectionHelper.GetPublicConstantsRecursively(typeof(AIPermissions)). This is commonly used for permission seeding/registration and keeps the module aligned with existing patterns.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 41 out of 42 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
...rantManager/modules/Unity.AI/src/Unity.AI.Application.Contracts/Permissions/AIPermissions.cs
Outdated
Show resolved
Hide resolved
...es/Unity.AI/src/Unity.AI.Application.Contracts/Permissions/AIPermissionDefinitionProvider.cs
Outdated
Show resolved
Hide resolved
| EndProject | ||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unity.AI.Application", "modules\Unity.AI\src\Unity.AI.Application\Unity.AI.Application.csproj", "{7CF9D364-2018-4199-879B-371F6E1AC58B}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.AI.Web", "modules\Unity.AI\src\Unity.AI.Web\Unity.AI.Web.csproj", "{378A4EB8-3DC1-420E-98B5-798DE71BEF0D}" |
There was a problem hiding this comment.
In the solution file, Unity.AI.Web is added with the legacy C# project type GUID {FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}. Most other SDK-style projects in this solution (including other *.Web modules like Unity.Payments.Web) use {9A19103F-16F7-4668-BE54-9A1E7A4F7556}; consider aligning Unity.AI.Web to the SDK-style GUID to avoid Visual Studio/solution tooling inconsistencies.
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Unity.AI.Web", "modules\Unity.AI\src\Unity.AI.Web\Unity.AI.Web.csproj", "{378A4EB8-3DC1-420E-98B5-798DE71BEF0D}" | |
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unity.AI.Web", "modules\Unity.AI\src\Unity.AI.Web\Unity.AI.Web.csproj", "{378A4EB8-3DC1-420E-98B5-798DE71BEF0D}" |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 49 out of 50 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| using Unity.GrantManager.Permissions; | ||
| using Unity.AI.Permissions; |
There was a problem hiding this comment.
using Unity.GrantManager.Permissions; appears to be unused after switching the permission check to AIPermissions.... Please remove the unused using to keep the file warning-free and avoid implying GrantApplicationPermissions is still involved here.
| public const string GroupName = "AI"; | ||
|
|
||
| public static class Default | ||
| { | ||
| public const string Management = GroupName + ".Management"; | ||
| public const string GroupName = "AI"; | ||
|
|
||
| public static class Reporting | ||
| { | ||
| public const string Default = GroupName + ".Reporting"; | ||
| } | ||
|
|
||
| public static class ApplicationAnalysis | ||
| { | ||
| public const string Default = GroupName + ".ApplicationAnalysis"; | ||
| } | ||
|
|
||
| public static class AttachmentSummary | ||
| { | ||
| public const string Default = GroupName + ".AttachmentSummary"; | ||
| } | ||
|
|
||
| public static class ScoringAssistant | ||
| { | ||
| public const string Default = GroupName + ".ScoringAssistant"; | ||
| } |
There was a problem hiding this comment.
AIPermissions currently defines GroupName both at the top-level and again inside the nested Default class, and the nested Default container leads to redundant usage like AIPermissions.Default.Reporting.Default. Consider flattening to AIPermissions.Reporting.Default (similar to other modules) and removing the duplicate GroupName to avoid name hiding/confusion as the module grows.
| "culture": "en", | ||
| "texts": { | ||
| "Permission:AI": "AI", | ||
| "Permission:AI.Default": "AI Management", |
There was a problem hiding this comment.
The localization key Permission:AI.Default is defined, but no corresponding permission appears to be registered (the provider only adds Reporting/ApplicationAnalysis/AttachmentSummary/ScoringAssistant). Either add a permission that uses this key (e.g., a module-level default/management permission) or remove the unused localization entry to prevent dead strings and confusion.
| "Permission:AI.Default": "AI Management", |
| // AI Permission Group | ||
| var aiPermissionsGroup = context.AddGroup( | ||
| AIPermissions.GroupName, | ||
| L("Permission:AI")); | ||
|
|
||
|
|
||
| aiPermissionsGroup.AddPermission( | ||
| AIPermissions.Default.Reporting.Default, | ||
| L("Permission:AI.Reporting")) | ||
| .RequireFeatures("Unity.AIReporting"); | ||
|
|
||
| aiPermissionsGroup.AddPermission( | ||
| AIPermissions.Default.ApplicationAnalysis.Default, | ||
| L("Permission:AI.ApplicationAnalysis")) | ||
| .RequireFeatures("Unity.AI.ApplicationAnalysis"); | ||
|
|
||
| aiPermissionsGroup.AddPermission( | ||
| AIPermissions.Default.AttachmentSummary.Default , | ||
| L("Permission:AI.AttachmentSummary")) | ||
| .RequireFeatures("Unity.AI.AttachmentSummaries"); | ||
|
|
||
| aiPermissionsGroup.AddPermission( | ||
| AIPermissions.Default.ScoringAssistant.Default, | ||
| L("Permission:AI.ScoringAssistant")) | ||
| .RequireFeatures("Unity.AI.Scoring"); | ||
|
|
There was a problem hiding this comment.
Formatting issues in this provider (extra indentation inside Define, stray space before a comma in AttachmentSummary.Default ,, inconsistent alignment) make diffs noisier and can trip style analyzers. Please normalize indentation and whitespace to match other *PermissionDefinitionProvider implementations in the repo.
| // AI Permission Group | |
| var aiPermissionsGroup = context.AddGroup( | |
| AIPermissions.GroupName, | |
| L("Permission:AI")); | |
| aiPermissionsGroup.AddPermission( | |
| AIPermissions.Default.Reporting.Default, | |
| L("Permission:AI.Reporting")) | |
| .RequireFeatures("Unity.AIReporting"); | |
| aiPermissionsGroup.AddPermission( | |
| AIPermissions.Default.ApplicationAnalysis.Default, | |
| L("Permission:AI.ApplicationAnalysis")) | |
| .RequireFeatures("Unity.AI.ApplicationAnalysis"); | |
| aiPermissionsGroup.AddPermission( | |
| AIPermissions.Default.AttachmentSummary.Default , | |
| L("Permission:AI.AttachmentSummary")) | |
| .RequireFeatures("Unity.AI.AttachmentSummaries"); | |
| aiPermissionsGroup.AddPermission( | |
| AIPermissions.Default.ScoringAssistant.Default, | |
| L("Permission:AI.ScoringAssistant")) | |
| .RequireFeatures("Unity.AI.Scoring"); | |
| // AI Permission Group | |
| var aiPermissionsGroup = context.AddGroup( | |
| AIPermissions.GroupName, | |
| L("Permission:AI")); | |
| aiPermissionsGroup.AddPermission( | |
| AIPermissions.Default.Reporting.Default, | |
| L("Permission:AI.Reporting")) | |
| .RequireFeatures("Unity.AIReporting"); | |
| aiPermissionsGroup.AddPermission( | |
| AIPermissions.Default.ApplicationAnalysis.Default, | |
| L("Permission:AI.ApplicationAnalysis")) | |
| .RequireFeatures("Unity.AI.ApplicationAnalysis"); | |
| aiPermissionsGroup.AddPermission( | |
| AIPermissions.Default.AttachmentSummary.Default, | |
| L("Permission:AI.AttachmentSummary")) | |
| .RequireFeatures("Unity.AI.AttachmentSummaries"); | |
| aiPermissionsGroup.AddPermission( | |
| AIPermissions.Default.ScoringAssistant.Default, | |
| L("Permission:AI.ScoringAssistant")) | |
| .RequireFeatures("Unity.AI.Scoring"); |
No description provided.