From 768dfdfd167ac54e42618739e11a0c1d42f6cf68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sedat=20=C3=96ZT=C3=9CRK?= <76204082+iamsedatozturk@users.noreply.github.com> Date: Fri, 24 Oct 2025 18:00:36 +0300 Subject: [PATCH] Hr Reservations ve Shuttleroute --- .../Seeds/HostData.json | 317 +++-- .../Seeds/ListFormsSeeder.cs | 1101 +++++++++++++++-- .../Enums/TableNameEnum.cs | 4 +- .../PlatformConsts.cs | 2 + .../TableNameResolver.cs | 4 +- .../Branch/BranchSeedManager.cs | 28 +- .../Branch/BranchSeederDto.cs | 12 +- .../Branch/Seeds/BranchData.json | 28 + .../Kurs.Platform.Domain/Data/SeedConsts.cs | 3 + .../Entities/Branch/{ => Accounting}/Bank.cs | 0 .../Branch/{ => Accounting}/BankAccount.cs | 0 .../{ => Administration}/BranchUsers.cs | 0 .../Branch/{ => Coordinator}/Class.cs | 0 .../Branch/{ => Coordinator}/ClassType.cs | 0 .../Branch/{ => Coordinator}/Classroom.cs | 0 .../{ => Coordinator}/ClassroomAttandance.cs | 0 .../Branch/{ => Coordinator}/ClassroomChat.cs | 0 .../{ => Coordinator}/ClassroomParticipant.cs | 0 .../Branch/{ => Coordinator}/LessonPeriod.cs | 0 .../Branch/{ => Coordinator}/Level.cs | 0 .../{ => Coordinator}/RegistrationMethod.cs | 0 .../{ => Coordinator}/RegistrationType.cs | 0 .../Branch/{ => Coordinator}/Schedule.cs | 0 .../{ => Coordinator}/ScheduleLesson.cs | 0 .../Entities/Branch/{ => Hr}/Meal.cs | 6 +- .../Host/{Forum => }/ForumCategory.cs | 0 .../Entities/Host/{Forum => }/ForumPost.cs | 0 .../Entities/Host/{Forum => }/ForumTopic.cs | 0 .../Entities/Host/{ListForm => }/ListForm.cs | 0 .../{ListForm => }/ListFormCustomization.cs | 0 .../Host/{ListForm => }/ListFormField.cs | 0 .../Host/{ListForm => }/ListFormImport.cs | 0 .../{ListForm => }/ListFormImportExecute.cs | 0 .../{Public => Administration}/About.cs | 0 .../ApiEndpoint.cs | 0 .../ApiMigration.cs | 0 .../Tenant/{ => Administration}/Behavior.cs | 0 .../BlogCategory.cs | 0 .../{Public => Administration}/BlogPost.cs | 0 .../{Public => Administration}/Contact.cs | 0 .../CustomComponent.cs | 0 .../CustomEndpoint.cs | 0 .../CustomEntity.cs | 0 .../Tenant/{Public => Administration}/Demo.cs | 0 .../Tenant/{ => Administration}/Disease.cs | 0 .../Tenant/{ => Administration}/Document.cs | 0 .../{ => Administration}/EducationStatus.cs | 0 .../InstallmentOption.cs | 0 .../{ => Administration}/IpRestriction.cs | 0 .../Tenant/{ => Administration}/Lawyer.cs | 0 .../{Public => Administration}/Order.cs | 0 .../PaymentMethod.cs | 0 .../{Public => Administration}/Product.cs | 0 .../Administration}/Psychologist.cs | 0 .../ReportCategory.cs | 0 .../ReportGenerated.cs | 0 .../ReportParameter.cs | 0 .../ReportTemplate.cs | 0 .../Tenant/{ => Administration}/Sector.cs | 0 .../{Public => Administration}/Service.cs | 0 .../Tenant/{ => Administration}/Skill.cs | 0 .../Tenant/{ => Administration}/SkillLevel.cs | 0 .../Tenant/{ => Administration}/SkillType.cs | 0 .../Tenant/{ => Administration}/Uom.cs | 0 .../{ => Administration}/UomCategory.cs | 0 .../Tenant/{ => Administration}/Vaccine.cs | 0 .../Tenant/{ => Administration}/Vehicle.cs | 0 .../Tenant/{ => Administration}/WorkHour.cs | 0 .../ClassCancellationReason.cs | 0 .../Tenant/{ => Coordinator}/Program.cs | 0 .../Tenant/{ => Coordinator}/Question.cs | 0 .../{ => Coordinator}/QuestionOption.cs | 0 .../Tenant/{ => Coordinator}/QuestionPool.cs | 0 .../Tenant/{ => Coordinator}/QuestionTag.cs | 0 .../Entities/Tenant/{ => Hr}/Event.cs | 0 .../Entities/Tenant/{ => Hr}/EventCategory.cs | 0 .../Entities/Tenant/{ => Hr}/EventComment.cs | 0 .../Entities/Tenant/{ => Hr}/EventPhoto.cs | 0 .../Entities/Tenant/{ => Hr}/EventType.cs | 0 .../Entities/Tenant/Hr/Reservation.cs | 24 + .../Entities/Tenant/Hr/ShuttleRoute.cs | 19 + .../Tenant/{ => Participant}/Interesting.cs | 0 .../Tenant/{ => Participant}/MeetingMethod.cs | 0 .../Tenant/{ => Participant}/MeetingResult.cs | 0 .../Tenant/{ => Participant}/NoteType.cs | 0 .../{ => Participant}/SalesRejectionReason.cs | 0 .../Tenant/{ => Participant}/Source.cs | 0 .../Tenant/{ => Platform}/GlobalSearch.cs | 0 .../Entities/Tenant/{ => Saas}/Activity.cs | 0 .../Entities/Tenant/{ => Saas}/Branch.cs | 0 .../EntityFrameworkCore/PlatformDbContext.cs | 35 +- ....cs => 20251024144858_Initial.Designer.cs} | 194 ++- ...2_Initial.cs => 20251024144858_Initial.cs} | 125 +- .../PlatformDbContextModelSnapshot.cs | 192 ++- .../Tenants/Seeds/TenantData.json | 105 ++ .../Tenants/TenantDataSeeder.cs | 47 +- .../Tenants/TenantSeederDto.cs | 26 + ui/src/mocks/mockIntranet.ts | 308 ++--- 98 files changed, 2214 insertions(+), 366 deletions(-) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Accounting}/Bank.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Accounting}/BankAccount.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Administration}/BranchUsers.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Coordinator}/Class.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Coordinator}/ClassType.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Coordinator}/Classroom.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Coordinator}/ClassroomAttandance.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Coordinator}/ClassroomChat.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Coordinator}/ClassroomParticipant.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Coordinator}/LessonPeriod.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Coordinator}/Level.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Coordinator}/RegistrationMethod.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Coordinator}/RegistrationType.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Coordinator}/Schedule.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Coordinator}/ScheduleLesson.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Branch/{ => Hr}/Meal.cs (73%) rename api/src/Kurs.Platform.Domain/Entities/Host/{Forum => }/ForumCategory.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Host/{Forum => }/ForumPost.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Host/{Forum => }/ForumTopic.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Host/{ListForm => }/ListForm.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Host/{ListForm => }/ListFormCustomization.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Host/{ListForm => }/ListFormField.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Host/{ListForm => }/ListFormImport.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Host/{ListForm => }/ListFormImportExecute.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Public => Administration}/About.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{DeveloperKit => Administration}/ApiEndpoint.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{DeveloperKit => Administration}/ApiMigration.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/Behavior.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Public => Administration}/BlogCategory.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Public => Administration}/BlogPost.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Public => Administration}/Contact.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{DeveloperKit => Administration}/CustomComponent.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{DeveloperKit => Administration}/CustomEndpoint.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{DeveloperKit => Administration}/CustomEntity.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Public => Administration}/Demo.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/Disease.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/Document.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/EducationStatus.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Public => Administration}/InstallmentOption.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/IpRestriction.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/Lawyer.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Public => Administration}/Order.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Public => Administration}/PaymentMethod.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Public => Administration}/Product.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/{Branch => Tenant/Administration}/Psychologist.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Report => Administration}/ReportCategory.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Report => Administration}/ReportGenerated.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Report => Administration}/ReportParameter.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Report => Administration}/ReportTemplate.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/Sector.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{Public => Administration}/Service.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/Skill.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/SkillLevel.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/SkillType.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/Uom.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/UomCategory.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/Vaccine.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/Vehicle.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Administration}/WorkHour.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Coordinator}/ClassCancellationReason.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Coordinator}/Program.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Coordinator}/Question.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Coordinator}/QuestionOption.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Coordinator}/QuestionPool.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Coordinator}/QuestionTag.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Hr}/Event.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Hr}/EventCategory.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Hr}/EventComment.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Hr}/EventPhoto.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Hr}/EventType.cs (100%) create mode 100644 api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Reservation.cs create mode 100644 api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/ShuttleRoute.cs rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Participant}/Interesting.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Participant}/MeetingMethod.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Participant}/MeetingResult.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Participant}/NoteType.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Participant}/SalesRejectionReason.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Participant}/Source.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Platform}/GlobalSearch.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Saas}/Activity.cs (100%) rename api/src/Kurs.Platform.Domain/Entities/Tenant/{ => Saas}/Branch.cs (100%) rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251024083852_Initial.Designer.cs => 20251024144858_Initial.Designer.cs} (98%) rename api/src/Kurs.Platform.EntityFrameworkCore/Migrations/{20251024083852_Initial.cs => 20251024144858_Initial.cs} (98%) diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json index 1ddaf8fa..d1c04f12 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/HostData.json @@ -7621,6 +7621,24 @@ "tr": "Eğitimler", "en": "Trainings" }, + { + "resourceName": "Platform", + "key": "App.Hr.Meal", + "tr": "Yemekler", + "en": "Meals" + }, + { + "resourceName": "Platform", + "key": "App.Hr.Reservation", + "tr": "Rezervasyonlar", + "en": "Reservations" + }, + { + "resourceName": "Platform", + "key": "App.Hr.ShuttleRoute", + "tr": "Servis Rotaları", + "en": "Shuttle Routes" + }, { "resourceName": "Platform", "key": "App.Definitions.Information", @@ -7711,12 +7729,6 @@ "tr": "Psikologlar", "en": "Psychologists" }, - { - "resourceName": "Platform", - "key": "App.Definitions.Meal", - "tr": "Yemekler", - "en": "Meals" - }, { "resourceName": "Platform", "key": "App.Definitions.Lawyer", @@ -14224,16 +14236,6 @@ "RequiredPermissionName": "App.Definitions.Lawyer", "IsDisabled": false }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.Meal", - "DisplayName": "App.Definitions.Meal", - "Order": 16, - "Url": "/admin/list/list-meal", - "Icon": "FcLike", - "RequiredPermissionName": "App.Definitions.Meal", - "IsDisabled": false - }, { "ParentCode": null, "Code": "App.Participant", @@ -15096,6 +15098,36 @@ "RequiredPermissionName": "App.Hr.Training", "IsDisabled": false }, + { + "ParentCode": "App.Hr", + "Code": "App.Hr.Meal", + "DisplayName": "App.Hr.Meal", + "Order": 16, + "Url": "/admin/list/list-meal", + "Icon": "FcLike", + "RequiredPermissionName": "App.Hr.Meal", + "IsDisabled": false + }, + { + "ParentCode": "App.Hr", + "Code": "App.Hr.Reservation", + "DisplayName": "App.Hr.Reservation", + "Order": 17, + "Url": "/admin/list/list-reservation", + "Icon": "FcAlarmClock", + "RequiredPermissionName": "App.Hr.Reservation", + "IsDisabled": false + }, + { + "ParentCode": "App.Hr", + "Code": "App.Hr.ShuttleRoute", + "DisplayName": "App.Hr.ShuttleRoute", + "Order": 17, + "Url": "/admin/list/list-shuttleroute", + "Icon": "FcAutomotive", + "RequiredPermissionName": "App.Hr.ShuttleRoute", + "IsDisabled": false + }, { "ParentCode": null, @@ -20562,70 +20594,6 @@ "MultiTenancySide": 3, "MenuGroup": "Kurs" }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Meal", - "ParentName": null, - "DisplayName": "App.Definitions.Meal", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Meal.Create", - "ParentName": "App.Definitions.Meal", - "DisplayName": "Create", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Meal.Update", - "ParentName": "App.Definitions.Meal", - "DisplayName": "Update", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Meal.Delete", - "ParentName": "App.Definitions.Meal", - "DisplayName": "Delete", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Meal.Export", - "ParentName": "App.Definitions.Meal", - "DisplayName": "Export", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Meal.Import", - "ParentName": "App.Definitions.Meal", - "DisplayName": "Import", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { - "GroupName": "App.Administration", - "Name": "App.Definitions.Meal.Activity", - "ParentName": "App.Definitions.Meal", - "DisplayName": "Activity", - "IsEnabled": true, - "MultiTenancySide": 3, - "MenuGroup": "Kurs" - }, - { "GroupName": "App.Participant", "Name": "App.Definitions.MeetingMethod", @@ -24858,6 +24826,195 @@ "MultiTenancySide": 3, "MenuGroup": "Erp" }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Meal", + "ParentName": null, + "DisplayName": "App.Hr.Meal", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Meal.Create", + "ParentName": "App.Hr.Meal", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Meal.Update", + "ParentName": "App.Hr.Meal", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Meal.Delete", + "ParentName": "App.Hr.Meal", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Meal.Export", + "ParentName": "App.Hr.Meal", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Meal.Import", + "ParentName": "App.Hr.Meal", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Meal.Activity", + "ParentName": "App.Hr.Meal", + "DisplayName": "Activity", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Reservation", + "ParentName": null, + "DisplayName": "App.Hr.Reservation", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Reservation.Create", + "ParentName": "App.Hr.Reservation", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Reservation.Update", + "ParentName": "App.Hr.Reservation", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Reservation.Delete", + "ParentName": "App.Hr.Reservation", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Reservation.Export", + "ParentName": "App.Hr.Reservation", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Reservation.Import", + "ParentName": "App.Hr.Reservation", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.Reservation.Activity", + "ParentName": "App.Hr.Reservation", + "DisplayName": "Activity", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.ShuttleRoute", + "ParentName": null, + "DisplayName": "App.Hr.ShuttleRoute", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.ShuttleRoute.Create", + "ParentName": "App.Hr.ShuttleRoute", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.ShuttleRoute.Update", + "ParentName": "App.Hr.ShuttleRoute", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.ShuttleRoute.Delete", + "ParentName": "App.Hr.ShuttleRoute", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.ShuttleRoute.Export", + "ParentName": "App.Hr.ShuttleRoute", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.ShuttleRoute.Import", + "ParentName": "App.Hr.ShuttleRoute", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, + { + "GroupName": "App.Hr", + "Name": "App.Hr.ShuttleRoute.Activity", + "ParentName": "App.Hr.ShuttleRoute", + "DisplayName": "Activity", + "IsEnabled": true, + "MultiTenancySide": 3, + "MenuGroup": "Kurs" + }, { "GroupName": "App.Crm", diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index d72e303a..e2b5a076 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -28195,13 +28195,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), CultureName = LanguageCodes.En, ListFormCode = ListFormCodes.Lists.Meal, - Name = AppCodes.Definitions.Meal, - Title = AppCodes.Definitions.Meal, + Name = AppCodes.Hr.Meal, + Title = AppCodes.Hr.Meal, DataSourceCode = SeedConsts.DataSources.DefaultCode, IsTenant = true, IsBranch = true, IsOrganizationUnit = false, - Description = AppCodes.Definitions.Meal, + Description = AppCodes.Hr.Meal, SelectCommandType = SelectCommandTypeEnum.Table, SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Meal)), KeyFieldName = "Id", @@ -28228,13 +28228,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto { - C = AppCodes.Definitions.Meal + ".Create", - R = AppCodes.Definitions.Meal, - U = AppCodes.Definitions.Meal + ".Update", - D = AppCodes.Definitions.Meal + ".Delete", - E = AppCodes.Definitions.Meal + ".Export", - I = AppCodes.Definitions.Meal + ".Import", - A = AppCodes.Definitions.Meal + ".Activity", + C = AppCodes.Hr.Meal + ".Create", + R = AppCodes.Hr.Meal, + U = AppCodes.Hr.Meal + ".Update", + D = AppCodes.Hr.Meal + ".Delete", + E = AppCodes.Hr.Meal + ".Export", + I = AppCodes.Hr.Meal + ".Import", + A = AppCodes.Hr.Meal + ".Activity", }), DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.Meal))}\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] @@ -28290,11 +28290,10 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency ItemType = "group", Items = [ - new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, - new EditingFormItemDto { Order = 3, DataField = "Date", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, - new EditingFormItemDto { Order = 4, DataField = "Breakfast", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, - new EditingFormItemDto { Order = 5, DataField = "Lunch", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, - new EditingFormItemDto { Order = 6, DataField = "Snack", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 2, DataField = "Date", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 3, DataField = "Type", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, + new EditingFormItemDto { Order = 4, DataField = "Materials", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTagBox }, ] } }), @@ -28325,7 +28324,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } ); - #region Meal Fields + #region Meal Menu Fields await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { // Id @@ -28338,7 +28337,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency SourceDbType = DbType.Guid, FieldName = "Id", Width = 100, - ListOrderNo = 0, + ListOrderNo = 1, Visible = false, IsActive = true, IsDeleted = false, @@ -28352,9 +28351,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.Definitions.Meal + ".Create", - R = AppCodes.Definitions.Meal, - U = AppCodes.Definitions.Meal + ".Update", + C = AppCodes.Hr.Meal + ".Create", + R = AppCodes.Hr.Meal, + U = AppCodes.Hr.Meal + ".Update", E = true, I = true, Deny = false @@ -28389,9 +28388,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.Definitions.Meal + ".Create", - R = AppCodes.Definitions.Meal, - U = AppCodes.Definitions.Meal + ".Update", + C = AppCodes.Hr.Meal + ".Create", + R = AppCodes.Hr.Meal, + U = AppCodes.Hr.Meal + ".Update", E = true, I = true, Deny = false @@ -28403,7 +28402,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency { ListFormCode = listFormMeal.ListFormCode, CultureName = LanguageCodes.En, - SourceDbType = DbType.DateTime, + SourceDbType = DbType.Date, FieldName = "Date", Width = 150, ListOrderNo = 3, @@ -28423,90 +28422,100 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.Definitions.Meal + ".Create", - R = AppCodes.Definitions.Meal, - U = AppCodes.Definitions.Meal + ".Update", + C = AppCodes.Hr.Meal + ".Create", + R = AppCodes.Hr.Meal, + U = AppCodes.Hr.Meal + ".Update", E = true, I = true, Deny = false }), PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) }, - // Breakfast + // Type new() { ListFormCode = listFormMeal.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.String, - FieldName = "Breakfast", + FieldName = "Type", Width = 300, ListOrderNo = 4, Visible = true, IsActive = true, IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key= "breakfast", Name= "Breakfast" }, + new () { Key= "lunch", Name= "Lunch" }, + new () { Key= "dinner", Name="Dinner" } + }), + }), ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto { AllowReordering = true, }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.Definitions.Meal + ".Create", - R = AppCodes.Definitions.Meal, - U = AppCodes.Definitions.Meal + ".Update", + C = AppCodes.Hr.Meal + ".Create", + R = AppCodes.Hr.Meal, + U = AppCodes.Hr.Meal + ".Update", E = true, I = true, Deny = false }), PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) }, - // Lunch + // Materials new() { ListFormCode = listFormMeal.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.String, - FieldName = "Lunch", + FieldName = "Materials", Width = 300, ListOrderNo = 5, Visible = true, IsActive = true, IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + //TODO: Materials kısmında Query olarak getirmeli + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key="Mercimek Çorbası", Name="Mercimek Çorbası" }, + new () { Key="Tavuk Şinitzel", Name="Tavuk Şinitzel" }, + new () { Key="Bulgur Pilavı", Name="Bulgur Pilavı" }, + new () { Key="Salata", Name="Salata" }, + new () { Key="Meyve", Name="Meyve" }, + new () { Key="Domates Çorbası", Name="Domates Çorbası" }, + new () { Key="Etli Kuru Fasulye", Name="Etli Kuru Fasulye" }, + new () { Key="Pilav", Name="Pilav" }, + new () { Key="Turşu", Name="Turşu" }, + new () { Key="Komposto", Name="Komposto" }, + new () { Key="Tarator", Name="Tarator" }, + new () { Key="Köfte", Name="Köfte" }, + new () { Key="Patates Püresi", Name="Patates Püresi" }, + new () { Key="Yoğurtlu Kabak Salatası", Name="Yoğurtlu Kabak Salatası" }, + new () { Key="Fırında Levrek", Name="Fırında Levrek" }, + new () { Key="Kuskus", Name="Kuskus" }, + new () { Key="Roka Salatası", Name="Roka Salatası" } + }), + }), ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto { AllowReordering = true, }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { - C = AppCodes.Definitions.Meal + ".Create", - R = AppCodes.Definitions.Meal, - U = AppCodes.Definitions.Meal + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) - }, - // Snack - new() - { - ListFormCode = listFormMeal.ListFormCode, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Snack", - Width = 300, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto - { - AllowReordering = true, - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Meal + ".Create", - R = AppCodes.Definitions.Meal, - U = AppCodes.Definitions.Meal + ".Update", + C = AppCodes.Hr.Meal + ".Create", + R = AppCodes.Hr.Meal, + U = AppCodes.Hr.Meal + ".Update", E = true, I = true, Deny = false @@ -38227,8 +38236,8 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Popup = new GridEditingPopupDto() { Title = "Training Form", - Width = 400, - Height = 500 + Width = 500, + Height = 600 }, AllowDeleting = true, AllowAdding = true, @@ -38272,7 +38281,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency ] } }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { new() { FieldName = "Status", @@ -38377,7 +38386,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Description", - Width = 500, + Width = 650, ListOrderNo = 3, Visible = true, IsActive = true, @@ -38565,7 +38574,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency CultureName = LanguageCodes.En, SourceDbType = DbType.String, FieldName = "Thumbnail", - Width = 400, + Width = 550, ListOrderNo = 8, Visible = true, IsActive = true, @@ -38797,6 +38806,960 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region Reservations + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Reservation)) + { + var listFormReservation = 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.Reservation, + Name = AppCodes.Hr.Reservation, + Title = AppCodes.Hr.Reservation, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Hr.Reservation, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.Reservation)), + 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.Hr.Reservation + ".Create", + R = AppCodes.Hr.Reservation, + U = AppCodes.Hr.Reservation + ".Update", + D = AppCodes.Hr.Reservation + ".Delete", + E = AppCodes.Hr.Reservation + ".Export", + I = AppCodes.Hr.Reservation + ".Import", + A = AppCodes.Hr.Reservation + ".Activity", + }), + DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.Reservation))}\" 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 = "Reservation Form", + Width = 500, + Height = 600 + }, + 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="Type", IsRequired = true, EditorType2 = EditorTypes.dxSelectBox}, + new EditingFormItemDto {Order=2,DataField="ResourceName", IsRequired = true, EditorType2 = EditorTypes.dxTextBox}, + new EditingFormItemDto {Order=3,DataField="EmployeeId", IsRequired = true, EditorType2 = EditorTypes.dxSelectBox}, + new EditingFormItemDto {Order=4,DataField="StartDate", IsRequired = true, EditorType2 = EditorTypes.dxDateBox}, + new EditingFormItemDto {Order=5,DataField="EndDate", IsRequired = true, EditorType2 = EditorTypes.dxDateBox}, + new EditingFormItemDto {Order=6,DataField="Purpose", IsRequired = true, EditorType2 = EditorTypes.dxTextBox}, + new EditingFormItemDto {Order=8,DataField="Participants", EditorType2 = EditorTypes.dxNumberBox}, + new EditingFormItemDto {Order=9,DataField="Notes", EditorType2 = EditorTypes.dxTextArea}, + new EditingFormItemDto {Order=7,DataField="Status", IsRequired = true, EditorType2 = EditorTypes.dxTextBox}, + ] + } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() { + FieldName = "Status", + FieldDbType = DbType.String, + Value = "pending", + CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { + FieldName = "Participants", + FieldDbType = DbType.Int32, + Value = "0", + CustomValueType = FieldCustomValueTypeEnum.Value } + }) + } + ); + + #region Reservation Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listFormReservation.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.Hr.Reservation + ".Create", + R = AppCodes.Hr.Reservation, + U = AppCodes.Hr.Reservation + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormReservation.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Type", + Width = 100, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key= "room", Name= "Room" }, + new () { Key= "vehicle", Name= "Vehicle" }, + new () { Key= "equipment", Name="Equipment" }, + }), + }), + 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.Hr.Reservation + ".Create", + R = AppCodes.Hr.Reservation, + U = AppCodes.Hr.Reservation + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormReservation.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "ResourceName", + Width = 300, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Reservation + ".Create", + R = AppCodes.Hr.Reservation, + U = AppCodes.Hr.Reservation + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormReservation.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "EmployeeId", + Width = 100, + ListOrderNo = 4, + 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.Hr.Reservation + ".Create", + R = AppCodes.Hr.Reservation, + U = AppCodes.Hr.Reservation + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormReservation.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "StartDate", + Width = 100, + ListOrderNo = 5, + 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.Hr.Reservation + ".Create", + R = AppCodes.Hr.Reservation, + U = AppCodes.Hr.Reservation + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormReservation.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Date, + FieldName = "EndDate", + Width = 100, + ListOrderNo = 6, + 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.Hr.Reservation + ".Create", + R = AppCodes.Hr.Reservation, + U = AppCodes.Hr.Reservation + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormReservation.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Purpose", + Width = 200, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Reservation + ".Create", + R = AppCodes.Hr.Reservation, + U = AppCodes.Hr.Reservation + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormReservation.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Participants", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Reservation + ".Create", + R = AppCodes.Hr.Reservation, + U = AppCodes.Hr.Reservation + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormReservation.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Notes", + Width = 300, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Reservation + ".Create", + R = AppCodes.Hr.Reservation, + U = AppCodes.Hr.Reservation + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormReservation.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 100, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key= "pending", Name= "Pending" }, + new () { Key= "approved", Name= "Approved" }, + new () { Key= "rejected", Name="Rejected" }, + new () { Key= "completed", Name="Completed" }, + }), + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.Reservation + ".Create", + R = AppCodes.Hr.Reservation, + U = AppCodes.Hr.Reservation + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + ]); + #endregion + } + #endregion + + #region Shuttle Routes + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ShuttleRoute)) + { + var listFormShuttleRoute = 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.ShuttleRoute, + Name = AppCodes.Hr.ShuttleRoute, + Title = AppCodes.Hr.ShuttleRoute, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Hr.ShuttleRoute, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.ShuttleRoute)), + 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.Hr.ShuttleRoute + ".Create", + R = AppCodes.Hr.ShuttleRoute, + U = AppCodes.Hr.ShuttleRoute + ".Update", + D = AppCodes.Hr.ShuttleRoute + ".Delete", + E = AppCodes.Hr.ShuttleRoute + ".Export", + I = AppCodes.Hr.ShuttleRoute + ".Import", + A = AppCodes.Hr.ShuttleRoute + ".Activity", + }), + DeleteCommand = $"UPDATE \"{TableNameResolver.GetFullTableName(nameof(TableNameEnum.ShuttleRoute))}\" 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 = "Shuttle Route Form", + Width = 500, + Height = 600 + }, + 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 = "Name", IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Type", IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField = "DepartureTime", IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.TimeSpanOptions }, + new EditingFormItemDto { Order = 4, DataField = "ArrivalTime", IsRequired = true, EditorType2 = EditorTypes.dxTextBox, EditorOptions = EditorOptionValues.TimeSpanOptions }, + new EditingFormItemDto { Order = 5, DataField = "Capacity", EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 6, DataField = "Route", IsRequired = true, EditorType2 = EditorTypes.dxTagBox } + ] + } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] + { + new() { + FieldName = "Capacity", + FieldDbType = DbType.Int32, + Value = "0", + CustomValueType = FieldCustomValueTypeEnum.Value }, + new() { + FieldName = "Type", + FieldDbType = DbType.String, + Value = "morning", + CustomValueType = FieldCustomValueTypeEnum.Value } + }) + } + ); + + #region Shuttle Route Fields + await _listFormFieldRepository.InsertManyAsync([ + new() { + ListFormCode = listFormShuttleRoute.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.Hr.ShuttleRoute + ".Create", + R = AppCodes.Hr.ShuttleRoute, + U = AppCodes.Hr.ShuttleRoute + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormShuttleRoute.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 2, + 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.Hr.ShuttleRoute + ".Create", + R = AppCodes.Hr.ShuttleRoute, + U = AppCodes.Hr.ShuttleRoute + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormShuttleRoute.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Type", + Width = 100, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key= "morning", Name= "Morning" }, + new () { Key= "evening", Name= "Evening" }, + }), + }), + 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.Hr.ShuttleRoute + ".Create", + R = AppCodes.Hr.ShuttleRoute, + U = AppCodes.Hr.ShuttleRoute + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormShuttleRoute.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "DepartureTime", + Width = 100, + ListOrderNo = 4, + 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.Hr.ShuttleRoute + ".Create", + R = AppCodes.Hr.ShuttleRoute, + U = AppCodes.Hr.ShuttleRoute + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormShuttleRoute.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "ArrivalTime", + Width = 100, + ListOrderNo = 5, + 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.Hr.ShuttleRoute + ".Create", + R = AppCodes.Hr.ShuttleRoute, + U = AppCodes.Hr.ShuttleRoute + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormShuttleRoute.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Capacity", + 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.Hr.ShuttleRoute + ".Create", + R = AppCodes.Hr.ShuttleRoute, + U = AppCodes.Hr.ShuttleRoute + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormShuttleRoute.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "Available", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.ShuttleRoute + ".Create", + R = AppCodes.Hr.ShuttleRoute, + U = AppCodes.Hr.ShuttleRoute + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormShuttleRoute.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Route", + Width = 300, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key= "Kadıköy İskele", Name= "Kadıköy İskele" }, + new () { Key= "Bostancı", Name= "Bostancı" }, + new () { Key= "Acıbadem", Name="Acıbadem" }, + new () { Key= "Kozyatağı", Name="Kozyatağı" }, + new () { Key= "Ofis", Name="Ofis" }, + new () { Key= "Üsküdar Meydanı", Name="Üsküdar Meydanı" }, + new () { Key= "Kısıklı", Name="Kısıklı" }, + new () { Key= "Bulgurlu", Name="Bulgurlu" }, + new () { Key= "Ümraniye", Name="Ümraniye" }, + }), + }), + ColumnCustomizationJson = JsonSerializer.Serialize(new ColumnCustomizationDto + { + AllowReordering = true, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Hr.ShuttleRoute + ".Create", + R = AppCodes.Hr.ShuttleRoute, + U = AppCodes.Hr.ShuttleRoute + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + ]); + #endregion + } + #endregion + #endregion } } diff --git a/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs b/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs index ea2c1eab..589ff2c4 100644 --- a/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs +++ b/api/src/Kurs.Platform.Domain.Shared/Enums/TableNameEnum.cs @@ -118,5 +118,7 @@ public enum TableNameEnum Template360, Performance360, Training, - Certificate + Certificate, + Reservation, + ShuttleRoute } \ 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 a5d697f1..5001f833 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -527,6 +527,8 @@ public static class PlatformConsts public const string Template360 = "list-template360"; public const string Performance360 = "list-performance360"; public const string Training = "list-training"; + public const string Reservation = "list-reservation"; + public const string ShuttleRoute = "list-shuttleroute"; } } diff --git a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs index 120645b0..1547708d 100644 --- a/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs +++ b/api/src/Kurs.Platform.Domain.Shared/TableNameResolver.cs @@ -74,7 +74,6 @@ public static class TableNameResolver { nameof(TableNameEnum.Psychologist), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.Vaccine), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.Lawyer), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, - { nameof(TableNameEnum.Meal), (PlatformConsts.TablePrefix.BranchByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.Document), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.Vehicle), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, { nameof(TableNameEnum.WorkHour), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Administration) }, @@ -136,6 +135,9 @@ public static class TableNameResolver { nameof(TableNameEnum.Event), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, { nameof(TableNameEnum.Training), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, { nameof(TableNameEnum.Certificate), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, + { nameof(TableNameEnum.Meal), (PlatformConsts.TablePrefix.BranchByName, MenuPrefix.Hr) }, + { nameof(TableNameEnum.Reservation), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, + { nameof(TableNameEnum.ShuttleRoute), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Hr) }, // 🔹 ACCOUNTING { nameof(TableNameEnum.Bank), (PlatformConsts.TablePrefix.TenantByName, MenuPrefix.Accounting) }, diff --git a/api/src/Kurs.Platform.Domain/Branch/BranchSeedManager.cs b/api/src/Kurs.Platform.Domain/Branch/BranchSeedManager.cs index c2b03806..b30a7ea5 100644 --- a/api/src/Kurs.Platform.Domain/Branch/BranchSeedManager.cs +++ b/api/src/Kurs.Platform.Domain/Branch/BranchSeedManager.cs @@ -19,6 +19,7 @@ public class BranchSeedManager : DomainService private readonly IRepository _levelRepository; private readonly IRepository _lessonPeriodRepository; private readonly IRepository _scheduleRepository; + private readonly IRepository _mealRepository; public BranchSeedManager( IRepository branchRepository, @@ -28,7 +29,9 @@ public class BranchSeedManager : DomainService IRepository classRepository, IRepository levelRepository, IRepository lessonPeriodRepository, - IRepository scheduleRepository) + IRepository scheduleRepository, + IRepository mealRepository + ) { _branchRepository = branchRepository; _registrationTypeRepository = registrationTypeRepository; @@ -38,6 +41,7 @@ public class BranchSeedManager : DomainService _levelRepository = levelRepository; _lessonPeriodRepository = lessonPeriodRepository; _scheduleRepository = scheduleRepository; + _mealRepository = mealRepository; } public async Task SeedRecordsAsync(Guid? tenantId, Guid branchId) @@ -268,6 +272,28 @@ public class BranchSeedManager : DomainService } result.Details.Add(scheduleLog); + var mealLog = CreateLog(nameof(Meal)); + foreach (var item in items.Meals) + { + var exists = await _mealRepository.AnyAsync(x => x.Date == item.Date && x.Type == item.Type && x.BranchId == branchId); + if (!exists) + { + await _mealRepository.InsertAsync(new() + { + TenantId = tenantId, + BranchId = branchId, + Date = item.Date, + Type = item.Type, + TotalCalorie = item.TotalCalorie, + Materials = item.Materials + }, autoSave: true); + + mealLog.InsertedCount++; + mealLog.InsertedItems.Add(string.Format("{0} {1} {2}", item.Date, item.Type, item.Materials)); + } + } + result.Details.Add(mealLog); + result.Success = true; result.Message = $"Seed işlemi başarıyla tamamlandı. Toplam {result.TotalInsertedCount} kayıt eklendi."; return result; diff --git a/api/src/Kurs.Platform.Domain/Branch/BranchSeederDto.cs b/api/src/Kurs.Platform.Domain/Branch/BranchSeederDto.cs index 0f7a969e..597950aa 100644 --- a/api/src/Kurs.Platform.Domain/Branch/BranchSeederDto.cs +++ b/api/src/Kurs.Platform.Domain/Branch/BranchSeederDto.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace Kurs.Platform.Branchs; @@ -11,6 +12,15 @@ public class BranchSeederDto public List Levels { get; set; } public List LessonPeriods { get; set; } public List Schedules { get; set; } + public List Meals { get; set; } +} + +public class MealSeedDto +{ + public DateTime Date { get; set; } + public string Type { get; set; } + public decimal TotalCalorie { get; set; } + public string Materials { get; set; } } public class RegistrationTypeSeedDto diff --git a/api/src/Kurs.Platform.Domain/Branch/Seeds/BranchData.json b/api/src/Kurs.Platform.Domain/Branch/Seeds/BranchData.json index 16b29049..e775f4ad 100644 --- a/api/src/Kurs.Platform.Domain/Branch/Seeds/BranchData.json +++ b/api/src/Kurs.Platform.Domain/Branch/Seeds/BranchData.json @@ -808,5 +808,33 @@ "Lesson3": "Ana", "Lesson4": "Ana" } + ], + "Meals": [ + { + "date": "01-10-2025", + "type": "lunch", + "totalCalorie": 650, + "materials": "Mercimek Çorbası|Tavuk Şinitzel|Bulgur Pilavı|Salata|Meyve" + }, + { + "date": "02-10-2025", + "type": "lunch", + "materials": "Domates Çorbası|Etli Kuru Fasulye|Pilav|Turşu|Komposto" + }, + { + "date": "03-10-2025", + "type": "lunch", + "materials": "Tarator|Köfte|Patates Püresi|Salata|Meyve" + }, + { + "date": "04-10-2025", + "type": "lunch", + "materials": "Yoğurtlu Kabak Salatası|Fırında Levrek|Kuskus|Roka Salatası|Meyve" + }, + { + "date": "05-10-2025", + "type": "lunch", + "materials": "Mercimek Çorbası|Tavuk Şinitzel|Bulgur Pilavı|Salata|Meyve" + } ] } diff --git a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs index 7fa0e305..10a11cc7 100644 --- a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs @@ -466,6 +466,9 @@ public static class SeedConsts public const string Event = Events + ".Event"; public const string Training = Default + ".Training"; + public const string Meal = Default + ".Meal"; + public const string Reservation = Default + ".Reservation"; + public const string ShuttleRoute = Default + ".ShuttleRoute"; } public static class Accounting diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/Bank.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Accounting/Bank.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/Bank.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Accounting/Bank.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/BankAccount.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Accounting/BankAccount.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/BankAccount.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Accounting/BankAccount.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/BranchUsers.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Administration/BranchUsers.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/BranchUsers.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Administration/BranchUsers.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/Class.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/Class.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/Class.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/Class.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/ClassType.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/ClassType.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/ClassType.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/ClassType.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/Classroom.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/Classroom.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/Classroom.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/Classroom.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/ClassroomAttandance.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/ClassroomAttandance.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/ClassroomAttandance.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/ClassroomAttandance.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/ClassroomChat.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/ClassroomChat.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/ClassroomChat.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/ClassroomChat.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/ClassroomParticipant.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/ClassroomParticipant.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/ClassroomParticipant.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/ClassroomParticipant.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/LessonPeriod.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/LessonPeriod.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/LessonPeriod.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/LessonPeriod.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/Level.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/Level.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/Level.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/Level.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/RegistrationMethod.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/RegistrationMethod.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/RegistrationMethod.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/RegistrationMethod.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/RegistrationType.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/RegistrationType.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/RegistrationType.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/RegistrationType.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/Schedule.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/Schedule.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/Schedule.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/Schedule.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/ScheduleLesson.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/ScheduleLesson.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/ScheduleLesson.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Coordinator/ScheduleLesson.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/Meal.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Hr/Meal.cs similarity index 73% rename from api/src/Kurs.Platform.Domain/Entities/Branch/Meal.cs rename to api/src/Kurs.Platform.Domain/Entities/Branch/Hr/Meal.cs index eab9a64e..663b43ef 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Branch/Meal.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Branch/Hr/Meal.cs @@ -10,9 +10,9 @@ public class Meal : FullAuditedEntity, IMultiTenant public Guid? BranchId { get; set; } public DateTime Date { get; set; } - public string Breakfast { get; set; } - public string Lunch { get; set; } - public string Snack { get; set; } + public string Type { get; set; } + public decimal TotalCalorie { get; set; } + public string Materials { get; set; } Guid? IMultiTenant.TenantId => TenantId; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Host/Forum/ForumCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Host/ForumCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Host/Forum/ForumCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Host/ForumCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Host/Forum/ForumPost.cs b/api/src/Kurs.Platform.Domain/Entities/Host/ForumPost.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Host/Forum/ForumPost.cs rename to api/src/Kurs.Platform.Domain/Entities/Host/ForumPost.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Host/Forum/ForumTopic.cs b/api/src/Kurs.Platform.Domain/Entities/Host/ForumTopic.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Host/Forum/ForumTopic.cs rename to api/src/Kurs.Platform.Domain/Entities/Host/ForumTopic.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Host/ListForm/ListForm.cs b/api/src/Kurs.Platform.Domain/Entities/Host/ListForm.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Host/ListForm/ListForm.cs rename to api/src/Kurs.Platform.Domain/Entities/Host/ListForm.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Host/ListForm/ListFormCustomization.cs b/api/src/Kurs.Platform.Domain/Entities/Host/ListFormCustomization.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Host/ListForm/ListFormCustomization.cs rename to api/src/Kurs.Platform.Domain/Entities/Host/ListFormCustomization.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Host/ListForm/ListFormField.cs b/api/src/Kurs.Platform.Domain/Entities/Host/ListFormField.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Host/ListForm/ListFormField.cs rename to api/src/Kurs.Platform.Domain/Entities/Host/ListFormField.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Host/ListForm/ListFormImport.cs b/api/src/Kurs.Platform.Domain/Entities/Host/ListFormImport.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Host/ListForm/ListFormImport.cs rename to api/src/Kurs.Platform.Domain/Entities/Host/ListFormImport.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Host/ListForm/ListFormImportExecute.cs b/api/src/Kurs.Platform.Domain/Entities/Host/ListFormImportExecute.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Host/ListForm/ListFormImportExecute.cs rename to api/src/Kurs.Platform.Domain/Entities/Host/ListFormImportExecute.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/About.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/About.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Public/About.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/About.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/DeveloperKit/ApiEndpoint.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/ApiEndpoint.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/DeveloperKit/ApiEndpoint.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/ApiEndpoint.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/DeveloperKit/ApiMigration.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/ApiMigration.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/DeveloperKit/ApiMigration.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/ApiMigration.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Behavior.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Behavior.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Behavior.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Behavior.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/BlogCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/BlogCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Public/BlogCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/BlogCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/BlogPost.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/BlogPost.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Public/BlogPost.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/BlogPost.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Contact.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Contact.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Contact.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Contact.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/DeveloperKit/CustomComponent.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/CustomComponent.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/DeveloperKit/CustomComponent.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/CustomComponent.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/DeveloperKit/CustomEndpoint.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/CustomEndpoint.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/DeveloperKit/CustomEndpoint.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/CustomEndpoint.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/DeveloperKit/CustomEntity.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/CustomEntity.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/DeveloperKit/CustomEntity.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/CustomEntity.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Demo.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Demo.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Demo.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Demo.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Disease.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Disease.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Disease.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Disease.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Document.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Document.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Document.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Document.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/EducationStatus.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/EducationStatus.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/EducationStatus.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/EducationStatus.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/InstallmentOption.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/InstallmentOption.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Public/InstallmentOption.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/InstallmentOption.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/IpRestriction.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/IpRestriction.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/IpRestriction.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/IpRestriction.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Lawyer.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Lawyer.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Lawyer.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Lawyer.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Order.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Order.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Order.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Order.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/PaymentMethod.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/PaymentMethod.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Public/PaymentMethod.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/PaymentMethod.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Product.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Product.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Product.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Product.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/Psychologist.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Psychologist.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch/Psychologist.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Psychologist.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Report/ReportCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/ReportCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Report/ReportCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/ReportCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Report/ReportGenerated.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/ReportGenerated.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Report/ReportGenerated.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/ReportGenerated.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Report/ReportParameter.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/ReportParameter.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Report/ReportParameter.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/ReportParameter.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Report/ReportTemplate.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/ReportTemplate.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Report/ReportTemplate.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/ReportTemplate.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Sector.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Sector.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Sector.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Sector.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Service.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Service.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Public/Service.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Service.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Skill.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Skill.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Skill.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Skill.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/SkillLevel.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/SkillLevel.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/SkillLevel.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/SkillLevel.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/SkillType.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/SkillType.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/SkillType.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/SkillType.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Uom.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Uom.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Uom.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Uom.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/UomCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/UomCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/UomCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/UomCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Vaccine.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Vaccine.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Vaccine.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Vaccine.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Vehicle.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Vehicle.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Vehicle.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/Vehicle.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/WorkHour.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/WorkHour.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/WorkHour.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Administration/WorkHour.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/ClassCancellationReason.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Coordinator/ClassCancellationReason.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/ClassCancellationReason.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Coordinator/ClassCancellationReason.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Program.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Coordinator/Program.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Program.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Coordinator/Program.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Question.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Coordinator/Question.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Question.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Coordinator/Question.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/QuestionOption.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Coordinator/QuestionOption.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/QuestionOption.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Coordinator/QuestionOption.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/QuestionPool.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Coordinator/QuestionPool.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/QuestionPool.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Coordinator/QuestionPool.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/QuestionTag.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Coordinator/QuestionTag.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/QuestionTag.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Coordinator/QuestionTag.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Event.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Event.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Event.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Event.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/EventCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/EventCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/EventCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/EventCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/EventComment.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/EventComment.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/EventComment.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/EventComment.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/EventPhoto.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/EventPhoto.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/EventPhoto.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/EventPhoto.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/EventType.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/EventType.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/EventType.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/EventType.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Reservation.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Reservation.cs new file mode 100644 index 00000000..5703f538 --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/Reservation.cs @@ -0,0 +1,24 @@ +// Domain/Entities/Reservation.cs +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Kurs.Platform.Entities; + +public class Reservation : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Type { get; set; } // room | vehicle | equipment + public string ResourceName { get; set; } + + public Guid? EmployeeId { get; set; } + public Employee Employee { get; set; } + + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + public string Purpose { get; set; } //Amaç + public int? Participants { get; set; } //Katılımcı Sayısı + public string Notes { get; set; } + public string Status { get; set; } // pending | approved | rejected | completed +} diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/ShuttleRoute.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/ShuttleRoute.cs new file mode 100644 index 00000000..48cbb7ca --- /dev/null +++ b/api/src/Kurs.Platform.Domain/Entities/Tenant/Hr/ShuttleRoute.cs @@ -0,0 +1,19 @@ +// Domain/Entities/ShuttleRoute.cs +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace Kurs.Platform.Entities; + +public class ShuttleRoute : FullAuditedEntity, IMultiTenant +{ + public Guid? TenantId { get; set; } + + public string Type { get; set; } + public string Name { get; set; } + public string DepartureTime { get; set; } + public string ArrivalTime { get; set; } + public int Capacity { get; set; } + public int Available { get; set; } + public string Route { get; set; } +} diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Interesting.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Participant/Interesting.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Interesting.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Participant/Interesting.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/MeetingMethod.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Participant/MeetingMethod.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/MeetingMethod.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Participant/MeetingMethod.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/MeetingResult.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Participant/MeetingResult.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/MeetingResult.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Participant/MeetingResult.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/NoteType.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Participant/NoteType.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/NoteType.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Participant/NoteType.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/SalesRejectionReason.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Participant/SalesRejectionReason.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/SalesRejectionReason.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Participant/SalesRejectionReason.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Source.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Participant/Source.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Source.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Participant/Source.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/GlobalSearch.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Platform/GlobalSearch.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/GlobalSearch.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Platform/GlobalSearch.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Activity.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Saas/Activity.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Activity.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Saas/Activity.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Tenant/Branch.cs b/api/src/Kurs.Platform.Domain/Entities/Tenant/Saas/Branch.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Tenant/Branch.cs rename to api/src/Kurs.Platform.Domain/Entities/Tenant/Saas/Branch.cs diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index e2aaaa77..d86dada9 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -179,6 +179,8 @@ 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; } #endregion @@ -1247,9 +1249,9 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.Date).IsRequired(); - b.Property(x => x.Breakfast).HasMaxLength(200); - b.Property(x => x.Lunch).HasMaxLength(200); - b.Property(x => x.Snack).HasMaxLength(200); + b.Property(x => x.Type).HasMaxLength(20); + b.Property(x => x.TotalCalorie).HasPrecision(9, 2); + b.Property(x => x.Materials).HasMaxLength(500); }); builder.Entity(b => @@ -1916,5 +1918,32 @@ public class PlatformDbContext : .HasPrincipalKey(e => e.Id) .OnDelete(DeleteBehavior.Cascade); }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.Reservation)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Type).IsRequired().HasMaxLength(50); + b.Property(x => x.EmployeeId).IsRequired(); + b.Property(x => x.ResourceName).IsRequired().HasMaxLength(200); + b.Property(x => x.Purpose).IsRequired().HasMaxLength(500); + b.Property(x => x.Notes).HasMaxLength(1000); + b.Property(x => x.Status).IsRequired().HasMaxLength(50); + }); + + builder.Entity(b => + { + b.ToTable(TableNameResolver.GetFullTableName(nameof(TableNameEnum.ShuttleRoute)), Prefix.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(150); + b.Property(x => x.Route).IsRequired(); // serialized list + b.Property(x => x.DepartureTime).HasMaxLength(10); + b.Property(x => x.ArrivalTime).HasMaxLength(10); + b.Property(x => x.Type).HasMaxLength(20); + b.Property(x => x.Capacity).HasDefaultValue(0); + b.Property(x => x.Available).HasDefaultValue(0); + }); } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024083852_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024144858_Initial.Designer.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024083852_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024144858_Initial.Designer.cs index 4b506da4..d0638a47 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024083852_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024144858_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251024083852_Initial")] + [Migration("20251024144858_Initial")] partial class Initial { /// @@ -5212,10 +5212,6 @@ namespace Kurs.Platform.Migrations b.Property("BranchId") .HasColumnType("uniqueidentifier"); - b.Property("Breakfast") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime"); @@ -5249,21 +5245,25 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); - b.Property("Lunch") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Snack") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + b.Property("Materials") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") .HasColumnName("TenantId"); + b.Property("TotalCalorie") + .HasPrecision(9, 2) + .HasColumnType("decimal(9,2)"); + + b.Property("Type") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + b.HasKey("Id"); - b.ToTable("B_Adm_Meal", (string)null); + b.ToTable("B_Hr_Meal", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.MeetingMethod", b => @@ -6950,6 +6950,88 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Sas_ReportTemplate", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Reservation", 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("EndDate") + .HasColumnType("datetime2"); + + 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("Notes") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Participants") + .HasColumnType("int"); + + b.Property("Purpose") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("ResourceName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.ToTable("T_Hr_Reservation", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Route", b => { b.Property("Id") @@ -7361,6 +7443,81 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Adm_Service", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.ShuttleRoute", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArrivalTime") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Available") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Capacity") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + 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("DepartureTime") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + 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(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Route") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.HasKey("Id"); + + b.ToTable("T_Hr_ShuttleRoute", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Skill", b => { b.Property("Id") @@ -10803,6 +10960,17 @@ namespace Kurs.Platform.Migrations b.Navigation("ReportCategory"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Reservation", b => + { + b.HasOne("Kurs.Platform.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.ScheduleLesson", b => { b.HasOne("Kurs.Platform.Entities.Schedule", "Schedule") diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024083852_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024144858_Initial.cs similarity index 98% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024083852_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024144858_Initial.cs index f8987d3e..e2c361b0 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024083852_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251024144858_Initial.cs @@ -434,30 +434,6 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_AbpUsers", x => x.Id); }); - migrationBuilder.CreateTable( - name: "B_Adm_Meal", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), - BranchId = table.Column(type: "uniqueidentifier", nullable: true), - Date = table.Column(type: "datetime2", nullable: false), - Breakfast = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - Lunch = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), - Snack = table.Column(type: "nvarchar(200)", maxLength: 200, 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_B_Adm_Meal", x => x.Id); - }); - migrationBuilder.CreateTable( name: "B_Crd_LessonPeriod", columns: table => new @@ -543,6 +519,30 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_B_Crd_Schedule", x => x.Id); }); + migrationBuilder.CreateTable( + name: "B_Hr_Meal", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + BranchId = table.Column(type: "uniqueidentifier", nullable: true), + Date = table.Column(type: "datetime2", nullable: false), + Type = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), + TotalCalorie = table.Column(type: "decimal(9,2)", precision: 9, scale: 2, nullable: false), + Materials = table.Column(type: "nvarchar(500)", maxLength: 500, 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_B_Hr_Meal", x => x.Id); + }); + migrationBuilder.CreateTable( name: "OpenIddictApplications", columns: table => new @@ -1829,6 +1829,32 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_T_Hr_Payroll", x => x.Id); }); + migrationBuilder.CreateTable( + name: "T_Hr_ShuttleRoute", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Type = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), + Name = table.Column(type: "nvarchar(150)", maxLength: 150, nullable: false), + DepartureTime = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), + ArrivalTime = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), + Capacity = table.Column(type: "int", nullable: false, defaultValue: 0), + Available = table.Column(type: "int", nullable: false, defaultValue: 0), + Route = table.Column(type: "nvarchar(max)", 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_Hr_ShuttleRoute", x => x.Id); + }); + migrationBuilder.CreateTable( name: "T_Hr_Template360", columns: table => new @@ -4199,6 +4225,40 @@ namespace Kurs.Platform.Migrations onDelete: ReferentialAction.Restrict); }); + migrationBuilder.CreateTable( + name: "T_Hr_Reservation", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), + Type = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), + ResourceName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: false), + EmployeeId = table.Column(type: "uniqueidentifier", nullable: false), + StartDate = table.Column(type: "datetime2", nullable: false), + EndDate = table.Column(type: "datetime2", nullable: false), + Purpose = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: false), + Participants = table.Column(type: "int", nullable: true), + Notes = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), + Status = table.Column(type: "nvarchar(50)", maxLength: 50, 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_Hr_Reservation", x => x.Id); + table.ForeignKey( + name: "FK_T_Hr_Reservation_T_Hr_Employee_EmployeeId", + column: x => x.EmployeeId, + principalTable: "T_Hr_Employee", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateIndex( name: "IX_AbpAuditLogActions_AuditLogId", table: "AbpAuditLogActions", @@ -4858,6 +4918,11 @@ namespace Kurs.Platform.Migrations table: "T_Hr_Performance360", column: "TemplateId"); + migrationBuilder.CreateIndex( + name: "IX_T_Hr_Reservation_EmployeeId", + table: "T_Hr_Reservation", + column: "EmployeeId"); + migrationBuilder.CreateIndex( name: "IX_T_Sas_ApiEndpoint_EntityId", table: "T_Sas_ApiEndpoint", @@ -5018,9 +5083,6 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "AbpUserTokens"); - migrationBuilder.DropTable( - name: "B_Adm_Meal"); - migrationBuilder.DropTable( name: "B_Crd_Class"); @@ -5036,6 +5098,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "B_Crd_ScheduleLesson"); + migrationBuilder.DropTable( + name: "B_Hr_Meal"); + migrationBuilder.DropTable( name: "OpenIddictScopes"); @@ -5195,6 +5260,12 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "T_Hr_Performance360"); + migrationBuilder.DropTable( + name: "T_Hr_Reservation"); + + migrationBuilder.DropTable( + name: "T_Hr_ShuttleRoute"); + migrationBuilder.DropTable( name: "T_Prt_Interesting"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index f1294ab0..6fb29e65 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -5209,10 +5209,6 @@ namespace Kurs.Platform.Migrations b.Property("BranchId") .HasColumnType("uniqueidentifier"); - b.Property("Breakfast") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime"); @@ -5246,21 +5242,25 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier") .HasColumnName("LastModifierId"); - b.Property("Lunch") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Snack") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + b.Property("Materials") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") .HasColumnName("TenantId"); + b.Property("TotalCalorie") + .HasPrecision(9, 2) + .HasColumnType("decimal(9,2)"); + + b.Property("Type") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + b.HasKey("Id"); - b.ToTable("B_Adm_Meal", (string)null); + b.ToTable("B_Hr_Meal", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.MeetingMethod", b => @@ -6947,6 +6947,88 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Sas_ReportTemplate", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Reservation", 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("EndDate") + .HasColumnType("datetime2"); + + 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("Notes") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Participants") + .HasColumnType("int"); + + b.Property("Purpose") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("ResourceName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.Property("StartDate") + .HasColumnType("datetime2"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.ToTable("T_Hr_Reservation", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Route", b => { b.Property("Id") @@ -7358,6 +7440,81 @@ namespace Kurs.Platform.Migrations b.ToTable("T_Adm_Service", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.ShuttleRoute", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ArrivalTime") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Available") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("Capacity") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + 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("DepartureTime") + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + 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(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Route") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Type") + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.HasKey("Id"); + + b.ToTable("T_Hr_ShuttleRoute", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.Skill", b => { b.Property("Id") @@ -10800,6 +10957,17 @@ namespace Kurs.Platform.Migrations b.Navigation("ReportCategory"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Reservation", b => + { + b.HasOne("Kurs.Platform.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Employee"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.ScheduleLesson", b => { b.HasOne("Kurs.Platform.Entities.Schedule", "Schedule") diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json index 666c6044..c4ba8ae9 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/Seeds/TenantData.json @@ -3467,5 +3467,110 @@ "location": "Eğitim Salonu D", "thumbnail": "https://images.unsplash.com/photo-1550751827-4bd374c3f58b?w=400&h=300&fit=crop" } + ], + "Reservations": [ + { + "type": "room", + "resourceName": "Toplantı Salonu A", + "employeeCode": "EMP-001", + "startDate": "10-10-2024 09:00:00", + "endDate": "10-10-2024 11:00:00", + "purpose": "Sprint Planning Toplantısı", + "status": "approved", + "participants": 8, + "notes": "Projeksiyon cihazı gerekli" + }, + { + "type": "vehicle", + "resourceName": "Şirket Aracı - 34 ABC 123", + "employeeCode": "EMP-001", + "startDate": "11-10-2024 08:00:00", + "endDate": "11-10-2024 18:00:00", + "purpose": "Müşteri Ziyareti", + "status": "pending", + "notes": "Ankara çıkışı" + }, + { + "type": "equipment", + "resourceName": "Kamera ve Tripod Seti", + "employeeCode": "EMP-001", + "startDate": "09-10-2024 14:00:00", + "endDate": "09-10-2024 17:00:00", + "purpose": "Ürün Tanıtım Videosu Çekimi", + "status": "approved" + }, + { + "type": "room", + "resourceName": "Eğitim Salonu B", + "employeeCode": "EMP-001", + "startDate": "05-10-2024 09:00:00", + "endDate": "05-10-2024 17:00:00", + "purpose": "Etkili İletişim Eğitimi", + "status": "approved", + "participants": 15, + "notes": "Tüm gün rezervasyon, öğle yemeği dahil" + } + ], + "ShuttleRoutes": [ + { + "name": "Kadıköy - Ofis", + "route": [ + "Kadıköy İskele", + "Bostancı", + "Acıbadem", + "Kozyatağı", + "Ofis" + ], + "departureTime": "07:30", + "arrivalTime": "08:45", + "capacity": 25, + "available": 3, + "type": "morning" + }, + { + "name": "Üsküdar - Ofis", + "route": [ + "Üsküdar Meydanı", + "Kısıklı", + "Bulgurlu", + "Ümraniye", + "Ofis" + ], + "departureTime": "07:45", + "arrivalTime": "08:50", + "capacity": 25, + "available": 8, + "type": "morning" + }, + { + "name": "Ofis - Kadıköy", + "route": [ + "Ofis", + "Kozyatağı", + "Acıbadem", + "Bostancı", + "Kadıköy İskele" + ], + "departureTime": "18:00", + "arrivalTime": "19:15", + "capacity": 25, + "available": 5, + "type": "evening" + }, + { + "name": "Ofis - Üsküdar", + "route": [ + "Ofis", + "Ümraniye", + "Bulgurlu", + "Kısıklı", + "Üsküdar Meydanı" + ], + "departureTime": "18:15", + "arrivalTime": "19:20", + "capacity": 25, + "available": 12, + "type": "evening" + } ] } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs index 6ed431e5..ebee01f6 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantDataSeeder.cs @@ -74,6 +74,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency private readonly IRepository _template360Repository; private readonly IRepository _performans360Repository; private readonly IRepository _trainingRepository; + private readonly IRepository _reservationRepository; + private readonly IRepository _shuttleRouteRepository; public TenantDataSeeder( IRepository repositoryUser, @@ -131,7 +133,9 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency IRepository payrollRepository, IRepository template360Repository, IRepository performans360Repository, - IRepository trainingRepository + IRepository trainingRepository, + IRepository reservationRepository, + IRepository shuttleRouteRepository ) { _repositoryUser = repositoryUser; @@ -190,6 +194,8 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency _template360Repository = template360Repository; _performans360Repository = performans360Repository; _trainingRepository = trainingRepository; + _reservationRepository = reservationRepository; + _shuttleRouteRepository = shuttleRouteRepository; } private static IConfigurationRoot BuildConfiguration() @@ -1203,5 +1209,44 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency Thumbnail = item.Thumbnail }, autoSave: true); } + + foreach (var item in items.Reservations) + { + var exists = await _reservationRepository.AnyAsync(x => x.ResourceName == item.ResourceName && x.StartDate == item.StartDate); + if (exists) + continue; + + var employee = await _employeeRepository.FirstOrDefaultAsync(x => x.Code == item.EmployeeCode); + await _reservationRepository.InsertAsync(new Reservation + { + Type = item.Type, + ResourceName = item.ResourceName, + EmployeeId = employee != null ? employee.Id : null, + StartDate = item.StartDate, + EndDate = item.EndDate, + Purpose = item.Purpose, + Participants = item.Participants, + Notes = item.Notes, + Status = item.Status + }, autoSave: true); + } + + foreach (var item in items.ShuttleRoutes) + { + var exists = await _shuttleRouteRepository.AnyAsync(x => x.Name == item.Name); + if (exists) + continue; + + await _shuttleRouteRepository.InsertAsync(new ShuttleRoute + { + Name = item.Name, + Route = item.Route != null ? string.Join("|", item.Route) : null, + DepartureTime = item.DepartureTime, + ArrivalTime = item.ArrivalTime, + Capacity = item.Capacity, + Available = item.Available, + Type = item.Type + }, autoSave: true); + } } } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs index aecb9788..6c21b0e5 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Tenants/TenantSeederDto.cs @@ -63,8 +63,34 @@ public class TenantSeederDto public List Template360s { get; set; } public List Performans360s { get; set; } public List Trainings { get; set; } + public List Reservations { get; set; } + public List ShuttleRoutes { get; set; } } +public class ShuttleRouteSeedDto +{ + public string Name { get; set; } + public List Route { get; set; } + public string DepartureTime { get; set; } + public string ArrivalTime { get; set; } + public int Capacity { get; set; } + public int Available { get; set; } + public string Type { get; set; } +} + +public class ReservationSeedDto +{ + public string Type { get; set; } + public string ResourceName { get; set; } + public string EmployeeCode { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + public string Purpose { get; set; } + public int? Participants { get; set; } + public string Notes { get; set; } + public string Status { get; set; } +} + public class TrainingSeedDto { public string Title { get; set; } diff --git a/ui/src/mocks/mockIntranet.ts b/ui/src/mocks/mockIntranet.ts index ed49f9ea..dd1dd090 100644 --- a/ui/src/mocks/mockIntranet.ts +++ b/ui/src/mocks/mockIntranet.ts @@ -387,160 +387,6 @@ export const mockDocuments: Document[] = [ }, ] -export const mockReservations: Reservation[] = [ - { - id: 'res1', - type: 'room', - resourceName: 'Toplantı Salonu A', - bookedBy: mockEmployees[2], - startDate: new Date('2024-10-20T09:00:00'), - endDate: new Date('2024-10-20T11:00:00'), - purpose: 'Sprint Planning Toplantısı', - status: 'approved', - participants: 8, - notes: 'Projeksiyon cihazı gerekli', - }, - { - id: 'res2', - type: 'vehicle', - resourceName: 'Şirket Aracı - 34 ABC 123', - bookedBy: mockEmployees[3], - startDate: new Date('2024-10-22T08:00:00'), - endDate: new Date('2024-10-22T18:00:00'), - purpose: 'Müşteri Ziyareti', - status: 'pending', - notes: 'Ankara çıkışı', - }, - { - id: 'res3', - type: 'equipment', - resourceName: 'Kamera ve Tripod Seti', - bookedBy: mockEmployees[5], - startDate: new Date('2024-10-19T14:00:00'), - endDate: new Date('2024-10-19T17:00:00'), - purpose: 'Ürün Tanıtım Videosu Çekimi', - status: 'approved', - }, - { - id: 'res4', - type: 'room', - resourceName: 'Eğitim Salonu B', - bookedBy: mockEmployees[6], - startDate: new Date('2024-10-25T09:00:00'), - endDate: new Date('2024-10-25T17:00:00'), - purpose: 'Etkili İletişim Eğitimi', - status: 'approved', - participants: 15, - notes: 'Tüm gün rezervasyon, öğle yemeği dahil', - }, -] - -export const mockMealMenus: MealMenu[] = [ - { - id: 'menu1', - date: new Date('2025-10-20'), - dayOfWeek: 'Pazartesi', - meals: [ - { - type: 'lunch', - items: ['Mercimek Çorbası', 'Tavuk Şinitzel', 'Bulgur Pilavı', 'Salata', 'Meyve'], - calories: 650, - }, - ], - }, - { - id: 'menu2', - date: new Date('2025-10-21'), - dayOfWeek: 'Salı', - meals: [ - { - type: 'lunch', - items: ['Yayla Çorbası', 'Köfte', 'Patates Püresi', 'Cacık', 'Ayran'], - calories: 720, - }, - ], - }, - { - id: 'menu3', - date: new Date('2025-10-22'), - dayOfWeek: 'Çarşamba', - meals: [ - { - type: 'lunch', - items: ['Domates Çorbası', 'Etli Kuru Fasulye', 'Pilav', 'Turşu', 'Komposto'], - calories: 680, - }, - ], - }, - { - id: 'menu4', - date: new Date('2025-10-23'), - dayOfWeek: 'Perşembe', - meals: [ - { - type: 'lunch', - items: ['Tarhana Çorbası', 'Fırın Tavuk', 'Makarna', 'Yeşil Salata', 'Sütlaç'], - calories: 700, - }, - ], - }, - { - id: 'menu5', - date: new Date('2025-10-24'), - dayOfWeek: 'Cuma', - meals: [ - { - type: 'lunch', - items: ['Ezogelin Çorbası', 'Balık', 'Bulgur Pilavı', 'Salata', 'Meyve'], - calories: 620, - }, - ], - }, -] - -export const mockShuttleRoutes: ShuttleRoute[] = [ - { - id: 'shuttle1', - name: 'Kadıköy - Ofis', - route: ['Kadıköy İskele', 'Bostancı', 'Acıbadem', 'Kozyatağı', 'Ofis'], - departureTime: '07:30', - arrivalTime: '08:45', - capacity: 25, - available: 3, - type: 'morning', - }, - { - id: 'shuttle2', - name: 'Üsküdar - Ofis', - route: ['Üsküdar Meydanı', 'Kısıklı', 'Bulgurlu', 'Ümraniye', 'Ofis'], - departureTime: '07:45', - arrivalTime: '08:50', - capacity: 25, - available: 8, - type: 'morning', - }, - { - id: 'shuttle3', - name: 'Ofis - Kadıköy', - route: ['Ofis', 'Kozyatağı', 'Acıbadem', 'Bostancı', 'Kadıköy İskele'], - departureTime: '18:00', - arrivalTime: '19:15', - capacity: 25, - available: 5, - type: 'evening', - }, - { - id: 'shuttle4', - name: 'Ofis - Üsküdar', - route: ['Ofis', 'Ümraniye', 'Bulgurlu', 'Kısıklı', 'Üsküdar Meydanı'], - departureTime: '18:15', - arrivalTime: '19:20', - capacity: 25, - available: 12, - type: 'evening', - }, -] - export const mockSurveys: Survey[] = [ { id: 'survey1', @@ -979,4 +825,158 @@ export const mockCertificates: Certificate[] = [ certificateUrl: '/certificates/cert3.pdf', score: 92, }, +] + +export const mockMealMenus: MealMenu[] = [ + { + id: 'menu1', + date: new Date('2025-10-20'), + dayOfWeek: 'Pazartesi', + meals: [ + { + type: 'lunch', + items: ['Mercimek Çorbası', 'Tavuk Şinitzel', 'Bulgur Pilavı', 'Salata', 'Meyve'], + calories: 650, + }, + ], + }, + { + id: 'menu2', + date: new Date('2025-10-21'), + dayOfWeek: 'Salı', + meals: [ + { + type: 'lunch', + items: ['Yayla Çorbası', 'Köfte', 'Patates Püresi', 'Cacık', 'Ayran'], + calories: 720, + }, + ], + }, + { + id: 'menu3', + date: new Date('2025-10-22'), + dayOfWeek: 'Çarşamba', + meals: [ + { + type: 'lunch', + items: ['Domates Çorbası', 'Etli Kuru Fasulye', 'Pilav', 'Turşu', 'Komposto'], + calories: 680, + }, + ], + }, + { + id: 'menu4', + date: new Date('2025-10-23'), + dayOfWeek: 'Perşembe', + meals: [ + { + type: 'lunch', + items: ['Tarhana Çorbası', 'Fırın Tavuk', 'Makarna', 'Yeşil Salata', 'Sütlaç'], + calories: 700, + }, + ], + }, + { + id: 'menu5', + date: new Date('2025-10-24'), + dayOfWeek: 'Cuma', + meals: [ + { + type: 'lunch', + items: ['Ezogelin Çorbası', 'Balık', 'Bulgur Pilavı', 'Salata', 'Meyve'], + calories: 620, + }, + ], + }, +] + +export const mockReservations: Reservation[] = [ + { + id: 'res1', + type: 'room', + resourceName: 'Toplantı Salonu A', + bookedBy: mockEmployees[2], + startDate: new Date('2024-10-20T09:00:00'), + endDate: new Date('2024-10-20T11:00:00'), + purpose: 'Sprint Planning Toplantısı', + status: 'approved', + participants: 8, + notes: 'Projeksiyon cihazı gerekli', + }, + { + id: 'res2', + type: 'vehicle', + resourceName: 'Şirket Aracı - 34 ABC 123', + bookedBy: mockEmployees[3], + startDate: new Date('2024-10-22T08:00:00'), + endDate: new Date('2024-10-22T18:00:00'), + purpose: 'Müşteri Ziyareti', + status: 'pending', + notes: 'Ankara çıkışı', + }, + { + id: 'res3', + type: 'equipment', + resourceName: 'Kamera ve Tripod Seti', + bookedBy: mockEmployees[5], + startDate: new Date('2024-10-19T14:00:00'), + endDate: new Date('2024-10-19T17:00:00'), + purpose: 'Ürün Tanıtım Videosu Çekimi', + status: 'approved', + }, + { + id: 'res4', + type: 'room', + resourceName: 'Eğitim Salonu B', + bookedBy: mockEmployees[6], + startDate: new Date('2024-10-25T09:00:00'), + endDate: new Date('2024-10-25T17:00:00'), + purpose: 'Etkili İletişim Eğitimi', + status: 'approved', + participants: 15, + notes: 'Tüm gün rezervasyon, öğle yemeği dahil', + }, +] + +export const mockShuttleRoutes: ShuttleRoute[] = [ + { + id: 'shuttle1', + name: 'Kadıköy - Ofis', + route: ['Kadıköy İskele', 'Bostancı', 'Acıbadem', 'Kozyatağı', 'Ofis'], + departureTime: '07:30', + arrivalTime: '08:45', + capacity: 25, + available: 3, + type: 'morning', + }, + { + id: 'shuttle2', + name: 'Üsküdar - Ofis', + route: ['Üsküdar Meydanı', 'Kısıklı', 'Bulgurlu', 'Ümraniye', 'Ofis'], + departureTime: '07:45', + arrivalTime: '08:50', + capacity: 25, + available: 8, + type: 'morning', + }, + { + id: 'shuttle3', + name: 'Ofis - Kadıköy', + route: ['Ofis', 'Kozyatağı', 'Acıbadem', 'Bostancı', 'Kadıköy İskele'], + departureTime: '18:00', + arrivalTime: '19:15', + capacity: 25, + available: 5, + type: 'evening', + }, + { + id: 'shuttle4', + name: 'Ofis - Üsküdar', + route: ['Ofis', 'Ümraniye', 'Bulgurlu', 'Kısıklı', 'Üsküdar Meydanı'], + departureTime: '18:15', + arrivalTime: '19:20', + capacity: 25, + available: 12, + type: 'evening', + }, ] \ No newline at end of file