From ab656ba0701478e4ed4921d5532bdfd10a8da4b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Wed, 6 May 2026 17:48:44 +0300 Subject: [PATCH] Event Type, Category ve Events --- .../Intranet/EventCommentDto.cs | 14 + .../Intranet/EventDto.cs | 23 + .../Intranet/IntranetDashboardDto.cs | 1 + .../Seeds/ListFormSeeder_Administration.cs | 852 +++++++++--------- .../Seeds/MenusData.json | 30 + .../Seeds/PermissionsData.json | 90 +- .../Enums/TableNameEnum.cs | 2 + .../PlatformConsts.cs | 7 +- .../TableNameResolver.cs | 5 + .../Data/SeedConsts.cs | 7 +- .../{Definitions => Intranet}/Announcement.cs | 0 .../Entities/Tenant/Intranet/Event.cs | 38 + .../Entities/Tenant/Intranet/EventCategory.cs | 19 + .../Entities/Tenant/Intranet/EventComment.cs | 19 + .../Entities/Tenant/Intranet/EventPhoto.cs | 17 + .../Entities/Tenant/Intranet/EventType.cs | 19 + .../{Definitions => Intranet}/SocialPost.cs | 0 .../{Definitions => Intranet}/Survey.cs | 0 .../EntityFrameworkCore/PlatformDbContext.cs | 75 +- ....cs => 20260506141749_Initial.Designer.cs} | 360 +++++++- ...6_Initial.cs => 20260506141749_Initial.cs} | 173 ++++ .../PlatformDbContextModelSnapshot.cs | 358 ++++++++ .../Seeds/TenantData.json | 134 +++ .../Seeds/TenantDataSeeder.cs | 155 ++++ ui/src/proxy/intranet/models.ts | 26 + ui/src/views/intranet/Dashboard.tsx | 9 +- .../views/intranet/widgets/UpcomingEvents.tsx | 51 ++ 27 files changed, 2001 insertions(+), 483 deletions(-) create mode 100644 api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventCommentDto.cs create mode 100644 api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventDto.cs rename api/src/Sozsoft.Platform.Domain/Entities/Tenant/{Definitions => Intranet}/Announcement.cs (100%) create mode 100644 api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/Event.cs create mode 100644 api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventCategory.cs create mode 100644 api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventComment.cs create mode 100644 api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventPhoto.cs create mode 100644 api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventType.cs rename api/src/Sozsoft.Platform.Domain/Entities/Tenant/{Definitions => Intranet}/SocialPost.cs (100%) rename api/src/Sozsoft.Platform.Domain/Entities/Tenant/{Definitions => Intranet}/Survey.cs (100%) rename api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/{20260506113136_Initial.Designer.cs => 20260506141749_Initial.Designer.cs} (95%) rename api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/{20260506113136_Initial.cs => 20260506141749_Initial.cs} (95%) create mode 100644 ui/src/views/intranet/widgets/UpcomingEvents.tsx diff --git a/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventCommentDto.cs b/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventCommentDto.cs new file mode 100644 index 0000000..af0fbf1 --- /dev/null +++ b/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventCommentDto.cs @@ -0,0 +1,14 @@ +using System; +using Sozsoft.Platform.Identity.Dto; + +namespace Sozsoft.Platform.Intranet; + +public class EventCommentDto +{ + public string Id { get; set; } + public UserInfoViewModel User { get; set; } + public string Content { get; set; } + public DateTime CreationTime { get; set; } + public int Likes { get; set; } +} + diff --git a/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventDto.cs b/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventDto.cs new file mode 100644 index 0000000..50ac5ba --- /dev/null +++ b/api/src/Sozsoft.Platform.Application.Contracts/Intranet/EventDto.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using Sozsoft.Platform.Identity.Dto; + +namespace Sozsoft.Platform.Intranet; + +public class EventDto +{ + public string Id { get; set; } + public string CategoryName { get; set; } + public string TypeName { get; set; } + public DateTime Date { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public string Place { get; set; } + public UserInfoViewModel Organizer { get; set; } + public int Participants { get; set; } + public List Photos { get; set; } = new(); + public List Comments { get; set; } = new(); + public int Likes { get; set; } + public bool IsPublished { get; set; } +} + diff --git a/api/src/Sozsoft.Platform.Application.Contracts/Intranet/IntranetDashboardDto.cs b/api/src/Sozsoft.Platform.Application.Contracts/Intranet/IntranetDashboardDto.cs index cd9baff..4cd669d 100644 --- a/api/src/Sozsoft.Platform.Application.Contracts/Intranet/IntranetDashboardDto.cs +++ b/api/src/Sozsoft.Platform.Application.Contracts/Intranet/IntranetDashboardDto.cs @@ -6,6 +6,7 @@ namespace Sozsoft.Platform.Intranet; public class IntranetDashboardDto { + public List Events { get; set; } = []; public List Birthdays { get; set; } = []; public List Documents { get; set; } = []; public List Announcements { get; set; } = []; diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs index 3c802bd..7baf592 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/ListFormSeeder_Administration.cs @@ -3948,436 +3948,436 @@ public class ListFormSeeder_Administration : IDataSeedContributor, ITransientDep } #endregion - // #region EventType - // listFormName = AppCodes.Intranet.EventType; - // if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) - // { - // var listForm = await _listFormRepository.InsertAsync( - // new ListForm() - // { - // ListFormType = ListFormTypeEnum.List, - // PageSize = 10, - // ExportJson = DefaultExportJson, - // IsSubForm = false, - // 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.EventType)), - // 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.EventType)), - // DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), - // PagerOptionJson = DefaultPagerOptionJson, - // EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false), - // EditingFormJson = JsonSerializer.Serialize(new List() { - // new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[ - // new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - // ]} - // }), - // InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(), - // } - // ); + #region EventType + listFormName = AppCodes.Intranet.EventType; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + PageSize = 10, + ExportJson = DefaultExportJson, + IsSubForm = false, + 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.EventType)), + 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.EventType)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items=[ + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + ]} + }), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(), + } + ); - // #region EventType Fields - // await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { - // new() { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.Guid, - // FieldName = "Id", - // CaptionName = "App.Listform.ListformField.Id", - // Width = 100, - // ListOrderNo = 1, - // Visible = false, - // IsActive = true, - // ValidationRuleJson = DefaultValidationRuleRequiredJson, - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // }, - // new() { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.String, - // FieldName = "Name", - // CaptionName = "App.Listform.ListformField.Name", - // Width = 500, - // ListOrderNo = 2, - // Visible = true, - // IsActive = true, - // SortIndex = 1, - // SortDirection = GridColumnOptions.SortOrderAsc, - // AllowSearch = true, - // ValidationRuleJson = DefaultValidationRuleRequiredJson, - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // } - // }); - // #endregion - // } - // #endregion + #region EventType Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + CaptionName = "App.Listform.ListformField.Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + CaptionName = "App.Listform.ListformField.Name", + Width = 500, + ListOrderNo = 2, + Visible = true, + IsActive = true, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + }); + #endregion + } + #endregion - // #region EventCategory - // listFormName = AppCodes.Intranet.EventCategory; - // if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) - // { - // var listForm = await _listFormRepository.InsertAsync( - // new ListForm() - // { - // ListFormType = ListFormTypeEnum.List, - // PageSize = 10, - // ExportJson = DefaultExportJson, - // IsSubForm = false, - // 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.EventCategory)), - // 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.EventCategory)), - // DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), - // PagerOptionJson = DefaultPagerOptionJson, - // EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false), - // EditingFormJson = JsonSerializer.Serialize(new List() { - // new() { Order=1, ColCount=1, ColSpan=1,ItemType="group", Items=[ - // new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - // ]} - // }), - // InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(), - // } - // ); + #region EventCategory + listFormName = AppCodes.Intranet.EventCategory; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + PageSize = 10, + ExportJson = DefaultExportJson, + IsSubForm = false, + 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.EventCategory)), + 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.EventCategory)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 250, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { Order=1, ColCount=1, ColSpan=1,ItemType="group", Items=[ + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + ]} + }), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(), + } + ); - // #region EventCategory Fields - // await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { - // new() { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.Guid, - // FieldName = "Id", - // CaptionName = "App.Listform.ListformField.Id", - // Width = 100, - // ListOrderNo = 1, - // Visible = false, - // IsActive = true, - // ValidationRuleJson = DefaultValidationRuleRequiredJson, - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // }, - // new() { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.String, - // FieldName = "Name", - // CaptionName = "App.Listform.ListformField.Name", - // Width = 500, - // ListOrderNo = 2, - // Visible = true, - // IsActive = true, - // SortIndex = 1, - // SortDirection = GridColumnOptions.SortOrderAsc, - // AllowSearch = true, - // ValidationRuleJson = DefaultValidationRuleRequiredJson, - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // } - // }); - // #endregion - // } - // #endregion + #region EventCategory Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + CaptionName = "App.Listform.ListformField.Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + new() { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + CaptionName = "App.Listform.ListformField.Name", + Width = 500, + ListOrderNo = 2, + Visible = true, + IsActive = true, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + }); + #endregion + } + #endregion - // #region Event - // listFormName = AppCodes.Intranet.Event; - // if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) - // { - // var listForm = await _listFormRepository.InsertAsync( - // new ListForm() - // { - // ListFormType = ListFormTypeEnum.List, - // PageSize = 10, - // ExportJson = DefaultExportJson, - // IsSubForm = false, - // 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.Event)), - // 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.Event)), - // DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), - // PagerOptionJson = DefaultPagerOptionJson, - // EditingOptionJson = DefaultEditingOptionJson(listFormName, 500, 400, true, true, true, true, false), - // EditingFormJson = JsonSerializer.Serialize(new List() - // { - // new() { - // Order = 1, ColCount = 1, ColSpan = 1, ItemType = "group", Items = - // [ - // new EditingFormItemDto { Order = 1, DataField = "CategoryId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - // new EditingFormItemDto { Order = 2, DataField = "TypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - // new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - // new EditingFormItemDto { Order = 4, DataField = "Place", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, - // new EditingFormItemDto { Order = 5, DataField = "UserId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - // new EditingFormItemDto { Order = 6, DataField = "Description", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, - // new EditingFormItemDto { Order = 7, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - // new EditingFormItemDto { Order = 8, DataField = "ParticipantsCount", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, - // new EditingFormItemDto { Order = 9, DataField = "Likes", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, - // ]} - // }), - // InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(), - // FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - // new() { FieldName = "Status", FieldDbType = DbType.String, Value = "Aktif", CustomValueType = FieldCustomValueTypeEnum.Value }, - // }), - // } - // ); + #region Event + listFormName = AppCodes.Intranet.Event; + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == listFormName)) + { + var listForm = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + PageSize = 10, + ExportJson = DefaultExportJson, + IsSubForm = false, + 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.Event)), + 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.Event)), + DeleteFieldsDefaultValueJson = DefaultDeleteFieldsDefaultValueJson(), + PagerOptionJson = DefaultPagerOptionJson, + EditingOptionJson = DefaultEditingOptionJson(listFormName, 750, 400, true, true, true, true, false), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() { + Order = 1, ColCount = 2, ColSpan = 1, ItemType = "group", Items = + [ + new EditingFormItemDto { Order = 1, DataField = "CategoryId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 2, DataField = "TypeId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Place", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "UserId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 7, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 6, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 8, DataField = "ParticipantsCount", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 9, DataField = "Likes", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + ]} + }), + InsertFieldsDefaultValueJson = DefaultInsertFieldsDefaultValueJson(), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { FieldName = "Status", FieldDbType = DbType.String, Value = "Aktif", CustomValueType = FieldCustomValueTypeEnum.Value }, + }), + } + ); - // #region Event Fields - // await _listFormFieldRepository.InsertManyAsync(new ListFormField[] - // { - // // Id - // new() - // { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.Guid, - // FieldName = "Id", - // CaptionName = "App.Listform.ListformField.Id", - // Width = 100, - // ListOrderNo = 1, - // Visible = false, - // IsActive = true, - // SortIndex = 0, - // ValidationRuleJson = DefaultValidationRuleRequiredJson, - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // }, - // // CategoryId - // new() - // { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.Guid, - // FieldName = "CategoryId", - // CaptionName = "App.Listform.ListformField.CategoryId", - // Width = 150, - // ListOrderNo = 2, - // Visible = true, - // IsActive = true, - // ValidationRuleJson = DefaultValidationRuleRequiredJson, - // LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.EventCategory), "Id", "Name"), - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // }, - // // TypeId - // new() - // { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.Guid, - // FieldName = "TypeId", - // CaptionName = "App.Listform.ListformField.TypeId", - // Width = 150, - // ListOrderNo = 3, - // Visible = true, - // IsActive = true, - // ValidationRuleJson = DefaultValidationRuleRequiredJson, - // LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.EventType), "Id", "Name"), - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // }, - // // Name - // new() - // { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.String, - // FieldName = "Name", - // CaptionName = "App.Listform.ListformField.Name", - // Width = 200, - // ListOrderNo = 4, - // Visible = true, - // IsActive = true, - // SortIndex = 1, - // SortDirection = GridColumnOptions.SortOrderAsc, - // AllowSearch = true, - // ValidationRuleJson = DefaultValidationRuleRequiredJson, - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // }, - // // Place - // new() - // { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.String, - // FieldName = "Place", - // CaptionName = "App.Listform.ListformField.Place", - // Width = 200, - // ListOrderNo = 5, - // Visible = true, - // IsActive = true, - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // }, - // // Description - // new() - // { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.String, - // FieldName = "Description", - // CaptionName = "App.Listform.ListformField.Description", - // Width = 500, - // ListOrderNo = 6, - // Visible = true, - // IsActive = true, - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // }, - // // OrganizerId - // new() - // { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.Guid, - // FieldName = "UserId", - // CaptionName = "App.Listform.ListformField.UserId", - // Width = 150, - // ListOrderNo = 7, - // Visible = true, - // IsActive = true, - // LookupJson = JsonSerializer.Serialize(new LookupDto { - // DataSourceType = UiLookupDataSourceTypeEnum.Query, - // DisplayExpr = "Name", - // ValueExpr = "Key", - // LookupQuery = LookupQueryValues.UserValues - // }), - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // }, - // // ParticipantsCount - // new() - // { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.Int32, - // FieldName = "ParticipantsCount", - // CaptionName = "App.Listform.ListformField.ParticipantsCount", - // Width = 80, - // ListOrderNo = 8, - // Visible = true, - // IsActive = true, - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // }, - // // ParticipantsCount - // new() - // { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.Int32, - // FieldName = "Likes", - // CaptionName = "App.Listform.ListformField.Likes", - // Width = 80, - // ListOrderNo = 9, - // Visible = true, - // IsActive = true, - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // }, - // // Status - // new() - // { - // ListFormCode = listForm.ListFormCode, - // CultureName = LanguageCodes.En, - // SourceDbType = DbType.String, - // FieldName = "Status", - // CaptionName = "App.Listform.ListformField.Status", - // Width = 120, - // ListOrderNo = 10, - // Visible = true, - // IsActive = true, - // LookupJson = JsonSerializer.Serialize(new LookupDto { - // DataSourceType = UiLookupDataSourceTypeEnum.StaticData, - // DisplayExpr = "name", - // ValueExpr = "key", - // LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { - // new () { Key="Published",Name="Yayımlandı" }, - // new () { Key="Draft",Name="Taslak" }, - // new () { Key="Cancelled",Name="İptal" }, - // }), - // }), - // ColumnCustomizationJson = DefaultColumnCustomizationJson, - // PermissionJson = DefaultFieldPermissionJson(listForm.Name), - // PivotSettingsJson = DefaultPivotSettingsJson - // } - // }); - // #endregion - // } - // #endregion + #region Event Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + CaptionName = "App.Listform.ListformField.Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + SortIndex = 0, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + // CategoryId + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "CategoryId", + CaptionName = "App.Listform.ListformField.CategoryId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.EventCategory), "Id", "Name"), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + // TypeId + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "TypeId", + CaptionName = "App.Listform.ListformField.TypeId", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + LookupJson = LookupQueryValues.DefaultLookupQueryJson(nameof(TableNameEnum.EventType), "Id", "Name"), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + // Name + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + CaptionName = "App.Listform.ListformField.Name", + Width = 200, + ListOrderNo = 4, + Visible = true, + IsActive = true, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = DefaultValidationRuleRequiredJson, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + // Place + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Place", + CaptionName = "App.Listform.ListformField.Place", + Width = 200, + ListOrderNo = 5, + Visible = true, + IsActive = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + // Description + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + CaptionName = "App.Listform.ListformField.Description", + Width = 500, + ListOrderNo = 6, + Visible = true, + IsActive = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + // OrganizerId + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "UserId", + CaptionName = "App.Listform.ListformField.UserId", + Width = 150, + ListOrderNo = 7, + Visible = true, + IsActive = true, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = LookupQueryValues.UserValues + }), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + // ParticipantsCount + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "ParticipantsCount", + CaptionName = "App.Listform.ListformField.ParticipantsCount", + Width = 80, + ListOrderNo = 8, + Visible = true, + IsActive = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + // ParticipantsCount + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Likes", + CaptionName = "App.Listform.ListformField.Likes", + Width = 80, + ListOrderNo = 9, + Visible = true, + IsActive = true, + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + }, + // Status + new() + { + ListFormCode = listForm.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + CaptionName = "App.Listform.ListformField.Status", + Width = 120, + ListOrderNo = 10, + Visible = true, + IsActive = true, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key="Published",Name="Yayımlandı" }, + new () { Key="Draft",Name="Taslak" }, + new () { Key="Cancelled",Name="İptal" }, + }), + }), + ColumnCustomizationJson = DefaultColumnCustomizationJson, + PermissionJson = DefaultFieldPermissionJson(listForm.Name), + PivotSettingsJson = DefaultPivotSettingsJson + } + }); + #endregion + } + #endregion } } diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenusData.json index 6dbd625..c85f689 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/MenusData.json @@ -1066,6 +1066,36 @@ "RequiredPermissionName": "App.Intranet.SocialPost", "IsDisabled": false }, + { + "ParentCode": "App.Administration.Intranet", + "Code": "App.Intranet.Events.EventType", + "DisplayName": "App.Intranet.Events.EventType", + "Order": 4, + "Url": "/admin/list/App.Intranet.Events.EventType", + "Icon": "FcPlanner", + "RequiredPermissionName": "App.Intranet.Events.EventType", + "IsDisabled": false + }, + { + "ParentCode": "App.Administration.Intranet", + "Code": "App.Intranet.Events.EventCategory", + "DisplayName": "App.Intranet.Events.EventCategory", + "Order": 5, + "Url": "/admin/list/App.Intranet.Events.EventCategory", + "Icon": "FcTreeStructure", + "RequiredPermissionName": "App.Intranet.Events.EventCategory", + "IsDisabled": false + }, + { + "ParentCode": "App.Administration.Intranet", + "Code": "App.Intranet.Events.Event", + "DisplayName": "App.Intranet.Events.Event", + "Order": 6, + "Url": "/admin/list/App.Intranet.Events.Event", + "Icon": "FcCalendar", + "RequiredPermissionName": "App.Intranet.Events.Event", + "IsDisabled": false + }, { "ParentCode": "App.Administration", "Code": "App.Administration.Restrictions", diff --git a/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionsData.json index fecaa8b..01ae9d1 100644 --- a/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Sozsoft.Platform.DbMigrator/Seeds/PermissionsData.json @@ -3347,7 +3347,7 @@ "DisplayName": "App.Intranet.Events.EventType", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3356,7 +3356,7 @@ "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3365,7 +3365,7 @@ "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3374,7 +3374,7 @@ "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3383,7 +3383,7 @@ "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3392,7 +3392,7 @@ "DisplayName": "Import", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3401,7 +3401,7 @@ "DisplayName": "Note", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3410,7 +3410,7 @@ "DisplayName": "App.Intranet.Events.EventCategory", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3419,7 +3419,7 @@ "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3428,7 +3428,7 @@ "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3437,7 +3437,7 @@ "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3446,7 +3446,7 @@ "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3455,7 +3455,7 @@ "DisplayName": "Import", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3464,7 +3464,7 @@ "DisplayName": "Note", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3473,7 +3473,7 @@ "DisplayName": "App.Intranet.Events.Event", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3482,7 +3482,7 @@ "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3491,7 +3491,7 @@ "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3500,7 +3500,7 @@ "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3509,7 +3509,7 @@ "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3518,7 +3518,7 @@ "DisplayName": "Import", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3527,7 +3527,7 @@ "DisplayName": "Note", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3536,7 +3536,7 @@ "DisplayName": "Widget", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3545,7 +3545,7 @@ "DisplayName": "App.Intranet.Announcement", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3554,7 +3554,7 @@ "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3563,7 +3563,7 @@ "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3572,7 +3572,7 @@ "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3581,7 +3581,7 @@ "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3590,7 +3590,7 @@ "DisplayName": "Import", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3599,7 +3599,7 @@ "DisplayName": "Note", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3608,7 +3608,7 @@ "DisplayName": "Widget", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3617,7 +3617,7 @@ "DisplayName": "App.Intranet.SocialPost", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3626,7 +3626,7 @@ "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3635,7 +3635,7 @@ "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3644,7 +3644,7 @@ "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3653,7 +3653,7 @@ "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3662,7 +3662,7 @@ "DisplayName": "Import", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3671,7 +3671,7 @@ "DisplayName": "Note", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3680,7 +3680,7 @@ "DisplayName": "Widget", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3689,7 +3689,7 @@ "DisplayName": "App.Intranet.SocialComment", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3698,7 +3698,7 @@ "DisplayName": "Create", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3707,7 +3707,7 @@ "DisplayName": "Update", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3716,7 +3716,7 @@ "DisplayName": "Delete", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3725,7 +3725,7 @@ "DisplayName": "Export", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3734,7 +3734,7 @@ "DisplayName": "Import", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", @@ -3743,7 +3743,7 @@ "DisplayName": "Note", "IsEnabled": true, "MultiTenancySide": 3, - "MenuGroup": "Kurs" + "MenuGroup": "Erp|Kurs" }, { "GroupName": "App.Administration", diff --git a/api/src/Sozsoft.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Sozsoft.Platform.Domain.Shared/Enums/TableNameEnum.cs index ca64caf..359d766 100644 --- a/api/src/Sozsoft.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Sozsoft.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -79,4 +79,6 @@ public enum TableNameEnum EventCategory, EventType, Event, + EventPhoto, + EventComment } diff --git a/api/src/Sozsoft.Platform.Domain.Shared/PlatformConsts.cs b/api/src/Sozsoft.Platform.Domain.Shared/PlatformConsts.cs index be5a096..217db0a 100644 --- a/api/src/Sozsoft.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Sozsoft.Platform.Domain.Shared/PlatformConsts.cs @@ -358,9 +358,10 @@ public static class PlatformConsts public const string SocialPost = Default + ".SocialPost"; public const string SocialComment = Default + ".SocialComment"; - public const string EventCategory = Default + ".EventCategory"; - public const string EventType = Default + ".EventType"; - public const string Event = Default + ".Event"; + public const string Events = Default + ".Events"; + public const string EventType = Events + ".EventType"; + public const string EventCategory = Events + ".EventCategory"; + public const string Event = Events + ".Event"; } public static class Definitions diff --git a/api/src/Sozsoft.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Sozsoft.Platform.Domain.Shared/TableNameResolver.cs index bc4dc1b..377bfc7 100644 --- a/api/src/Sozsoft.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Sozsoft.Platform.Domain.Shared/TableNameResolver.cs @@ -90,6 +90,11 @@ public static class TableNameResolver { nameof(TableNameEnum.SocialPollOption), (TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.SocialComment), (TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.SocialLike), (TablePrefix.TenantByName, MenuPrefix.Administration) }, + { nameof(TableNameEnum.EventCategory), (TablePrefix.TenantByName, MenuPrefix.Administration) }, + { nameof(TableNameEnum.EventType), (TablePrefix.TenantByName, MenuPrefix.Administration) }, + { nameof(TableNameEnum.Event), (TablePrefix.TenantByName, MenuPrefix.Administration) }, + { nameof(TableNameEnum.EventPhoto), (TablePrefix.TenantByName, MenuPrefix.Administration) }, + { nameof(TableNameEnum.EventComment), (TablePrefix.TenantByName, MenuPrefix.Administration) }, }; diff --git a/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs b/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs index f2d642f..5fb4a2e 100644 --- a/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Sozsoft.Platform.Domain/Data/SeedConsts.cs @@ -337,9 +337,10 @@ public static class SeedConsts public const string SocialPost = Default + ".SocialPost"; public const string SocialComment = Default + ".SocialComment"; - public const string EventCategory = Default + ".EventCategory"; - public const string EventType = Default + ".EventType"; - public const string Event = Default + ".Event"; + public const string Events = Default + ".Events"; + public const string EventType = Events + ".EventType"; + public const string EventCategory = Events + ".EventCategory"; + public const string Event = Events + ".Event"; } public static class Definitions diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Definitions/Announcement.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/Announcement.cs similarity index 100% rename from api/src/Sozsoft.Platform.Domain/Entities/Tenant/Definitions/Announcement.cs rename to api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/Announcement.cs diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/Event.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/Event.cs new file mode 100644 index 0000000..bdffc56 --- /dev/null +++ b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/Event.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Sozsoft.Platform.Entities; + +public class Event : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid CategoryId { get; set; } + public EventCategory Category { get; set; } + + public Guid TypeId { get; set; } + public EventType Type { get; set; } + + public DateTime Date { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public string Place { get; set; } + public string Status { get; set; } + + public Guid? UserId { get; set; } + + public int ParticipantsCount { get; set; } + public int Likes { get; set; } + public bool isPublished { get; set; } = false; + + // public ICollection Participants { get; set; } = []; + public ICollection Photos { get; set; } = []; + public ICollection Comments { get; set; } = []; + + Guid? IMultiTenant.TenantId => TenantId; +} + + + diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventCategory.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventCategory.cs new file mode 100644 index 0000000..d975018 --- /dev/null +++ b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventCategory.cs @@ -0,0 +1,19 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; +using System.Collections.Generic; + +namespace Sozsoft.Platform.Entities; + +public class EventCategory : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + + // Navigation + public ICollection Events { get; set; } + + Guid? IMultiTenant.TenantId => TenantId; +} + diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventComment.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventComment.cs new file mode 100644 index 0000000..c7f22dc --- /dev/null +++ b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventComment.cs @@ -0,0 +1,19 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Sozsoft.Platform.Entities; + +public class EventComment : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid EventId { get; set; } + public Guid? UserId { get; set; } + public string Content { get; set; } + public int Likes { get; set; } + + public Event Event { get; set; } + + Guid? IMultiTenant.TenantId => TenantId; +} diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventPhoto.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventPhoto.cs new file mode 100644 index 0000000..5d0924f --- /dev/null +++ b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventPhoto.cs @@ -0,0 +1,17 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Sozsoft.Platform.Entities; + +public class EventPhoto : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid EventId { get; set; } + public string Url { get; set; } + + public Event Event { get; set; } + + Guid? IMultiTenant.TenantId => TenantId; +} diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventType.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventType.cs new file mode 100644 index 0000000..061e2b8 --- /dev/null +++ b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/EventType.cs @@ -0,0 +1,19 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; +using System.Collections.Generic; + +namespace Sozsoft.Platform.Entities; + +public class EventType : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Name { get; set; } + + // Navigation + public ICollection Events { get; set; } + + Guid? IMultiTenant.TenantId => TenantId; +} + diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Definitions/SocialPost.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/SocialPost.cs similarity index 100% rename from api/src/Sozsoft.Platform.Domain/Entities/Tenant/Definitions/SocialPost.cs rename to api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/SocialPost.cs diff --git a/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Definitions/Survey.cs b/api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/Survey.cs similarity index 100% rename from api/src/Sozsoft.Platform.Domain/Entities/Tenant/Definitions/Survey.cs rename to api/src/Sozsoft.Platform.Domain/Entities/Tenant/Intranet/Survey.cs diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 2b0a5dd..d6fece3 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -110,6 +110,12 @@ public class PlatformDbContext : #endregion #region Intranet + public DbSet Events { get; set; } + public DbSet EventCategories { get; set; } + public DbSet EventTypes { get; set; } + public DbSet EventPhotos { get; set; } + public DbSet EventComments { get; set; } + public DbSet Announcements { get; set; } public DbSet Surveys { get; set; } @@ -1167,7 +1173,7 @@ public class PlatformDbContext : b.HasOne(x => x.SocialPost) .WithOne(p => p.Media) - .HasForeignKey(x => x.SocialPostId) + .HasForeignKey(x => x.SocialPostId) .OnDelete(DeleteBehavior.Cascade); }); @@ -1207,5 +1213,72 @@ public class PlatformDbContext : .HasForeignKey(x => x.SocialPostId) .OnDelete(DeleteBehavior.Cascade); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventCategory)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventType)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(128); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Event)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Place).HasMaxLength(256); + b.Property(x => x.Description).HasMaxLength(1024); + b.Property(x => x.Status).HasMaxLength(20); + b.Property(x => x.isPublished).HasDefaultValue(false); + + b.HasOne(x => x.Category) + .WithMany(x => x.Events) + .HasForeignKey(x => x.CategoryId) + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne(x => x.Type) + .WithMany(x => x.Events) + .HasForeignKey(x => x.TypeId) + .OnDelete(DeleteBehavior.Restrict); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventPhoto)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Url).HasMaxLength(512); + + // Event -> EventPhoto (1 - N) + b.HasOne(x => x.Event) + .WithMany(x => x.Photos) + .HasForeignKey(x => x.EventId) + .OnDelete(DeleteBehavior.Cascade); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.EventComment)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Content).HasMaxLength(512); + b.Property(x => x.Likes).HasDefaultValue(0); + + // Event -> EventComment (1 - N) + b.HasOne(x => x.Event) + .WithMany(x => x.Comments) + .HasForeignKey(x => x.EventId) + .OnDelete(DeleteBehavior.Cascade); + }); } } diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260506113136_Initial.Designer.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260506141749_Initial.Designer.cs similarity index 95% rename from api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260506113136_Initial.Designer.cs rename to api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260506141749_Initial.Designer.cs index d87816e..1fcb81e 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260506113136_Initial.Designer.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260506141749_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Sozsoft.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20260506113136_Initial")] + [Migration("20260506141749_Initial")] partial class Initial { /// @@ -1945,6 +1945,306 @@ namespace Sozsoft.Platform.Migrations b.ToTable("Sas_H_DynamicService", (string)null); }); + modelBuilder.Entity("Sozsoft.Platform.Entities.Event", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Likes") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ParticipantsCount") + .HasColumnType("int"); + + b.Property("Place") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Status") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("isPublished") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.HasIndex("TypeId"); + + b.ToTable("Adm_T_Event", (string)null); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventCategory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Adm_T_EventCategory", (string)null); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventComment", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EventId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Likes") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EventId"); + + b.ToTable("Adm_T_EventComment", (string)null); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventPhoto", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EventId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Url") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.HasKey("Id"); + + b.HasIndex("EventId"); + + b.ToTable("Adm_T_EventPhoto", (string)null); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Adm_T_EventType", (string)null); + }); + modelBuilder.Entity("Sozsoft.Platform.Entities.GlobalSearch", b => { b.Property("Id") @@ -7107,6 +7407,47 @@ namespace Sozsoft.Platform.Migrations .HasForeignKey("CityId"); }); + modelBuilder.Entity("Sozsoft.Platform.Entities.Event", b => + { + b.HasOne("Sozsoft.Platform.Entities.EventCategory", "Category") + .WithMany("Events") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Sozsoft.Platform.Entities.EventType", "Type") + .WithMany("Events") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("Type"); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventComment", b => + { + b.HasOne("Sozsoft.Platform.Entities.Event", "Event") + .WithMany("Comments") + .HasForeignKey("EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventPhoto", b => + { + b.HasOne("Sozsoft.Platform.Entities.Event", "Event") + .WithMany("Photos") + .HasForeignKey("EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + }); + modelBuilder.Entity("Sozsoft.Platform.Entities.JobPosition", b => { b.HasOne("Sozsoft.Platform.Entities.Department", "Department") @@ -7535,6 +7876,23 @@ namespace Sozsoft.Platform.Migrations b.Navigation("JobPositions"); }); + modelBuilder.Entity("Sozsoft.Platform.Entities.Event", b => + { + b.Navigation("Comments"); + + b.Navigation("Photos"); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventCategory", b => + { + b.Navigation("Events"); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventType", b => + { + b.Navigation("Events"); + }); + modelBuilder.Entity("Sozsoft.Platform.Entities.Order", b => { b.Navigation("Items"); diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260506113136_Initial.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260506141749_Initial.cs similarity index 95% rename from api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260506113136_Initial.cs rename to api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260506141749_Initial.cs index c598019..e631e80 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260506113136_Initial.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/20260506141749_Initial.cs @@ -513,6 +513,46 @@ namespace Sozsoft.Platform.Migrations table.PrimaryKey("PK_Adm_T_Department", x => x.Id); }); + migrationBuilder.CreateTable( + name: "Adm_T_EventCategory", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Adm_T_EventCategory", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Adm_T_EventType", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Adm_T_EventType", x => x.Id); + }); + migrationBuilder.CreateTable( name: "Adm_T_IpRestriction", columns: table => new @@ -1916,6 +1956,48 @@ namespace Sozsoft.Platform.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "Adm_T_Event", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + CategoryId = table.Column(type: "uniqueidentifier", nullable: false), + TypeId = table.Column(type: "uniqueidentifier", nullable: false), + Date = table.Column(type: "datetime2", nullable: false), + Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Description = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), + Place = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + Status = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), + UserId = table.Column(type: "uniqueidentifier", nullable: true), + ParticipantsCount = table.Column(type: "int", nullable: false), + Likes = table.Column(type: "int", nullable: false), + isPublished = table.Column(type: "bit", nullable: false, defaultValue: false), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Adm_T_Event", x => x.Id); + table.ForeignKey( + name: "FK_Adm_T_Event_Adm_T_EventCategory_CategoryId", + column: x => x.CategoryId, + principalTable: "Adm_T_EventCategory", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Adm_T_Event_Adm_T_EventType_TypeId", + column: x => x.TypeId, + principalTable: "Adm_T_EventType", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + migrationBuilder.CreateTable( name: "Adm_T_ReportTemplate", columns: table => new @@ -2620,6 +2702,62 @@ namespace Sozsoft.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "Adm_T_EventComment", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + EventId = table.Column(type: "uniqueidentifier", nullable: false), + UserId = table.Column(type: "uniqueidentifier", nullable: true), + Content = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + Likes = table.Column(type: "int", nullable: false, defaultValue: 0), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Adm_T_EventComment", x => x.Id); + table.ForeignKey( + name: "FK_Adm_T_EventComment_Adm_T_Event_EventId", + column: x => x.EventId, + principalTable: "Adm_T_Event", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Adm_T_EventPhoto", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + EventId = table.Column(type: "uniqueidentifier", nullable: false), + Url = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Adm_T_EventPhoto", x => x.Id); + table.ForeignKey( + name: "FK_Adm_T_EventPhoto_Adm_T_Event_EventId", + column: x => x.EventId, + principalTable: "Adm_T_Event", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "Adm_T_SocialPollOption", columns: table => new @@ -3117,6 +3255,26 @@ namespace Sozsoft.Platform.Migrations table: "AbpUsers", column: "UserName"); + migrationBuilder.CreateIndex( + name: "IX_Adm_T_Event_CategoryId", + table: "Adm_T_Event", + column: "CategoryId"); + + migrationBuilder.CreateIndex( + name: "IX_Adm_T_Event_TypeId", + table: "Adm_T_Event", + column: "TypeId"); + + migrationBuilder.CreateIndex( + name: "IX_Adm_T_EventComment_EventId", + table: "Adm_T_EventComment", + column: "EventId"); + + migrationBuilder.CreateIndex( + name: "IX_Adm_T_EventPhoto_EventId", + table: "Adm_T_EventPhoto", + column: "EventId"); + migrationBuilder.CreateIndex( name: "IX_Adm_T_JobPosition_DepartmentId", table: "Adm_T_JobPosition", @@ -3466,6 +3624,12 @@ namespace Sozsoft.Platform.Migrations migrationBuilder.DropTable( name: "Adm_T_Announcement"); + migrationBuilder.DropTable( + name: "Adm_T_EventComment"); + + migrationBuilder.DropTable( + name: "Adm_T_EventPhoto"); + migrationBuilder.DropTable( name: "Adm_T_IpRestriction"); @@ -3634,6 +3798,9 @@ namespace Sozsoft.Platform.Migrations migrationBuilder.DropTable( name: "AbpUsers"); + migrationBuilder.DropTable( + name: "Adm_T_Event"); + migrationBuilder.DropTable( name: "Adm_T_Department"); @@ -3691,6 +3858,12 @@ namespace Sozsoft.Platform.Migrations migrationBuilder.DropTable( name: "AbpAuditLogs"); + migrationBuilder.DropTable( + name: "Adm_T_EventCategory"); + + migrationBuilder.DropTable( + name: "Adm_T_EventType"); + migrationBuilder.DropTable( name: "Adm_T_SocialPost"); diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index b42a7b7..6433ee9 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -1942,6 +1942,306 @@ namespace Sozsoft.Platform.Migrations b.ToTable("Sas_H_DynamicService", (string)null); }); + modelBuilder.Entity("Sozsoft.Platform.Entities.Event", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Description") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Likes") + .HasColumnType("int"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("ParticipantsCount") + .HasColumnType("int"); + + b.Property("Place") + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("Status") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("TypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("isPublished") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.HasKey("Id"); + + b.HasIndex("CategoryId"); + + b.HasIndex("TypeId"); + + b.ToTable("Adm_T_Event", (string)null); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventCategory", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Adm_T_EventCategory", (string)null); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventComment", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EventId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Likes") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EventId"); + + b.ToTable("Adm_T_EventComment", (string)null); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventPhoto", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("EventId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Url") + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.HasKey("Id"); + + b.HasIndex("EventId"); + + b.ToTable("Adm_T_EventPhoto", (string)null); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventType", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.ToTable("Adm_T_EventType", (string)null); + }); + modelBuilder.Entity("Sozsoft.Platform.Entities.GlobalSearch", b => { b.Property("Id") @@ -7104,6 +7404,47 @@ namespace Sozsoft.Platform.Migrations .HasForeignKey("CityId"); }); + modelBuilder.Entity("Sozsoft.Platform.Entities.Event", b => + { + b.HasOne("Sozsoft.Platform.Entities.EventCategory", "Category") + .WithMany("Events") + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Sozsoft.Platform.Entities.EventType", "Type") + .WithMany("Events") + .HasForeignKey("TypeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Category"); + + b.Navigation("Type"); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventComment", b => + { + b.HasOne("Sozsoft.Platform.Entities.Event", "Event") + .WithMany("Comments") + .HasForeignKey("EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventPhoto", b => + { + b.HasOne("Sozsoft.Platform.Entities.Event", "Event") + .WithMany("Photos") + .HasForeignKey("EventId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Event"); + }); + modelBuilder.Entity("Sozsoft.Platform.Entities.JobPosition", b => { b.HasOne("Sozsoft.Platform.Entities.Department", "Department") @@ -7532,6 +7873,23 @@ namespace Sozsoft.Platform.Migrations b.Navigation("JobPositions"); }); + modelBuilder.Entity("Sozsoft.Platform.Entities.Event", b => + { + b.Navigation("Comments"); + + b.Navigation("Photos"); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventCategory", b => + { + b.Navigation("Events"); + }); + + modelBuilder.Entity("Sozsoft.Platform.Entities.EventType", b => + { + b.Navigation("Events"); + }); + modelBuilder.Entity("Sozsoft.Platform.Entities.Order", b => { b.Navigation("Items"); diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json index bf62672..717556a 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantData.json @@ -1899,5 +1899,139 @@ "Photos": [], "Comments": [] } + ], + "EventComments": [ + { + "EventName": "Yaz Futbol Turnuvası 2025", + "UserName": "system@sozsoft.com", + "Content": "Muhteşem bir gündü! Yılın en güzel etkinliği 🎉", + "Likes": 12 + }, + { + "EventName": "Yaz Futbol Turnuvası 2025", + "UserName": "system@sozsoft.com", + "Content": "Voleybol turnuvası harikaydı, gelecek yıl yine yapalım!", + "Likes": 8 + }, + { + "EventName": "Kültür Gezisi: Kapadokya", + "UserName": "system@sozsoft.com", + "Content": "Ekibimiz 2. oldu! Çok gurur duydum herkesle 💪", + "Likes": 15 + }, + { + "EventName": "Kültür Gezisi: Kapadokya", + "UserName": "system@sozsoft.com", + "Content": "Gece boyunca kod yazmak ve pizza yemek priceless! 🍕", + "Likes": 10 + }, + { + "EventName": "Müzik Dinletisi: Jazz Akşamı", + "UserName": "system@sozsoft.com", + "Content": "İT departmanı şampiyon oldu! Gelecek sene kupayı koruyacağız 🏆", + "Likes": 18 + }, + { + "EventName": "Müzik Dinletisi: Jazz Akşamı", + "UserName": "system@sozsoft.com", + "Content": "Yılın en şık gecesi! Organizasyon mükemmeldi 👏", + "Likes": 25 + }, + { + "EventName": "Müzik Dinletisi: Jazz Akşamı", + "UserName": "system@sozsoft.com", + "Content": "Tombala hediyelerim harika, çok teşekkürler! 🎁", + "Likes": 14 + }, + { + "EventName": "Müzik Dinletisi: Jazz Akşamı", + "UserName": "system@sozsoft.com", + "Content": "Müzik grubunuz süperdi, dans pistinden ayrılamadık! 🎵", + "Likes": 19 + }, + { + "EventName": "Müzik Dinletisi: Jazz Akşamı", + "UserName": "system@sozsoft.com", + "Content": "İlk defa ebru yaptım, çok huzurlu bir deneyimdi 🎨", + "Likes": 11 + } + ], + "EventPhotos": [ + { + "EventName": "Yaz Futbol Turnuvası 2025", + "Url": "https://images.unsplash.com/photo-1530541930197-ff16ac917b0e?w=800" + }, + { + "EventName": "Yaz Futbol Turnuvası 2025", + "Url": "https://images.unsplash.com/photo-1527529482837-4698179dc6ce?w=800" + }, + { + "EventName": "Yaz Futbol Turnuvası 2025", + "Url": "https://images.unsplash.com/photo-1528605105345-5344ea20e269?w=800" + }, + { + "EventName": "Yaz Futbol Turnuvası 2025", + "Url": "https://images.unsplash.com/photo-1504196606672-aef5c9cefc92?w=800" + }, + { + "EventName": "Kültür Gezisi: Kapadokya", + "Url": "https://images.unsplash.com/photo-1504384308090-c894fdcc538d?w=800" + }, + { + "EventName": "Kültür Gezisi: Kapadokya", + "Url": "https://images.unsplash.com/photo-1522071820081-009f0129c71c?w=800" + }, + { + "EventName": "Kültür Gezisi: Kapadokya", + "Url": "https://images.unsplash.com/photo-1531482615713-2afd69097998?w=800" + }, + { + "EventName": "Müzik Dinletisi: Jazz Akşamı", + "Url": "hhttps://images.unsplash.com/photo-1579952363873-27f3bade9f55?w=800" + }, + { + "EventName": "Müzik Dinletisi: Jazz Akşamı", + "Url": "https://images.unsplash.com/photo-1574629810360-7efbbe195018?w=800" + }, + { + "EventName": "Müzik Dinletisi: Jazz Akşamı", + "Url": "https://images.unsplash.com/photo-1431324155629-1a6deb1dec8d?w=800" + }, + { + "EventName": "Müzik Dinletisi: Jazz Akşamı", + "Url": "https://images.unsplash.com/photo-1553778263-73a83bab9b0c?w=800" + }, + { + "EventName": "Müzik Dinletisi: Jazz Akşamı", + "Url": "https://images.unsplash.com/photo-1511795409834-ef04bbd61622?w=800" + }, + { + "EventName": "Yaz Futbol Turnuvası 2025", + "Url": "https://images.unsplash.com/photo-1519167758481-83f29da8c2b9?w=800" + }, + { + "EventName": "Yaz Futbol Turnuvası 2025", + "Url": "https://images.unsplash.com/photo-1464366400600-7168b8af9bc3?w=800" + }, + { + "EventName": "Kültür Gezisi: Kapadokya", + "Url": "https://images.unsplash.com/photo-1478147427282-58a87a120781?w=800" + }, + { + "EventName": "Kültür Gezisi: Kapadokya", + "Url": "https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=800" + }, + { + "EventName": "Kültür Gezisi: Kapadokya", + "Url": "https://images.unsplash.com/photo-1460661419201-fd4cecdf8a8b?w=800" + }, + { + "EventName": "Kültür Gezisi: Kapadokya", + "Url": "https://images.unsplash.com/photo-1513364776144-60967b0f800f?w=800" + }, + { + "EventName": "Kültür Gezisi: Kapadokya", + "Url": "https://images.unsplash.com/photo-1515405295579-ba7b45403062?w=800" + } ] } \ No newline at end of file diff --git a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs index 36b358d..c4c6904 100644 --- a/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs +++ b/api/src/Sozsoft.Platform.EntityFrameworkCore/Seeds/TenantDataSeeder.cs @@ -65,6 +65,11 @@ public class TenantSeederDto public List SocialPollOptions { get; set; } public List SocialComments { get; set; } public List SocialLikes { get; set; } + public List EventTypes { get; set; } + public List EventCategories { get; set; } + public List Events { get; set; } + public List EventPhotos { get; set; } + public List EventComments { get; set; } } public class SocialPostSeedDto @@ -121,6 +126,47 @@ public class SocialLikeSeedDto public string UserName { get; set; } } +public class EventTypeSeedDto +{ + public Guid Id { get; set; } + public string Name { get; set; } +} + +public class EventCategorySeedDto +{ + public Guid Id { get; set; } + public string Name { get; set; } +} + +public class EventSeedDto +{ + public string CategoryName { get; set; } + public string TypeName { get; set; } + public DateTime Date { get; set; } + public string Name { get; set; } + public string Description { get; set; } + public string Place { get; set; } + public string Status { get; set; } + public string UserName { get; set; } + public int ParticipantsCount { get; set; } + public int Likes { get; set; } + public bool IsPublished { get; set; } +} + +public class EventCommentSeedDto +{ + public string EventName { get; set; } + public string UserName { get; set; } + public string Content { get; set; } + public int Likes { get; set; } +} + +public class EventPhotoSeedDto +{ + public string EventName { get; set; } + public string Url { get; set; } +} + public class SurveySeedDto { public string Title { get; set; } @@ -409,6 +455,13 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _socialPollOptionRepository; private readonly IRepository _socialCommentRepository; private readonly IRepository _socialLikeRepository; + + private readonly IRepository _eventTypeRepository; + private readonly IRepository _eventCategoryRepository; + private readonly IRepository _eventRepository; + private readonly IRepository _eventCommentRepository; + private readonly IRepository _eventPhotoRepository; + private readonly ICurrentTenant _currentTenant; public TenantDataSeeder( @@ -451,6 +504,11 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository socialPollOptionRepository, IRepository socialCommentRepository, IRepository socialLikeRepository, + IRepository eventTypeRepository, + IRepository eventCategoryRepository, + IRepository eventRepository, + IRepository eventPhotoRepository, + IRepository eventCommentRepository, OrganizationUnitManager organizationUnitManager, ICurrentTenant currentTenant @@ -494,6 +552,11 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _socialPollOptionRepository = socialPollOptionRepository; _socialCommentRepository = socialCommentRepository; _socialLikeRepository = socialLikeRepository; + _eventTypeRepository = eventTypeRepository; + _eventCategoryRepository = eventCategoryRepository; + _eventRepository = eventRepository; + _eventCommentRepository = eventCommentRepository; + _eventPhotoRepository = eventPhotoRepository; _organizationUnitManager = organizationUnitManager; _currentTenant = currentTenant; } @@ -1108,6 +1171,98 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency }, autoSave: true); } + foreach (var item in items.EventTypes) + { + var exists = await _eventTypeRepository.AnyAsync(x => x.Name == item.Name); + + if (!exists) + { + await _eventTypeRepository.InsertAsync(new EventType { Name = item.Name }, autoSave: true); + } + } + + foreach (var item in items.EventCategories) + { + var exists = await _eventCategoryRepository.AnyAsync(x => x.Name == item.Name); + + if (!exists) + { + await _eventCategoryRepository.InsertAsync( + new EventCategory + { + Name = item.Name + }, autoSave: true + ); + } + } + + foreach (var item in items.Events) + { + var exists = await _eventRepository.AnyAsync(x => x.Name == item.Name); + + if (!exists) + { + var category = await _eventCategoryRepository.FirstOrDefaultAsync(x => x.Name == item.CategoryName); + var type = await _eventTypeRepository.FirstOrDefaultAsync(x => x.Name == item.TypeName); + var user = await _repositoryUser.FindByNormalizedUserNameAsync(item.UserName); + + if (category != null && type != null) + { + await _eventRepository.InsertAsync(new Event + { + CategoryId = category.Id, + TypeId = type.Id, + Date = item.Date, + Name = item.Name, + Place = item.Place, + Description = item.Description, + UserId = user != null ? user.Id : null, + Status = item.Status, + ParticipantsCount = item.ParticipantsCount, + Likes = item.Likes, + isPublished = item.IsPublished, + }, autoSave: true); + } + } + } + + foreach (var item in items.EventPhotos) + { + var exists = await _eventPhotoRepository.AnyAsync(x => x.Url == item.Url); + if (!exists) + { + var eventEntity = await _eventRepository.FirstOrDefaultAsync(x => x.Name == item.EventName); + + await _eventPhotoRepository.InsertAsync(new EventPhoto + { + EventId = eventEntity.Id, + Url = item.Url + }); + } + } + + foreach (var item in items.EventComments) + { + var eventEntity = await _eventRepository.FirstOrDefaultAsync(x => x.Name == item.EventName); + + if (eventEntity == null) + continue; + + var exists = await _eventCommentRepository.AnyAsync(x => x.Content == item.Content); + if (!exists) + { + var user = await _repositoryUser.FindByNormalizedUserNameAsync(item.UserName); + + await _eventCommentRepository.InsertAsync(new EventComment + { + EventId = eventEntity.Id, + Content = item.Content, + UserId = user != null ? user.Id : null, + Likes = item.Likes + }); + } + } + //admin kullanının departmen ve pozisyonunu default olarak belirliyoruz var adminUser = await _repositoryUser.FindByNormalizedEmailAsync(PlatformConsts.AbpIdentity.User.AdminEmailDefaultValue); if (adminUser != null) diff --git a/ui/src/proxy/intranet/models.ts b/ui/src/proxy/intranet/models.ts index bb91177..09ca10e 100644 --- a/ui/src/proxy/intranet/models.ts +++ b/ui/src/proxy/intranet/models.ts @@ -1,6 +1,7 @@ import { UserInfoViewModel } from "../admin/models" export interface IntranetDashboardDto { + events: EventDto[] birthdays: UserInfoViewModel[] documents: DocumentDto[] announcements: AnnouncementDto[] @@ -8,6 +9,31 @@ export interface IntranetDashboardDto { socialPosts: SocialPostDto[] } +// Etkinlik +export interface EventDto { + id: string + categoryName: string + typeName: string + date: Date + name: string + description: string + place: string + organizer: UserInfoViewModel + participants: number + photos: string[] + comments: EventCommentDto[] + likes: number + isPublished: boolean +} + +export interface EventCommentDto { + id: string + user: UserInfoViewModel + content: string + creationTime: Date + likes: number +} + // Doküman (FileItemDto ile uyumlu) export interface DocumentDto { id: string diff --git a/ui/src/views/intranet/Dashboard.tsx b/ui/src/views/intranet/Dashboard.tsx index 446eec3..464cf63 100644 --- a/ui/src/views/intranet/Dashboard.tsx +++ b/ui/src/views/intranet/Dashboard.tsx @@ -30,6 +30,7 @@ import { useLocalization } from '@/utils/hooks/useLocalization' import useLocale from '@/utils/hooks/useLocale' import { currentLocalDate } from '@/utils/dateUtils' import { useStoreState } from '@/store/store' +import UpcomingEvents from './widgets/UpcomingEvents' dayjs.extend(relativeTime) dayjs.extend(isBetween) @@ -110,6 +111,7 @@ const IntranetDashboard: React.FC = () => { permission: 'App.Intranet.Announcement.Widget', column: 'right', }, + { id: 'upcoming-events', permission: 'App.Intranet.Events.Event.Widget', column: 'right' }, ] // If permissions arrive after mount, initialize default order when needed @@ -239,6 +241,8 @@ const IntranetDashboard: React.FC = () => { // Widget component'ını render et const renderWidgetComponent = (widgetId: string) => { switch (widgetId) { + case 'upcoming-events': + return case 'today-birthdays': return case 'documents': @@ -252,10 +256,7 @@ const IntranetDashboard: React.FC = () => { ) case 'active-surveys': return ( - + ) case 'social-wall': return diff --git a/ui/src/views/intranet/widgets/UpcomingEvents.tsx b/ui/src/views/intranet/widgets/UpcomingEvents.tsx new file mode 100644 index 0000000..88ab055 --- /dev/null +++ b/ui/src/views/intranet/widgets/UpcomingEvents.tsx @@ -0,0 +1,51 @@ +import React from 'react' +import { FaCalendarAlt } from 'react-icons/fa' +import dayjs from 'dayjs' +import { EventDto } from '@/proxy/intranet/models' +import useLocale from '@/utils/hooks/useLocale' +import { currentLocalDate } from '@/utils/dateUtils' +import { useLocalization } from '@/utils/hooks/useLocalization' + +const UpcomingEvents: React.FC<{ events: EventDto[] }> = ({ events }) => { + const currentLocale = useLocale() + const { translate } = useLocalization(); + + const upcomingEvents = events.filter( + (event) => + event.isPublished && + dayjs(event.date).isAfter(dayjs()) && + dayjs(event.date).isBefore(dayjs().add(7, 'day')), + ) + + return ( +
+
+

+ + {translate('::App.Platform.Intranet.Widgets.UpcomingEvents.Title')} +

+
+
+ {upcomingEvents.length > 0 ? ( + upcomingEvents.slice(0, 3).map((event) => ( +
+

{event.name}

+

+ {currentLocalDate(event.date, currentLocale || 'tr')} - {event.place} +

+
+ )) + ) : ( +

+ {translate('::App.Platform.Intranet.Widgets.UpcomingEvents.NoEvent')} +

+ )} +
+
+ ) +} + +export default UpcomingEvents