diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformListFormsSeeder.cs index 8e960195..6979b0c7 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/PlatformListFormsSeeder.cs @@ -707,7 +707,11 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc new { ParentFieldName = "Id", ChildFieldName = "BankId" - } + }, + new { + ParentFieldName = "BranchId", + ChildFieldName = "BranchId" + }, } }, }), @@ -758,21 +762,21 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc EditingFormJson = JsonSerializer.Serialize(new List() { new() { Order = 1, - ColCount = 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 = "IdentifierCode", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox}, - new EditingFormItemDto { Order = 3, DataField = "AddressLine1", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField = "AddressLine2", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 6, DataField = "City", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 7, DataField = "District", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 8, DataField = "PostalCode", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 9, DataField = "Phone", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 10, DataField = "Email", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - ] + new EditingFormItemDto { Order = 1, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "IdentifierCode", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxTextBox}, + new EditingFormItemDto { Order = 4, DataField = "AddressLine1", ColSpan = 1, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "AddressLine2", ColSpan = 1, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField = "Country", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 7, DataField = "City", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 8, DataField = "District", ColSpan = 1, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 9, DataField = "PostalCode", ColSpan = 1, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 10, DataField = "Phone", ColSpan = 1, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 11, DataField = "Email", ColSpan = 1, EditorType2=EditorTypes.dxTextBox }, ] } }), InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { @@ -803,6 +807,67 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc ); #region Bank Fields await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new() { + ListFormCode = formBank.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.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + // BranchId + new() + { + ListFormCode = formBank.ListFormCode, + CultureName = LanguageCodes.En, + RoleId = null, + UserId = null, + 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.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, new() { ListFormCode = formBank.ListFormCode, RoleId = null, @@ -811,7 +876,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Name", Width = 150, - ListOrderNo = 1, + ListOrderNo = 3, Visible = true, IsActive = true, IsDeleted = false, @@ -843,7 +908,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "IdentifierCode", Width = 150, - ListOrderNo = 2, + ListOrderNo = 4, Visible = true, IsActive = true, IsDeleted = false, @@ -873,7 +938,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "AddressLine1", Width = 150, - ListOrderNo = 3, + ListOrderNo = 5, Visible = true, IsActive = true, IsDeleted = false, @@ -900,7 +965,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "AddressLine2", Width = 150, - ListOrderNo = 4, + ListOrderNo = 6, Visible = true, IsActive = true, IsDeleted = false, @@ -927,7 +992,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Country", Width = 100, - ListOrderNo = 5, + ListOrderNo = 7, Visible = true, IsActive = true, IsDeleted = false, @@ -962,7 +1027,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "City", Width = 100, - ListOrderNo = 6, + ListOrderNo = 8, Visible = true, IsActive = true, IsDeleted = false, @@ -1000,7 +1065,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "District", Width = 100, - ListOrderNo = 7, + ListOrderNo = 9, Visible = true, IsActive = true, IsDeleted = false, @@ -1038,7 +1103,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "PostalCode", Width = 150, - ListOrderNo = 8, + ListOrderNo = 10, Visible = true, IsActive = true, IsDeleted = false, @@ -1065,7 +1130,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Phone", Width = 150, - ListOrderNo = 9, + ListOrderNo = 11, Visible = true, IsActive = true, IsDeleted = false, @@ -1998,13 +2063,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc id = "@Id" }) }, - new() { - ButtonPosition= UiCommandButtonPositionTypeEnum.Toolbar, - Hint = "Branches", - Text = "Branches", - AuthName = AppCodes.Branches, - Url = "/admin/list/list-branch", - }, new() { Hint = "Branches", Text = "Branches", @@ -17982,848 +18040,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc } #endregion - #region Bank - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Bank)) - { - var listFormBank = 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 = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.Bank, - Name = AppCodes.Definitions.Bank, - Title = AppCodes.Definitions.Bank, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = true, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.Bank, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("Bank", 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.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - D = AppCodes.Definitions.Bank + ".Delete", - E = AppCodes.Definitions.Bank + ".Export", - I = AppCodes.Definitions.Bank + ".Import", - }), - DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Bank", 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 = "Bank Form", - Width = 600, - Height = 600 - }, - 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 = "IdentifierCode", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox}, - new EditingFormItemDto { Order = 3, DataField = "AddressLine1", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField = "AddressLine2", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 5, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 6, DataField = "City", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 7, DataField = "District", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 8, DataField = "PostalCode", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 9, DataField = "Phone", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 10, DataField = "Email", ColSpan = 2, 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 } - }), - CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { - new() { - Hint = "Manage", - Text ="Manage", - UrlTarget="_blank", - AuthName = AppCodes.Definitions.Bank + ".Update", - Url=$"/admin/form/{ListFormCodes.Forms.FormBank}/@Id" - }, - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "Country", - FieldDbType = DbType.String, - Value = "TR", - CustomValueType = FieldCustomValueTypeEnum.Value } - }) - } - ); - - #region Bank Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { - new() { - ListFormCode = listFormBank.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.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Name", - 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.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "IdentifierCode", - Width = 150, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "AddressLine1", - Width = 150, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "AddressLine2", - Width = 150, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Country", - Width = 100, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = lookupQueryCountryValues, - CascadeEmptyFields = "City,District,Street" - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "City", - Width = 100, - ListOrderNo = 7, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = lookupQueryCityValues, - CascadeRelationField = "Country", - CascadeFilterOperator="=", - CascadeParentFields = "Country", - CascadeEmptyFields = "District,Street" - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "District", - Width = 100, - ListOrderNo = 8, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = lookupQueryDistrictValues, - CascadeRelationField = "City", - CascadeFilterOperator="=", - CascadeParentFields = "Country,City", - CascadeEmptyFields = "Street", - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "PostalCode", - Width = 150, - ListOrderNo = 9, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Phone", - Width = 150, - ListOrderNo = 10, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBank.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "Email", - Width = 150, - ListOrderNo = 11, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.Bank + ".Create", - R = AppCodes.Definitions.Bank, - U = AppCodes.Definitions.Bank + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - }); - #endregion - } - #endregion - - #region BankAccount - if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BankAccount)) - { - var listFormBankAccount = 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 = 4 - }), - CultureName = LanguageCodes.En, - ListFormCode = ListFormCodes.Lists.BankAccount, - Name = AppCodes.Definitions.BankAccount, - Title = AppCodes.Definitions.BankAccount, - DataSourceCode = SeedConsts.DataSources.DefaultCode, - IsTenant = true, - IsBranch = false, - IsOrganizationUnit = false, - Description = AppCodes.Definitions.BankAccount, - SelectCommandType = SelectCommandTypeEnum.Table, - SelectCommand = SelectCommandByTableName("BankAccount", 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.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - D = AppCodes.Definitions.BankAccount + ".Delete", - E = AppCodes.Definitions.BankAccount + ".Export", - I = AppCodes.Definitions.BankAccount + ".Import", - }), - DeleteCommand = $"UPDATE \"{SelectCommandByTableName("BankAccount", 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 = "Bank Account Form", - Width = 600, - Height = 300 - }, - 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 = "AccountNumber", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 2, DataField = "BankId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 3, DataField = "AccountOwner", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, - new EditingFormItemDto { Order = 4, DataField = "CurrencyId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, - new EditingFormItemDto { Order = 5, DataField = "CanTransferMoney", ColSpan = 2, 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 } - }), - FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { - new() { - FieldName = "CanTransferMoney", - FieldDbType = DbType.Boolean, - Value = "false", - CustomValueType = FieldCustomValueTypeEnum.Value } - }), - } - ); - - #region Bank Account Fields - await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { - new() { - ListFormCode = listFormBankAccount.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.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBankAccount.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "AccountNumber", - 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.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBankAccount.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "BankId", - Width = 250, - ListOrderNo = 3, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\".\"Id\" AS \"Key\", \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\".\"Name\"", - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBankAccount.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.String, - FieldName = "AccountOwner", - Width = 250, - ListOrderNo = 4, - Visible = true, - IsActive = true, - IsDeleted = false, - SortIndex = 1, - AllowSearch = true, - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { - new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBankAccount.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Guid, - FieldName = "CurrencyId", - Width = 150, - ListOrderNo = 5, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - LookupJson = JsonSerializer.Serialize(new LookupDto - { - DataSourceType = UiLookupDataSourceTypeEnum.Query, - DisplayExpr = "Name", - ValueExpr = "Key", - LookupQuery = $"SELECT \"{Prefix.DbTableDefault}Currency\".\"Id\" AS \"Key\", \"{Prefix.DbTableDefault}Currency\".\"Code\" as \"Name\" FROM \"{Prefix.DbTableDefault}Currency\" ORDER BY \"{Prefix.DbTableDefault}Currency\".\"Name\"", - }), - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - new() { - ListFormCode = listFormBankAccount.ListFormCode, - RoleId = null, - UserId = null, - CultureName = LanguageCodes.En, - SourceDbType = DbType.Boolean, - FieldName = "CanTransferMoney", - Width = 50, - ListOrderNo = 6, - Visible = true, - IsActive = true, - IsDeleted = false, - AllowSearch = true, - PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto - { - C = AppCodes.Definitions.BankAccount + ".Create", - R = AppCodes.Definitions.BankAccount, - U = AppCodes.Definitions.BankAccount + ".Update", - E = true, - I = true, - Deny = false - }), - PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto - { - IsPivot = true - }) - }, - }); - #endregion - } - #endregion - #region Behavior if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Behavior)) { @@ -23353,12 +22569,11 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc 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 }, + new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Phone", 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 = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, ] } }), @@ -23428,35 +22643,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc }), 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() { @@ -23465,7 +22651,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Name", Width = 200, - ListOrderNo = 3, + ListOrderNo = 2, Visible = true, IsActive = true, IsDeleted = false, @@ -23495,7 +22681,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Phone", Width = 150, - ListOrderNo = 4, + ListOrderNo = 3, Visible = true, IsActive = true, IsDeleted = false, @@ -23518,7 +22704,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Email", Width = 200, - ListOrderNo = 5, + ListOrderNo = 4, Visible = true, IsActive = true, IsDeleted = false, @@ -23541,7 +22727,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Address", Width = 300, - ListOrderNo = 6, + ListOrderNo = 5, Visible = true, IsActive = true, IsDeleted = false, @@ -23564,7 +22750,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Status", Width = 150, - ListOrderNo = 7, + ListOrderNo = 6, Visible = true, IsActive = true, IsDeleted = false, @@ -23593,315 +22779,6 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc } #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 = false, - 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 = 1, - 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)) { @@ -24011,7 +22888,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc new EditingFormItemDto { Order = 10, DataField = "Phone4", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 11, DataField = "Fax", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 12, DataField = "Description", ColSpan = 1, EditorType2 = EditorTypes.dxTextArea }, - new EditingFormItemDto { Order = 13, DataField = "Status", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 13, DataField = "Status", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, ] } }), @@ -24179,7 +23056,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc ListFormCode = listFormLawyer.ListFormCode, CultureName = LanguageCodes.En, SourceDbType = DbType.String, - FieldName = "City", + FieldName = "TaxOffice", Width = 150, ListOrderNo = 6, Visible = true, @@ -24200,38 +23077,13 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc }) }, 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, + ListOrderNo = 7, Visible = true, IsActive = true, IsDeleted = false, @@ -24258,7 +23110,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Phone1", Width = 150, - ListOrderNo = 9, + ListOrderNo = 8, Visible = true, IsActive = true, IsDeleted = false, @@ -24283,7 +23135,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Phone2", Width = 150, - ListOrderNo = 10, + ListOrderNo = 9, Visible = true, IsActive = true, IsDeleted = false, @@ -24308,7 +23160,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Phone3", Width = 150, - ListOrderNo = 11, + ListOrderNo = 10, Visible = true, IsActive = true, IsDeleted = false, @@ -24333,7 +23185,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Phone4", Width = 150, - ListOrderNo = 12, + ListOrderNo = 11, Visible = true, IsActive = true, IsDeleted = false, @@ -24358,7 +23210,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Fax", Width = 150, - ListOrderNo = 13, + ListOrderNo = 12, Visible = true, IsActive = true, IsDeleted = false, @@ -24385,7 +23237,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Description", Width = 300, - ListOrderNo = 14, + ListOrderNo = 13, Visible = true, IsActive = true, IsDeleted = false, @@ -24410,7 +23262,7 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc SourceDbType = DbType.String, FieldName = "Status", Width = 120, - ListOrderNo = 15, + ListOrderNo = 14, Visible = true, IsActive = true, IsDeleted = false, @@ -24423,7 +23275,11 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc 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 }), + 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 }) }, }); @@ -24602,6 +23458,10 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc ValueExpr = "Key", LookupQuery = lookupQueryBranchValues, }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { C = AppCodes.Definitions.RegistrationType + ".Create", @@ -24850,6 +23710,10 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc ValueExpr = "Key", LookupQuery = lookupQueryBranchValues, }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { C = AppCodes.Definitions.RegistrationMethod + ".Create", @@ -25130,6 +23994,10 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc ValueExpr = "Key", LookupQuery = lookupQueryBranchValues, }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { C = AppCodes.Definitions.ClassType + ".Create", @@ -25453,6 +24321,10 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc ValueExpr = "Key", LookupQuery = lookupQueryBranchValues, }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { C = AppCodes.Definitions.Class + ".Create", @@ -25734,6 +24606,10 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc ValueExpr = "Key", LookupQuery = lookupQueryBranchValues, }), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { C = AppCodes.Definitions.Level + ".Create", @@ -26101,7 +24977,10 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc ValueExpr = "Key", LookupQuery = lookupQueryBranchValues, }), - ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[]{}), + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] + { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required) } + }), PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto { C = AppCodes.Definitions.LessonPeriod + ".Create", @@ -26995,6 +25874,1221 @@ public class PlatformListFormsSeeder : IDataSeedContributor, ITransientDependenc } #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 = 1, + 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 Bank + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Bank)) + { + var listFormBank = 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 = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Bank, + Name = AppCodes.Definitions.Bank, + Title = AppCodes.Definitions.Bank, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Bank, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Bank", 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.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + D = AppCodes.Definitions.Bank + ".Delete", + E = AppCodes.Definitions.Bank + ".Export", + I = AppCodes.Definitions.Bank + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("Bank", 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 = "Bank Form", + Width = 600, + Height = 600 + }, + 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 = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "IdentifierCode", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox}, + new EditingFormItemDto { Order = 4, DataField = "AddressLine1", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "AddressLine2", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField = "Country", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 7, DataField = "City", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 8, DataField = "District", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 9, DataField = "PostalCode", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 10, DataField = "Phone", ColSpan = 2, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 11, DataField = "Email", ColSpan = 2, 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 } + }), + CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] { + new() { + Hint = "Manage", + Text ="Manage", + UrlTarget="_blank", + AuthName = AppCodes.Definitions.Bank + ".Update", + Url=$"/admin/form/{ListFormCodes.Forms.FormBank}/@Id" + }, + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "Country", + FieldDbType = DbType.String, + Value = "TR", + CustomValueType = FieldCustomValueTypeEnum.Value } + }) + } + ); + + #region Bank Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new() { + ListFormCode = listFormBank.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.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + // BranchId + new() + { + ListFormCode = listFormBank.ListFormCode, + CultureName = LanguageCodes.En, + RoleId = null, + UserId = null, + 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.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 150, + 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.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "IdentifierCode", + Width = 150, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AddressLine1", + Width = 150, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AddressLine2", + Width = 150, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Country", + Width = 100, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryCountryValues, + CascadeEmptyFields = "City,District,Street" + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "City", + Width = 100, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryCityValues, + CascadeRelationField = "Country", + CascadeFilterOperator="=", + CascadeParentFields = "Country", + CascadeEmptyFields = "District,Street" + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "District", + Width = 100, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = lookupQueryDistrictValues, + CascadeRelationField = "City", + CascadeFilterOperator="=", + CascadeParentFields = "Country,City", + CascadeEmptyFields = "Street", + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "PostalCode", + Width = 150, + ListOrderNo = 10, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Phone", + Width = 150, + ListOrderNo = 11, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBank.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Email", + Width = 150, + ListOrderNo = 12, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Bank + ".Create", + R = AppCodes.Definitions.Bank, + U = AppCodes.Definitions.Bank + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + }); + #endregion + } + #endregion + + #region BankAccount + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.BankAccount)) + { + var listFormBankAccount = 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 = 4 + }), + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.BankAccount, + Name = AppCodes.Definitions.BankAccount, + Title = AppCodes.Definitions.BankAccount, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = true, + IsBranch = true, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.BankAccount, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("BankAccount", 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.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + D = AppCodes.Definitions.BankAccount + ".Delete", + E = AppCodes.Definitions.BankAccount + ".Export", + I = AppCodes.Definitions.BankAccount + ".Import", + }), + DeleteCommand = $"UPDATE \"{SelectCommandByTableName("BankAccount", 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 = "Bank Account Form", + Width = 600, + Height = 300 + }, + 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 = "BankId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 2, DataField = "BranchId", ColSpan = 1, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox }, + new EditingFormItemDto { Order = 3, DataField = "AccountNumber", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "AccountOwner", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "CurrencyId", ColSpan = 2, IsRequired = true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton }, + new EditingFormItemDto { Order = 6, DataField = "CanTransferMoney", ColSpan = 2, 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 } + }), + FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] { + new() { + FieldName = "CanTransferMoney", + FieldDbType = DbType.Boolean, + Value = "false", + CustomValueType = FieldCustomValueTypeEnum.Value } + }), + } + ); + + #region Bank Account Fields + await _listFormFieldRepository.InsertManyAsync(new ListFormField[] { + new() { + ListFormCode = listFormBankAccount.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.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBankAccount.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "BankId", + Width = 250, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\".\"Id\" AS \"Key\", \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\".\"Name\" as \"Name\" FROM \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\" ORDER BY \"{SelectCommandByTableName("Bank", Prefix.DbTableDefinition)}\".\"Name\"", + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + // BranchId + new() + { + ListFormCode = listFormBankAccount.ListFormCode, + CultureName = LanguageCodes.En, + RoleId = null, + UserId = null, + SourceDbType = DbType.Guid, + FieldName = "BranchId", + Width = 150, + ListOrderNo = 3, + 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.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto { IsPivot = true }) + }, + new() { + ListFormCode = listFormBankAccount.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AccountNumber", + Width = 150, + 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.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBankAccount.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "AccountOwner", + Width = 250, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + SortIndex = 1, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new ValidationRuleDto[] { + new ValidationRuleDto() { Type = Enum.GetName(UiColumnValidationRuleTypeEnum.required)} + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBankAccount.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "CurrencyId", + Width = 150, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + LookupJson = JsonSerializer.Serialize(new LookupDto + { + DataSourceType = UiLookupDataSourceTypeEnum.Query, + DisplayExpr = "Name", + ValueExpr = "Key", + LookupQuery = $"SELECT \"{Prefix.DbTableDefault}Currency\".\"Id\" AS \"Key\", \"{Prefix.DbTableDefault}Currency\".\"Code\" as \"Name\" FROM \"{Prefix.DbTableDefault}Currency\" ORDER BY \"{Prefix.DbTableDefault}Currency\".\"Name\"", + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".Update", + E = true, + I = true, + Deny = false + }), + PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto + { + IsPivot = true + }) + }, + new() { + ListFormCode = listFormBankAccount.ListFormCode, + RoleId = null, + UserId = null, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "CanTransferMoney", + Width = 50, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.BankAccount + ".Create", + R = AppCodes.Definitions.BankAccount, + U = AppCodes.Definitions.BankAccount + ".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/TenantData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/TenantData.json index a78430b3..7f7fb63a 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/TenantData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/TenantData.json @@ -7388,8 +7388,8 @@ { "resourceName": "Platform", "key": "App.Parameters", - "tr": "Parametreler", - "en": "Parameters" + "tr": "Ana Tanımlar", + "en": "Master Definitions" }, { "resourceName": "Platform", @@ -13344,11 +13344,21 @@ "RequiredPermissionName": "AbpTenantManagement.Tenants", "IsDisabled": false }, + { + "ParentCode": "App.Saas", + "Code": "App.Branches", + "DisplayName": "App.Branches", + "Order": 2, + "Url": "/admin/list/list-branch", + "Icon": "FcTreeStructure", + "RequiredPermissionName": "App.Branches", + "IsDisabled": false + }, { "ParentCode": "App.Saas", "Code": "App.Settings", "DisplayName": "App.Settings", - "Order": 2, + "Order": 3, "Url": null, "Icon": "FcCircuit", "RequiredPermissionName": null, @@ -13378,7 +13388,7 @@ "ParentCode": "App.Saas", "Code": "App.Languages", "DisplayName": "App.Languages", - "Order": 3, + "Order": 4, "Url": null, "Icon": "FcGlobe", "RequiredPermissionName": null, @@ -13408,7 +13418,7 @@ "ParentCode": "App.Saas", "Code": "App.Routes", "DisplayName": "App.Routes", - "Order": 4, + "Order": 5, "Url": "/admin/list/list-route", "Icon": "FaSynagogue", "RequiredPermissionName": "App.Routes", @@ -13418,7 +13428,7 @@ "ParentCode": "App.Saas", "Code": "App.Menus", "DisplayName": "App.Menus", - "Order": 5, + "Order": 6, "Url": null, "Icon": "FaSchlix", "RequiredPermissionName": null, @@ -13448,7 +13458,7 @@ "ParentCode": "App.Saas", "Code": "App.Listforms", "DisplayName": "App.Listforms", - "Order": 6, + "Order": 7, "Url": null, "Icon": "FcList", "RequiredPermissionName": null, @@ -13488,7 +13498,7 @@ "ParentCode": "App.Saas", "Code": "App.Notifications", "DisplayName": "App.Notifications", - "Order": 7, + "Order": 8, "Url": null, "Icon": "FcWorkflow", "RequiredPermissionName": null, @@ -13518,7 +13528,7 @@ "ParentCode": "App.Saas", "Code": "App.BackgroundWorkers", "DisplayName": "App.BackgroundWorkers", - "Order": 8, + "Order": 9, "Url": "/admin/list/list-backgroundworker", "Icon": "FcScatterPlot", "RequiredPermissionName": "App.BackgroundWorkers", @@ -13528,7 +13538,7 @@ "ParentCode": "App.Saas", "Code": "App.ForumManagement", "DisplayName": "App.ForumManagement", - "Order": 9, + "Order": 10, "Url": "/admin/forumManagement", "Icon": "FcReading", "RequiredPermissionName": "App.ForumManagement", @@ -13538,7 +13548,7 @@ "ParentCode": "App.Saas", "Code": "App.Parameters", "DisplayName": "App.Parameters", - "Order": 10, + "Order": 11, "Url": null, "Icon": "FcFilingCabinet", "RequiredPermissionName": null, @@ -13987,21 +13997,11 @@ "RequiredPermissionName": "App.Definitions.UomCategory", "IsDisabled": false }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.Bank", - "DisplayName": "App.Definitions.Bank", - "Order": 4, - "Url": "/admin/list/list-bank", - "Icon": "FcMoneyTransfer", - "RequiredPermissionName": "App.Definitions.Bank", - "IsDisabled": false - }, { "ParentCode": "App.Definitions", "Code": "App.Definitions.Behavior", "DisplayName": "App.Definitions.Behavior", - "Order": 5, + "Order": 4, "Url": "/admin/list/list-behavior", "Icon": "FcPuzzle", "RequiredPermissionName": "App.Definitions.Behavior", @@ -14011,7 +14011,7 @@ "ParentCode": "App.Definitions", "Code": "App.Definitions.Disease", "DisplayName": "App.Definitions.Disease", - "Order": 6, + "Order": 5, "Url": "/admin/list/list-disease", "Icon": "FcBiohazard", "RequiredPermissionName": "App.Definitions.Disease", @@ -14021,7 +14021,7 @@ "ParentCode": "App.Definitions", "Code": "App.Definitions.Document", "DisplayName": "App.Definitions.Document", - "Order": 7, + "Order": 6, "Url": "/admin/list/list-document", "Icon": "FcDocument", "RequiredPermissionName": "App.Definitions.Document", @@ -14031,7 +14031,7 @@ "ParentCode": "App.Definitions", "Code": "App.Definitions.EducationStatus", "DisplayName": "App.Definitions.EducationStatus", - "Order": 8, + "Order": 7, "Url": "/admin/list/list-educationstatus", "Icon": "FcGraduationCap", "RequiredPermissionName": "App.Definitions.EducationStatus", @@ -14041,7 +14041,7 @@ "ParentCode": "App.Definitions", "Code": "App.Definitions.EventType", "DisplayName": "App.Definitions.EventType", - "Order": 9, + "Order": 8, "Url": "/admin/list/list-eventtype", "Icon": "FcPlanner", "RequiredPermissionName": "App.Definitions.EventType", @@ -14051,7 +14051,7 @@ "ParentCode": "App.Definitions", "Code": "App.Definitions.EventCategory", "DisplayName": "App.Definitions.EventCategory", - "Order": 10, + "Order": 9, "Url": "/admin/list/list-eventcategory", "Icon": "FcTreeStructure", "RequiredPermissionName": "App.Definitions.EventCategory", @@ -14061,117 +14061,27 @@ "ParentCode": "App.Definitions", "Code": "App.Definitions.Event", "DisplayName": "App.Definitions.Event", - "Order": 11, + "Order": 10, "Url": "/admin/list/list-event", "Icon": "FcCalendar", "RequiredPermissionName": "App.Definitions.Event", "IsDisabled": false }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.MeetingMethod", - "DisplayName": "App.Definitions.MeetingMethod", - "Order": 12, - "Url": "/admin/list/list-meetingmethod", - "Icon": "FcCollaboration", - "RequiredPermissionName": "App.Definitions.MeetingMethod", - "IsDisabled": false - }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.MeetingResult", - "DisplayName": "App.Definitions.MeetingResult", - "Order": 13, - "Url": "/admin/list/list-meetingresult", - "Icon": "FcApproval", - "RequiredPermissionName": "App.Definitions.MeetingResult", - "IsDisabled": false - }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.Program", - "DisplayName": "App.Definitions.Program", - "Order": 14, - "Url": "/admin/list/list-program", - "Icon": "FcFlowChart", - "RequiredPermissionName": "App.Definitions.Program", - "IsDisabled": false - }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.Interesting", - "DisplayName": "App.Definitions.Interesting", - "Order": 15, - "Url": "/admin/list/list-interesting", - "Icon": "FcIdea", - "RequiredPermissionName": "App.Definitions.Interesting", - "IsDisabled": false - }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.SalesRejectionReason", - "DisplayName": "App.Definitions.SalesRejectionReason", - "Order": 16, - "Url": "/admin/list/list-salesrejectionreason", - "Icon": "FcCancel", - "RequiredPermissionName": "App.Definitions.SalesRejectionReason", - "IsDisabled": false - }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.Source", - "DisplayName": "App.Definitions.Source", - "Order": 17, - "Url": "/admin/list/list-source", - "Icon": "FcAdvertising", - "RequiredPermissionName": "App.Definitions.Source", - "IsDisabled": false - }, { "ParentCode": "App.Definitions", "Code": "App.Definitions.Vaccine", "DisplayName": "App.Definitions.Vaccine", - "Order": 18, + "Order": 11, "Url": "/admin/list/list-vaccine", "Icon": "FcBiotech", "RequiredPermissionName": "App.Definitions.Vaccine", "IsDisabled": false }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.NoteType", - "DisplayName": "App.Definitions.NoteType", - "Order": 19, - "Url": "/admin/list/list-notetype", - "Icon": "FcTodoList", - "RequiredPermissionName": "App.Definitions.NoteType", - "IsDisabled": false - }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.ClassCancellationReason", - "DisplayName": "App.Definitions.ClassCancellationReason", - "Order": 20, - "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": 21, - "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": 22, + "Order": 12, "Url": "/admin/list/list-vehicle", "Icon": "FcAutomotive", "RequiredPermissionName": "App.Definitions.Vehicle", @@ -14181,17 +14091,27 @@ "ParentCode": "App.Definitions", "Code": "App.Definitions.Psychologist", "DisplayName": "App.Definitions.Psychologist", - "Order": 23, + "Order": 13, "Url": "/admin/list/list-psychologist", "Icon": "FcMindMap", "RequiredPermissionName": "App.Definitions.Psychologist", "IsDisabled": false }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.WorkHour", + "DisplayName": "App.Definitions.WorkHour", + "Order": 14, + "Url": "/admin/list/list-workhour", + "Icon": "FcClock", + "RequiredPermissionName": "App.Definitions.WorkHour", + "IsDisabled": false + }, { "ParentCode": "App.Definitions", "Code": "App.Definitions.Lawyer", "DisplayName": "App.Definitions.Lawyer", - "Order": 24, + "Order": 15, "Url": "/admin/list/list-lawyer", "Icon": "FcBusinessman", "RequiredPermissionName": "App.Definitions.Lawyer", @@ -14201,92 +14121,152 @@ "ParentCode": "App.Definitions", "Code": "App.Definitions.Meal", "DisplayName": "App.Definitions.Meal", - "Order": 25, + "Order": 16, "Url": "/admin/list/list-meal", "Icon": "FcLike", "RequiredPermissionName": "App.Definitions.Meal", "IsDisabled": false }, - { - "ParentCode": "App.Definitions", - "Code": "App.Definitions.Schedule", - "DisplayName": "App.Definitions.Schedule", - "Order": 26, - "Url": "/admin/list/list-schedule", - "Icon": "FcPlanner", - "RequiredPermissionName": "App.Definitions.Schedule", - "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": 32, - "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": 33, - "Url": "/admin/list/list-level", - "Icon": "FcGraduationCap", - "RequiredPermissionName": "App.Definitions.Level", - "IsDisabled": false - }, { "ParentCode": null, - "Code": "App.Participant", - "DisplayName": "Kursiyer", + "Code": "App.CRM", + "DisplayName": "App.CRM", "Order": 400, "Url": null, - "Icon": "FcConferenceCall", + "Icon": "FcContacts", "RequiredPermissionName": null, "IsDisabled": false }, + { + "ParentCode": "App.CRM", + "Code": "App.CRM.Definitions", + "DisplayName": "App.Definitions", + "Order": 1, + "Url": null, + "Icon": "FcFilingCabinet", + "RequiredPermissionName": null, + "IsDisabled": false + }, + { + "ParentCode": "App.CRM.Definitions", + "Code": "App.Definitions.MeetingMethod", + "DisplayName": "App.Definitions.MeetingMethod", + "Order": 1, + "Url": "/admin/list/list-meetingmethod", + "Icon": "FcCollaboration", + "RequiredPermissionName": "App.Definitions.MeetingMethod", + "IsDisabled": false + }, + { + "ParentCode": "App.CRM.Definitions", + "Code": "App.Definitions.MeetingResult", + "DisplayName": "App.Definitions.MeetingResult", + "Order": 2, + "Url": "/admin/list/list-meetingresult", + "Icon": "FcApproval", + "RequiredPermissionName": "App.Definitions.MeetingResult", + "IsDisabled": false + }, + { + "ParentCode": "App.CRM.Definitions", + "Code": "App.Definitions.Source", + "DisplayName": "App.Definitions.Source", + "Order": 3, + "Url": "/admin/list/list-source", + "Icon": "FcAdvertising", + "RequiredPermissionName": "App.Definitions.Source", + "IsDisabled": false + }, + { + "ParentCode": "App.CRM.Definitions", + "Code": "App.Definitions.Interesting", + "DisplayName": "App.Definitions.Interesting", + "Order": 4, + "Url": "/admin/list/list-interesting", + "Icon": "FcIdea", + "RequiredPermissionName": "App.Definitions.Interesting", + "IsDisabled": false + }, + { + "ParentCode": "App.CRM.Definitions", + "Code": "App.Definitions.SalesRejectionReason", + "DisplayName": "App.Definitions.SalesRejectionReason", + "Order": 5, + "Url": "/admin/list/list-salesrejectionreason", + "Icon": "FcCancel", + "RequiredPermissionName": "App.Definitions.SalesRejectionReason", + "IsDisabled": false + }, + { + "ParentCode": "App.CRM.Definitions", + "Code": "App.Definitions.NoteType", + "DisplayName": "App.Definitions.NoteType", + "Order": 6, + "Url": "/admin/list/list-notetype", + "Icon": "FcTodoList", + "RequiredPermissionName": "App.Definitions.NoteType", + "IsDisabled": false + }, + { + "ParentCode": "App.CRM", + "Code": "App.CRM.Customers", + "DisplayName": "App.CRM.Customers", + "Order": 2, + "Url": "/admin/crm/customers", + "Icon": "FcBusinessman", + "RequiredPermissionName": "App.CRM.Customers", + "IsDisabled": false + }, + { + "ParentCode": "App.CRM", + "Code": "App.CRM.SalesTeams", + "DisplayName": "App.CRM.SalesTeams", + "Order": 3, + "Url": "/admin/crm/sales-teams", + "Icon": "FcCollaboration", + "RequiredPermissionName": "App.CRM.SalesTeams", + "IsDisabled": false + }, + { + "ParentCode": "App.CRM", + "Code": "App.CRM.LossReasons", + "DisplayName": "App.CRM.LossReasons", + "Order": 4, + "Url": "/admin/crm/loss-reasons", + "Icon": "FcHighPriority", + "RequiredPermissionName": "App.CRM.LossReasons", + "IsDisabled": false + }, + { + "ParentCode": "App.CRM", + "Code": "App.CRM.Opportunities", + "DisplayName": "App.CRM.Opportunities", + "Order": 5, + "Url": "/admin/crm/opportunities", + "Icon": "FcIdea", + "RequiredPermissionName": "App.CRM.Opportunities", + "IsDisabled": false + }, + { + "ParentCode": "App.CRM", + "Code": "App.CRM.Activities", + "DisplayName": "App.CRM.Activities", + "Order": 6, + "Url": "/admin/crm/activities", + "Icon": "FcCalendar", + "RequiredPermissionName": "App.CRM.Activities", + "IsDisabled": false + }, + { + "ParentCode": "App.CRM", + "Code": "App.CRM.SalesOrders", + "DisplayName": "App.CRM.SalesOrders", + "Order": 7, + "Url": "/admin/crm/sales-orders", + "Icon": "FcShop", + "RequiredPermissionName": "App.CRM.SalesOrders", + "IsDisabled": false + }, { "ParentCode": null, "Code": "App.Coordinator", @@ -14297,11 +14277,111 @@ "RequiredPermissionName": null, "IsDisabled": false }, + { + "ParentCode": "App.Coordinator", + "Code": "App.Coordinator.Definitions", + "DisplayName": "App.Definitions", + "Order": 1, + "Url": null, + "Icon": "FcFilingCabinet", + "RequiredPermissionName": null, + "IsDisabled": false + }, + { + "ParentCode": "App.Coordinator.Definitions", + "Code": "App.Definitions.Program", + "DisplayName": "App.Definitions.Program", + "Order": 1, + "Url": "/admin/list/list-program", + "Icon": "FcFlowChart", + "RequiredPermissionName": "App.Definitions.Program", + "IsDisabled": false + }, + { + "ParentCode": "App.Coordinator.Definitions", + "Code": "App.Definitions.Schedule", + "DisplayName": "App.Definitions.Schedule", + "Order": 2, + "Url": "/admin/list/list-schedule", + "Icon": "FcPlanner", + "RequiredPermissionName": "App.Definitions.Schedule", + "IsDisabled": false + }, + { + "ParentCode": "App.Coordinator.Definitions", + "Code": "App.Definitions.RegistrationType", + "DisplayName": "App.Definitions.RegistrationType", + "Order": 3, + "Url": "/admin/list/list-registrationtype", + "Icon": "FcTodoList", + "RequiredPermissionName": "App.Definitions.RegistrationType", + "IsDisabled": false + }, + { + "ParentCode": "App.Coordinator.Definitions", + "Code": "App.Definitions.RegistrationMethod", + "DisplayName": "App.Definitions.RegistrationMethod", + "Order": 4, + "Url": "/admin/list/list-registrationmethod", + "Icon": "FcCollaboration", + "RequiredPermissionName": "App.Definitions.RegistrationMethod", + "IsDisabled": false + }, + { + "ParentCode": "App.Coordinator.Definitions", + "Code": "App.Definitions.ClassType", + "DisplayName": "App.Definitions.ClassType", + "Order": 5, + "Url": "/admin/list/list-classtype", + "Icon": "FcTreeStructure", + "RequiredPermissionName": "App.Definitions.ClassType", + "IsDisabled": false + }, + { + "ParentCode": "App.Coordinator.Definitions", + "Code": "App.Definitions.Class", + "DisplayName": "App.Definitions.Class", + "Order": 6, + "Url": "/admin/list/list-class", + "Icon": "FcConferenceCall", + "RequiredPermissionName": "App.Definitions.Class", + "IsDisabled": false + }, + { + "ParentCode": "App.Coordinator.Definitions", + "Code": "App.Definitions.Level", + "DisplayName": "App.Definitions.Level", + "Order": 7, + "Url": "/admin/list/list-level", + "Icon": "FcGraduationCap", + "RequiredPermissionName": "App.Definitions.Level", + "IsDisabled": false + }, + { + "ParentCode": "App.Coordinator.Definitions", + "Code": "App.Definitions.ClassCancellationReason", + "DisplayName": "App.Definitions.ClassCancellationReason", + "Order": 8, + "Url": "/admin/list/list-classcancellationreason", + "Icon": "FcDisapprove", + "RequiredPermissionName": "App.Definitions.ClassCancellationReason", + "IsDisabled": false + }, + { + "ParentCode": "App.Coordinator.Definitions", + "Code": "App.Definitions.LessonPeriod", + "DisplayName": "App.Definitions.LessonPeriod", + "Order": 9, + "Url": "/admin/list/list-lessonperiod", + "Icon": "FcClock", + "RequiredPermissionName": "App.Definitions.LessonPeriod", + "IsDisabled": false + }, { "ParentCode": "App.Coordinator", "Code": "App.Classroom", "DisplayName": "App.Classroom", - "Order": 5, + "Order": 2, "Url": "/admin/classroom/dashboard", "Icon": "FcNeutralDecision", "RequiredPermissionName": "App.Classroom.Dashboard", @@ -14787,76 +14867,6 @@ "RequiredPermissionName": "App.HR.Evaluation", "IsDisabled": false }, - { - "ParentCode": null, - "Code": "App.CRM", - "DisplayName": "App.CRM", - "Order": 1100, - "Url": null, - "Icon": "FcContacts", - "RequiredPermissionName": null, - "IsDisabled": false - }, - { - "ParentCode": "App.CRM", - "Code": "App.CRM.Customers", - "DisplayName": "App.CRM.Customers", - "Order": 1, - "Url": "/admin/crm/customers", - "Icon": "FcBusinessman", - "RequiredPermissionName": "App.CRM.Customers", - "IsDisabled": false - }, - { - "ParentCode": "App.CRM", - "Code": "App.CRM.SalesTeams", - "DisplayName": "App.CRM.SalesTeams", - "Order": 2, - "Url": "/admin/crm/sales-teams", - "Icon": "FcCollaboration", - "RequiredPermissionName": "App.CRM.SalesTeams", - "IsDisabled": false - }, - { - "ParentCode": "App.CRM", - "Code": "App.CRM.LossReasons", - "DisplayName": "App.CRM.LossReasons", - "Order": 3, - "Url": "/admin/crm/loss-reasons", - "Icon": "FcHighPriority", - "RequiredPermissionName": "App.CRM.LossReasons", - "IsDisabled": false - }, - { - "ParentCode": "App.CRM", - "Code": "App.CRM.Opportunities", - "DisplayName": "App.CRM.Opportunities", - "Order": 4, - "Url": "/admin/crm/opportunities", - "Icon": "FcIdea", - "RequiredPermissionName": "App.CRM.Opportunities", - "IsDisabled": false - }, - { - "ParentCode": "App.CRM", - "Code": "App.CRM.Activities", - "DisplayName": "App.CRM.Activities", - "Order": 5, - "Url": "/admin/crm/activities", - "Icon": "FcCalendar", - "RequiredPermissionName": "App.CRM.Activities", - "IsDisabled": false - }, - { - "ParentCode": "App.CRM", - "Code": "App.CRM.SalesOrders", - "DisplayName": "App.CRM.SalesOrders", - "Order": 6, - "Url": "/admin/crm/sales-orders", - "Icon": "FcShop", - "RequiredPermissionName": "App.CRM.SalesOrders", - "IsDisabled": false - }, { "ParentCode": null, "Code": "App.MRP", @@ -14967,11 +14977,21 @@ "RequiredPermissionName": null, "IsDisabled": false }, + { + "ParentCode": "App.Accounting", + "Code": "App.Definitions.Bank", + "DisplayName": "App.Definitions.Bank", + "Order": 1, + "Url": "/admin/list/list-bank", + "Icon": "FcMoneyTransfer", + "RequiredPermissionName": "App.Definitions.Bank", + "IsDisabled": false + }, { "ParentCode": "App.Accounting", "Code": "App.Accounting.CurrentAccounts", "DisplayName": "App.Accounting.CurrentAccounts", - "Order": 1, + "Order": 2, "Url": "/admin/accounting/current-accounts", "Icon": "FcDebt", "RequiredPermissionName": "App.Accounting.CurrentAccounts", @@ -14981,7 +15001,7 @@ "ParentCode": "App.Accounting", "Code": "App.Accounting.Waybills", "DisplayName": "App.Accounting.Waybills", - "Order": 2, + "Order": 3, "Url": "/admin/accounting/waybills", "Icon": "FcSurvey", "RequiredPermissionName": "App.Accounting.Waybills", @@ -14991,7 +15011,7 @@ "ParentCode": "App.Accounting", "Code": "App.Accounting.Invoices", "DisplayName": "App.Accounting.Invoices", - "Order": 3, + "Order": 4, "Url": "/admin/accounting/invoices", "Icon": "FcSalesPerformance", "RequiredPermissionName": "App.Accounting.Invoices", @@ -15001,7 +15021,7 @@ "ParentCode": "App.Accounting", "Code": "App.Accounting.Cash", "DisplayName": "App.Accounting.Cash", - "Order": 4, + "Order": 5, "Url": "/admin/accounting/cash", "Icon": "FcMoneyTransfer", "RequiredPermissionName": "App.Accounting.Cash", @@ -15011,7 +15031,7 @@ "ParentCode": "App.Accounting", "Code": "App.Accounting.Bank", "DisplayName": "App.Accounting.Bank", - "Order": 5, + "Order": 6, "Url": "/admin/accounting/bank", "Icon": "FcSalesPerformance", "RequiredPermissionName": "App.Accounting.Bank", @@ -15021,7 +15041,7 @@ "ParentCode": "App.Accounting", "Code": "App.Accounting.CheckNote", "DisplayName": "App.Accounting.CheckNote", - "Order": 6, + "Order": 7, "Url": "/admin/accounting/check-note", "Icon": "FcInspection", "RequiredPermissionName": "App.Accounting.CheckNote", @@ -18988,7 +19008,7 @@ "ParentName": "App.Orders.Products", "DisplayName": "Import", "IsEnabled": true, - "MultiTenancySide": 3 + "MultiTenancySide": 3 }, { "GroupName": "App.Administration", @@ -25073,7 +25093,7 @@ }, { "Name": "EĞİTİM SİSTEMİNİ BEĞENMEDİ", - "Status": "Pasif" + "Status": "Aktif" }, { "Name": "EŞİNE SORACAK", @@ -25123,10 +25143,6 @@ "Name": "FİYAT YÜKSEK", "Status": "Aktif" }, - { - "Name": "BS COK PAHALI", - "Status": "Pasif" - }, { "Name": "VEFAT", "Status": "Aktif" @@ -25151,7 +25167,7 @@ }, { "Name": "İLAN", - "Status": "Pasif" + "Status": "Aktif" }, { "Name": "İNSERT", diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch/Psychologist.cs b/api/src/Kurs.Platform.Domain/Entities/Branch/Psychologist.cs index 6aed5c20..1e8900bf 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Branch/Psychologist.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Branch/Psychologist.cs @@ -7,7 +7,6 @@ namespace Kurs.Platform.Entities; public class Psychologist : FullAuditedEntity, IMultiTenant { public Guid? TenantId { get; set; } - public Guid? BranchId { get; set; } // SubeID public string Name { get; set; } // AdSoyad public string Phone { get; set; } // Telefon diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251007083102_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251007120118_Initial.Designer.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251007083102_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251007120118_Initial.Designer.cs index 220cdef6..233287b1 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251007083102_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251007120118_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251007083102_Initial")] + [Migration("20251007120118_Initial")] partial class Initial { /// @@ -4957,9 +4957,6 @@ namespace Kurs.Platform.Migrations .HasMaxLength(250) .HasColumnType("nvarchar(250)"); - b.Property("BranchId") - .HasColumnType("uniqueidentifier"); - b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251007083102_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251007120118_Initial.cs similarity index 99% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251007083102_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251007120118_Initial.cs index 58806b8d..b2dbc489 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251007083102_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251007120118_Initial.cs @@ -880,7 +880,6 @@ namespace Kurs.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - BranchId = table.Column(type: "uniqueidentifier", nullable: true), Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Phone = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), Email = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), @@ -1444,6 +1443,7 @@ namespace Kurs.Platform.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), + TenantId = table.Column(type: "uniqueidentifier", nullable: true), Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Slug = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Description = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), @@ -1457,7 +1457,6 @@ namespace Kurs.Platform.Migrations LastPostDate = table.Column(type: "datetime2", nullable: true), LastPostUserId = table.Column(type: "uniqueidentifier", nullable: true), LastPostUserName = table.Column(type: "nvarchar(max)", nullable: true), - TenantId = table.Column(type: "uniqueidentifier", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 1667c8ae..222354a2 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -4954,9 +4954,6 @@ namespace Kurs.Platform.Migrations .HasMaxLength(250) .HasColumnType("nvarchar(250)"); - b.Property("BranchId") - .HasColumnType("uniqueidentifier"); - b.Property("CreationTime") .HasColumnType("datetime2") .HasColumnName("CreationTime");