diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/LanguagesData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/LanguagesData.json index 84bd354e..8dbbff8f 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/LanguagesData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/LanguagesData.json @@ -6679,6 +6679,12 @@ "tr": "Ziyaretçiler", "en": "Visitors" }, + { + "resourceName": "Platform", + "key": "App.Intranet.SocialPost", + "tr": "Sosyal Paylaşımlar", + "en": "Social Posts" + }, { "resourceName": "Platform", "key": "App.Definitions.Information", diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormSeeder.cs index 06f8aef6..5cd71c33 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormSeeder.cs @@ -41067,7 +41067,7 @@ public class ListFormSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "CompanyName", - Width = 200, + Width = 300, ListOrderNo = 3, Visible = true, IsActive = true, @@ -41101,7 +41101,7 @@ public class ListFormSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Email", - Width = 100, + Width = 150, ListOrderNo = 4, Visible = true, IsActive = true, @@ -41240,7 +41240,7 @@ public class ListFormSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.DateTime, FieldName = "CheckIn", - Width = 100, + Width = 150, ListOrderNo = 8, Visible = true, IsActive = true, @@ -41271,7 +41271,7 @@ public class ListFormSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.DateTime, FieldName = "CheckOut", - Width = 100, + Width = 150, ListOrderNo = 9, Visible = true, IsActive = true, @@ -43017,6 +43017,356 @@ public class ListFormSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region Social Post + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SocialPost)) + { + var listFormSocialPost = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = true, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.SocialPost, + Name = AppCodes.Intranet.SocialPost, + Title = AppCodes.Intranet.SocialPost, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Intranet.SocialPost, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialPost)), + KeyFieldName = "Id", + KeyFieldDbSourceType = DbType.Guid, + DefaultFilter = "\"IsDeleted\" = 'false'", + SortMode = GridOptions.SortModeSingle, + FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }), + HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }), + SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }), + GroupPanelJson = JsonSerializer.Serialize(new { Visible = true }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + ColumnOptionJson = JsonSerializer.Serialize(new + { + ColumnFixingEnabled = true, + ColumnAutoWidth = true, + ColumnChooserEnabled = true, + AllowColumnResizing = true, + AllowColumnReordering = true, + ColumnResizingMode = "widget", + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Intranet.SocialPost + ".Create", + R = AppCodes.Intranet.SocialPost, + U = AppCodes.Intranet.SocialPost + ".Update", + D = AppCodes.Intranet.SocialPost + ".Delete", + E = AppCodes.Intranet.SocialPost + ".Export", + I = AppCodes.Intranet.SocialPost + ".Import", + A = AppCodes.Intranet.SocialPost + ".Activity", + }), + DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialPost))}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "Id", + FieldDbType = DbType.Guid, + Value = "@ID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey } + }), + PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto + { + Visible = true, + AllowedPageSizes = "10,20,50,100", + ShowPageSizeSelector = true, + ShowNavigationButtons = true, + ShowInfo = false, + InfoText = "Page {0} of {1} ({2} items)", + DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive, + ScrollingMode = GridColumnOptions.ScrollingModeStandard, + LoadPanelEnabled = "auto", + LoadPanelText = "Loading..." + }), + EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto + { + Popup = new GridEditingPopupDto() + { + Title = "Social Post Form", + Width = 500, + Height = 400 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey }, + new() { + FieldName = "IsDeleted", + FieldDbType = DbType.Boolean, + Value = "false", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() { + Order=1, ColCount=1, ColSpan=2, ItemType="group", Items = + [ + new EditingFormItemDto { Order = 1, DataField = "EmployeeId", IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "Content", IsRequired = true, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 3, DataField = "LikeCount", IsRequired = true, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 4, DataField = "IsLiked", IsRequired = true, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 5, DataField = "IsOwnPost", IsRequired = true, EditorType2 = EditorTypes.dxCheckBox } + ] + } + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new() { + Hint = "Comments", + Text ="Comments", + UrlTarget="_blank", + AuthName = AppCodes.Hr.SurveyResponse + ".Update", + Url="/admin/list/list-employees/@Id" + }, + }), + } + ); + + #region Social Post Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listFormSocialPost.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + SortIndex = 0, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Intranet.SocialPost + ".Create", + R = AppCodes.Intranet.SocialPost, + U = AppCodes.Intranet.SocialPost + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormSocialPost.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "EmployeeId", + Width = 100, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = LookUpQueryValues.EmployeeValues + }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Intranet.SocialPost + ".Create", + R = AppCodes.Intranet.SocialPost, + U = AppCodes.Intranet.SocialPost + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormSocialPost.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Content", + Width = 800, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Intranet.SocialPost + ".Create", + R = AppCodes.Intranet.SocialPost, + U = AppCodes.Intranet.SocialPost + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormSocialPost.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "LikeCount", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Intranet.SocialPost + ".Create", + R = AppCodes.Intranet.SocialPost, + U = AppCodes.Intranet.SocialPost + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormSocialPost.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsLiked", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Intranet.SocialPost + ".Create", + R = AppCodes.Intranet.SocialPost, + U = AppCodes.Intranet.SocialPost + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormSocialPost.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsOwnPost", + Width = 100, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Intranet.SocialPost + ".Create", + R = AppCodes.Intranet.SocialPost, + U = AppCodes.Intranet.SocialPost + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + ]); + #endregion + } + #endregion + #endregion } } diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/MenusData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/MenusData.json index 978b5eb3..3a99eff7 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/MenusData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/MenusData.json @@ -2141,6 +2141,16 @@ "RequiredPermissionName": "App.Intranet.Visitor", "IsDisabled": false }, + { + "ParentCode": "App.Intranet", + "Code": "App.Intranet.SocialPost", + "DisplayName": "App.Intranet.SocialPost", + "Order": 7, + "Url": "/admin/list/list-socialpost", + "Icon": "FcShare", + "RequiredPermissionName": "App.Intranet.SocialPost", + "IsDisabled": false + }, { "ParentCode": null, "Code": "App.Participant", diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/PermissionsData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/PermissionsData.json index 1f7bdc62..99bfaaab 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/PermissionsData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/PermissionsData.json @@ -8995,6 +8995,80 @@ "MultiTenancySide": 3, "MenuGroup": "Kurs" }, + + { + "GroupName": "App.Intranet", + "Name": "App.Intranet.SocialPost", + "ParentName": null, + "DisplayName": "App.Intranet.SocialPost", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Intranet", + "Name": "App.Intranet.SocialPost.Create", + "ParentName": "App.Intranet.SocialPost", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Intranet", + "Name": "App.Intranet.SocialPost.Update", + "ParentName": "App.Intranet.SocialPost", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Intranet", + "Name": "App.Intranet.SocialPost.Delete", + "ParentName": "App.Intranet.SocialPost", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Intranet", + "Name": "App.Intranet.SocialPost.Export", + "ParentName": "App.Intranet.SocialPost", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Intranet", + "Name": "App.Intranet.SocialPost.Import", + "ParentName": "App.Intranet.SocialPost", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Intranet", + "Name": "App.Intranet.SocialPost.Activity", + "ParentName": "App.Intranet.SocialPost", + "DisplayName": "Activity", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Intranet", + "Name": "App.Intranet.SocialPost.Widget", + "ParentName": "App.Intranet.SocialPost", + "DisplayName": "Widget", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { "GroupName": "App.Crm", "Name": "App.Crm.Customer", diff --git a/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs index 97295a25..d2f8a446 100644 --- a/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -128,5 +128,11 @@ public enum TableNameEnum SurveyQuestion, SurveyQuestionOption, SurveyResponse, - SurveyAnswer + SurveyAnswer, + SocialPost, + SocialLocation, + SocialMedia, + SocialPollOption, + SocialComment, + SocialLike } \ No newline at end of file diff --git a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs index b40e50e5..4ef5ed04 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -539,6 +539,7 @@ public static class PlatformConsts public const string SurveyQuestion = "list-surveyquestion"; public const string SurveyQuestionOption = "list-surveyquestionoption"; public const string SurveyResponse = "list-surveyresponse"; + public const string SocialPost = "list-socialpost"; } } diff --git a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs index cfdf8370..80cd4707 100644 --- a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs @@ -148,6 +148,12 @@ public static class TableNameResolver { nameof(TableNameEnum.ShuttleRoute), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) }, { nameof(TableNameEnum.Announcement), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) }, { nameof(TableNameEnum.Visitor), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) }, + { nameof(TableNameEnum.SocialPost), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) }, + { nameof(TableNameEnum.SocialLocation), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) }, + { nameof(TableNameEnum.SocialMedia), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) }, + { nameof(TableNameEnum.SocialPollOption), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) }, + { nameof(TableNameEnum.SocialComment), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) }, + { nameof(TableNameEnum.SocialLike), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Intranet) }, // 🔹 ACCOUNTING { nameof(TableNameEnum.Bank), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Accounting) }, diff --git a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs index 6d426839..fecb3a21 100644 --- a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs @@ -458,6 +458,7 @@ public static class SeedConsts public const string ShuttleRoute = Default + ".ShuttleRoute"; public const string Announcement = Default + ".Announcement"; public const string Visitor = Default + ".Visitor"; + public const string SocialPost = Default + ".SocialPost"; } public static class Hr diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/SocialPost.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/SocialPost.cs index 7427a1d7..ed3024e4 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/SocialPost.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/SocialPost.cs @@ -5,95 +5,90 @@ using Volo.Abp.MultiTenancy; namespace Kurs.Platform.Entities; -public class SocialLocation : FullAuditedEntity, IMultiTenant -{ - public Guid? TenantId { get; set; } - - public string Name { get; set; } - public string Address { get; set; } - public double Lat { get; set; } - public double Lng { get; set; } - public string PlaceId { get; set; } -} - public class SocialPost : FullAuditedEntity, IMultiTenant { public Guid? TenantId { get; set; } - public Guid AuthorId { get; set; } - public Employee Author { get; set; } + public Guid? EmployeeId { get; set; } + public Employee? Employee { get; set; } public string Content { get; set; } - public Guid? LocationId { get; set; } - public SocialLocation Location { get; set; } - - public Guid? MediaId { get; set; } - public SocialMedia Media { get; set; } - - public int LikesCount { get; set; } + public int LikeCount { get; set; } + public bool IsLiked { get; set; } public bool IsOwnPost { get; set; } - public ICollection LikeUsers { get; set; } + // Relations + public SocialLocation? Location { get; set; } + public SocialMedia? Media { get; set; } public ICollection Comments { get; set; } + public ICollection Likes { get; set; } } -public class SocialLikeUser : FullAuditedEntity, IMultiTenant +public class SocialLocation : FullAuditedEntity, IMultiTenant { public Guid? TenantId { get; set; } - public Guid PostId { get; set; } - public SocialPost Post { get; set; } + public Guid SocialPostId { get; set; } + public SocialPost SocialPost { get; set; } - public Guid UserId { get; set; } - public Employee User { get; set; } -} - -public class SocialComment : FullAuditedEntity, IMultiTenant -{ - public Guid? TenantId { get; set; } - - public Guid PostId { get; set; } - public SocialPost Post { get; set; } - - public Guid AuthorId { get; set; } - public Employee Author { get; set; } - - public string Content { get; set; } + public string Name { get; set; } + public string? Address { get; set; } + public double? Lat { get; set; } + public double? Lng { get; set; } + public string? PlaceId { get; set; } } public class SocialMedia : FullAuditedEntity, IMultiTenant { public Guid? TenantId { get; set; } - public string Type { get; set; } // "image" | "video" | "poll" - public string Url { get; set; } - public string UrlsJson { get; set; } // Çoklu URL’ler JSON saklanabilir - public string FilePath { get; set; } + public Guid SocialPostId { get; set; } + public SocialPost SocialPost { get; set; } - public Guid? PollId { get; set; } - public SocialPoll Poll { get; set; } -} + public string Type { get; set; } // image | video | poll + public string[] Urls { get; set; } -public class SocialPoll : FullAuditedEntity, IMultiTenant -{ - public Guid? TenantId { get; set; } + // Poll fields + public string? PollQuestion { get; set; } + public int? PollTotalVotes { get; set; } + public DateTime? PollEndsAt { get; set; } + public string? PollUserVoteId { get; set; } - public string Question { get; set; } - public int TotalVotes { get; set; } - public DateTime EndsAt { get; set; } - public string UserVote { get; set; } - - public ICollection Options { get; set; } + public ICollection PollOptions { get; set; } } public class SocialPollOption : FullAuditedEntity, IMultiTenant { public Guid? TenantId { get; set; } - public Guid PollId { get; set; } - public SocialPoll Poll { get; set; } + public Guid SocialMediaId { get; set; } + public SocialMedia SocialMedia { get; set; } public string Text { get; set; } public int Votes { get; set; } +} + +public class SocialComment : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid SocialPostId { get; set; } + public SocialPost SocialPost { get; set; } + + public Guid? EmployeeId { get; set; } + public Employee? Employee { get; set; } + + public string Content { get; set; } +} + +public class SocialLike : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public Guid SocialPostId { get; set; } + public SocialPost SocialPost { get; set; } + + public Guid? EmployeeId { get; set; } + public Employee? Employee { get; set; } } \ No newline at end of file diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index c547781d..dafad733 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -91,14 +91,8 @@ public class PlatformDbContext : public DbSet ScheduleLessons { get; set; } public DbSet ClassTypes { get; set; } public DbSet Classes { get; set; } - 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 LessonPeriods { get; set; } public DbSet Lawyers { get; set; } - public DbSet Meals { get; set; } public DbSet Diseases { get; set; } public DbSet Documents { get; set; } public DbSet InterestAreas { get; set; } @@ -179,10 +173,6 @@ public class PlatformDbContext : public DbSet Performans360s { get; set; } public DbSet Trainings { get; set; } public DbSet Certificates { get; set; } - public DbSet Reservations { get; set; } - public DbSet ShuttleRoutes { get; set; } - public DbSet Announcements { get; set; } - public DbSet Visitors { get; set; } public DbSet ExpenseRequests { get; set; } public DbSet Surveys { get; set; } public DbSet SurveyQuestions { get; set; } @@ -192,6 +182,26 @@ 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 Meals { get; set; } + public DbSet Reservations { get; set; } + public DbSet ShuttleRoutes { get; set; } + public DbSet Announcements { get; set; } + public DbSet Visitors { get; set; } + + public DbSet SocialPosts { get; set; } + public DbSet SocialLocations { get; set; } + public DbSet SocialMedias { get; set; } + public DbSet SocialPollOptions { get; set; } + public DbSet SocialComments { get; set; } + public DbSet SocialLikes { get; set; } + #endregion + public PlatformDbContext(DbContextOptions options) : base(options) { @@ -2105,5 +2115,84 @@ public class PlatformDbContext : .HasForeignKey(x => x.QuestionId) .OnDelete(DeleteBehavior.Restrict); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialPost)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Content).IsRequired().HasMaxLength(4000); + b.Property(x => x.LikeCount).HasDefaultValue(0); + b.Property(x => x.IsOwnPost).HasDefaultValue(false); + b.Property(x => x.IsLiked).HasDefaultValue(false); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialLocation)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(256); + b.Property(x => x.Address).HasMaxLength(512); + b.Property(x => x.PlaceId).HasMaxLength(128); + + b.HasOne(x => x.SocialPost) + .WithOne(p => p.Location) + .HasForeignKey(x => x.SocialPostId) + .OnDelete(DeleteBehavior.Cascade); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialMedia)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Type).IsRequired().HasMaxLength(64); + b.Property(x => x.Urls).HasMaxLength(2000); + + b.HasOne(x => x.SocialPost) + .WithOne(p => p.Media) + .HasForeignKey(x => x.SocialPostId) // ✅ doğru entity + .OnDelete(DeleteBehavior.Cascade); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialPollOption)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Text).IsRequired().HasMaxLength(512); + + b.HasOne(x => x.SocialMedia) + .WithMany(x => x.PollOptions) + .HasForeignKey(x => x.SocialMediaId) + .OnDelete(DeleteBehavior.Cascade); + }); + + // 🔹 SocialComment + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialComment)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Content).IsRequired().HasMaxLength(8000); + + b.HasOne(x => x.SocialPost) + .WithMany(x => x.Comments) + .HasForeignKey(x => x.SocialPostId) + .OnDelete(DeleteBehavior.Cascade); + }); + + // 🔹 SocialLike + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.SocialLike)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.HasOne(x => x.SocialPost) + .WithMany(x => x.Likes) + .HasForeignKey(x => x.SocialPostId) + .OnDelete(DeleteBehavior.Cascade); + }); } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251027142130_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251028102645_Initial.Designer.cs similarity index 96% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251027142130_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251028102645_Initial.Designer.cs index a381a28f..f8d9e35f 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251027142130_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251028102645_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251027142130_Initial")] + [Migration("20251028102645_Initial")] partial class Initial { /// @@ -7877,6 +7877,385 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Adm_SkillType", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.SocialComment", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(8000) + .HasColumnType("nvarchar(max)"); + + 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("EmployeeId") + .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("SocialPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("SocialPostId"); + + b.ToTable("T_Net_SocialComment", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialLike", 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("EmployeeId") + .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("SocialPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("SocialPostId"); + + b.ToTable("T_Net_SocialLike", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialLocation", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .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("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Lat") + .HasColumnType("float"); + + b.Property("Lng") + .HasColumnType("float"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PlaceId") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("SocialPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("SocialPostId") + .IsUnique(); + + b.ToTable("T_Net_SocialLocation", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialMedia", 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("PollEndsAt") + .HasColumnType("datetime2"); + + b.Property("PollQuestion") + .HasColumnType("nvarchar(max)"); + + b.Property("PollTotalVotes") + .HasColumnType("int"); + + b.Property("PollUserVoteId") + .HasColumnType("nvarchar(max)"); + + b.Property("SocialPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.PrimitiveCollection("Urls") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("Id"); + + b.HasIndex("SocialPostId") + .IsUnique(); + + b.ToTable("T_Net_SocialMedia", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialPollOption", 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("SocialMediaId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("Votes") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("SocialMediaId"); + + b.ToTable("T_Net_SocialPollOption", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + 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("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsLiked") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsOwnPost") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LikeCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.ToTable("T_Net_SocialPost", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Source", b => { b.Property("Id") @@ -11633,6 +12012,82 @@ namespace Kurs.Platform.Migrations b.Navigation("SkillType"); }); + modelBuilder.Entity("Kurs.Platform.Entities.SocialComment", b => + { + b.HasOne("Kurs.Platform.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId"); + + b.HasOne("Kurs.Platform.Entities.SocialPost", "SocialPost") + .WithMany("Comments") + .HasForeignKey("SocialPostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("SocialPost"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialLike", b => + { + b.HasOne("Kurs.Platform.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId"); + + b.HasOne("Kurs.Platform.Entities.SocialPost", "SocialPost") + .WithMany("Likes") + .HasForeignKey("SocialPostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("SocialPost"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialLocation", b => + { + b.HasOne("Kurs.Platform.Entities.SocialPost", "SocialPost") + .WithOne("Location") + .HasForeignKey("Kurs.Platform.Entities.SocialLocation", "SocialPostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SocialPost"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialMedia", b => + { + b.HasOne("Kurs.Platform.Entities.SocialPost", "SocialPost") + .WithOne("Media") + .HasForeignKey("Kurs.Platform.Entities.SocialMedia", "SocialPostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SocialPost"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialPollOption", b => + { + b.HasOne("Kurs.Platform.Entities.SocialMedia", "SocialMedia") + .WithMany("PollOptions") + .HasForeignKey("SocialMediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SocialMedia"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialPost", b => + { + b.HasOne("Kurs.Platform.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId"); + + b.Navigation("Employee"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.SurveyAnswer", b => { b.HasOne("Kurs.Platform.Entities.SurveyQuestion", "Question") @@ -12039,6 +12494,22 @@ namespace Kurs.Platform.Migrations b.Navigation("Skills"); }); + modelBuilder.Entity("Kurs.Platform.Entities.SocialMedia", b => + { + b.Navigation("PollOptions"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialPost", b => + { + b.Navigation("Comments"); + + b.Navigation("Likes"); + + b.Navigation("Location"); + + b.Navigation("Media"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Survey", b => { b.Navigation("Questions"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251027142130_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251028102645_Initial.cs similarity index 96% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251027142130_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251028102645_Initial.cs index b82127cb..ed443fc9 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251027142130_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251028102645_Initial.cs @@ -4466,6 +4466,35 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "T_Net_SocialPost", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + EmployeeId = table.Column(type: "uniqueidentifier", nullable: true), + Content = table.Column(type: "nvarchar(4000)", maxLength: 4000, nullable: false), + LikeCount = table.Column(type: "int", nullable: false, defaultValue: 0), + IsLiked = table.Column(type: "bit", nullable: false, defaultValue: false), + IsOwnPost = 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_T_Net_SocialPost", x => x.Id); + table.ForeignKey( + name: "FK_T_Net_SocialPost_T_Hr_Employee_EmployeeId", + column: x => x.EmployeeId, + principalTable: "T_Hr_Employee", + principalColumn: "Id"); + }); + migrationBuilder.CreateTable( name: "T_Net_Visitor", columns: table => new @@ -4536,6 +4565,162 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "T_Net_SocialComment", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + SocialPostId = table.Column(type: "uniqueidentifier", nullable: false), + EmployeeId = table.Column(type: "uniqueidentifier", nullable: true), + Content = table.Column(type: "nvarchar(max)", maxLength: 8000, 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_T_Net_SocialComment", x => x.Id); + table.ForeignKey( + name: "FK_T_Net_SocialComment_T_Hr_Employee_EmployeeId", + column: x => x.EmployeeId, + principalTable: "T_Hr_Employee", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_T_Net_SocialComment_T_Net_SocialPost_SocialPostId", + column: x => x.SocialPostId, + principalTable: "T_Net_SocialPost", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "T_Net_SocialLike", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + SocialPostId = table.Column(type: "uniqueidentifier", nullable: false), + EmployeeId = table.Column(type: "uniqueidentifier", 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_T_Net_SocialLike", x => x.Id); + table.ForeignKey( + name: "FK_T_Net_SocialLike_T_Hr_Employee_EmployeeId", + column: x => x.EmployeeId, + principalTable: "T_Hr_Employee", + principalColumn: "Id"); + table.ForeignKey( + name: "FK_T_Net_SocialLike_T_Net_SocialPost_SocialPostId", + column: x => x.SocialPostId, + principalTable: "T_Net_SocialPost", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "T_Net_SocialLocation", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + SocialPostId = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Address = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + Lat = table.Column(type: "float", nullable: true), + Lng = table.Column(type: "float", nullable: true), + PlaceId = table.Column(type: "nvarchar(128)", maxLength: 128, 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_T_Net_SocialLocation", x => x.Id); + table.ForeignKey( + name: "FK_T_Net_SocialLocation_T_Net_SocialPost_SocialPostId", + column: x => x.SocialPostId, + principalTable: "T_Net_SocialPost", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "T_Net_SocialMedia", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + SocialPostId = table.Column(type: "uniqueidentifier", nullable: false), + Type = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Urls = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), + PollQuestion = table.Column(type: "nvarchar(max)", nullable: true), + PollTotalVotes = table.Column(type: "int", nullable: true), + PollEndsAt = table.Column(type: "datetime2", nullable: true), + PollUserVoteId = table.Column(type: "nvarchar(max)", 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_T_Net_SocialMedia", x => x.Id); + table.ForeignKey( + name: "FK_T_Net_SocialMedia_T_Net_SocialPost_SocialPostId", + column: x => x.SocialPostId, + principalTable: "T_Net_SocialPost", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "T_Net_SocialPollOption", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + SocialMediaId = table.Column(type: "uniqueidentifier", nullable: false), + Text = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: false), + Votes = table.Column(type: "int", 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_T_Net_SocialPollOption", x => x.Id); + table.ForeignKey( + name: "FK_T_Net_SocialPollOption_T_Net_SocialMedia_SocialMediaId", + column: x => x.SocialMediaId, + principalTable: "T_Net_SocialMedia", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateIndex( name: "IX_AbpAuditLogActions_AuditLogId", table: "AbpAuditLogActions", @@ -5255,6 +5440,48 @@ namespace Kurs.Platform.Migrations table: "T_Net_Reservation", column: "EmployeeId"); + migrationBuilder.CreateIndex( + name: "IX_T_Net_SocialComment_EmployeeId", + table: "T_Net_SocialComment", + column: "EmployeeId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Net_SocialComment_SocialPostId", + table: "T_Net_SocialComment", + column: "SocialPostId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Net_SocialLike_EmployeeId", + table: "T_Net_SocialLike", + column: "EmployeeId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Net_SocialLike_SocialPostId", + table: "T_Net_SocialLike", + column: "SocialPostId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Net_SocialLocation_SocialPostId", + table: "T_Net_SocialLocation", + column: "SocialPostId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_T_Net_SocialMedia_SocialPostId", + table: "T_Net_SocialMedia", + column: "SocialPostId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_T_Net_SocialPollOption_SocialMediaId", + table: "T_Net_SocialPollOption", + column: "SocialMediaId"); + + migrationBuilder.CreateIndex( + name: "IX_T_Net_SocialPost_EmployeeId", + table: "T_Net_SocialPost", + column: "EmployeeId"); + migrationBuilder.CreateIndex( name: "IX_T_Net_Visitor_EmployeeId", table: "T_Net_Visitor", @@ -5615,6 +5842,18 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Net_ShuttleRoute"); + migrationBuilder.DropTable( + name: "T_Net_SocialComment"); + + migrationBuilder.DropTable( + name: "T_Net_SocialLike"); + + migrationBuilder.DropTable( + name: "T_Net_SocialLocation"); + + migrationBuilder.DropTable( + name: "T_Net_SocialPollOption"); + migrationBuilder.DropTable( name: "T_Net_Visitor"); @@ -5756,6 +5995,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Net_Training"); + migrationBuilder.DropTable( + name: "T_Net_SocialMedia"); + migrationBuilder.DropTable( name: "T_Sas_CustomEntity"); @@ -5795,6 +6037,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Hr_Survey"); + migrationBuilder.DropTable( + name: "T_Net_SocialPost"); + migrationBuilder.DropTable( name: "T_Sas_ReportCategory"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 2d5b53e2..c990f1b9 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -7874,6 +7874,385 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Adm_SkillType", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.SocialComment", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(8000) + .HasColumnType("nvarchar(max)"); + + 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("EmployeeId") + .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("SocialPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("SocialPostId"); + + b.ToTable("T_Net_SocialComment", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialLike", 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("EmployeeId") + .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("SocialPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("SocialPostId"); + + b.ToTable("T_Net_SocialLike", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialLocation", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .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("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Lat") + .HasColumnType("float"); + + b.Property("Lng") + .HasColumnType("float"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); + + b.Property("PlaceId") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("SocialPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("SocialPostId") + .IsUnique(); + + b.ToTable("T_Net_SocialLocation", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialMedia", 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("PollEndsAt") + .HasColumnType("datetime2"); + + b.Property("PollQuestion") + .HasColumnType("nvarchar(max)"); + + b.Property("PollTotalVotes") + .HasColumnType("int"); + + b.Property("PollUserVoteId") + .HasColumnType("nvarchar(max)"); + + b.Property("SocialPostId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.PrimitiveCollection("Urls") + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); + + b.HasKey("Id"); + + b.HasIndex("SocialPostId") + .IsUnique(); + + b.ToTable("T_Net_SocialMedia", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialPollOption", 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("SocialMediaId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); + + b.Property("Votes") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("SocialMediaId"); + + b.ToTable("T_Net_SocialPollOption", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialPost", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + 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("EmployeeId") + .HasColumnType("uniqueidentifier"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsLiked") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsOwnPost") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LikeCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.ToTable("T_Net_SocialPost", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Source", b => { b.Property("Id") @@ -11630,6 +12009,82 @@ namespace Kurs.Platform.Migrations b.Navigation("SkillType"); }); + modelBuilder.Entity("Kurs.Platform.Entities.SocialComment", b => + { + b.HasOne("Kurs.Platform.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId"); + + b.HasOne("Kurs.Platform.Entities.SocialPost", "SocialPost") + .WithMany("Comments") + .HasForeignKey("SocialPostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("SocialPost"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialLike", b => + { + b.HasOne("Kurs.Platform.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId"); + + b.HasOne("Kurs.Platform.Entities.SocialPost", "SocialPost") + .WithMany("Likes") + .HasForeignKey("SocialPostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("SocialPost"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialLocation", b => + { + b.HasOne("Kurs.Platform.Entities.SocialPost", "SocialPost") + .WithOne("Location") + .HasForeignKey("Kurs.Platform.Entities.SocialLocation", "SocialPostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SocialPost"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialMedia", b => + { + b.HasOne("Kurs.Platform.Entities.SocialPost", "SocialPost") + .WithOne("Media") + .HasForeignKey("Kurs.Platform.Entities.SocialMedia", "SocialPostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SocialPost"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialPollOption", b => + { + b.HasOne("Kurs.Platform.Entities.SocialMedia", "SocialMedia") + .WithMany("PollOptions") + .HasForeignKey("SocialMediaId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SocialMedia"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialPost", b => + { + b.HasOne("Kurs.Platform.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId"); + + b.Navigation("Employee"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.SurveyAnswer", b => { b.HasOne("Kurs.Platform.Entities.SurveyQuestion", "Question") @@ -12036,6 +12491,22 @@ namespace Kurs.Platform.Migrations b.Navigation("Skills"); }); + modelBuilder.Entity("Kurs.Platform.Entities.SocialMedia", b => + { + b.Navigation("PollOptions"); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.SocialPost", b => + { + b.Navigation("Comments"); + + b.Navigation("Likes"); + + b.Navigation("Location"); + + b.Navigation("Media"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Survey", b => { b.Navigation("Questions"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index 69cdda8b..87b6643e 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -100,9 +100,7 @@ "props": null, "description": null, "isActive": true, - "dependencies": [ - "AxiosListComponent" - ] + "dependencies": ["AxiosListComponent"] } ], "ReportCategories": [ @@ -2211,12 +2209,7 @@ "minSalary": 80000, "maxSalary": 120000, "currencyCode": "USD", - "requiredSkills": [ - "JavaScript", - "TypeScript", - "React", - "Node.js" - ], + "requiredSkills": ["JavaScript", "TypeScript", "React", "Node.js"], "responsibilities": [ "Develop frontend and backend applications", "Write clean and maintainable code", @@ -3874,5 +3867,156 @@ "Text": "Hibrit (Karma)", "Order": 3 } + ], + "SocialPosts": [ + { + "content": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", + "employeeCode": "EMP-002", + "likeCount": 24, + "isLiked": true, + "isOwnPost": false + }, + { + "content": "Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!", + "employeeCode": "EMP-001", + "likeCount": 18, + "isLiked": false, + "isOwnPost": true + }, + { + "content": "Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨", + "employeeCode": "EMP-003", + "likeCount": 42, + "isLiked": true, + "isOwnPost": false + }, + { + "content": "CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪", + "employeeCode": "EMP-004", + "likeCount": 31, + "isLiked": false, + "isOwnPost": false + }, + { + "content": "Ekip üyelerimize yeni eğitim programımızı duyurmak istiyorum! 🎓 React, TypeScript ve Modern Web Geliştirme konularında kapsamlı bir program hazırladık.", + "employeeCode": "EMP-007", + "likeCount": 56, + "isLiked": true, + "isOwnPost": false + }, + { + "content": "Bugün müşteri ile harika bir toplantı yaptık! Yeni projenin detaylarını konuştuk. 🎯", + "employeeCode": "EMP-002", + "likeCount": 18, + "isLiked": false, + "isOwnPost": false + } + ], + "SocialLocations": [ + { + "postContent": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", + "name": "Taksim Meydanı", + "address": "Taksim, Gümüşsuyu Mahallesi, 34437 Beyoğlu/İstanbul", + "lat": 41.0369, + "lng": 28.985, + "placeId": "ChIJBQRGmL25yhQRXwqRTHAwAAQ" + }, + { + "postContent": "Bugün müşteri ile harika bir toplantı yaptık! Yeni projenin detaylarını konuştuk. 🎯", + "name": "Sultanahmet Meydanı", + "address": "Sultanahmet Mahallesi, 34122 Fatih/İstanbul", + "lat": 41.0058, + "lng": 28.9768, + "placeId": "ChIJ7fVVZiy5yhQRzsXXXXXXXXk" + } + ], + "SocialMedias": [ + { + "postContent": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", + "type": "image", + "urls": [ + "https://images.unsplash.com/photo-1633356122544-f134324a6cee?w=800&q=80" + ] + }, + { + "postContent": "Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!", + "type": "poll", + "pollQuestion": "Hangi özelliği öncelikli olarak geliştirmeliyiz?", + "pollOptions": [ + { "text": "Kullanıcı profilleri", "votes": 12 }, + { "text": "Bildirim sistemi", "votes": 8 }, + { "text": "Mesajlaşma", "votes": 15 }, + { "text": "Raporlama", "votes": 5 } + ], + "pollTotalVotes": 40, + "pollEndsAt": "2024-10-20T23:59:59", + "pollUserVoteId": "p3" + }, + { + "postContent": "Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨", + "type": "image", + "urls": [ + "https://images.unsplash.com/photo-1561070791-2526d30994b5?w=800&q=80", + "https://images.unsplash.com/photo-1586717799252-bd134ad00e26?w=800&q=80", + "https://images.unsplash.com/photo-1609921212029-bb5a28e60960?w=800&q=80" + ] + }, + { + "postContent": "CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪", + "type": "video", + "urls": ["https://www.w3schools.com/html/mov_bbb.mp4"] + } + ], + "SocialComments": [ + { + "postContent": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", + "employeeCode": "EMP-003", + "content": "Harika görünüyor! Başarılar 👏" + }, + { + "postContent": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", + "employeeCode": "EMP-003", + "content": "TypeScript gerçekten fark yaratıyor!" + }, + { + "postContent": "Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!", + "employeeCode": "EMP-004", + "content": "Mesajlaşma özelliğine kesinlikle ihtiyacımız var!" + }, + { + "postContent": "Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨", + "employeeCode": "EMP-005", + "content": "Tasarımlar çok şık! Renk paleti özellikle güzel 😍" + }, + { + "postContent": "Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨", + "employeeCode": "EMP-005", + "content": "Dark mode opsiyonu da olacak mı?" + }, + { + "postContent": "CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪", + "employeeCode": "EMP-006", + "content": "Harika iş! Detayları paylaşabilir misin?" + }, + { + "postContent": "Ekip üyelerimize yeni eğitim programımızı duyurmak istiyorum! 🎓 React, TypeScript ve Modern Web Geliştirme konularında kapsamlı bir program hazırladık.", + "employeeCode": "EMP-001", + "content": "Ne zaman başlıyor?" + }, + { + "postContent": "Ekip üyelerimize yeni eğitim programımızı duyurmak istiyorum! 🎓 React, TypeScript ve Modern Web Geliştirme konularında kapsamlı bir program hazırladık.", + "employeeCode": "EMP-005", + "content": "Gelecek hafta başlıyoruz! Kayıt linki mail ile paylaşılacak." + } + ], + "SocialLikes": [ + { + "postContent": "Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀", + "employeeCode": "EMP-002" + }, + { + "postContent": "Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨", + "employeeCode": "EMP-003" + } ] -} \ No newline at end of file +} diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index e00637e3..1f7a315a 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -13,7 +13,6 @@ using Microsoft.EntityFrameworkCore; using System.Linq; using System.Collections.Generic; using Volo.Abp.Identity; -using Azure.Core; namespace Kurs.Platform.Data.Seeds; @@ -83,6 +82,11 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _surveyRepository; private readonly IRepository _surveyQuestionRepository; private readonly IRepository _surveyQuestionOptionRepository; + private readonly IRepository _socialPostRepository; + private readonly IRepository _socialLocationRepository; + private readonly IRepository _socialMediaRepository; + private readonly IRepository _socialCommentRepository; + private readonly IRepository _socialLikeRepository; public TenantDataSeeder( IRepository repositoryUser, @@ -148,7 +152,12 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository expenseRepository, IRepository surveyRepository, IRepository surveyQuestionRepository, - IRepository surveyQuestionOptionRepository + IRepository surveyQuestionOptionRepository, + IRepository socialPostRepository, + IRepository socialLocationRepository, + IRepository socialMediaRepository, + IRepository socialCommentRepository, + IRepository socialLikeRepository ) { _repositoryUser = repositoryUser; @@ -216,6 +225,11 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _surveyRepository = surveyRepository; _surveyQuestionRepository = surveyQuestionRepository; _surveyQuestionOptionRepository = surveyQuestionOptionRepository; + _socialPostRepository = socialPostRepository; + _socialLocationRepository = socialLocationRepository; + _socialMediaRepository = socialMediaRepository; + _socialCommentRepository = socialCommentRepository; + _socialLikeRepository = socialLikeRepository; } private static IConfigurationRoot BuildConfiguration() @@ -1397,5 +1411,106 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency Order = item.Order }, autoSave: true); } + + foreach (var item in items.SocialPosts) + { + var exists = await _socialPostRepository.AnyAsync(x => x.Content == item.Content); + if (exists) + continue; + + var employee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.EmployeeCode); + await _socialPostRepository.InsertAsync(new SocialPost + { + EmployeeId = employee != null ? employee.Id : null, + Content = item.Content, + LikeCount = item.LikeCount, + IsLiked = item.IsLiked, + IsOwnPost = item.IsOwnPost + }, autoSave: true); + } + + foreach (var item in items.SocialLocations) + { + var post = await _socialPostRepository.FirstOrDefaultAsync(x => x.Content == item.PostContent); + + if (post == null) + continue; + + var exists = await _socialLocationRepository.AnyAsync(x => x.SocialPostId == post.Id && x.Name == item.Name); + if (exists) + continue; + + await _socialLocationRepository.InsertAsync(new SocialLocation + { + SocialPostId = post != null ? post.Id : Guid.Empty, + Name = item.Name, + Address = item.Address, + Lat = item.Lat, + Lng = item.Lng, + PlaceId = item.PlaceId + }, autoSave: true); + } + + foreach (var item in items.SocialMedias) + { + var post = await _socialPostRepository.FirstOrDefaultAsync(x => x.Content == item.PostContent); + + if (post == null) + continue; + + var exists = await _socialMediaRepository.AnyAsync(x => x.SocialPostId == post.Id); + if (exists) + continue; + + await _socialMediaRepository.InsertAsync(new SocialMedia + { + SocialPostId = post != null ? post.Id : Guid.Empty, + Type = item.Type, + Urls = item.Urls, + PollQuestion = item.PollQuestion, + PollTotalVotes = item.PollTotalVotes, + PollEndsAt = item.PollEndsAt, + PollUserVoteId = item.PollUserVoteId + }, autoSave: true); + } + + foreach (var item in items.SocialComments) + { + var post = await _socialPostRepository.FirstOrDefaultAsync(x => x.Content == item.PostContent); + + if (post == null) + continue; + + var exists = await _socialCommentRepository.AnyAsync(x => x.SocialPostId == post.Id && x.Content == item.Content); + if (exists) + continue; + + var employee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.EmployeeCode); + await _socialCommentRepository.InsertAsync(new SocialComment + { + EmployeeId = employee != null ? employee.Id : null, + SocialPostId = post != null ? post.Id : Guid.Empty, + Content = item.Content + }, autoSave: true); + } + + foreach (var item in items.SocialLikes) + { + var post = await _socialPostRepository.FirstOrDefaultAsync(x => x.Content == item.PostContent); + + if (post == null) + continue; + + var exists = await _socialLikeRepository.AnyAsync(x => x.SocialPostId == post.Id); + if (exists) + continue; + + var employee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.EmployeeCode); + await _socialLikeRepository.InsertAsync(new SocialLike + { + SocialPostId = post != null ? post.Id : Guid.Empty, + EmployeeId = employee != null ? employee.Id : null + }, autoSave: true); + } } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index ce172e19..9faccd15 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -71,6 +71,63 @@ public class TenantSeederDto public List Surveys { get; set; } public List SurveyQuestions { get; set; } public List SurveyQuestionOptions { get; set; } + public List SocialPosts { get; set; } + public List SocialLocations { get; set; } + public List SocialMedias { get; set; } + public List SocialComments { get; set; } + public List SocialLikes { get; set; } +} + +public class SocialPostSeedDto +{ + public string Content { get; set; } + public string EmployeeCode { get; set; } + public int LikeCount { get; set; } + public bool IsLiked { get; set; } + public bool IsOwnPost { get; set; } +} + +public class SocialLocationSeedDto +{ + public string PostContent { get; set; } + public string Name { get; set; } + public string Address { get; set; } + public double? Lat { get; set; } + public double? Lng { get; set; } + public string PlaceId { get; set; } +} + +public class SocialMediaSeedDto +{ + public string PostContent { get; set; } + public string Type { get; set; } + public string[] Urls { get; set; } + + public string PollQuestion { get; set; } + public int? PollTotalVotes { get; set; } + public DateTime? PollEndsAt { get; set; } + public string PollUserVoteId { get; set; } + + public List PollOptions { get; set; } +} + +public class SocialPollOptionSeedDto +{ + public string Text { get; set; } + public int Votes { get; set; } +} + +public class SocialCommentSeedDto +{ + public string PostContent { get; set; } + public string EmployeeCode { get; set; } + public string Content { get; set; } +} + +public class SocialLikeSeedDto +{ + public string PostContent { get; set; } + public string EmployeeCode { get; set; } } public class SurveySeedDto diff --git a/ui/src/mocks/mockIntranet.ts b/ui/src/mocks/mockIntranet.ts index 8b47dcbc..a00f1366 100644 --- a/ui/src/mocks/mockIntranet.ts +++ b/ui/src/mocks/mockIntranet.ts @@ -14,195 +14,6 @@ import { SocialPost, } from '@/types/intranet' -// Mevcut çalışanları kullan - "Siz" kullanıcısı mockEmployees[0] (Ali Öztürk) olacak -const currentUser = { ...mockEmployees[0], fullName: 'Siz' } // Ali Öztürk'ü "Siz" olarak kullan - -export const mockSocialPosts: SocialPost[] = [ - { - id: '1', - author: mockEmployees[2], // Mehmet Yılmaz - content: - 'Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀', - creationTime: new Date('2024-10-15T10:30:00'), - location: { - id: '1', - name: 'Taksim Meydanı', - address: 'Taksim, Gümüşsuyu Mahallesi, 34437 Beyoğlu/İstanbul', - lat: 41.0369, - lng: 28.985, - placeId: 'ChIJBQRGmL25yhQRXwqRTHAwAAQ', - }, - media: { - type: 'image', - url: 'https://images.unsplash.com/photo-1633356122544-f134324a6cee?w=800&q=80', - }, - likes: { - count: 24, - isLiked: true, - users: [mockEmployees[1], mockEmployees[3]], // Ayşe Kaya, Selin Demir - }, - comments: [ - { - id: 'c1', - author: mockEmployees[1], // Ayşe Kaya - content: 'Harika görünüyor! Başarılar 👏', - creationTime: new Date('2024-10-15T11:00:00'), - }, - { - id: 'c2', - author: mockEmployees[3], // Selin Demir - content: 'TypeScript gerçekten fark yaratıyor!', - creationTime: new Date('2024-10-15T11:30:00'), - }, - ], - isOwnPost: false, - }, - { - id: '2', - author: currentUser, - content: - 'Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!', - creationTime: new Date('2024-10-16T09:00:00'), - media: { - type: 'poll', - poll: { - question: 'Hangi özelliği öncelikli olarak geliştirmeliyiz?', - options: [ - { id: 'p1', text: 'Kullanıcı profilleri', votes: 12 }, - { id: 'p2', text: 'Bildirim sistemi', votes: 8 }, - { id: 'p3', text: 'Mesajlaşma', votes: 15 }, - { id: 'p4', text: 'Raporlama', votes: 5 }, - ], - totalVotes: 40, - endsAt: new Date('2024-10-20T23:59:59'), - userVote: 'p3', - }, - }, - likes: { - count: 18, - isLiked: false, - users: [], - }, - comments: [ - { - id: 'c3', - author: mockEmployees[4], // Ahmet Çelik - content: 'Mesajlaşma özelliğine kesinlikle ihtiyacımız var!', - creationTime: new Date('2024-10-16T10:15:00'), - }, - ], - isOwnPost: true, - }, - { - id: '3', - author: mockEmployees[5], // Zeynep Arslan - content: - 'Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨', - creationTime: new Date('2024-10-17T14:20:00'), - media: { - type: 'image', - urls: [ - 'https://images.unsplash.com/photo-1561070791-2526d30994b5?w=800&q=80', - 'https://images.unsplash.com/photo-1586717799252-bd134ad00e26?w=800&q=80', - 'https://images.unsplash.com/photo-1609921212029-bb5a28e60960?w=800&q=80', - ], - }, - likes: { - count: 42, - isLiked: true, - users: [mockEmployees[2]], // Mehmet Yılmaz - }, - comments: [ - { - id: 'c4', - author: mockEmployees[6], // Burak Koç - content: 'Tasarımlar çok şık! Renk paleti özellikle güzel 😍', - creationTime: new Date('2024-10-17T15:00:00'), - }, - { - id: 'c5', - author: mockEmployees[7], // Elif Şahin - content: 'Dark mode opsiyonu da olacak mı?', - creationTime: new Date('2024-10-17T15:30:00'), - }, - ], - isOwnPost: false, - }, - { - id: '4', - author: mockEmployees[6], // Burak Koç - content: - 'CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪', - creationTime: new Date('2024-10-18T08:45:00'), - media: { - type: 'video', - url: 'https://www.w3schools.com/html/mov_bbb.mp4', - }, - likes: { - count: 31, - isLiked: false, - users: [], - }, - comments: [ - { - id: 'c6', - author: mockEmployees[8], // Canan Öztürk - content: 'Harika iş! Detayları paylaşabilir misin?', - creationTime: new Date('2024-10-18T09:15:00'), - }, - ], - isOwnPost: false, - }, - { - id: '5', - author: mockEmployees[7], // Elif Şahin - content: - 'Ekip üyelerimize yeni eğitim programımızı duyurmak istiyorum! 🎓 React, TypeScript ve Modern Web Geliştirme konularında kapsamlı bir program hazırladık.', - creationTime: new Date('2024-10-14T16:00:00'), - likes: { - count: 56, - isLiked: true, - users: [], - }, - comments: [ - { - id: 'c7', - author: mockEmployees[2], // Mehmet Yılmaz - content: 'Ne zaman başlıyor?', - creationTime: new Date('2024-10-14T16:30:00'), - }, - { - id: 'c8', - author: mockEmployees[7], // Elif Şahin - content: 'Gelecek hafta başlıyoruz! Kayıt linki mail ile paylaşılacak.', - creationTime: new Date('2024-10-14T17:00:00'), - }, - ], - isOwnPost: false, - }, - { - id: '6', - author: mockEmployees[9], // Murat Aydın - content: 'Bugün müşteri ile harika bir toplantı yaptık! Yeni projenin detaylarını konuştuk. 🎯', - creationTime: new Date('2024-10-17T14:00:00'), - location: { - id: '4', - name: 'Sultanahmet Meydanı', - address: 'Sultanahmet Mahallesi, 34122 Fatih/İstanbul', - lat: 41.0058, - lng: 28.9768, - placeId: 'ChIJ7fVVZiy5yhQRzsXXXXXXXXk', - }, - likes: { - count: 18, - isLiked: false, - users: [], - }, - comments: [], - isOwnPost: false, - }, -] - ///////////////////////////////////////////////////////////////////////////////////// ///////EKLENENLER////////// export const mockTrainings: Training[] = [ @@ -1000,3 +811,178 @@ export const mockSurveys: Survey[] = [ isAnonymous: true, }, ] + +// Mevcut çalışanları kullan - "Siz" kullanıcısı mockEmployees[0] (Ali Öztürk) olacak +const currentUser = { ...mockEmployees[0], fullName: 'Siz' } // Ali Öztürk'ü "Siz" olarak kullan + +export const mockSocialPosts: SocialPost[] = [ + { + id: '1', + creator: mockEmployees[2], // Mehmet Yılmaz + content: + 'Yeni proje üzerinde çalışıyoruz! React ve TypeScript ile harika bir deneyim oluşturuyoruz. Ekip çalışması harika gidiyor! 🚀', + creationTime: new Date('2024-10-15T10:30:00'), + locationJson: JSON.stringify({ + id: '1', + name: 'Taksim Meydanı', + address: 'Taksim, Gümüşsuyu Mahallesi, 34437 Beyoğlu/İstanbul', + lat: 41.0369, + lng: 28.985, + placeId: 'ChIJBQRGmL25yhQRXwqRTHAwAAQ', + }), + media: { + type: 'image', + urls: ['https://images.unsplash.com/photo-1633356122544-f134324a6cee?w=800&q=80'], + }, + likeCount: 24, + isLiked: true, + likeUsers: [mockEmployees[1], mockEmployees[3]], // Ayşe Kaya, Selin Demir + comments: [ + { + id: 'c1', + creator: mockEmployees[1], // Ayşe Kaya + content: 'Harika görünüyor! Başarılar 👏', + creationTime: new Date('2024-10-15T11:00:00'), + }, + { + id: 'c2', + creator: mockEmployees[3], // Selin Demir + content: 'TypeScript gerçekten fark yaratıyor!', + creationTime: new Date('2024-10-15T11:30:00'), + }, + ], + isOwnPost: false, + }, + { + id: '2', + creator: currentUser, + content: + 'Bu hafta sprint planlamasını yaptık. Ekibimizle birlikte yeni özellikleri değerlendirdik. Heyecan verici bir hafta olacak!', + creationTime: new Date('2024-10-16T09:00:00'), + media: { + type: 'poll', + pollQuestion: 'Hangi özelliği öncelikli olarak geliştirmeliyiz?', + pollOptions: [ + { id: 'p1', text: 'Kullanıcı profilleri', votes: 12 }, + { id: 'p2', text: 'Bildirim sistemi', votes: 8 }, + { id: 'p3', text: 'Mesajlaşma', votes: 15 }, + { id: 'p4', text: 'Raporlama', votes: 5 }, + ], + pollTotalVotes: 40, + pollEndsAt: new Date('2024-10-20T23:59:59'), + pollUserVoteId: 'p3', + }, + likeCount: 18, + isLiked: false, + likeUsers: [], + comments: [ + { + id: 'c3', + creator: mockEmployees[4], // Ahmet Çelik + content: 'Mesajlaşma özelliğine kesinlikle ihtiyacımız var!', + creationTime: new Date('2024-10-16T10:15:00'), + }, + ], + isOwnPost: true, + }, + { + id: '3', + creator: mockEmployees[5], // Zeynep Arslan + content: + 'Yeni tasarım sistemimizin ilk prototipini hazırladık! Kullanıcı deneyimini iyileştirmek için çok çalıştık. Geri bildirimlerinizi bekliyorum! 🎨', + creationTime: new Date('2024-10-17T14:20:00'), + media: { + type: 'image', + urls: [ + 'https://images.unsplash.com/photo-1561070791-2526d30994b5?w=800&q=80', + 'https://images.unsplash.com/photo-1586717799252-bd134ad00e26?w=800&q=80', + 'https://images.unsplash.com/photo-1609921212029-bb5a28e60960?w=800&q=80', + ], + }, + likeCount: 42, + isLiked: true, + likeUsers: [mockEmployees[2]], // Mehmet Yılmaz + comments: [ + { + id: 'c4', + creator: mockEmployees[6], // Burak Koç + content: 'Tasarımlar çok şık! Renk paleti özellikle güzel 😍', + creationTime: new Date('2024-10-17T15:00:00'), + }, + { + id: 'c5', + creator: mockEmployees[7], // Elif Şahin + content: 'Dark mode opsiyonu da olacak mı?', + creationTime: new Date('2024-10-17T15:30:00'), + }, + ], + isOwnPost: false, + }, + { + id: '4', + creator: mockEmployees[6], // Burak Koç + content: + 'CI/CD pipeline güncellememiz tamamlandı! Deployment süremiz %40 azaldı. Otomasyonun gücü 💪', + creationTime: new Date('2024-10-18T08:45:00'), + media: { + type: 'video', + urls: ['https://www.w3schools.com/html/mov_bbb.mp4'], + }, + likeCount: 31, + isLiked: false, + likeUsers: [], + comments: [ + { + id: 'c6', + creator: mockEmployees[8], // Canan Öztürk + content: 'Harika iş! Detayları paylaşabilir misin?', + creationTime: new Date('2024-10-18T09:15:00'), + }, + ], + isOwnPost: false, + }, + { + id: '5', + creator: mockEmployees[7], // Elif Şahin + content: + 'Ekip üyelerimize yeni eğitim programımızı duyurmak istiyorum! 🎓 React, TypeScript ve Modern Web Geliştirme konularında kapsamlı bir program hazırladık.', + creationTime: new Date('2024-10-14T16:00:00'), + likeCount: 56, + isLiked: true, + likeUsers: [], + comments: [ + { + id: 'c7', + creator: mockEmployees[2], // Mehmet Yılmaz + content: 'Ne zaman başlıyor?', + creationTime: new Date('2024-10-14T16:30:00'), + }, + { + id: 'c8', + creator: mockEmployees[7], // Elif Şahin + content: 'Gelecek hafta başlıyoruz! Kayıt linki mail ile paylaşılacak.', + creationTime: new Date('2024-10-14T17:00:00'), + }, + ], + isOwnPost: false, + }, + { + id: '6', + creator: mockEmployees[9], // Murat Aydın + content: 'Bugün müşteri ile harika bir toplantı yaptık! Yeni projenin detaylarını konuştuk. 🎯', + creationTime: new Date('2024-10-17T14:00:00'), + locationJson: JSON.stringify({ + id: '4', + name: 'Sultanahmet Meydanı', + address: 'Sultanahmet Mahallesi, 34122 Fatih/İstanbul', + lat: 41.0058, + lng: 28.9768, + placeId: 'ChIJ7fVVZiy5yhQRzsXXXXXXXXk', + }), + likeCount: 18, + isLiked: false, + likeUsers: [], + comments: [], + isOwnPost: false, + }, +] \ No newline at end of file diff --git a/ui/src/types/intranet.ts b/ui/src/types/intranet.ts index dbbd0f42..6f8aca56 100644 --- a/ui/src/types/intranet.ts +++ b/ui/src/types/intranet.ts @@ -232,66 +232,47 @@ export interface Visitor { photo?: string } -// Sosyal Duvar - Comment Interface -export interface SocialComment { +// Sosyal Duvar - Ana Interface +export interface SocialPost { id: string - author: HrEmployee + creator: HrEmployee content: string + locationJson?: string + media?: SocialMedia + likeCount: number + isLiked: boolean + likeUsers: HrEmployee[] + comments: SocialComment[] + isOwnPost: boolean creationTime: Date } -// Sosyal Duvar - Likes Interface -export interface SocialLikes { - count: number - isLiked: boolean - users: HrEmployee[] +// Sosyal Duvar - Social Media Interface +export interface SocialMedia { + id?: string + type: 'image' | 'video' | 'poll' + + // Ortak alanlar + urls?: string[] + + // Anket (poll) ile ilgili alanlar doğrudan burada + pollQuestion?: string + pollOptions?: SocialPollOption[] + pollTotalVotes?: number + pollEndsAt?: Date + pollUserVoteId?: string } -// Sosyal Duvar - Poll Option Interface export interface SocialPollOption { id: string text: string votes: number } -// Sosyal Duvar - Poll Interface -export interface SocialPoll { - question: string - options: SocialPollOption[] - totalVotes: number - endsAt: Date - userVote?: string -} - -// Unified Media interface for all media-related operations -export interface SocialMedia { - id?: string - type: 'image' | 'video' | 'poll' - url?: string - urls?: string[] - file?: File - poll?: SocialPoll -} - -// Sosyal Duvar - Social Location -export interface SocialLocation { +// Sosyal Duvar - Comment Interface +export interface SocialComment { id: string - name: string - address: string - lat: number - lng: number - placeId?: string -} - -// Sosyal Duvar - Ana Interface -export interface SocialPost { - id: string - author: HrEmployee + creator: HrEmployee content: string creationTime: Date - location?: SocialLocation - media?: SocialMedia - likes: SocialLikes - comments: SocialComment[] - isOwnPost: boolean } diff --git a/ui/src/views/intranet/Dashboard.tsx b/ui/src/views/intranet/Dashboard.tsx index 87195961..1ef84d81 100644 --- a/ui/src/views/intranet/Dashboard.tsx +++ b/ui/src/views/intranet/Dashboard.tsx @@ -108,7 +108,7 @@ const IntranetDashboard: React.FC = () => {
- + {checkPermission('App.Intranet.SocialPost.Widget') && ( ) }
diff --git a/ui/src/views/intranet/SocialWall/CreatePost.tsx b/ui/src/views/intranet/SocialWall/CreatePost.tsx index 404b2bec..03b2fd1c 100644 --- a/ui/src/views/intranet/SocialWall/CreatePost.tsx +++ b/ui/src/views/intranet/SocialWall/CreatePost.tsx @@ -11,12 +11,12 @@ import { } from 'react-icons/fa' import MediaManager from './MediaManager' import LocationPicker from './LocationPicker' -import { SocialLocation, SocialMedia } from '@/types/intranet' +import { SocialMedia } from '@/types/intranet' interface CreatePostProps { onCreatePost: (post: { content: string - location?: SocialLocation + location?: string media?: { type: 'mixed' | 'poll' mediaItems?: SocialMedia[] @@ -32,7 +32,7 @@ const CreatePost: React.FC = ({ onCreatePost }) => { const [content, setContent] = useState('') const [mediaType, setMediaType] = useState<'media' | 'poll' | null>(null) const [mediaItems, setMediaItems] = useState([]) - const [location, setLocation] = useState(null) + const [location, setLocation] = useState(null) const [pollQuestion, setPollQuestion] = useState('') const [pollOptions, setPollOptions] = useState(['', '']) const [isExpanded, setIsExpanded] = useState(false) @@ -203,13 +203,13 @@ const CreatePost: React.FC = ({ onCreatePost }) => {
{item.type === 'image' ? ( Preview ) : (
-