diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index cfa73a2c..7312f38a 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -9209,6 +9209,1370 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #endregion + #region Currency + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Currency)) + { + var listFormCurrency = await _listFormRepository.InsertAsync( + new ListForm + { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Currency, + Name = AppCodes.Definitions.Currency, + Title = AppCodes.Definitions.Currency, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Currency, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Currency"), + 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 = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + D = AppCodes.Definitions.Currency + ".Delete", + E = AppCodes.Definitions.Currency + ".Export" + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}PCurrency\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + 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 = "Currency Form", + Width = 500, + Height = 350 + }, + 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 = "Code", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxTextBox + }, + new EditingFormItemDto + { + Order = 2, + DataField = "Symbol", + ColSpan = 2, + IsRequired = false, + EditorType2 = EditorTypes.dxTextBox + }, + new EditingFormItemDto + { + Order = 3, + DataField = "Name", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxTextBox + }, + new EditingFormItemDto + { + Order = 4, + DataField = "Rate", + ColSpan = 2, + IsRequired = true, + EditorType2 = EditorTypes.dxNumberBox + }, + new EditingFormItemDto + { + Order = 5, + DataField = "IsActive", + ColSpan = 2, + IsRequired = false, + EditorType2 = EditorTypes.dxCheckBox + } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region Currency Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormCurrency.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCurrency.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Code", + Width = 120, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCurrency.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Symbol", + Width = 100, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCurrency.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCurrency.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Decimal, + FieldName = "Rate", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCurrency.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "IsActive", + Width = 80, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Currency + ".Create", + R = AppCodes.Definitions.Currency, + U = AppCodes.Definitions.Currency + ".Update", + E = true, + Deny = false + }) + } + ]); + #endregion + } + #endregion + + #region CountryGroup + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.CountryGroup)) + { + var listFormCountryGroup = await _listFormRepository.InsertAsync( + new ListForm + { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.CountryGroup, + Name = AppCodes.Definitions.CountryGroup, + Title = AppCodes.Definitions.CountryGroup, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.CountryGroup, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("CountryGroup"), + 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 = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.CountryGroup + ".Create", + R = AppCodes.Definitions.CountryGroup, + U = AppCodes.Definitions.CountryGroup + ".Update", + D = AppCodes.Definitions.CountryGroup + ".Delete", + E = AppCodes.Definitions.CountryGroup + ".Export" + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}PCountryGroup\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + 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 = "Country Group Form", + Width = 400, + Height = 200 + }, + 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 + } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region CountryGroup Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormCountryGroup.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.CountryGroup + ".Create", + R = AppCodes.Definitions.CountryGroup, + U = AppCodes.Definitions.CountryGroup + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountryGroup.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.CountryGroup + ".Create", + R = AppCodes.Definitions.CountryGroup, + U = AppCodes.Definitions.CountryGroup + ".Update", + E = true, + Deny = false + }) + } + ]); + #endregion + } + #endregion + + #region Country + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.Country)) + { + var listFormCountry = await _listFormRepository.InsertAsync( + new ListForm + { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.Country, + Name = AppCodes.Definitions.Country, + Title = AppCodes.Definitions.Country, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Country, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Country"), + 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 = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + D = AppCodes.Definitions.Country + ".Delete", + E = AppCodes.Definitions.Country + ".Export" + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}Country\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + 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 = "Country Form", + Width = 600, + Height = 500 + }, + 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 = "Code", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "GroupName", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 4, DataField = "CurrencyCode", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 5, DataField = "PhoneCode", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 6, DataField = "TaxLabel", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 7, DataField = "ZipRequired", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxCheckBox }, + new EditingFormItemDto { Order = 8, DataField = "StateRequired", ColSpan = 2, IsRequired = false, EditorType2 = EditorTypes.dxCheckBox } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region Country Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Code", + Width = 100, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "GroupName", + Width = 150, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "CurrencyCode", + Width = 100, + ListOrderNo = 5, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "PhoneCode", + Width = 80, + ListOrderNo = 6, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "TaxLabel", + Width = 120, + ListOrderNo = 7, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "ZipRequired", + Width = 80, + ListOrderNo = 8, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormCountry.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Boolean, + FieldName = "StateRequired", + Width = 80, + ListOrderNo = 9, + Visible = true, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.Country + ".Create", + R = AppCodes.Definitions.Country, + U = AppCodes.Definitions.Country + ".Update", + E = true, + Deny = false + }) + } + ]); + #endregion + + } + #endregion + + #region State + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.State)) + { + var listFormState = await _listFormRepository.InsertAsync( + new ListForm + { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.State, + Name = AppCodes.Definitions.State, + Title = AppCodes.Definitions.State, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.State, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("State"), + 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 = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.State + ".Create", + R = AppCodes.Definitions.State, + U = AppCodes.Definitions.State + ".Update", + D = AppCodes.Definitions.State + ".Delete", + E = AppCodes.Definitions.State + ".Export" + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}PState\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + 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 = "State Form", + Width = 500, + 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 = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 2, DataField = "Code", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }, + new EditingFormItemDto { Order = 3, DataField = "CountryCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region State Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormState.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.State + ".Create", + R = AppCodes.Definitions.State, + U = AppCodes.Definitions.State + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormState.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.State + ".Create", + R = AppCodes.Definitions.State, + U = AppCodes.Definitions.State + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormState.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Code", + Width = 120, + ListOrderNo = 3, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.State + ".Create", + R = AppCodes.Definitions.State, + U = AppCodes.Definitions.State + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormState.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "CountryCode", + Width = 120, + ListOrderNo = 4, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = false, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.State + ".Create", + R = AppCodes.Definitions.State, + U = AppCodes.Definitions.State + ".Update", + E = true, + Deny = false + }) + } + ]); + #endregion + } + #endregion + + #region SkillType + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SkillType)) + { + var listFormSkillType = await _listFormRepository.InsertAsync( + new ListForm + { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.SkillType, + Name = AppCodes.Definitions.SkillType, + Title = AppCodes.Definitions.SkillType, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.SkillType, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("SkillType"), + 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 = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.SkillType + ".Create", + R = AppCodes.Definitions.SkillType, + U = AppCodes.Definitions.SkillType + ".Update", + D = AppCodes.Definitions.SkillType + ".Delete", + E = AppCodes.Definitions.SkillType + ".Export" + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}SkillType\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + 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 = "Skill Type Form", + Width = 400, + Height = 200 + }, + 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 + } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region SkillType Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormSkillType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.SkillType + ".Create", + R = AppCodes.Definitions.SkillType, + U = AppCodes.Definitions.SkillType + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormSkillType.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.SkillType + ".Create", + R = AppCodes.Definitions.SkillType, + U = AppCodes.Definitions.SkillType + ".Update", + E = true, + Deny = false + }) + } + ]); + #endregion + } + #endregion + + #region UomCategory + if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.UomCategory)) + { + var listFormUomCategory = await _listFormRepository.InsertAsync( + new ListForm + { + CultureName = LanguageCodes.En, + ListFormCode = ListFormCodes.Lists.UomCategory, + Name = AppCodes.Definitions.UomCategory, + Title = AppCodes.Definitions.UomCategory, + DataSourceCode = SeedConsts.DataSources.DefaultCode, + IsTenant = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.UomCategory, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("UomCategory"), + 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 = false }), + SelectionJson = JsonSerializer.Serialize(new SelectionDto + { + Mode = GridOptions.SelectionModeSingle, + AllowSelectAll = false + }), + PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto + { + C = AppCodes.Definitions.UomCategory + ".Create", + R = AppCodes.Definitions.UomCategory, + U = AppCodes.Definitions.UomCategory + ".Update", + D = AppCodes.Definitions.UomCategory + ".Delete", + E = AppCodes.Definitions.UomCategory + ".Export" + }), + DeleteCommand = $"UPDATE \"{DbTablePrefix}PUomCategory\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id", + DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "DeleterId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + 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 = "UOM Category Form", + Width = 400, + Height = 200 + }, + 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 + } + ] + } + }), + InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[] + { + new FieldsDefaultValue + { + FieldName = "CreationTime", + FieldDbType = DbType.DateTime, + Value = "@NOW", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + }, + new FieldsDefaultValue + { + FieldName = "CreatorId", + FieldDbType = DbType.Guid, + Value = "@USERID", + CustomValueType = FieldCustomValueTypeEnum.CustomKey + } + }) + }); + + #region UomCategory Fields + await _listFormFieldRepository.InsertManyAsync([ + new() + { + ListFormCode = listFormUomCategory.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.Guid, + FieldName = "Id", + Width = 100, + ListOrderNo = 1, + Visible = false, + IsActive = true, + IsDeleted = false, + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.UomCategory + ".Create", + R = AppCodes.Definitions.UomCategory, + U = AppCodes.Definitions.UomCategory + ".Update", + E = true, + Deny = false + }) + }, + new() + { + ListFormCode = listFormUomCategory.ListFormCode, + CultureName = LanguageCodes.En, + SourceDbType = DbType.String, + FieldName = "Name", + Width = 200, + ListOrderNo = 2, + Visible = true, + IsActive = true, + IsDeleted = false, + AllowSearch = true, + ValidationRuleJson = JsonSerializer.Serialize(new[] + { + new ValidationRuleDto { Type = "required" } + }), + PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto + { + C = AppCodes.Definitions.UomCategory + ".Create", + R = AppCodes.Definitions.UomCategory, + U = AppCodes.Definitions.UomCategory + ".Update", + E = true, + Deny = false + }) + } + ]); + #endregion + } + #endregion + + #endregion } } diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json index 245067fd..950f6077 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json @@ -5043,8 +5043,8 @@ { "resourceName": "Platform", "key": "App.Definitions.UomCategory", - "tr": "Ölçüm Kategorileri", - "en": "Measurement Categories" + "tr": "Ölçü Birimi Kategorileri", + "en": "Units of Measure Categories" }, { "resourceName": "Platform", diff --git a/ui/dev-dist/sw.js b/ui/dev-dist/sw.js index e2240917..e51093f3 100644 --- a/ui/dev-dist/sw.js +++ b/ui/dev-dist/sw.js @@ -82,7 +82,7 @@ define(['./workbox-54d0af47'], (function (workbox) { 'use strict'; "revision": "3ca0b8505b4bec776b69afdba2768812" }, { "url": "index.html", - "revision": "0.flj9lansh4" + "revision": "0.e088p05bgmo" }], {}); workbox.cleanupOutdatedCaches(); workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {