diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json index 25cf5615..80e187d2 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/LanguagesData.json @@ -9843,7 +9843,7 @@ }, { "resourceName": "Platform", - "key": "App.Crm.Activities", + "key": "App.Crm.Activity", "tr": "Aktiviteler", "en": "Activities" }, diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Crm.cs b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Crm.cs index 56a64f14..fc785507 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Crm.cs +++ b/api/src/Erp.Platform.DbMigrator/Seeds/ListFormSeeder_Crm.cs @@ -54,7 +54,8 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -176,7 +177,8 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -297,7 +299,8 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency { var listForm = await _listFormRepository.InsertAsync(new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -953,7 +956,8 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -1123,7 +1127,8 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = false, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -1503,14 +1508,15 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency } #endregion - #region Activity + #region OpportunityActivity listFormName = AppCodes.Crm.OpportunityActivity; if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) { var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -1788,14 +1794,15 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency } #endregion - #region Competitor + #region OpportunityCompetitor listFormName = AppCodes.Crm.OpportunityCompetitor; if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) { var listForm = await _listFormRepository.InsertAsync( new ListForm() { - ListFormType = ListFormTypeEnum.List, ExportJson = DefaultExportJson, + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, IsSubForm = true, ShowNote = true, LayoutJson = DefaultLayoutJson, @@ -1969,5 +1976,309 @@ public class ListFormSeeder_Crm : IDataSeedContributor, ITransientDependency }, }) ); + + #region Activity + listFormName = AppCodes.Crm.Activity; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + ExportJson = DefaultExportJson, + IsSubForm = true, + ShowNote = true, + LayoutJson = DefaultLayoutJson, + CultureName = LanguageCodes.En, + ListFormCode = listFormName, + Name = listFormName, + Title = listFormName, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = listFormName, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Activity)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = DefaultFilterJson, + SortMode = GridOptions.SortModeSingle, + FilterRowJson = DefaultFilterRowJson, + HeaderFilterJson = DefaultHeaderFilterJson, + SearchPanelJson = DefaultSearchPanelJson, + GroupPanelJson = DefaultGroupPanelJson, + SelectionJson = DefaultSelectionSingleJson, + ColumnOptionJson = DefaultColumnOptionJson, + PermissionJson = DefaultPermissionJson(listFormName), + DeleteCommand = DefaultDeleteCommand(nameof(TableNameEnum.Activity)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson, + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 600, true, true, true, true, false), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson, + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() { + Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =[ + new EditingFormItemDto { Order = 1, DataField="OpportunityId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 2, DataField="ActivityType", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 3, DataField="Subject", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField="Description", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 5, DataField="EmployeeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 6, DataField="ActivityDate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 7, DataField="StartTime", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 8, DataField="EndTime", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 9, DataField="Duration", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 10, DataField="FollowUpDate", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 11, DataField="FollowUpActivity", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 12, DataField="Outcome", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 13, DataField="NextSteps", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, + ]} + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "ActivityDate", FieldDbType = DbType.DateTime, Value = "@DATE", CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }), + }, autoSave: true + ); + + #region Activity Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "OpportunityId", + Width = 100, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Opportunity), "Id", "Title"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "ActivityType", + Width = 100, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new() { Key="Call", Name="Call" }, + new() { Key="Email", Name="Email" }, + new() { Key="Meeting", Name="Meeting" }, + new() { Key="Task", Name="Task" }, + new() { Key="Note", Name="Note" }, + new() { Key="Demo", Name="Demo" }, + new() { Key="Proposal", Name="Proposal" }, + }), + }), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Subject", + Width = 500, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "EmployeeId", + Width = 100, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.Employee), "Id", "FullName"), + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "ActivityDate", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.DateTime, + FieldName = "StartTime", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.DateTime, + FieldName = "EndTime", + Width = 100, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Duration", + Width = 100, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.DateTime, + FieldName = "FollowUpDate", + Width = 100, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "FollowUpActivity", + Width = 200, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Outcome", + Width = 200, + ListOrderNo = 13, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "NextSteps", + Width = 200, + ListOrderNo = 14, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + ], autoSave: true); + #endregion + } + #endregion } } diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json index 0eb4504a..aea716c0 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/MenusData.json @@ -2220,12 +2220,12 @@ }, { "ParentCode": "App.Crm", - "Code": "App.Crm.Activities", - "DisplayName": "App.Crm.Activities", + "Code": "App.Crm.Activity", + "DisplayName": "App.Crm.Activity", "Order": 7, - "Url": "/admin/list/App.Crm.Activities", + "Url": "/admin/list/App.Crm.Activity", "Icon": "FcCalendar", - "RequiredPermissionName": "App.Crm.Activities", + "RequiredPermissionName": "App.Crm.Activity", "IsDisabled": false }, { diff --git a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json index f3b1fe30..59e14e7c 100644 --- a/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Erp.Platform.DbMigrator/Seeds/PermissionsData.json @@ -11404,17 +11404,17 @@ }, { "GroupName": "App.Crm", - "Name": "App.Crm.Activities", + "Name": "App.Crm.Activity", "ParentName": null, - "DisplayName": "App.Crm.Activities", + "DisplayName": "App.Crm.Activity", "IsEnabled": true, "MultiTenancySide": 3, "MenuGroup": "Erp" }, { "GroupName": "App.Crm", - "Name": "App.Crm.Activities.Create", - "ParentName": "App.Crm.Activities", + "Name": "App.Crm.Activity.Create", + "ParentName": "App.Crm.Activity", "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3, @@ -11422,8 +11422,8 @@ }, { "GroupName": "App.Crm", - "Name": "App.Crm.Activities.Update", - "ParentName": "App.Crm.Activities", + "Name": "App.Crm.Activity.Update", + "ParentName": "App.Crm.Activity", "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3, @@ -11431,8 +11431,8 @@ }, { "GroupName": "App.Crm", - "Name": "App.Crm.Activities.Delete", - "ParentName": "App.Crm.Activities", + "Name": "App.Crm.Activity.Delete", + "ParentName": "App.Crm.Activity", "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3, @@ -11440,8 +11440,8 @@ }, { "GroupName": "App.Crm", - "Name": "App.Crm.Activities.Export", - "ParentName": "App.Crm.Activities", + "Name": "App.Crm.Activity.Export", + "ParentName": "App.Crm.Activity", "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3, @@ -11449,8 +11449,8 @@ }, { "GroupName": "App.Crm", - "Name": "App.Crm.Activities.Import", - "ParentName": "App.Crm.Activities", + "Name": "App.Crm.Activity.Import", + "ParentName": "App.Crm.Activity", "DisplayName": "Import", "IsEnabled": true, "MultiTenancySide": 3, @@ -11458,8 +11458,8 @@ }, { "GroupName": "App.Crm", - "Name": "App.Crm.Activities.Note", - "ParentName": "App.Crm.Activities", + "Name": "App.Crm.Activity.Note", + "ParentName": "App.Crm.Activity", "DisplayName": "Note", "IsEnabled": true, "MultiTenancySide": 3, diff --git a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs index ab9c08e5..84d09b62 100644 --- a/api/src/Erp.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Erp.Platform.Domain/Data/SeedConsts.cs @@ -506,6 +506,8 @@ public static class SeedConsts public const string Opportunity = Default + ".Opportunity"; public const string OpportunityActivity = Default + ".OpportunityActivity"; public const string OpportunityCompetitor = Default + ".OpportunityCompetitor"; + public const string Activity = Default + ".Activity"; + public const string Orders = Default + ".Orders"; } public static class SupplyChain