diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index 5092a0a8..c40cba89 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -52,6 +52,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency var lookupQueryDistrictValues = $"SELECT \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" AS \"Key\", \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\" WHERE (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL) AND (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"City\" = @param1 OR @param1 IS NULL) GROUP BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" ORDER BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\""; var lookupQueryStreetValues = $"SELECT \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Street\" AS \"Key\", \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Street\" as \"Name\" FROM \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\" WHERE (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Country\" = @param0 OR @param0 IS NULL) AND (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"City\" = @param1 OR @param1 IS NULL) AND (\"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Name\" = @param2 OR @param2 IS NULL) GROUP BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Street\" ORDER BY \"{SelectCommandByTableName("District", Prefix.DbTableDefinition)}\".\"Street\""; + var lookupQueryTenantValues = $"SELECT \"AbpTenants\".\"Id\" AS \"Key\", \"AbpTenants\".\"Name\" as \"Name\" FROM \"AbpTenants\" ORDER BY \"AbpTenants\".\"Name\""; + var lookupQueryBranchValues = $"SELECT \"{SelectCommandByTableName("Branch")}\".\"Id\" AS \"Key\", \"{SelectCommandByTableName("Branch")}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("Branch")}\" ORDER BY \"{SelectCommandByTableName("Branch")}\".\"Name\""; + var htmlEditorOptions = "{\"toolbar\": {\"multiline\": true, \"items\": [{\"name\": \"undo\"},{\"name\": \"redo\"},{\"name\": \"separator\"},{\"name\": \"size\",\"acceptedValues\": [\"8pt\",\"10pt\",\"12pt\",\"14pt\",\"18pt\",\"24pt\",\"36pt\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font size\"}}},{\"name\": \"font\",\"acceptedValues\": [\"Arial\",\"Courier New\",\"Georgia\",\"Impact\",\"Lucida Console\",\"Tahoma\",\"Times New Roman\",\"Verdana\"],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"bold\"},{\"name\": \"italic\"},{\"name\": \"strike\"},{\"name\": \"underline\"},{\"name\": \"separator\"},{\"name\": \"alignLeft\"},{\"name\": \"alignCenter\"},{\"name\": \"alignRight\"},{\"name\": \"alignJustify\"},{\"name\": \"separator\"},{\"name\": \"orderedList\"},{\"name\": \"bulletList\"},{\"name\": \"separator\"},{\"name\": \"header\",\"acceptedValues\": [false,1,2,3,4,5],\"options\": {\"inputAttr\": {\"aria-label\": \"Font family\"}}},{\"name\": \"separator\"},{\"name\": \"color\"},{\"name\": \"background\"},{\"name\": \"separator\"},{\"name\": \"link\"},{\"name\": \"image\"},{\"name\": \"separator\"},{\"name\": \"clear\"},{\"name\": \"codeBlock\"},{\"name\": \"blockquote\"},{\"name\": \"separator\"},{\"name\": \"insertTable\"},{\"name\": \"deleteTable\"},{\"name\": \"insertRowAbove\"},{\"name\": \"insertRowBelow\"},{\"name\": \"deleteRow\"},{\"name\": \"insertColumnLeft\"},{\"name\": \"insertColumnRight\"},{\"name\": \"deleteColumn\"}]}}"; var showClearButton = "{ \"showClearButton\" : true }"; @@ -2059,7 +2062,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency DataSourceType = UiLookupDataSourceTypeEnum.Query, DisplayExpr = "Name", ValueExpr = "Key", - LookupQuery = $"SELECT \"AbpTenants\".\"Id\" AS \"Key\", \"AbpTenants\".\"Name\" as \"Name\" FROM \"AbpTenants\" ORDER BY \"AbpTenants\".\"Name\"", + LookupQuery = lookupQueryTenantValues, }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { @@ -18392,7 +18395,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = false, IsActive = true, IsDeleted = false, - SortIndex = 0, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } }), @@ -18582,7 +18584,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = false, IsActive = true, IsDeleted = false, - SortIndex = 0, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } }), @@ -18773,7 +18774,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = false, IsActive = true, IsDeleted = false, - SortIndex = 0, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } }), @@ -18803,8 +18803,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, AllowSearch = true, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } @@ -18992,7 +18990,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = false, IsActive = true, IsDeleted = false, - SortIndex = 0, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } }), @@ -19182,7 +19179,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = false, IsActive = true, IsDeleted = false, - SortIndex = 0, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } }), @@ -19563,7 +19559,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = false, IsActive = true, IsDeleted = false, - SortIndex = 0, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } }), @@ -19625,8 +19620,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, AllowSearch = true, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } @@ -19786,7 +19779,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = false, IsActive = true, IsDeleted = false, - SortIndex = 0, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } }), @@ -19848,8 +19840,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = true, IsActive = true, IsDeleted = false, - SortIndex = 1, - SortDirection = GridColumnOptions.SortOrderAsc, AllowSearch = true, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } @@ -20009,7 +19999,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = false, IsActive = true, IsDeleted = false, - SortIndex = 0, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } }), @@ -20239,7 +20228,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = false, IsActive = true, IsDeleted = false, - SortIndex = 0, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } }), @@ -20563,6 +20551,235 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region ClassCancellationReason + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ClassCancellationReason)) + { + var listFormClassCancellationReason = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.ClassCancellationReason, + Name = AppCodes.Definitions.ClassCancellationReason, + Title = AppCodes.Definitions.ClassCancellationReason, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.ClassCancellationReason, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("ClassCancellationReason", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.ClassCancellationReason + ".Create", + R = AppCodes.Definitions.ClassCancellationReason, + U = AppCodes.Definitions.ClassCancellationReason + ".Update", + D = AppCodes.Definitions.ClassCancellationReason + ".Delete", + E = AppCodes.Definitions.ClassCancellationReason + ".Export", + I = AppCodes.Definitions.ClassCancellationReason + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("ClassCancellationReason", Prefix.DbTableDefinition)}\" 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 = "Sales Rejection Reason Form", + Width = 500, + Height = 250 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= + [ + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Status", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, + ] + } + }), + 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 } + }), + } + ); + + #region ClassCancellationReason Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new() { + ListFormCode = listFormClassCancellationReason.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ClassCancellationReason + ".Create", + R = AppCodes.Definitions.ClassCancellationReason, + U = AppCodes.Definitions.ClassCancellationReason + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormClassCancellationReason.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 250, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ClassCancellationReason + ".Create", + R = AppCodes.Definitions.ClassCancellationReason, + U = AppCodes.Definitions.ClassCancellationReason + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormClassCancellationReason.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 250, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key="Aktif",Name="Aktif" }, + new () { Key="Pasif",Name="Pasif" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ClassCancellationReason + ".Create", + R = AppCodes.Definitions.ClassCancellationReason, + U = AppCodes.Definitions.ClassCancellationReason + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + } + }); + #endregion + } + #endregion + #region Source if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Source)) { @@ -20661,6 +20878,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency new() { Order=1,ColCount=1,ColSpan=2,ItemType="group", Items= [ new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Status", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox }, ] } }), @@ -20698,7 +20916,6 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency Visible = false, IsActive = true, IsDeleted = false, - SortIndex = 0, ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } }), @@ -21172,6 +21389,4844 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region WorkHour + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.WorkHour)) + { + var listFormWorkHour = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.WorkHour, + Name = AppCodes.Definitions.WorkHour, + Title = AppCodes.Definitions.WorkHour, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.WorkHour, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("WorkHour", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.WorkHour + ".Create", + R = AppCodes.Definitions.WorkHour, + U = AppCodes.Definitions.WorkHour + ".Update", + D = AppCodes.Definitions.WorkHour + ".Delete", + E = AppCodes.Definitions.WorkHour + ".Export", + I = AppCodes.Definitions.WorkHour + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("WorkHour", Prefix.DbTableDefinition)}\" 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 = "Work Hour Form", + Width = 600, + Height = 500 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order = 1, ColCount = 2, ColSpan = 2, ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "StartHour", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "EndHour", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Monday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 5, DataField = "Tuesday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 6, DataField = "Wednesday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 7, DataField = "Thursday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 8, DataField = "Friday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 9, DataField = "Saturday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 10, DataField = "Sunday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + ] + } + }), + 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 } + }), + } + ); + + #region WorkHour Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + new() { + ListFormCode = listFormWorkHour.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.WorkHour + ".Create", + R = AppCodes.Definitions.WorkHour, + U = AppCodes.Definitions.WorkHour + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormWorkHour.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 250, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.WorkHour + ".Create", + R = AppCodes.Definitions.WorkHour, + U = AppCodes.Definitions.WorkHour + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + // Saat alanları + new() { + ListFormCode = listFormWorkHour.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "StartHour", + Width = 120, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.WorkHour + ".Create", + R = AppCodes.Definitions.WorkHour, + U = AppCodes.Definitions.WorkHour + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormWorkHour.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "EndHour", + Width = 120, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.WorkHour + ".Create", + R = AppCodes.Definitions.WorkHour, + U = AppCodes.Definitions.WorkHour + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + // Günlük kolonlar + new() + { + ListFormCode = listFormWorkHour.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Monday", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.WorkHour + ".Create", + R = AppCodes.Definitions.WorkHour, + U = AppCodes.Definitions.WorkHour + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormWorkHour.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Tuesday", + Width = 100, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.WorkHour + ".Create", + R = AppCodes.Definitions.WorkHour, + U = AppCodes.Definitions.WorkHour + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormWorkHour.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Wednesday", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.WorkHour + ".Create", + R = AppCodes.Definitions.WorkHour, + U = AppCodes.Definitions.WorkHour + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormWorkHour.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Thursday", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.WorkHour + ".Create", + R = AppCodes.Definitions.WorkHour, + U = AppCodes.Definitions.WorkHour + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormWorkHour.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Friday", + Width = 100, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.WorkHour + ".Create", + R = AppCodes.Definitions.WorkHour, + U = AppCodes.Definitions.WorkHour + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormWorkHour.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Saturday", + Width = 100, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.WorkHour + ".Create", + R = AppCodes.Definitions.WorkHour, + U = AppCodes.Definitions.WorkHour + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormWorkHour.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Sunday", + Width = 100, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.WorkHour + ".Create", + R = AppCodes.Definitions.WorkHour, + U = AppCodes.Definitions.WorkHour + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + }); + #endregion + } + #endregion + + #region Vehicle + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Vehicle)) + { + var listFormVehicle = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Vehicle, + Name = AppCodes.Definitions.Vehicle, + Title = AppCodes.Definitions.Vehicle, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Vehicle, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Vehicle", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + D = AppCodes.Definitions.Vehicle + ".Delete", + E = AppCodes.Definitions.Vehicle + ".Export", + I = AppCodes.Definitions.Vehicle + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Vehicle", Prefix.DbTableDefinition)}\" 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 = "Vehicle Form", + Width = 700, + Height = 600 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order = 1, ColCount = 2, ColSpan = 2, ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "Plate", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Brand", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "ModelYear", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 4, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 5, DataField = "DriverNationalId", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField = "DriverName", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 7, DataField = "DriverPhone1", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 8, DataField = "DriverPhone2", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 9, DataField = "AssistantDriverNationalId", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 10, DataField = "AssistantDriverName", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 11, DataField = "AssistantDriverPhone1", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 12, DataField = "AssistantDriverPhone2", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + ] + } + }), + 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 } + }), + } + ); + + #region Vehicle Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + new() { + ListFormCode = listFormVehicle.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + new() { + ListFormCode = listFormVehicle.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Plate", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + new() { + ListFormCode = listFormVehicle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Brand", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + new() { + ListFormCode = listFormVehicle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "ModelYear", + Width = 100, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Driver bilgileri + new() + { + ListFormCode = listFormVehicle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "DriverNationalId", + Width = 150, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormVehicle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "DriverName", + Width = 200, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormVehicle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "DriverPhone1", + Width = 150, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormVehicle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "DriverPhone2", + Width = 150, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + + // Assistant Driver bilgileri + new() + { + ListFormCode = listFormVehicle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AssistantDriverNationalId", + Width = 150, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormVehicle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AssistantDriverName", + Width = 200, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormVehicle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AssistantDriverPhone1", + Width = 150, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormVehicle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AssistantDriverPhone2", + Width = 150, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Vehicle + ".Create", + R = AppCodes.Definitions.Vehicle, + U = AppCodes.Definitions.Vehicle + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + // Status + new() { + ListFormCode = listFormVehicle.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", Width = 120, + ListOrderNo = 13, + 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="Aktif",Name="Aktif" }, + new () { Key="Pasif",Name="Pasif" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto{ C = AppCodes.Definitions.Vehicle + ".Create", R = AppCodes.Definitions.Vehicle, U = AppCodes.Definitions.Vehicle + ".Update", E = true, I = true, Deny = false}), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto{ IsPivot = true}) + }, + }); + #endregion + } + #endregion + + #region Schedule + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Schedule)) + { + var listFormSchedule = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Schedule, + Name = AppCodes.Definitions.Schedule, + Title = AppCodes.Definitions.Schedule, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Schedule, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Schedule", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + D = AppCodes.Definitions.Schedule + ".Delete", + E = AppCodes.Definitions.Schedule + ".Export", + I = AppCodes.Definitions.Schedule + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Schedule", Prefix.DbTableDefinition)}\" 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 = "Schedule Form", + Width = 750, + Height = 700 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() { + new() { + Order = 1, ColCount = 2, ColSpan = 2, ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 4, DataField = "StartTime", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "EndTime", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField = "LessonMinute", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 7, DataField = "LessonBreakMinute", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 8, DataField = "LessonCount", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 9, DataField = "LunchTime", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 10, DataField = "LunchMinute", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 11, DataField = "IncludeLunch", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 12, DataField = "Monday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 13, DataField = "Tuesday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 14, DataField = "Wednesday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 15, DataField = "Thursday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 16, DataField = "Friday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 17, DataField = "Saturday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 18, DataField = "Sunday", ColSpan = 1, EditorType2 = EditorTypes.dxCheckBox }, + ] + } + }), + 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 } + }), + } + ); + + #region Schedule Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() { + ListFormCode = listFormSchedule.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // BranchId + new() { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BranchId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryBranchValues, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Name + new() { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 2, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Status + new() { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 150, + 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="Aktif",Name="Aktif" }, + new () { Key="Pasif",Name="Pasif" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto{ C = AppCodes.Definitions.Schedule + ".Create", R = AppCodes.Definitions.Schedule, U = AppCodes.Definitions.Schedule + ".Update", E = true, I = true, Deny = false}), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto{ IsPivot = true}) + }, + // Ders Saatleri + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "StartTime", + Width = 120, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "EndTime", + Width = 120, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "LessonMinute", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "LessonBreakMinute", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "LessonCount", + Width = 100, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + + // Öğle Arası + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "LunchTime", + Width = 120, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "LunchMinute", + Width = 100, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IncludeLunch", + Width = 100, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + + // Günler + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Monday", + Width = 100, + ListOrderNo = 13, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Tuesday", + Width = 100, + ListOrderNo = 14, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Wednesday", + Width = 100, + ListOrderNo = 15, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Thursday", + Width = 100, + ListOrderNo = 16, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Friday", + Width = 100, + ListOrderNo = 17, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Saturday", + Width = 100, + ListOrderNo = 18, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormSchedule.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "Sunday", + Width = 100, + ListOrderNo = 19, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Schedule + ".Create", + R = AppCodes.Definitions.Schedule, + U = AppCodes.Definitions.Schedule + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + + }); + #endregion + } + #endregion + + #region Psychologist + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Psychologist)) + { + var listFormPsychologist = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Psychologist, + Name = AppCodes.Definitions.Psychologist, + Title = AppCodes.Definitions.Psychologist, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Psychologist, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Psychologist", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Psychologist + ".Create", + R = AppCodes.Definitions.Psychologist, + U = AppCodes.Definitions.Psychologist + ".Update", + D = AppCodes.Definitions.Psychologist + ".Delete", + E = AppCodes.Definitions.Psychologist + ".Export", + I = AppCodes.Definitions.Psychologist + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Psychologist", Prefix.DbTableDefinition)}\" 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 = "Psychologist Form", + Width = 650, + Height = 500 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() + { + Order = 1, + ColCount = 2, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Phone", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Email", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "Address", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 6, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + ] + } + }), + 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 + } + }), + } + ); + + #region Psychologist Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() + { + ListFormCode = listFormPsychologist.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Psychologist + ".Create", + R = AppCodes.Definitions.Psychologist, + U = AppCodes.Definitions.Psychologist + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // BranchId + new() + { + ListFormCode = listFormPsychologist.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BranchId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryBranchValues, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Psychologist + ".Create", + R = AppCodes.Definitions.Psychologist, + U = AppCodes.Definitions.Psychologist + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Name + new() + { + ListFormCode = listFormPsychologist.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 2, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Psychologist + ".Create", + R = AppCodes.Definitions.Psychologist, + U = AppCodes.Definitions.Psychologist + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Phone + new() + { + ListFormCode = listFormPsychologist.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Phone", + Width = 150, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Psychologist + ".Create", + R = AppCodes.Definitions.Psychologist, + U = AppCodes.Definitions.Psychologist + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Email + new() + { + ListFormCode = listFormPsychologist.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Email", + Width = 200, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Psychologist + ".Create", + R = AppCodes.Definitions.Psychologist, + U = AppCodes.Definitions.Psychologist + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Address + new() + { + ListFormCode = listFormPsychologist.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Address", + Width = 300, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Psychologist + ".Create", + R = AppCodes.Definitions.Psychologist, + U = AppCodes.Definitions.Psychologist + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Status + new() + { + ListFormCode = listFormPsychologist.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 150, + ListOrderNo = 7, + 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="Aktif",Name="Aktif" }, + new () { Key="Pasif",Name="Pasif" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Psychologist + ".Create", + R = AppCodes.Definitions.Psychologist, + U = AppCodes.Definitions.Psychologist + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + } + }); + #endregion + } + #endregion + + #region Meal + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Meal)) + { + var listFormMeal = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Meal, + Name = AppCodes.Definitions.Meal, + Title = AppCodes.Definitions.Meal, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Meal, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Meal", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + 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", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Meal", Prefix.DbTableDefinition)}\" 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 = "Meal Form", + Width = 600, + Height = 450 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() + { + Order = 1, + ColCount = 2, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "Date", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxDateBox }, + new EditingFormItemDto { Order = 3, DataField = "Breakfast", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 4, DataField = "Lunch", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 5, DataField = "Snack", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + ] + } + }), + 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 + } + }), + } + ); + + #region Meal Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() + { + ListFormCode = listFormMeal.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + 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 }) + }, + // BranchId + new() + { + ListFormCode = listFormMeal.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BranchId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryBranchValues, + }), + 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 }) + }, + // Date + new() + { + ListFormCode = listFormMeal.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.DateTime, + FieldName = "Date", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 2, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + 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 }) + }, + // Breakfast + new() + { + ListFormCode = listFormMeal.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Breakfast", + Width = 300, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + 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 }) + }, + // Lunch + new() + { + ListFormCode = listFormMeal.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Lunch", + Width = 300, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + 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, + 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 }) + } + }); + #endregion + } + #endregion + + #region Lawyer + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Lawyer)) + { + var listFormLawyer = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Lawyer, + Name = AppCodes.Definitions.Lawyer, + Title = AppCodes.Definitions.Lawyer, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Lawyer, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Lawyer", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + D = AppCodes.Definitions.Lawyer + ".Delete", + E = AppCodes.Definitions.Lawyer + ".Export", + I = AppCodes.Definitions.Lawyer + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Lawyer", Prefix.DbTableDefinition)}\" 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 = "Lawyer Form", + Width = 700, + Height = 700 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() + { + Order = 1, + ColCount = 2, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "ContactPerson", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Email", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Address", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 5, DataField = "City", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField = "TaxOffice", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 7, DataField = "TaxNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 8, DataField = "Phone1", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 9, DataField = "Phone2", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 10, DataField = "Phone3", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 11, DataField = "Phone4", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 12, DataField = "Fax", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 13, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 14, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + ] + } + }), + 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 } + }), + } + ); + + #region Lawyer Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() + { + ListFormCode = listFormLawyer.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // String alanlar + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() + { + Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) + } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "ContactPerson", + Width = 200, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Email", + Width = 200, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Address", + Width = 300, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "City", + Width = 150, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "TaxOffice", + Width = 150, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "TaxNumber", + Width = 150, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + + // Telefon ve Fax alanları + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Phone1", + Width = 150, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Phone2", + Width = 150, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Phone3", + Width = 150, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Phone4", + Width = 150, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Fax", + Width = 150, + ListOrderNo = 13, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + + // Description ve Status + new() + { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 300, + ListOrderNo = 14, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Lawyer + ".Create", + R = AppCodes.Definitions.Lawyer, + U = AppCodes.Definitions.Lawyer + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + + new() { + ListFormCode = listFormLawyer.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 120, + ListOrderNo = 15, + 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="Aktif",Name="Aktif" }, + new () { Key="Pasif",Name="Pasif" }, + }), + }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]{}), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto{ C = AppCodes.Definitions.Lawyer + ".Create", R = AppCodes.Definitions.Lawyer, U = AppCodes.Definitions.Lawyer + ".Update", E = true, I = true, Deny = false }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto{ IsPivot = true }) + }, + }); + #endregion + } + #endregion + + #region Event + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Event)) + { + var listFormEvent = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Event, + Name = AppCodes.Definitions.Event, + Title = AppCodes.Definitions.Event, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Event, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Event", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Event + ".Create", + R = AppCodes.Definitions.Event, + U = AppCodes.Definitions.Event + ".Update", + D = AppCodes.Definitions.Event + ".Delete", + E = AppCodes.Definitions.Event + ".Export", + I = AppCodes.Definitions.Event + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Event", Prefix.DbTableDefinition)}\" 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 = "Event Form", + Width = 650, + Height = 550 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() + { + Order = 1, + ColCount = 2, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "CategoryId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "TypeId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Place", ColSpan = 2, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "Description", ColSpan = 2, EditorType2 = EditorTypes.dxTextArea }, + new EditingFormItemDto { Order = 6, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + ] + } + }), + 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 } + }), + } + ); + + #region Event Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() + { + ListFormCode = listFormEvent.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) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Event + ".Create", + R = AppCodes.Definitions.Event, + U = AppCodes.Definitions.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // CategoryId + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "CategoryId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]{}), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Event + ".Create", + R = AppCodes.Definitions.Event, + U = AppCodes.Definitions.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // TypeId + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "TypeId", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 2, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]{}), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Event + ".Create", + R = AppCodes.Definitions.Event, + U = AppCodes.Definitions.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Name + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 3, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Event + ".Create", + R = AppCodes.Definitions.Event, + U = AppCodes.Definitions.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Place + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Place", + Width = 200, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 4, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]{}), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Event + ".Create", + R = AppCodes.Definitions.Event, + U = AppCodes.Definitions.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Description + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Description", + Width = 300, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 5, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]{}), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Event + ".Create", + R = AppCodes.Definitions.Event, + U = AppCodes.Definitions.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Status + new() + { + ListFormCode = listFormEvent.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 120, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 6, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.StaticData, + DisplayExpr = "name", + ValueExpr = "key", + LookupQuery = JsonSerializer.Serialize(new LookupDataDto[] { + new () { Key="Aktif",Name="Aktif" }, + new () { Key="Pasif",Name="Pasif" }, + }), + }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]{}), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Event + ".Create", + R = AppCodes.Definitions.Event, + U = AppCodes.Definitions.Event + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + } + }); + #endregion + } + #endregion + + #region LessonPeriod + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.LessonPeriod)) + { + var listFormLessonPeriod = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.LessonPeriod, + Name = AppCodes.Definitions.LessonPeriod, + Title = AppCodes.Definitions.LessonPeriod, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.LessonPeriod, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("LessonPeriod", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.LessonPeriod + ".Create", + R = AppCodes.Definitions.LessonPeriod, + U = AppCodes.Definitions.LessonPeriod + ".Update", + D = AppCodes.Definitions.LessonPeriod + ".Delete", + E = AppCodes.Definitions.LessonPeriod + ".Export", + I = AppCodes.Definitions.LessonPeriod + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("LessonPeriod", Prefix.DbTableDefinition)}\" 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 = "Lesson Period Form", + Width = 600, + Height = 500 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() + { + Order = 1, + ColCount = 2, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Day", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Lesson1", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 5, DataField = "Lesson2", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 6, DataField = "Lesson3", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 7, DataField = "Lesson4", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + ] + } + }), + 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 } + }), + } + ); + + #region LessonPeriod Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() + { + ListFormCode = listFormLessonPeriod.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) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.LessonPeriod + ".Create", + R = AppCodes.Definitions.LessonPeriod, + U = AppCodes.Definitions.LessonPeriod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // BranchId + new() + { + ListFormCode = listFormLessonPeriod.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BranchId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryBranchValues, + }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]{}), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.LessonPeriod + ".Create", + R = AppCodes.Definitions.LessonPeriod, + U = AppCodes.Definitions.LessonPeriod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Name + new() + { + ListFormCode = listFormLessonPeriod.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 2, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.LessonPeriod + ".Create", + R = AppCodes.Definitions.LessonPeriod, + U = AppCodes.Definitions.LessonPeriod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Day + new() + { + ListFormCode = listFormLessonPeriod.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Day", + Width = 120, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 3, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.LessonPeriod + ".Create", + R = AppCodes.Definitions.LessonPeriod, + U = AppCodes.Definitions.LessonPeriod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Lesson1-4 + new() + { + ListFormCode = listFormLessonPeriod.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Lesson1", + Width = 200, + ListOrderNo = 5, + 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="Ana",Name="Ana" }, + new () { Key="Ek",Name="Ek" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.LessonPeriod + ".Create", + R = AppCodes.Definitions.LessonPeriod, + U = AppCodes.Definitions.LessonPeriod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLessonPeriod.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Lesson2", + Width = 200, + ListOrderNo = 6, + 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="Ana",Name="Ana" }, + new () { Key="Ek",Name="Ek" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.LessonPeriod + ".Create", + R = AppCodes.Definitions.LessonPeriod, + U = AppCodes.Definitions.LessonPeriod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLessonPeriod.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Lesson3", + Width = 200, + ListOrderNo = 7, + 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="Ana",Name="Ana" }, + new () { Key="Ek",Name="Ek" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.LessonPeriod + ".Create", + R = AppCodes.Definitions.LessonPeriod, + U = AppCodes.Definitions.LessonPeriod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() + { + ListFormCode = listFormLessonPeriod.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Lesson4", + Width = 200, + ListOrderNo = 8, + 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="Ana",Name="Ana" }, + new () { Key="Ek",Name="Ek" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.LessonPeriod + ".Create", + R = AppCodes.Definitions.LessonPeriod, + U = AppCodes.Definitions.LessonPeriod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + }); + #endregion + } + #endregion + + #region RegistrationType + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.RegistrationType)) + { + var listFormRegistrationType = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.RegistrationType, + Name = AppCodes.Definitions.RegistrationType, + Title = AppCodes.Definitions.RegistrationType, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.RegistrationType, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("RegistrationType", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.RegistrationType + ".Create", + R = AppCodes.Definitions.RegistrationType, + U = AppCodes.Definitions.RegistrationType + ".Update", + D = AppCodes.Definitions.RegistrationType + ".Delete", + E = AppCodes.Definitions.RegistrationType + ".Export", + I = AppCodes.Definitions.RegistrationType + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("RegistrationType", Prefix.DbTableDefinition)}\" 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 = "Registration Type Form", + Width = 500, + Height = 300 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() + { + Order = 1, + ColCount = 2, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + ] + } + }), + 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 } + }), + } + ); + + #region RegistrationType Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() + { + ListFormCode = listFormRegistrationType.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) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.RegistrationType + ".Create", + R = AppCodes.Definitions.RegistrationType, + U = AppCodes.Definitions.RegistrationType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // BranchId + new() + { + ListFormCode = listFormRegistrationType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BranchId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryBranchValues, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.RegistrationType + ".Create", + R = AppCodes.Definitions.RegistrationType, + U = AppCodes.Definitions.RegistrationType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Name + new() + { + ListFormCode = listFormRegistrationType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.RegistrationType + ".Create", + R = AppCodes.Definitions.RegistrationType, + U = AppCodes.Definitions.RegistrationType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Status + new() + { + ListFormCode = listFormRegistrationType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 150, + 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="Aktif",Name="Aktif" }, + new () { Key="Pasif",Name="Pasif" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.RegistrationType + ".Create", + R = AppCodes.Definitions.RegistrationType, + U = AppCodes.Definitions.RegistrationType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + } + }); + #endregion + } + #endregion + + #region RegistrationMethod + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.RegistrationMethod)) + { + var listFormRegistrationMethod = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.RegistrationMethod, + Name = AppCodes.Definitions.RegistrationMethod, + Title = AppCodes.Definitions.RegistrationMethod, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.RegistrationMethod, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("RegistrationMethod", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.RegistrationMethod + ".Create", + R = AppCodes.Definitions.RegistrationMethod, + U = AppCodes.Definitions.RegistrationMethod + ".Update", + D = AppCodes.Definitions.RegistrationMethod + ".Delete", + E = AppCodes.Definitions.RegistrationMethod + ".Export", + I = AppCodes.Definitions.RegistrationMethod + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("RegistrationMethod", Prefix.DbTableDefinition)}\" 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 = "Registration Method Form", + Width = 550, + Height = 350 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() + { + Order = 1, + ColCount = 2, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "RegistrationTypeId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + ] + } + }), + 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 } + }), + } + ); + + #region RegistrationMethod Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() + { + ListFormCode = listFormRegistrationMethod.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.RegistrationMethod + ".Create", + R = AppCodes.Definitions.RegistrationMethod, + U = AppCodes.Definitions.RegistrationMethod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // BranchId + new() + { + ListFormCode = listFormRegistrationMethod.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BranchId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryBranchValues, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.RegistrationMethod + ".Create", + R = AppCodes.Definitions.RegistrationMethod, + U = AppCodes.Definitions.RegistrationMethod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // RegistrationTypeId + new() + { + ListFormCode = listFormRegistrationMethod.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "RegistrationTypeId", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.RegistrationMethod + ".Create", + R = AppCodes.Definitions.RegistrationMethod, + U = AppCodes.Definitions.RegistrationMethod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Name + new() + { + ListFormCode = listFormRegistrationMethod.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.RegistrationMethod + ".Create", + R = AppCodes.Definitions.RegistrationMethod, + U = AppCodes.Definitions.RegistrationMethod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Status + new() + { + ListFormCode = listFormRegistrationMethod.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 150, + ListOrderNo = 5, + 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="Aktif",Name="Aktif" }, + new () { Key="Pasif",Name="Pasif" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.RegistrationMethod + ".Create", + R = AppCodes.Definitions.RegistrationMethod, + U = AppCodes.Definitions.RegistrationMethod + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + } + }); + #endregion + } + #endregion + + #region ClassType + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.ClassType)) + { + var listFormClassType = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.ClassType, + Name = AppCodes.Definitions.ClassType, + Title = AppCodes.Definitions.ClassType, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.ClassType, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("ClassType", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.ClassType + ".Create", + R = AppCodes.Definitions.ClassType, + U = AppCodes.Definitions.ClassType + ".Update", + D = AppCodes.Definitions.ClassType + ".Delete", + E = AppCodes.Definitions.ClassType + ".Export", + I = AppCodes.Definitions.ClassType + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("ClassType", Prefix.DbTableDefinition)}\" 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 = "Class Type Form", + Width = 600, + Height = 400 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() + { + Order = 1, + ColCount = 2, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "RegistrationTypeId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "MinStudentCount", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 5, DataField = "MaxStudentCount", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 6, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + ] + } + }), + 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 } + }), + } + ); + + #region ClassType Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() + { + ListFormCode = listFormClassType.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) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ClassType + ".Create", + R = AppCodes.Definitions.ClassType, + U = AppCodes.Definitions.ClassType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // BranchId + new() + { + ListFormCode = listFormClassType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BranchId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryBranchValues, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ClassType + ".Create", + R = AppCodes.Definitions.ClassType, + U = AppCodes.Definitions.ClassType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // RegistrationTypeId + new() + { + ListFormCode = listFormClassType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "RegistrationTypeId", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ClassType + ".Create", + R = AppCodes.Definitions.ClassType, + U = AppCodes.Definitions.ClassType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Name + new() + { + ListFormCode = listFormClassType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ClassType + ".Create", + R = AppCodes.Definitions.ClassType, + U = AppCodes.Definitions.ClassType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // MinStudentCount + new() + { + ListFormCode = listFormClassType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "MinStudentCount", + Width = 120, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ClassType + ".Create", + R = AppCodes.Definitions.ClassType, + U = AppCodes.Definitions.ClassType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // MaxStudentCount + new() + { + ListFormCode = listFormClassType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "MaxStudentCount", + Width = 120, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ClassType + ".Create", + R = AppCodes.Definitions.ClassType, + U = AppCodes.Definitions.ClassType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Status + new() + { + ListFormCode = listFormClassType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 150, + ListOrderNo = 7, + 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="Aktif",Name="Aktif" }, + new () { Key="Pasif",Name="Pasif" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.ClassType + ".Create", + R = AppCodes.Definitions.ClassType, + U = AppCodes.Definitions.ClassType + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + } + }); + #endregion + } + #endregion + + #region Class + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Class)) + { + var listFormClass = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Class, + Name = AppCodes.Definitions.Class, + Title = AppCodes.Definitions.Class, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Class, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Class", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Class + ".Create", + R = AppCodes.Definitions.Class, + U = AppCodes.Definitions.Class + ".Update", + D = AppCodes.Definitions.Class + ".Delete", + E = AppCodes.Definitions.Class + ".Export", + I = AppCodes.Definitions.Class + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Class", Prefix.DbTableDefinition)}\" 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 = "Class Form", + Width = 550, + Height = 300 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() + { + Order = 1, + ColCount = 2, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "ClassTypeId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + ] + } + }), + 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 } + }), + } + ); + + #region Class Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() + { + ListFormCode = listFormClass.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Class + ".Create", + R = AppCodes.Definitions.Class, + U = AppCodes.Definitions.Class + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // BranchId + new() + { + ListFormCode = listFormClass.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BranchId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryBranchValues, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Class + ".Create", + R = AppCodes.Definitions.Class, + U = AppCodes.Definitions.Class + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // ClassTypeId + new() + { + ListFormCode = listFormClass.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "ClassTypeId", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Class + ".Create", + R = AppCodes.Definitions.Class, + U = AppCodes.Definitions.Class + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Name + new() + { + ListFormCode = listFormClass.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Class + ".Create", + R = AppCodes.Definitions.Class, + U = AppCodes.Definitions.Class + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Status + new() + { + ListFormCode = listFormClass.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 150, + ListOrderNo = 5, + 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="Aktif",Name="Aktif" }, + new () { Key="Pasif",Name="Pasif" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Class + ".Create", + R = AppCodes.Definitions.Class, + U = AppCodes.Definitions.Class + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + } + }); + #endregion + } + #endregion + + #region Level + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Level)) + { + var listFormLevel = await _listFormRepository.InsertAsync( + new ListForm() + { + ListFormType = ListFormTypeEnum.List, + IsSubForm = false, + LayoutJson = JsonSerializer.Serialize(new LayoutDto() + { + Grid = true, + Card = true, + Pivot = true, + Chart = true, + DefaultLayout = "grid", + CardLayoutColumn = 3 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Level, + Name = AppCodes.Definitions.Level, + Title = AppCodes.Definitions.Level, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Level, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Level", Prefix.DbTableDefinition), + 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, + ColumnChooserEnabled = true + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Level + ".Create", + R = AppCodes.Definitions.Level, + U = AppCodes.Definitions.Level + ".Update", + D = AppCodes.Definitions.Level + ".Delete", + E = AppCodes.Definitions.Level + ".Export", + I = AppCodes.Definitions.Level + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Level", Prefix.DbTableDefinition)}\" 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 = "Level Form", + Width = 650, + Height = 450 + }, + AllowDeleting = true, + AllowAdding = true, + AllowUpdating = true, + SendOnlyChangedFormValuesUpdate = false, + }), + EditingFormJson = JsonSerializer.Serialize(new List() + { + new() + { + Order = 1, + ColCount = 2, + ColSpan = 2, + ItemType = "group", + Items = + [ + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "ClassTypeId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "LevelType", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "LessonCount", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 6, DataField = "LessonDuration", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 7, DataField = "MonthlyPaymentRate", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, + new EditingFormItemDto { Order = 8, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + ] + } + }), + 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 } + }), + } + ); + + #region Level Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] + { + // Id + new() + { + ListFormCode = listFormLevel.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Level + ".Create", + R = AppCodes.Definitions.Level, + U = AppCodes.Definitions.Level + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // BranchId + new() + { + ListFormCode = listFormLevel.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BranchId", + Width = 150, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + LookupJson = JsonSerializer.Serialize(new LookupDto { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryBranchValues, + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Level + ".Create", + R = AppCodes.Definitions.Level, + U = AppCodes.Definitions.Level + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // ClassTypeId + new() + { + ListFormCode = listFormLevel.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "ClassTypeId", + Width = 150, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Level + ".Create", + R = AppCodes.Definitions.Level, + U = AppCodes.Definitions.Level + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Name + new() + { + ListFormCode = listFormLevel.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 180, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + SortDirection = GridColumnOptions.SortOrderAsc, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Level + ".Create", + R = AppCodes.Definitions.Level, + U = AppCodes.Definitions.Level + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // LevelType + new() + { + ListFormCode = listFormLevel.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "LevelType", + Width = 150, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Level + ".Create", + R = AppCodes.Definitions.Level, + U = AppCodes.Definitions.Level + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // LessonCount + new() + { + ListFormCode = listFormLevel.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "LessonCount", + Width = 120, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Level + ".Create", + R = AppCodes.Definitions.Level, + U = AppCodes.Definitions.Level + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // LessonDuration + new() + { + ListFormCode = listFormLevel.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Int32, + FieldName = "LessonDuration", + Width = 120, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Level + ".Create", + R = AppCodes.Definitions.Level, + U = AppCodes.Definitions.Level + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // MonthlyPaymentRate + new() + { + ListFormCode = listFormLevel.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "MonthlyPaymentRate", + Width = 150, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Level + ".Create", + R = AppCodes.Definitions.Level, + U = AppCodes.Definitions.Level + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + // Status + new() + { + ListFormCode = listFormLevel.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Status", + Width = 150, + ListOrderNo = 9, + 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="Aktif",Name="Aktif" }, + new () { Key="Pasif",Name="Pasif" }, + }), + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Level + ".Create", + R = AppCodes.Definitions.Level, + U = AppCodes.Definitions.Level + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + } + }); + #endregion + } + #endregion + #endregion } } diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformDataSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformDataSeeder.cs index cafc9b76..67274b35 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformDataSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformDataSeeder.cs @@ -1162,7 +1162,6 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency Name = item.Name, StartHour = item.StartHour, EndHour = item.EndHour, - IsFixed = item.IsFixed, Monday = item.Monday, Tuesday = item.Tuesday, Wednesday = item.Wednesday, diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json index 840d063c..ac4f6a2c 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json @@ -3518,6 +3518,682 @@ "IsEnabled": true, "MultiTenancySide": 3 }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ClassCancellationReason", + "ParentName": null, + "DisplayName": "App.Definitions.ClassCancellationReason", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ClassCancellationReason.Create", + "ParentName": "App.Definitions.ClassCancellationReason", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ClassCancellationReason.Update", + "ParentName": "App.Definitions.ClassCancellationReason", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ClassCancellationReason.Delete", + "ParentName": "App.Definitions.ClassCancellationReason", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ClassCancellationReason.Export", + "ParentName": "App.Definitions.ClassCancellationReason", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ClassCancellationReason.Import", + "ParentName": "App.Definitions.ClassCancellationReason", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.WorkHour", + "ParentName": null, + "DisplayName": "App.Definitions.WorkHour", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.WorkHour.Create", + "ParentName": "App.Definitions.WorkHour", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.WorkHour.Update", + "ParentName": "App.Definitions.WorkHour", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.WorkHour.Delete", + "ParentName": "App.Definitions.WorkHour", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.WorkHour.Export", + "ParentName": "App.Definitions.WorkHour", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.WorkHour.Import", + "ParentName": "App.Definitions.WorkHour", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Vehicle", + "ParentName": null, + "DisplayName": "App.Definitions.Vehicle", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Vehicle.Create", + "ParentName": "App.Definitions.Vehicle", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Vehicle.Update", + "ParentName": "App.Definitions.Vehicle", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Vehicle.Delete", + "ParentName": "App.Definitions.Vehicle", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Vehicle.Export", + "ParentName": "App.Definitions.Vehicle", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Vehicle.Import", + "ParentName": "App.Definitions.Vehicle", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Schedule", + "ParentName": null, + "DisplayName": "App.Definitions.Schedule", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Schedule.Create", + "ParentName": "App.Definitions.Schedule", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Schedule.Update", + "ParentName": "App.Definitions.Schedule", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Schedule.Delete", + "ParentName": "App.Definitions.Schedule", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Schedule.Export", + "ParentName": "App.Definitions.Schedule", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Schedule.Import", + "ParentName": "App.Definitions.Schedule", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ScheduleLesson", + "ParentName": null, + "DisplayName": "App.Definitions.ScheduleLesson", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ScheduleLesson.Create", + "ParentName": "App.Definitions.ScheduleLesson", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ScheduleLesson.Update", + "ParentName": "App.Definitions.ScheduleLesson", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ScheduleLesson.Delete", + "ParentName": "App.Definitions.ScheduleLesson", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ScheduleLesson.Export", + "ParentName": "App.Definitions.ScheduleLesson", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ScheduleLesson.Import", + "ParentName": "App.Definitions.ScheduleLesson", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Psychologist", + "ParentName": null, + "DisplayName": "App.Definitions.Psychologist", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Psychologist.Create", + "ParentName": "App.Definitions.Psychologist", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Psychologist.Update", + "ParentName": "App.Definitions.Psychologist", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Psychologist.Delete", + "ParentName": "App.Definitions.Psychologist", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Psychologist.Export", + "ParentName": "App.Definitions.Psychologist", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Psychologist.Import", + "ParentName": "App.Definitions.Psychologist", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Meal", + "ParentName": null, + "DisplayName": "App.Definitions.Meal", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Meal.Create", + "ParentName": "App.Definitions.Meal", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Meal.Update", + "ParentName": "App.Definitions.Meal", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Meal.Delete", + "ParentName": "App.Definitions.Meal", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Meal.Export", + "ParentName": "App.Definitions.Meal", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Meal.Import", + "ParentName": "App.Definitions.Meal", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Lawyer", + "ParentName": null, + "DisplayName": "App.Definitions.Lawyer", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Lawyer.Create", + "ParentName": "App.Definitions.Lawyer", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Lawyer.Update", + "ParentName": "App.Definitions.Lawyer", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Lawyer.Delete", + "ParentName": "App.Definitions.Lawyer", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Lawyer.Export", + "ParentName": "App.Definitions.Lawyer", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Lawyer.Import", + "ParentName": "App.Definitions.Lawyer", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Event", + "ParentName": null, + "DisplayName": "App.Definitions.Event", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Event.Create", + "ParentName": "App.Definitions.Event", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Event.Update", + "ParentName": "App.Definitions.Event", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Event.Delete", + "ParentName": "App.Definitions.Event", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Event.Export", + "ParentName": "App.Definitions.Event", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Event.Import", + "ParentName": "App.Definitions.Event", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.RegistrationType", + "ParentName": null, + "DisplayName": "App.Definitions.RegistrationType", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.RegistrationType.Create", + "ParentName": "App.Definitions.RegistrationType", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.RegistrationType.Update", + "ParentName": "App.Definitions.RegistrationType", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.RegistrationType.Delete", + "ParentName": "App.Definitions.RegistrationType", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.RegistrationType.Export", + "ParentName": "App.Definitions.RegistrationType", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.RegistrationType.Import", + "ParentName": "App.Definitions.RegistrationType", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.RegistrationMethod", + "ParentName": null, + "DisplayName": "App.Definitions.RegistrationMethod", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.RegistrationMethod.Create", + "ParentName": "App.Definitions.RegistrationMethod", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.RegistrationMethod.Update", + "ParentName": "App.Definitions.RegistrationMethod", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.RegistrationMethod.Delete", + "ParentName": "App.Definitions.RegistrationMethod", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.RegistrationMethod.Export", + "ParentName": "App.Definitions.RegistrationMethod", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.RegistrationMethod.Import", + "ParentName": "App.Definitions.RegistrationMethod", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ClassType", + "ParentName": null, + "DisplayName": "App.Definitions.ClassType", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ClassType.Create", + "ParentName": "App.Definitions.ClassType", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ClassType.Update", + "ParentName": "App.Definitions.ClassType", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ClassType.Delete", + "ParentName": "App.Definitions.ClassType", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ClassType.Export", + "ParentName": "App.Definitions.ClassType", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.ClassType.Import", + "ParentName": "App.Definitions.ClassType", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Class", + "ParentName": null, + "DisplayName": "App.Definitions.Class", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Class.Create", + "ParentName": "App.Definitions.Class", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Class.Update", + "ParentName": "App.Definitions.Class", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Class.Delete", + "ParentName": "App.Definitions.Class", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Class.Export", + "ParentName": "App.Definitions.Class", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Class.Import", + "ParentName": "App.Definitions.Class", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Level", + "ParentName": null, + "DisplayName": "App.Definitions.Level", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Level.Create", + "ParentName": "App.Definitions.Level", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Level.Update", + "ParentName": "App.Definitions.Level", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Level.Delete", + "ParentName": "App.Definitions.Level", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Level.Export", + "ParentName": "App.Definitions.Level", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Level.Import", + "ParentName": "App.Definitions.Level", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { "GroupName": "App.Coordinator", "Name": "App.Classroom", @@ -7462,6 +8138,146 @@ "RequiredPermissionName": "App.Definitions.NoteType", "IsDisabled": false }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.ClassCancellationReason", + "DisplayName": "App.Definitions.ClassCancellationReason", + "Order": 19, + "Url": "/admin/list/list-classcancellationreason", + "Icon": "FcDisapprove", + "RequiredPermissionName": "App.Definitions.ClassCancellationReason", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.WorkHour", + "DisplayName": "App.Definitions.WorkHour", + "Order": 20, + "Url": "/admin/list/list-workhour", + "Icon": "FcClock", + "RequiredPermissionName": "App.Definitions.WorkHour", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.Vehicle", + "DisplayName": "App.Definitions.Vehicle", + "Order": 21, + "Url": "/admin/list/list-vehicle", + "Icon": "FcAutomotive", + "RequiredPermissionName": "App.Definitions.Vehicle", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.Schedule", + "DisplayName": "App.Definitions.Schedule", + "Order": 22, + "Url": "/admin/list/list-schedule", + "Icon": "FcPlanner", + "RequiredPermissionName": "App.Definitions.Schedule", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.Psychologist", + "DisplayName": "App.Definitions.Psychologist", + "Order": 23, + "Url": "/admin/list/list-psychologist", + "Icon": "FcMindMap", + "RequiredPermissionName": "App.Definitions.Psychologist", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.Meal", + "DisplayName": "App.Definitions.Meal", + "Order": 24, + "Url": "/admin/list/list-meal", + "Icon": "FcLike", + "RequiredPermissionName": "App.Definitions.Meal", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.Lawyer", + "DisplayName": "App.Definitions.Lawyer", + "Order": 25, + "Url": "/admin/list/list-lawyer", + "Icon": "FcBusinessman", + "RequiredPermissionName": "App.Definitions.Lawyer", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.Event", + "DisplayName": "App.Definitions.Event", + "Order": 26, + "Url": "/admin/list/list-event", + "Icon": "FcCalendar", + "RequiredPermissionName": "App.Definitions.Event", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.LessonPeriod", + "DisplayName": "App.Definitions.LessonPeriod", + "Order": 27, + "Url": "/admin/list/list-lessonperiod", + "Icon": "FcClock", + "RequiredPermissionName": "App.Definitions.LessonPeriod", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.RegistrationType", + "DisplayName": "App.Definitions.RegistrationType", + "Order": 28, + "Url": "/admin/list/list-registrationtype", + "Icon": "FcTodoList", + "RequiredPermissionName": "App.Definitions.RegistrationType", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.RegistrationMethod", + "DisplayName": "App.Definitions.RegistrationMethod", + "Order": 29, + "Url": "/admin/list/list-registrationmethod", + "Icon": "FcCollaboration", + "RequiredPermissionName": "App.Definitions.RegistrationMethod", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.ClassType", + "DisplayName": "App.Definitions.ClassType", + "Order": 30, + "Url": "/admin/list/list-classtype", + "Icon": "FcTreeStructure", + "RequiredPermissionName": "App.Definitions.ClassType", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.Class", + "DisplayName": "App.Definitions.Class", + "Order": 31, + "Url": "/admin/list/list-class", + "Icon": "FcConferenceCall", + "RequiredPermissionName": "App.Definitions.Class", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.Level", + "DisplayName": "App.Definitions.Level", + "Order": 32, + "Url": "/admin/list/list-level", + "Icon": "FcGraduationCap", + "RequiredPermissionName": "App.Definitions.Level", + "IsDisabled": false + }, { "ParentCode": null, "Code": "App.Participant", @@ -8359,18 +9175,14 @@ "path": "/admin/menuManager", "componentPath": "@/views/menu/MenuManager", "routeType": "protected", - "authority": [ - "App.Menus.Manager" - ] + "authority": ["App.Menus.Manager"] }, { "key": "admin.listFormManagement.wizard", "path": "/admin/listform/wizard", "componentPath": "@/views/admin/listForm/Wizard", "routeType": "protected", - "authority": [ - "App.Listforms.Wizard" - ] + "authority": ["App.Listforms.Wizard"] }, { "key": "admin.listFormManagement.edit", @@ -8384,18 +9196,14 @@ "path": "/admin/forumManagement", "componentPath": "@/views/forum/Management", "routeType": "protected", - "authority": [ - "App.ForumManagement" - ] + "authority": ["App.ForumManagement"] }, { "key": "admin.ai", "path": "/admin/ai", "componentPath": "@/views/ai/Assistant", "routeType": "protected", - "authority": [ - "Abp.Identity.Ai" - ] + "authority": ["Abp.Identity.Ai"] }, { "key": "admin.profile.general", @@ -8437,36 +9245,28 @@ "path": "/admin/settings", "componentPath": "@/views/settings/Settings", "routeType": "protected", - "authority": [ - "App.Setting" - ] + "authority": ["App.Setting"] }, { "key": "admin.identity.user.detail", "path": "/admin/users/detail/:userId", "componentPath": "@/views/admin/user-management/Details", "routeType": "protected", - "authority": [ - "AbpIdentity.Users.Update" - ] + "authority": ["AbpIdentity.Users.Update"] }, { "key": "admin.identity.ous", "path": "/admin/ous", "componentPath": "@/views/admin/organization-unit/OrganizationUnits", "routeType": "protected", - "authority": [ - "Abp.Identity.OrganizationUnits" - ] + "authority": ["Abp.Identity.OrganizationUnits"] }, { "key": "admin.forum", "path": "/admin/forum", "componentPath": "@/views/forum/Forum", "routeType": "protected", - "authority": [ - "App.ForumManagement.Publish" - ] + "authority": ["App.ForumManagement.Publish"] }, { "key": "admin.list", @@ -8515,144 +9315,112 @@ "path": "/admin/developerkit", "componentPath": "@/views/developerKit/DashboardPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit" - ] + "authority": ["App.DeveloperKit"] }, { "key": "admin.developerkit.entities", "path": "/admin/developerkit/entities", "componentPath": "@/views/developerKit/EntityPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Entity" - ] + "authority": ["App.DeveloperKit.Entity"] }, { "key": "admin.developerkit.entities.new", "path": "/admin/developerkit/entities/new", "componentPath": "@/views/developerKit/EntityDetailPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Entity" - ] + "authority": ["App.DeveloperKit.Entity"] }, { "key": "admin.developerkit.entities.edit", "path": "/admin/developerkit/entities/edit/:id", "componentPath": "@/views/developerKit/EntityDetailPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Entity" - ] + "authority": ["App.DeveloperKit.Entity"] }, { "key": "admin.developerkit.migrations", "path": "/admin/developerkit/migrations", "componentPath": "@/views/developerKit/MigrationPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Migrations" - ] + "authority": ["App.DeveloperKit.Migrations"] }, { "key": "admin.developerkit.endpoints", "path": "/admin/developerkit/endpoints", "componentPath": "@/views/developerKit/EndpointPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Endpoints" - ] + "authority": ["App.DeveloperKit.Endpoints"] }, { "key": "admin.developerkit.components", "path": "/admin/developerkit/components", "componentPath": "@/views/developerKit/ComponentPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Components" - ] + "authority": ["App.DeveloperKit.Components"] }, { "key": "admin.developerkit.components.new", "path": "/admin/developerkit/components/new", "componentPath": "@/views/developerKit/ComponentDetailPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Components" - ] + "authority": ["App.DeveloperKit.Components"] }, { "key": "admin.developerkit.components.view", "path": "/admin/developerkit/components/view/:id", "componentPath": "@/views/developerKit/ComponentDetailPage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Components" - ] + "authority": ["App.DeveloperKit.Components"] }, { "key": "admin.developerkit.components.edit", "path": "/admin/developerkit/components/edit/:id", "componentPath": "@/views/developerKit/CodePage", "routeType": "protected", - "authority": [ - "App.DeveloperKit.Components" - ] + "authority": ["App.DeveloperKit.Components"] }, { "key": "admin.reportManagement", "path": "/admin/reports/management", "componentPath": "@/views/report/DashboardPage", "routeType": "protected", - "authority": [ - "App.Reports.Management" - ] + "authority": ["App.Reports.Management"] }, { "key": "admin.reports.view", "path": "/admin/reports/:id", "componentPath": "@/views/report/ReportViewerPage", "routeType": "protected", - "authority": [ - "App.Reports.Categories" - ] + "authority": ["App.Reports.Categories"] }, { "key": "admin.classroom.dashboard", "path": "/admin/classroom/dashboard", "componentPath": "@/views/classroom/Dashboard", "routeType": "protected", - "authority": [ - "App.Classroom.Dashboard" - ] + "authority": ["App.Classroom.Dashboard"] }, { "key": "admin.classroom.classes", "path": "/admin/classroom/classes", "componentPath": "@/views/classroom/ClassList", "routeType": "protected", - "authority": [ - "App.Classroom.List" - ] + "authority": ["App.Classroom.List"] }, { "key": "admin.classroom.classroom", "path": "/admin/classroom/room/:id", "componentPath": "@/views/classroom/RoomDetail", "routeType": "protected", - "authority": [ - "App.Classroom.RoomDetail" - ] + "authority": ["App.Classroom.RoomDetail"] }, { "key": "admin.classroom.planning", "path": "/admin/classroom/planning/:id", "componentPath": "@/views/classroom/PlanningPage", "routeType": "protected", - "authority": [ - "App.Classroom.Planning" - ] + "authority": ["App.Classroom.Planning"] }, { "key": "admin.supplychain.materialTypes", @@ -15948,6 +16716,12 @@ "tr": "Satış Reddetme Nedeni", "en": "Sales Rejection Reason" }, + { + "resourceName": "Platform", + "key": "App.Definitions.ClassCancellationReason", + "tr": "Sınıf İptal Nedeni", + "en": "Class Cancellation Reason" + }, { "resourceName": "Platform", "key": "App.Definitions.Source", @@ -15966,6 +16740,90 @@ "tr": "Not Tipleri", "en": "Note Types" }, + { + "resourceName": "Platform", + "key": "App.Definitions.WorkHour", + "tr": "Çalışma Saatleri", + "en": "Work Hours" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.Vehicle", + "tr": "Araçlar", + "en": "Vehicles" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.Schedule", + "tr": "Çizelgeler", + "en": "Schedules" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.ScheduleLesson", + "tr": "Ders Çizelgeleri", + "en": "Lesson Schedules" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.Psychologist", + "tr": "Psikologlar", + "en": "Psychologists" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.Meal", + "tr": "Yemekler", + "en": "Meals" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.Lawyer", + "tr": "Avukatlar", + "en": "Lawyers" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.Event", + "tr": "Etkinlikler", + "en": "Events" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.LessonPeriod", + "tr": "Ders Dönemleri", + "en": "Lesson Periods" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.RegistrationType", + "tr": "Kayıt Türleri", + "en": "Registration Types" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.RegistrationMethod", + "tr": "Kayıt Yöntemleri", + "en": "Registration Methods" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.ClassType", + "tr": "Sınıf Türleri", + "en": "Class Types" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.Class", + "tr": "Sınıflar", + "en": "Classes" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.Level", + "tr": "Seviyeler", + "en": "Levels" + }, { "resourceName": "Platform", "key": "App.Orders", @@ -20456,10 +21314,7 @@ "descriptionKey": "Abp.Localization.DefaultLanguage.Description", "defaultValue": "en", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.SiteManagement", @@ -20493,10 +21348,7 @@ "descriptionKey": "Abp.Localization.Timezone.Description", "defaultValue": "UTC", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.SiteManagement", @@ -20652,11 +21504,7 @@ "descriptionKey": "App.SiteManagement.Theme.Style.Description", "defaultValue": "dx.light.compact", "isVisibleToClients": true, - "providers": [ - "U", - "G", - "D" - ], + "providers": ["U", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.SiteManagement", @@ -20704,10 +21552,7 @@ "descriptionKey": "App.SiteManagement.General.NewMemberNotificationEmails.Description", "defaultValue": "system@sozsoft.com", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.SiteManagement", @@ -20723,10 +21568,7 @@ "descriptionKey": "App.SiteManagement.General.TimedLoginEmails.Description", "defaultValue": "system@sozsoft.com", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.SiteManagement", @@ -20742,11 +21584,7 @@ "descriptionKey": "App.Sender.Sms.PostaGuvercini.Url.Description", "defaultValue": "https://www.postaguvercini.com/api_http", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.Sender", @@ -20762,11 +21600,7 @@ "descriptionKey": "App.Sender.Sms.PostaGuvercini.Username.Description", "defaultValue": "2AIlj4QlCrvlbDDBS/712A==", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": true, "mainGroupKey": "App.Sender", @@ -20782,11 +21616,7 @@ "descriptionKey": "App.Sender.Sms.PostaGuvercini.Password.Description", "defaultValue": "oTuwyZM9sxfJI+jDH5wJAw==", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": true, "mainGroupKey": "App.Sender", @@ -20802,11 +21632,7 @@ "descriptionKey": "App.Sender.WhatsApp.Url.Description", "defaultValue": "https://graph.facebook.com/v21.0", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.Sender", @@ -20822,11 +21648,7 @@ "descriptionKey": "App.Sender.WhatsApp.PhoneNumberId.Description", "defaultValue": "442035112335974", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.Sender", @@ -20842,11 +21664,7 @@ "descriptionKey": "App.Sender.WhatsApp.Token.Description", "defaultValue": "EAANoftqZAJ64BO5oPwXPqniUtNGF70u8TKvQVzGZBaYQh5UY8fYrgQkcXP9UbQUqT9PWRah1L7TzcBIiWQMacT8AkmZB33AP1begLoywIZCsQSdBSUz21GQaCowfVosYgBoXSyqH8irSBPQDLIjxxVxrC2n76SD9X6zPXeHgOqIPY92DqJXplstWrlhtZCAZDZD", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.Sender", @@ -20862,11 +21680,7 @@ "descriptionKey": "App.Sender.WhatsApp.TemplateName.Description", "defaultValue": "kurs_platform_notification", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.Sender", @@ -20882,10 +21696,7 @@ "descriptionKey": "App.Sender.Rocket.Url.Description", "defaultValue": "https://chat.sozsoft.com/api/v1", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.Sender", @@ -20901,10 +21712,7 @@ "descriptionKey": "App.Sender.Rocket.UserId.Description", "defaultValue": "LfpzPjzag4QJXm84N", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.Sender", @@ -20920,10 +21728,7 @@ "descriptionKey": "App.Sender.Rocket.Token.Description", "defaultValue": "jvqALawvXn0Q7c6FfHJV3h58DCHDfQLgFF5y7oIc7oc", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "App.Sender", @@ -20939,11 +21744,7 @@ "descriptionKey": "Abp.Mailing.DefaultFromDisplayName.Description", "defaultValue": "Kurs", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Mailing", @@ -20959,11 +21760,7 @@ "descriptionKey": "Abp.Mailing.DefaultFromAddress.Description", "defaultValue": "system@sozsoft.com", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Mailing", @@ -20979,11 +21776,7 @@ "descriptionKey": "Abp.Mailing.Smtp.UserName.Description", "defaultValue": "system@sozsoft.com", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Mailing", @@ -20999,11 +21792,7 @@ "descriptionKey": "Abp.Mailing.Smtp.Password.Description", "defaultValue": "QT9L7BCl1CT/1Hq19HoSlQ==", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": true, "mainGroupKey": "Abp.Mailing", @@ -21019,11 +21808,7 @@ "descriptionKey": "Abp.Mailing.Smtp.Host.Description", "defaultValue": "127.0.0.1", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Mailing", @@ -21039,11 +21824,7 @@ "descriptionKey": "Abp.Mailing.Smtp.Port.Description", "defaultValue": "25", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Mailing", @@ -21059,11 +21840,7 @@ "descriptionKey": "Abp.Mailing.Smtp.Domain.Description", "defaultValue": "sozsoft.com", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Mailing", @@ -21079,11 +21856,7 @@ "descriptionKey": "Abp.Mailing.Smtp.EnableSsl.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Mailing", @@ -21099,11 +21872,7 @@ "descriptionKey": "Abp.Mailing.AWS.Profile.Description", "defaultValue": "mail-sdk-user", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Mailing", @@ -21119,11 +21888,7 @@ "descriptionKey": "Abp.Mailing.AWS.Region.Description", "defaultValue": "eu-central-1", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Mailing", @@ -21139,11 +21904,7 @@ "descriptionKey": "Abp.Mailing.AWS.AccessKey.Description", "defaultValue": "aXW8L21rP6dPO6Txj76Be2FCpWRBa25EMrSAVL76", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Mailing", @@ -21159,11 +21920,7 @@ "descriptionKey": "Abp.Mailing.AWS.AccessKeyId.Description", "defaultValue": "AKIATULUYBLX4IY3S2P1", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Mailing", @@ -21179,10 +21936,7 @@ "descriptionKey": "Abp.Account.IsSelfRegistrationEnabled.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Account", @@ -21198,10 +21952,7 @@ "descriptionKey": "Abp.Account.EnableLocalLogin.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Account", @@ -21217,11 +21968,7 @@ "descriptionKey": "Abp.Account.TwoFactor.Enabled.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Account", @@ -21237,10 +21984,7 @@ "descriptionKey": "Abp.Account.Captcha.MaxFailedAccessAttempts.Description", "defaultValue": "3", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Account", @@ -21256,10 +22000,7 @@ "descriptionKey": "Abp.Account.Captcha.EndPoint.Description", "defaultValue": "https://challenges.cloudflare.com/turnstile/v0/siteverify", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Account", @@ -21275,10 +22016,7 @@ "descriptionKey": "Abp.Account.Captcha.SiteKey.Description", "defaultValue": "0x4AAAAAAAGadwQME-GSYuJU", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Account", @@ -21294,10 +22032,7 @@ "descriptionKey": "Abp.Account.Captcha.SecretKey.Description", "defaultValue": "0x4AAAAAAAGad_f_WP47IcNBs9FTu5DhNX8", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Account", @@ -21313,11 +22048,7 @@ "descriptionKey": "Abp.Identity.Profile.General.RequireVerifiedAccount.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21333,11 +22064,7 @@ "descriptionKey": "Abp.Identity.Profile.General.BlacklistedEmailProviders.Description", "defaultValue": "gmail.com\r\nyahoo.com\r\nhotmail.com", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21353,11 +22080,7 @@ "descriptionKey": "Abp.Identity.Password.ForceUsersToPeriodicallyChangePassword.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21373,11 +22096,7 @@ "descriptionKey": "Abp.Identity.Password.PasswordChangePeriodDays.Description", "defaultValue": "0", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21393,11 +22112,7 @@ "descriptionKey": "Abp.Identity.Password.RequiredLength.Description", "defaultValue": "6", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21413,11 +22128,7 @@ "descriptionKey": "Abp.Identity.Password.RequiredUniqueChars.Description", "defaultValue": "1", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21433,11 +22144,7 @@ "descriptionKey": "Abp.Identity.Password.RequireNonAlphanumeric.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21453,11 +22160,7 @@ "descriptionKey": "Abp.Identity.Password.RequireLowercase.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21473,11 +22176,7 @@ "descriptionKey": "Abp.Identity.Password.RequireUppercase.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21493,11 +22192,7 @@ "descriptionKey": "Abp.Identity.Password.RequireDigit.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21513,11 +22208,7 @@ "descriptionKey": "Abp.Identity.Lockout.AllowedForNewUsers.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21533,11 +22224,7 @@ "descriptionKey": "Abp.Identity.Lockout.LockoutDuration.Description", "defaultValue": "300", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21553,11 +22240,7 @@ "descriptionKey": "Abp.Identity.Lockout.MaxFailedAccessAttempts.Description", "defaultValue": "5", "isVisibleToClients": false, - "providers": [ - "T", - "G", - "D" - ], + "providers": ["T", "G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21573,10 +22256,7 @@ "descriptionKey": "Abp.Identity.SignIn.RequireConfirmedEmail.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21592,10 +22272,7 @@ "descriptionKey": "Abp.Identity.SignIn.RequireConfirmedPhoneNumber.Description", "defaultValue": "False", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21611,10 +22288,7 @@ "descriptionKey": "Abp.Identity.User.IsUserNameUpdateEnabled.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -21630,10 +22304,7 @@ "descriptionKey": "Abp.Identity.User.IsEmailUpdateEnabled.Description", "defaultValue": "True", "isVisibleToClients": false, - "providers": [ - "G", - "D" - ], + "providers": ["G", "D"], "isInherited": false, "isEncrypted": false, "mainGroupKey": "Abp.Identity", @@ -23854,9 +24525,7 @@ "props": null, "description": null, "isActive": true, - "dependencies": [ - "AxiosListComponent" - ] + "dependencies": ["AxiosListComponent"] } ], "ReportCategories": [ @@ -24152,9 +24821,6 @@ }, { "Name": "Tırnak Yeme" - }, - { - "Name": "Tik" } ], "Vaccines": [ @@ -25294,7 +25960,7 @@ "LessonCount": 80, "Status": "Aktif", "LessonDuration": 2, - "MonthlyPaymentRate": 20.00 + "MonthlyPaymentRate": 20.0 }, { "ClassTypeId": "22222222-BBBB-4444-CCCC-666666666666", @@ -25303,7 +25969,7 @@ "LessonCount": 90, "Status": "Aktif", "LessonDuration": 3, - "MonthlyPaymentRate": 30.00 + "MonthlyPaymentRate": 30.0 }, { "ClassTypeId": "22222222-BBBB-4444-CCCC-666666666666", @@ -25384,7 +26050,7 @@ "LessonCount": 80, "Status": "Aktif", "LessonDuration": 3, - "MonthlyPaymentRate": 30.00 + "MonthlyPaymentRate": 30.0 }, { "ClassTypeId": "11111111-AAAA-4444-BBBB-555555555555", @@ -25603,4 +26269,4 @@ "MonthlyPaymentRate": null } ] -} \ 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 c7aed305..bb2eb144 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -314,7 +314,7 @@ public static class PlatformConsts public const string City = Default + ".City"; public const string District = Default + ".District"; } - + //Administration public const string Administration = Prefix.App + ".Administration"; public const string Setting = Prefix.App + ".Setting"; @@ -343,9 +343,24 @@ public static class PlatformConsts public const string Program = Default + ".Program"; public const string Interesting = Default + ".Interesting"; public const string SalesRejectionReason = Default + ".SalesRejectionReason"; + public const string ClassCancellationReason = Default + ".ClassCancellationReason"; public const string Source = Default + ".Source"; public const string Vaccine = Default + ".Vaccine"; public const string NoteType = Default + ".NoteType"; + public const string WorkHour = Default + ".WorkHour"; + public const string Vehicle = Default + ".Vehicle"; + public const string Schedule = Default + ".Schedule"; + public const string ScheduleLesson = Default + ".ScheduleLesson"; + public const string Psychologist = Default + ".Psychologist"; + public const string Meal = Default + ".Meal"; + public const string Lawyer = Default + ".Lawyer"; + public const string Event = Default + ".Event"; + public const string LessonPeriod = Default + ".LessonPeriod"; + public const string RegistrationType = Default + ".RegistrationType"; + public const string RegistrationMethod = Default + ".RegistrationMethod"; + public const string ClassType = Default + ".ClassType"; + public const string Class = Default + ".Class"; + public const string Level = Default + ".Level"; } } @@ -423,9 +438,23 @@ public static class PlatformConsts public const string Program = "list-program"; public const string Interesting = "list-interesting"; public const string SalesRejectionReason = "list-salesrejectionreason"; + public const string ClassCancellationReason = "list-classcancellationreason"; public const string Source = "list-source"; public const string Vaccine = "list-vaccine"; public const string NoteType = "list-notetype"; + public const string WorkHour = "list-workhour"; + public const string Vehicle = "list-vehicle"; + public const string Schedule = "list-schedule"; + public const string Psychologist = "list-psychologist"; + public const string Meal = "list-meal"; + public const string Lawyer = "list-lawyer"; + public const string Event = "list-event"; + public const string LessonPeriod = "list-lessonperiod"; + public const string RegistrationType = "list-registrationtype"; + public const string RegistrationMethod = "list-registrationmethod"; + public const string ClassType = "list-classtype"; + public const string Class = "list-class"; + public const string Level = "list-level"; } } diff --git a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs index f5abadc0..b14c2dc8 100644 --- a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs @@ -391,7 +391,7 @@ public static class SeedConsts } //Administration - public const string Administration = Prefix.App + ".Administration"; + public const string Administration = Prefix.App + ".Administration"; public const string Setting = Prefix.App + ".Setting"; public static class IdentityManagement { @@ -421,9 +421,24 @@ public static class SeedConsts public const string Program = Default + ".Program"; public const string Interesting = Default + ".Interesting"; public const string SalesRejectionReason = Default + ".SalesRejectionReason"; + public const string ClassCancellationReason = Default + ".ClassCancellationReason"; public const string Source = Default + ".Source"; public const string Vaccine = Default + ".Vaccine"; public const string NoteType = Default + ".NoteType"; + public const string WorkHour = Default + ".WorkHour"; + public const string Vehicle = Default + ".Vehicle"; + public const string Schedule = Default + ".Schedule"; + public const string ScheduleLesson = Default + ".ScheduleLesson"; + public const string Psychologist = Default + ".Psychologist"; + public const string Meal = Default + ".Meal"; + public const string Lawyer = Default + ".Lawyer"; + public const string Event = Default + ".Event"; + public const string LessonPeriod = Default + ".LessonPeriod"; + public const string RegistrationType = Default + ".RegistrationType"; + public const string RegistrationMethod = Default + ".RegistrationMethod"; + public const string ClassType = Default + ".ClassType"; + public const string Class = Default + ".Class"; + public const string Level = Default + ".Level"; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/Administration/WorkHour.cs b/api/src/Kurs.Platform.Domain/Entities/Administration/WorkHour.cs index 54b86157..bb3bcb5a 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Administration/WorkHour.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Administration/WorkHour.cs @@ -11,7 +11,6 @@ public class WorkHour : FullAuditedEntity, IMultiTenant public string Name { get; set; } public string StartHour { get; set; } public string EndHour { get; set; } - public bool? IsFixed { get; set; } public bool? Monday { get; set; } public bool? Tuesday { get; set; } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index ff85d908..5120f949 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -1314,8 +1314,6 @@ public class PlatformDbContext : b.Property(x => x.StartHour).HasMaxLength(8).IsRequired(); b.Property(x => x.EndHour).HasMaxLength(8).IsRequired(); - b.Property(x => x.IsFixed); - b.Property(x => x.Monday); b.Property(x => x.Tuesday); b.Property(x => x.Wednesday); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251005211345_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251006064241_Initial.Designer.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251005211345_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251006064241_Initial.Designer.cs index a0cef021..de80ccab 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251005211345_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251006064241_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251005211345_Initial")] + [Migration("20251006064241_Initial")] partial class Initial { /// @@ -6242,9 +6242,6 @@ namespace Kurs.Platform.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); - b.Property("IsFixed") - .HasColumnType("bit"); - b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251005211345_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251006064241_Initial.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251005211345_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251006064241_Initial.cs index 288b2c40..050eaa84 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251005211345_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251006064241_Initial.cs @@ -1139,7 +1139,6 @@ namespace Kurs.Platform.Migrations Name = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), StartHour = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), EndHour = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), - IsFixed = table.Column(type: "bit", nullable: true), Monday = table.Column(type: "bit", nullable: true), Tuesday = table.Column(type: "bit", nullable: true), Wednesday = table.Column(type: "bit", nullable: true), diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index ea40682d..9e0a6fc8 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -6239,9 +6239,6 @@ namespace Kurs.Platform.Migrations .HasDefaultValue(false) .HasColumnName("IsDeleted"); - b.Property("IsFixed") - .HasColumnType("bit"); - b.Property("LastModificationTime") .HasColumnType("datetime2") .HasColumnName("LastModificationTime"); diff --git a/ui/src/views/admin/role-management/RolesPermission.tsx b/ui/src/views/admin/role-management/RolesPermission.tsx index 6660aa91..d0a2bed5 100644 --- a/ui/src/views/admin/role-management/RolesPermission.tsx +++ b/ui/src/views/admin/role-management/RolesPermission.tsx @@ -148,11 +148,29 @@ function RolesPermission({ if (!searchTerm) { return selectedGroupPermissions } - return selectedGroupPermissions.filter((p) => - translate('::' + p.displayName) - .toLowerCase() - .includes(searchTerm.toLowerCase()), + + const lowerTerm = searchTerm.toLowerCase() + + // 1️⃣ Sadece 1. kırınımdakileri (parent olmayanları değil) ara + const topLevelMatches = selectedGroupPermissions.filter( + (p) => + !p.parentName && // parentName yoksa bu 1. kırınım demektir + translate('::' + p.displayName) + .toLowerCase() + .includes(lowerTerm), ) + + // 2️⃣ Her bulunan parent’ın altındaki child izinleri ekle + const result: PermissionWithStyle[] = [] + topLevelMatches.forEach((parent) => { + result.push(parent) + + // Alt kırılımları bul + const children = selectedGroupPermissions.filter((child) => child.parentName === parent.name) + result.push(...children) + }) + + return result }, [selectedGroupPermissions, searchTerm, translate]) const onSelectAll = (value: boolean, e: ChangeEvent) => {