diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs index 77d0508f..55432df3 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/ListFormsSeeder.cs @@ -12147,6 +12147,832 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency } #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 = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.Bank, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("Bank"), + 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 \"{DbTablePrefix}Bank\" 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 } + }), + } + ); + + #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 = $"SELECT \"{DbTablePrefix}Country\".\"Code\" AS \"Key\", \"{DbTablePrefix}Country\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Country\" ORDER BY \"{DbTablePrefix}Country\".\"Name\"", + 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 = $"SELECT \"{DbTablePrefix}City\".\"Code\" AS \"Key\", \"{DbTablePrefix}City\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}City\" WHERE \"PCity\".\"CountryCode\" = @param0 OR @param0 IS NULL ORDER BY \"{DbTablePrefix}City\".\"Name\"", + 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 = $"SELECT \"{DbTablePrefix}District\".\"Name\" AS \"Key\", \"{DbTablePrefix}District\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}District\" WHERE (\"{DbTablePrefix}District\".\"CountryCode\" = @param0 OR @param0 IS NULL) AND (\"{DbTablePrefix}District\".\"CityCode\" = @param1 OR @param1 IS NULL) GROUP BY \"{DbTablePrefix}District\".\"Name\" ORDER BY \"{DbTablePrefix}District\".\"Name\"", + 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 = false, + IsBranch = false, + IsOrganizationUnit = false, + Description = AppCodes.Definitions.BankAccount, + SelectCommandType = SelectCommandTypeEnum.Table, + SelectCommand = SelectCommandByTableName("BankAccount"), + 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 \"{DbTablePrefix}BankAccount\" 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 \"{DbTablePrefix}Bank\".\"Id\" AS \"Key\", \"{DbTablePrefix}Bank\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}Bank\" ORDER BY \"{DbTablePrefix}Bank\".\"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 \"{DbTablePrefix}Currency\".\"Id\" AS \"Key\", \"{DbTablePrefix}Currency\".\"Code\" as \"Name\" FROM \"{DbTablePrefix}Currency\" ORDER BY \"{DbTablePrefix}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 Skill Level if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SkillLevel)) { diff --git a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json index 3bb88f6d..29197d25 100644 --- a/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json +++ b/api/src/Kurs.Platform.DbMigrator/Seeds/SeederData.json @@ -2712,6 +2712,102 @@ "IsEnabled": true, "MultiTenancySide": 3 }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Bank", + "ParentName": null, + "DisplayName": "App.Definitions.Bank", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Bank.Create", + "ParentName": "App.Definitions.Bank", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Bank.Update", + "ParentName": "App.Definitions.Bank", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Bank.Delete", + "ParentName": "App.Definitions.Bank", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Bank.Export", + "ParentName": "App.Definitions.Bank", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.Bank.Import", + "ParentName": "App.Definitions.Bank", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.BankAccount", + "ParentName": null, + "DisplayName": "App.Definitions.BankAccount", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.BankAccount.Create", + "ParentName": "App.Definitions.BankAccount", + "DisplayName": "Create", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.BankAccount.Update", + "ParentName": "App.Definitions.BankAccount", + "DisplayName": "Update", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.BankAccount.Delete", + "ParentName": "App.Definitions.BankAccount", + "DisplayName": "Delete", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.BankAccount.Export", + "ParentName": "App.Definitions.BankAccount", + "DisplayName": "Export", + "IsEnabled": true, + "MultiTenancySide": 3 + }, + { + "GroupName": "App.Administration", + "Name": "App.Definitions.BankAccount.Import", + "ParentName": "App.Definitions.BankAccount", + "DisplayName": "Import", + "IsEnabled": true, + "MultiTenancySide": 3 + }, { "GroupName": "App.Coordinator", @@ -6495,6 +6591,26 @@ "RequiredPermissionName": "App.Definitions.UomCategory", "IsDisabled": false }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.Bank", + "DisplayName": "App.Definitions.Bank", + "Order": 10, + "Url": "/admin/list/list-bank", + "Icon": "FaUniversity", + "RequiredPermissionName": "App.Definitions.Bank", + "IsDisabled": false + }, + { + "ParentCode": "App.Definitions", + "Code": "App.Definitions.BankAccount", + "DisplayName": "App.Definitions.BankAccount", + "Order": 10, + "Url": "/admin/list/list-bankaccount", + "Icon": "FaMoneyCheckAlt", + "RequiredPermissionName": "App.Definitions.BankAccount", + "IsDisabled": false + }, { "ParentCode": null, @@ -14857,6 +14973,18 @@ "tr": "Ölçümler", "en": "Measurements" }, + { + "resourceName": "Platform", + "key": "App.Definitions.Bank", + "tr": "Bankalar", + "en": "Banks" + }, + { + "resourceName": "Platform", + "key": "App.Definitions.BankAccount", + "tr": "Banka Hesapları", + "en": "Bank Accounts" + }, { "resourceName": "Platform", "key": "App.Orders", diff --git a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs index f27418e9..bcd6027a 100644 --- a/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs +++ b/api/src/Kurs.Platform.Domain.Shared/PlatformConsts.cs @@ -365,6 +365,8 @@ public static class PlatformConsts public const string SkillLevel = "list-skilllevel"; public const string UomCategory = "list-uomcategory"; public const string Uom = "list-uom"; + public const string Bank = "list-bank"; + public const string BankAccount = "list-bankaccount"; public const string BlogCategory = "list-blogcategory"; public const string BlogPost = "list-blogpost"; public const string Route = "list-route"; diff --git a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs index d494d7e4..362c639b 100644 --- a/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs +++ b/api/src/Kurs.Platform.Domain/Data/SeedConsts.cs @@ -404,6 +404,8 @@ public static class SeedConsts public const string Skill = Default + ".Skill"; public const string UomCategory = Default + ".UomCategory"; public const string Uom = Default + ".Uom"; + public const string Bank = Default + ".Bank"; + public const string BankAccount = Default + ".BankAccount"; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/City.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/City.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/City.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/City.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ContactTag.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTag.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ContactTag.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTag.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ContactTitle.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTitle.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ContactTitle.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTitle.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Country.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/Country.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Country.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/Country.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Currency.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/Currency.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Currency.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/Currency.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/District.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/District.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/District.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/District.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Sector.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/Sector.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Sector.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/Sector.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Skill.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/Skill.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Skill.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/Skill.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/SkillLevel.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/SkillLevel.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/SkillLevel.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/SkillLevel.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/SkillType.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/SkillType.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/SkillType.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/SkillType.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Uom.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/Uom.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Uom.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/Uom.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/UomCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/UomCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/UomCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/UomCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ApiEndpoint.cs b/api/src/Kurs.Platform.Domain/Entities/DeveloperKit/ApiEndpoint.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ApiEndpoint.cs rename to api/src/Kurs.Platform.Domain/Entities/DeveloperKit/ApiEndpoint.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ApiMigration.cs b/api/src/Kurs.Platform.Domain/Entities/DeveloperKit/ApiMigration.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ApiMigration.cs rename to api/src/Kurs.Platform.Domain/Entities/DeveloperKit/ApiMigration.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/CustomComponent.cs b/api/src/Kurs.Platform.Domain/Entities/DeveloperKit/CustomComponent.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/CustomComponent.cs rename to api/src/Kurs.Platform.Domain/Entities/DeveloperKit/CustomComponent.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/CustomEndpoint.cs b/api/src/Kurs.Platform.Domain/Entities/DeveloperKit/CustomEndpoint.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/CustomEndpoint.cs rename to api/src/Kurs.Platform.Domain/Entities/DeveloperKit/CustomEndpoint.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/CustomEntity.cs b/api/src/Kurs.Platform.Domain/Entities/DeveloperKit/CustomEntity.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/CustomEntity.cs rename to api/src/Kurs.Platform.Domain/Entities/DeveloperKit/CustomEntity.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ForumCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Forum/ForumCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ForumCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Forum/ForumCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ForumPost.cs b/api/src/Kurs.Platform.Domain/Entities/Forum/ForumPost.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ForumPost.cs rename to api/src/Kurs.Platform.Domain/Entities/Forum/ForumPost.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ForumTopic.cs b/api/src/Kurs.Platform.Domain/Entities/Forum/ForumTopic.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ForumTopic.cs rename to api/src/Kurs.Platform.Domain/Entities/Forum/ForumTopic.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ListForm.cs b/api/src/Kurs.Platform.Domain/Entities/ListForm/ListForm.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ListForm.cs rename to api/src/Kurs.Platform.Domain/Entities/ListForm/ListForm.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ListFormCustomization.cs b/api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormCustomization.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ListFormCustomization.cs rename to api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormCustomization.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ListFormField.cs b/api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormField.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ListFormField.cs rename to api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormField.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ListFormImport.cs b/api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormImport.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ListFormImport.cs rename to api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormImport.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ListFormImportExecute.cs b/api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormImportExecute.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ListFormImportExecute.cs rename to api/src/Kurs.Platform.Domain/Entities/ListForm/ListFormImportExecute.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/AiBot.cs b/api/src/Kurs.Platform.Domain/Entities/Platform/AiBot.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/AiBot.cs rename to api/src/Kurs.Platform.Domain/Entities/Platform/AiBot.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/About.cs b/api/src/Kurs.Platform.Domain/Entities/Public/About.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/About.cs rename to api/src/Kurs.Platform.Domain/Entities/Public/About.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/BlogCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Public/BlogCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/BlogCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Public/BlogCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/BlogPost.cs b/api/src/Kurs.Platform.Domain/Entities/Public/BlogPost.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/BlogPost.cs rename to api/src/Kurs.Platform.Domain/Entities/Public/BlogPost.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Contact.cs b/api/src/Kurs.Platform.Domain/Entities/Public/Contact.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Contact.cs rename to api/src/Kurs.Platform.Domain/Entities/Public/Contact.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Demo.cs b/api/src/Kurs.Platform.Domain/Entities/Public/Demo.cs similarity index 92% rename from api/src/Kurs.Platform.Domain/Entities/Demo.cs rename to api/src/Kurs.Platform.Domain/Entities/Public/Demo.cs index 87853b17..b3f44d2f 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Demo.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Public/Demo.cs @@ -1,5 +1,4 @@ using System; -using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; diff --git a/api/src/Kurs.Platform.Domain/Entities/InstallmentOption.cs b/api/src/Kurs.Platform.Domain/Entities/Public/InstallmentOption.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/InstallmentOption.cs rename to api/src/Kurs.Platform.Domain/Entities/Public/InstallmentOption.cs diff --git a/api/src/Kurs.Platform.Domain/Orders/Order.cs b/api/src/Kurs.Platform.Domain/Entities/Public/Order.cs similarity index 97% rename from api/src/Kurs.Platform.Domain/Orders/Order.cs rename to api/src/Kurs.Platform.Domain/Entities/Public/Order.cs index be9f7d42..445936e2 100644 --- a/api/src/Kurs.Platform.Domain/Orders/Order.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Public/Order.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; -namespace Kurs.Platform.Orders; +namespace Kurs.Platform.Entities; public class Order : FullAuditedEntity, IMultiTenant { diff --git a/api/src/Kurs.Platform.Domain/Entities/PaymentMethod.cs b/api/src/Kurs.Platform.Domain/Entities/Public/PaymentMethod.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/PaymentMethod.cs rename to api/src/Kurs.Platform.Domain/Entities/Public/PaymentMethod.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Product.cs b/api/src/Kurs.Platform.Domain/Entities/Public/Product.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Product.cs rename to api/src/Kurs.Platform.Domain/Entities/Public/Product.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Service.cs b/api/src/Kurs.Platform.Domain/Entities/Public/Service.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Service.cs rename to api/src/Kurs.Platform.Domain/Entities/Public/Service.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ReportCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Report/ReportCategory.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ReportCategory.cs rename to api/src/Kurs.Platform.Domain/Entities/Report/ReportCategory.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ReportGenerated.cs b/api/src/Kurs.Platform.Domain/Entities/Report/ReportGenerated.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ReportGenerated.cs rename to api/src/Kurs.Platform.Domain/Entities/Report/ReportGenerated.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ReportParameter.cs b/api/src/Kurs.Platform.Domain/Entities/Report/ReportParameter.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ReportParameter.cs rename to api/src/Kurs.Platform.Domain/Entities/Report/ReportParameter.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/ReportTemplate.cs b/api/src/Kurs.Platform.Domain/Entities/Report/ReportTemplate.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/ReportTemplate.cs rename to api/src/Kurs.Platform.Domain/Entities/Report/ReportTemplate.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/BackgroundWorker.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/BackgroundWorker.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/BackgroundWorker.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/BackgroundWorker.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Branch.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Branch.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Branch.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Branch.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/BranchUsers.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/BranchUsers.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/BranchUsers.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/BranchUsers.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/DataSource.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/DataSource.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/DataSource.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/DataSource.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/GlobalSearch.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/GlobalSearch.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/GlobalSearch.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/GlobalSearch.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/IpRestriction.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/IpRestriction.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/IpRestriction.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/IpRestriction.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Menu.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Menu.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Menu.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Menu.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Route.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/Route.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Entities/Route.cs rename to api/src/Kurs.Platform.Domain/Entities/Saas/Route.cs diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index 9c24ba90..8e828252 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -22,7 +22,6 @@ using Kurs.Platform.Forum; using Microsoft.EntityFrameworkCore.ChangeTracking; using System; using System.Linq; -using Kurs.Platform.Orders; using System.Text.Json; namespace Kurs.Platform.EntityFrameworkCore; @@ -40,6 +39,8 @@ public class PlatformDbContext : public DbSet ListForms { get; set; } public DbSet ListFormFields { get; set; } public DbSet ListFormCustomization { get; set; } + public DbSet ListFormImports { get; set; } + public DbSet ListFormImportExecutes { get; set; } public DbSet Menus { get; set; } public DbSet IpRestrictions { get; set; } public DbSet DataSources { get; set; } @@ -75,26 +76,23 @@ public class PlatformDbContext : public DbSet ForumCategories { get; set; } public DbSet ForumTopics { get; set; } public DbSet ForumPosts { get; set; } + + // Public Entities public DbSet Products { get; set; } public DbSet PaymentMethods { get; set; } public DbSet InstallmentOptions { get; set; } - public DbSet Abouts { get; set; } public DbSet Contacts { get; set; } - public DbSet Orders { get; set; } public DbSet OrderItems { get; set; } - - public DbSet ListFormImports { get; set; } - public DbSet ListFormImportExecutes { get; set; } + public DbSet Demos { get; set; } + public DbSet Services { get; set; } // Reports Entities public DbSet ReportTemplates { get; set; } public DbSet ReportParameters { get; set; } public DbSet ReportGenerated { get; set; } public DbSet ReportCategories { get; set; } - public DbSet Demos { get; set; } - public DbSet Services { get; set; } public DbSet ClassSessions { get; set; } public DbSet Participants { get; set; } @@ -335,6 +333,30 @@ public class PlatformDbContext : b.Property(x => x.LastUpdated); }); + builder.Entity(b => + { + b.ToTable(PlatformConsts.DbTablePrefix + nameof(Bank), PlatformConsts.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.Name).IsRequired().HasMaxLength(8); + }); + + builder.Entity(b => + { + b.ToTable(PlatformConsts.DbTablePrefix + nameof(BankAccount), PlatformConsts.DbSchema); + b.ConfigureByConvention(); + + b.Property(x => x.AccountNumber).IsRequired().HasMaxLength(64); + b.Property(x => x.BankId).IsRequired(); + b.Property(x => x.AccountOwner).IsRequired().HasMaxLength(256); + + b.HasOne(x => x.Bank) + .WithMany() + .HasPrincipalKey(x => x.Id) + .HasForeignKey(x => x.BankId) + .OnDelete(DeleteBehavior.Restrict); + }); + builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(CountryGroup), PlatformConsts.DbSchema); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250926063427_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002081543_Initial.Designer.cs similarity index 97% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250926063427_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002081543_Initial.Designer.cs index 3782c4c6..674f6e84 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250926063427_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002081543_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20250926063427_Initial")] + [Migration("20251002081543_Initial")] partial class Initial { /// @@ -988,8 +988,8 @@ namespace Kurs.Platform.Migrations b.Property("Name") .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasMaxLength(8) + .HasColumnType("nvarchar(8)"); b.Property("Phone") .HasMaxLength(64) @@ -1001,7 +1001,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("Banks"); + b.ToTable("PBank", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.BankAccount", b => @@ -1015,6 +1015,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(64)"); b.Property("AccountOwner") + .IsRequired() .HasMaxLength(256) .HasColumnType("nvarchar(256)"); @@ -1067,7 +1068,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("CurrencyId"); - b.ToTable("BankAccounts"); + b.ToTable("PBankAccount", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b => @@ -1359,144 +1360,6 @@ namespace Kurs.Platform.Migrations b.ToTable("PBranchUsers", (string)null); }); - modelBuilder.Entity("Kurs.Platform.Entities.Chart", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("AdaptiveLayoutJson") - .HasColumnType("nvarchar(max)"); - - b.Property("AnimationJson") - .HasColumnType("nvarchar(max)"); - - b.Property("AnnotationsJson") - .HasColumnType("nvarchar(max)"); - - b.Property("ArgumentAxisJson") - .HasColumnType("nvarchar(max)"); - - b.Property("ChartCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CommonAnnotationsSettingsJson") - .HasColumnType("nvarchar(max)"); - - b.Property("CommonAxisSettingsJson") - .HasColumnType("nvarchar(max)"); - - b.Property("CommonJson") - .HasColumnType("nvarchar(max)"); - - b.Property("CommonPaneSettingsJson") - .HasColumnType("nvarchar(max)"); - - b.Property("CommonSeriesSettingsJson") - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("CrosshairJson") - .HasColumnType("nvarchar(max)"); - - b.Property("CultureName") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("nvarchar(max)") - .HasDefaultValue("en"); - - b.Property("DataSourceCode") - .HasColumnType("nvarchar(max)"); - - b.Property("DataSourceJson") - .HasColumnType("nvarchar(max)"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("ExportJson") - .HasColumnType("nvarchar(max)"); - - b.Property("IsBranch") - .HasColumnType("bit"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("IsOrganizationUnit") - .HasColumnType("bit"); - - b.Property("IsTenant") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("LegendJson") - .HasColumnType("nvarchar(max)"); - - b.Property("MarginJson") - .HasColumnType("nvarchar(max)"); - - b.Property("PanesJson") - .HasColumnType("nvarchar(max)"); - - b.Property("PermissionJson") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(max)"); - - b.Property("ScrollBarJson") - .HasColumnType("nvarchar(max)"); - - b.Property("SeriesJson") - .HasColumnType("nvarchar(max)"); - - b.Property("SizeJson") - .HasColumnType("nvarchar(max)"); - - b.Property("TitleJson") - .HasColumnType("nvarchar(max)"); - - b.Property("TooltipJson") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(max)"); - - b.Property("ValueAxisJson") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoomAndPanJson") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PChart", (string)null); - }); - modelBuilder.Entity("Kurs.Platform.Entities.City", b => { b.Property("Id") @@ -3456,6 +3319,188 @@ namespace Kurs.Platform.Migrations b.ToTable("PMenu", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Order", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("Address2") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .HasColumnType("nvarchar(max)"); + + b.Property("Commission") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Country") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("District") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("Fax") + .HasColumnType("bigint"); + + b.Property("Founder") + .HasColumnType("nvarchar(max)"); + + b.Property("InstallmentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Installments") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Mobile") + .HasColumnType("bigint"); + + b.Property("OrganizationName") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDataJson") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("PaymentMethod") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Phone") + .HasColumnType("bigint"); + + b.Property("PostalCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Subtotal") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("TaxOffice") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Total") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("VknTckn") + .HasColumnType("bigint"); + + b.Property("Website") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("POrder", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.OrderItem", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("BillingCycle") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("TotalPrice") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("POrderItem", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.PaymentMethod", b => { b.Property("Id") @@ -4498,188 +4543,6 @@ namespace Kurs.Platform.Migrations b.ToTable("PForumTopic", (string)null); }); - modelBuilder.Entity("Kurs.Platform.Orders.Order", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("Address2") - .HasColumnType("nvarchar(max)"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("Commission") - .HasPrecision(18, 2) - .HasColumnType("decimal(18,2)"); - - b.Property("Country") - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("District") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(max)"); - - b.Property("Fax") - .HasColumnType("bigint"); - - b.Property("Founder") - .HasColumnType("nvarchar(max)"); - - b.Property("InstallmentName") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Installments") - .HasColumnType("int"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Mobile") - .HasColumnType("bigint"); - - b.Property("OrganizationName") - .HasColumnType("nvarchar(max)"); - - b.Property("PaymentDataJson") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); - - b.Property("PaymentMethod") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Phone") - .HasColumnType("bigint"); - - b.Property("PostalCode") - .HasColumnType("nvarchar(max)"); - - b.Property("Subtotal") - .HasPrecision(18, 2) - .HasColumnType("decimal(18,2)"); - - b.Property("TaxOffice") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Total") - .HasPrecision(18, 2) - .HasColumnType("decimal(18,2)"); - - b.Property("VknTckn") - .HasColumnType("bigint"); - - b.Property("Website") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("POrder", (string)null); - }); - - modelBuilder.Entity("Kurs.Platform.Orders.OrderItem", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("BillingCycle") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("nvarchar(32)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("OrderId") - .HasColumnType("uniqueidentifier"); - - b.Property("ProductId") - .HasColumnType("uniqueidentifier"); - - b.Property("ProductName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("TotalPrice") - .HasPrecision(18, 2) - .HasColumnType("decimal(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.ToTable("POrderItem", (string)null); - }); - modelBuilder.Entity("Kurs.Settings.Entities.SettingDefinition", b => { b.Property("Id") @@ -6625,7 +6488,7 @@ namespace Kurs.Platform.Migrations b.HasOne("Kurs.Platform.Entities.Bank", "Bank") .WithMany() .HasForeignKey("BankId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Kurs.Platform.Entities.Currency", "Currency") @@ -6744,6 +6607,16 @@ namespace Kurs.Platform.Migrations .IsRequired(); }); + modelBuilder.Entity("Kurs.Platform.Entities.OrderItem", b => + { + b.HasOne("Kurs.Platform.Entities.Order", "Order") + .WithMany("Items") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Order"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.ReportGenerated", b => { b.HasOne("Kurs.Platform.Entities.ReportTemplate", "Template") @@ -6838,16 +6711,6 @@ namespace Kurs.Platform.Migrations b.Navigation("Category"); }); - modelBuilder.Entity("Kurs.Platform.Orders.OrderItem", b => - { - b.HasOne("Kurs.Platform.Orders.Order", "Order") - .WithMany("Items") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Order"); - }); - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) @@ -7024,6 +6887,11 @@ namespace Kurs.Platform.Migrations b.Navigation("Fields"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Order", b => + { + b.Navigation("Items"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.ReportCategory", b => { b.Navigation("ReportTemplates"); @@ -7061,11 +6929,6 @@ namespace Kurs.Platform.Migrations b.Navigation("Posts"); }); - modelBuilder.Entity("Kurs.Platform.Orders.Order", b => - { - b.Navigation("Items"); - }); - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => { b.Navigation("Actions"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250926063427_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002081543_Initial.cs similarity index 97% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250926063427_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002081543_Initial.cs index 195fdcca..806e970b 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20250926063427_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002081543_Initial.cs @@ -432,34 +432,6 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_AbpUsers", x => x.Id); }); - migrationBuilder.CreateTable( - name: "Banks", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - IdentifierCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - AddressLine1 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - AddressLine2 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), - District = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - City = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - PostalCode = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true), - Country = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - Phone = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), - Email = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Banks", x => x.Id); - }); - migrationBuilder.CreateTable( name: "OpenIddictApplications", columns: table => new @@ -661,6 +633,34 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_PBackgroundWorker_MailQueueTableFormat", x => x.Id); }); + migrationBuilder.CreateTable( + name: "PBank", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Name = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), + IdentifierCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + AddressLine1 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + AddressLine2 = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + District = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + City = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + PostalCode = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true), + Country = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Phone = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Email = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PBank", x => x.Id); + }); + migrationBuilder.CreateTable( name: "PBlogCategory", columns: table => new @@ -737,55 +737,6 @@ namespace Kurs.Platform.Migrations table.PrimaryKey("PK_PBranchUsers", x => new { x.UserId, x.BranchId }); }); - migrationBuilder.CreateTable( - name: "PChart", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ChartCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), - DataSourceCode = table.Column(type: "nvarchar(max)", nullable: true), - UserId = table.Column(type: "nvarchar(max)", nullable: true), - RoleId = table.Column(type: "nvarchar(max)", nullable: true), - CultureName = table.Column(type: "nvarchar(max)", nullable: false, defaultValue: "en"), - CommonJson = table.Column(type: "nvarchar(max)", nullable: true), - DataSourceJson = table.Column(type: "nvarchar(max)", nullable: true), - AdaptiveLayoutJson = table.Column(type: "nvarchar(max)", nullable: true), - AnimationJson = table.Column(type: "nvarchar(max)", nullable: true), - AnnotationsJson = table.Column(type: "nvarchar(max)", nullable: true), - ArgumentAxisJson = table.Column(type: "nvarchar(max)", nullable: true), - CommonAnnotationsSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), - CommonAxisSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), - CommonPaneSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), - CommonSeriesSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), - CrosshairJson = table.Column(type: "nvarchar(max)", nullable: true), - ExportJson = table.Column(type: "nvarchar(max)", nullable: true), - LegendJson = table.Column(type: "nvarchar(max)", nullable: true), - MarginJson = table.Column(type: "nvarchar(max)", nullable: true), - PanesJson = table.Column(type: "nvarchar(max)", nullable: true), - ScrollBarJson = table.Column(type: "nvarchar(max)", nullable: true), - SeriesJson = table.Column(type: "nvarchar(max)", nullable: true), - SizeJson = table.Column(type: "nvarchar(max)", nullable: true), - TitleJson = table.Column(type: "nvarchar(max)", nullable: true), - TooltipJson = table.Column(type: "nvarchar(max)", nullable: true), - ValueAxisJson = table.Column(type: "nvarchar(max)", nullable: true), - ZoomAndPanJson = table.Column(type: "nvarchar(max)", nullable: true), - PermissionJson = table.Column(type: "nvarchar(max)", nullable: true), - IsTenant = table.Column(type: "bit", nullable: false), - IsBranch = table.Column(type: "bit", nullable: false), - IsOrganizationUnit = table.Column(type: "bit", nullable: false), - CreationTime = table.Column(type: "datetime2", nullable: false), - CreatorId = table.Column(type: "uniqueidentifier", nullable: true), - LastModificationTime = table.Column(type: "datetime2", nullable: true), - LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), - IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), - DeleterId = table.Column(type: "uniqueidentifier", nullable: true), - DeletionTime = table.Column(type: "datetime2", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PChart", x => x.Id); - }); - migrationBuilder.CreateTable( name: "PClassroom", columns: table => new @@ -2081,13 +2032,13 @@ namespace Kurs.Platform.Migrations }); migrationBuilder.CreateTable( - name: "BankAccounts", + name: "PBankAccount", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), AccountNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), BankId = table.Column(type: "uniqueidentifier", nullable: false), - AccountOwner = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + AccountOwner = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), CurrencyId = table.Column(type: "uniqueidentifier", nullable: true), CanTransferMoney = table.Column(type: "bit", nullable: false), Company = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), @@ -2101,15 +2052,15 @@ namespace Kurs.Platform.Migrations }, constraints: table => { - table.PrimaryKey("PK_BankAccounts", x => x.Id); + table.PrimaryKey("PK_PBankAccount", x => x.Id); table.ForeignKey( - name: "FK_BankAccounts_Banks_BankId", + name: "FK_PBankAccount_PBank_BankId", column: x => x.BankId, - principalTable: "Banks", + principalTable: "PBank", principalColumn: "Id", - onDelete: ReferentialAction.Cascade); + onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_BankAccounts_PCurrency_CurrencyId", + name: "FK_PBankAccount_PCurrency_CurrencyId", column: x => x.CurrencyId, principalTable: "PCurrency", principalColumn: "Id"); @@ -2937,16 +2888,6 @@ namespace Kurs.Platform.Migrations table: "AbpUsers", column: "UserName"); - migrationBuilder.CreateIndex( - name: "IX_BankAccounts_BankId", - table: "BankAccounts", - column: "BankId"); - - migrationBuilder.CreateIndex( - name: "IX_BankAccounts_CurrencyId", - table: "BankAccounts", - column: "CurrencyId"); - migrationBuilder.CreateIndex( name: "IX_OpenIddictApplications_ClientId", table: "OpenIddictApplications", @@ -2993,6 +2934,16 @@ namespace Kurs.Platform.Migrations columns: new[] { "TableName", "Order" }, unique: true); + migrationBuilder.CreateIndex( + name: "IX_PBankAccount_BankId", + table: "PBankAccount", + column: "BankId"); + + migrationBuilder.CreateIndex( + name: "IX_PBankAccount_CurrencyId", + table: "PBankAccount", + column: "CurrencyId"); + migrationBuilder.CreateIndex( name: "IX_PBlogCategory_Slug", table: "PBlogCategory", @@ -3290,9 +3241,6 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "AbpUserTokens"); - migrationBuilder.DropTable( - name: "BankAccounts"); - migrationBuilder.DropTable( name: "OpenIddictScopes"); @@ -3323,6 +3271,9 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "PBackgroundWorker_MailQueueTableFormat"); + migrationBuilder.DropTable( + name: "PBankAccount"); + migrationBuilder.DropTable( name: "PBlogPost"); @@ -3332,9 +3283,6 @@ namespace Kurs.Platform.Migrations migrationBuilder.DropTable( name: "PBranchUsers"); - migrationBuilder.DropTable( - name: "PChart"); - migrationBuilder.DropTable( name: "PClassroomAttandance"); @@ -3462,14 +3410,14 @@ namespace Kurs.Platform.Migrations name: "AbpUsers"); migrationBuilder.DropTable( - name: "Banks"); + name: "OpenIddictAuthorizations"); + + migrationBuilder.DropTable( + name: "PBank"); migrationBuilder.DropTable( name: "PCurrency"); - migrationBuilder.DropTable( - name: "OpenIddictAuthorizations"); - migrationBuilder.DropTable( name: "PBlogCategory"); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 1dc37918..2506a2ab 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -985,8 +985,8 @@ namespace Kurs.Platform.Migrations b.Property("Name") .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasMaxLength(8) + .HasColumnType("nvarchar(8)"); b.Property("Phone") .HasMaxLength(64) @@ -998,7 +998,7 @@ namespace Kurs.Platform.Migrations b.HasKey("Id"); - b.ToTable("Banks"); + b.ToTable("PBank", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.BankAccount", b => @@ -1012,6 +1012,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(64)"); b.Property("AccountOwner") + .IsRequired() .HasMaxLength(256) .HasColumnType("nvarchar(256)"); @@ -1064,7 +1065,7 @@ namespace Kurs.Platform.Migrations b.HasIndex("CurrencyId"); - b.ToTable("BankAccounts"); + b.ToTable("PBankAccount", (string)null); }); modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b => @@ -1356,144 +1357,6 @@ namespace Kurs.Platform.Migrations b.ToTable("PBranchUsers", (string)null); }); - modelBuilder.Entity("Kurs.Platform.Entities.Chart", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("AdaptiveLayoutJson") - .HasColumnType("nvarchar(max)"); - - b.Property("AnimationJson") - .HasColumnType("nvarchar(max)"); - - b.Property("AnnotationsJson") - .HasColumnType("nvarchar(max)"); - - b.Property("ArgumentAxisJson") - .HasColumnType("nvarchar(max)"); - - b.Property("ChartCode") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("CommonAnnotationsSettingsJson") - .HasColumnType("nvarchar(max)"); - - b.Property("CommonAxisSettingsJson") - .HasColumnType("nvarchar(max)"); - - b.Property("CommonJson") - .HasColumnType("nvarchar(max)"); - - b.Property("CommonPaneSettingsJson") - .HasColumnType("nvarchar(max)"); - - b.Property("CommonSeriesSettingsJson") - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("CrosshairJson") - .HasColumnType("nvarchar(max)"); - - b.Property("CultureName") - .IsRequired() - .ValueGeneratedOnAdd() - .HasColumnType("nvarchar(max)") - .HasDefaultValue("en"); - - b.Property("DataSourceCode") - .HasColumnType("nvarchar(max)"); - - b.Property("DataSourceJson") - .HasColumnType("nvarchar(max)"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("ExportJson") - .HasColumnType("nvarchar(max)"); - - b.Property("IsBranch") - .HasColumnType("bit"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("IsOrganizationUnit") - .HasColumnType("bit"); - - b.Property("IsTenant") - .HasColumnType("bit"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("LegendJson") - .HasColumnType("nvarchar(max)"); - - b.Property("MarginJson") - .HasColumnType("nvarchar(max)"); - - b.Property("PanesJson") - .HasColumnType("nvarchar(max)"); - - b.Property("PermissionJson") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(max)"); - - b.Property("ScrollBarJson") - .HasColumnType("nvarchar(max)"); - - b.Property("SeriesJson") - .HasColumnType("nvarchar(max)"); - - b.Property("SizeJson") - .HasColumnType("nvarchar(max)"); - - b.Property("TitleJson") - .HasColumnType("nvarchar(max)"); - - b.Property("TooltipJson") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .HasColumnType("nvarchar(max)"); - - b.Property("ValueAxisJson") - .HasColumnType("nvarchar(max)"); - - b.Property("ZoomAndPanJson") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("PChart", (string)null); - }); - modelBuilder.Entity("Kurs.Platform.Entities.City", b => { b.Property("Id") @@ -3453,6 +3316,188 @@ namespace Kurs.Platform.Migrations b.ToTable("PMenu", (string)null); }); + modelBuilder.Entity("Kurs.Platform.Entities.Order", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasColumnType("nvarchar(max)"); + + b.Property("Address2") + .HasColumnType("nvarchar(max)"); + + b.Property("City") + .HasColumnType("nvarchar(max)"); + + b.Property("Commission") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("Country") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("District") + .HasColumnType("nvarchar(max)"); + + b.Property("Email") + .HasColumnType("nvarchar(max)"); + + b.Property("Fax") + .HasColumnType("bigint"); + + b.Property("Founder") + .HasColumnType("nvarchar(max)"); + + b.Property("InstallmentName") + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Installments") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Mobile") + .HasColumnType("bigint"); + + b.Property("OrganizationName") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDataJson") + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.Property("PaymentMethod") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Phone") + .HasColumnType("bigint"); + + b.Property("PostalCode") + .HasColumnType("nvarchar(max)"); + + b.Property("Subtotal") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("TaxOffice") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier") + .HasColumnName("TenantId"); + + b.Property("Total") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.Property("VknTckn") + .HasColumnType("bigint"); + + b.Property("Website") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("POrder", (string)null); + }); + + modelBuilder.Entity("Kurs.Platform.Entities.OrderItem", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("BillingCycle") + .IsRequired() + .HasMaxLength(32) + .HasColumnType("nvarchar(32)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("TotalPrice") + .HasPrecision(18, 2) + .HasColumnType("decimal(18,2)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("POrderItem", (string)null); + }); + modelBuilder.Entity("Kurs.Platform.Entities.PaymentMethod", b => { b.Property("Id") @@ -4495,188 +4540,6 @@ namespace Kurs.Platform.Migrations b.ToTable("PForumTopic", (string)null); }); - modelBuilder.Entity("Kurs.Platform.Orders.Order", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("Address") - .HasColumnType("nvarchar(max)"); - - b.Property("Address2") - .HasColumnType("nvarchar(max)"); - - b.Property("City") - .HasColumnType("nvarchar(max)"); - - b.Property("Commission") - .HasPrecision(18, 2) - .HasColumnType("decimal(18,2)"); - - b.Property("Country") - .HasColumnType("nvarchar(max)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("District") - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(max)"); - - b.Property("Fax") - .HasColumnType("bigint"); - - b.Property("Founder") - .HasColumnType("nvarchar(max)"); - - b.Property("InstallmentName") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Installments") - .HasColumnType("int"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("Mobile") - .HasColumnType("bigint"); - - b.Property("OrganizationName") - .HasColumnType("nvarchar(max)"); - - b.Property("PaymentDataJson") - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); - - b.Property("PaymentMethod") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("nvarchar(64)"); - - b.Property("Phone") - .HasColumnType("bigint"); - - b.Property("PostalCode") - .HasColumnType("nvarchar(max)"); - - b.Property("Subtotal") - .HasPrecision(18, 2) - .HasColumnType("decimal(18,2)"); - - b.Property("TaxOffice") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("uniqueidentifier") - .HasColumnName("TenantId"); - - b.Property("Total") - .HasPrecision(18, 2) - .HasColumnType("decimal(18,2)"); - - b.Property("VknTckn") - .HasColumnType("bigint"); - - b.Property("Website") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("POrder", (string)null); - }); - - modelBuilder.Entity("Kurs.Platform.Orders.OrderItem", b => - { - b.Property("Id") - .HasColumnType("uniqueidentifier"); - - b.Property("BillingCycle") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("nvarchar(32)"); - - b.Property("CreationTime") - .HasColumnType("datetime2") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uniqueidentifier") - .HasColumnName("CreatorId"); - - b.Property("DeleterId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DeleterId"); - - b.Property("DeletionTime") - .HasColumnType("datetime2") - .HasColumnName("DeletionTime"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false) - .HasColumnName("IsDeleted"); - - b.Property("LastModificationTime") - .HasColumnType("datetime2") - .HasColumnName("LastModificationTime"); - - b.Property("LastModifierId") - .HasColumnType("uniqueidentifier") - .HasColumnName("LastModifierId"); - - b.Property("OrderId") - .HasColumnType("uniqueidentifier"); - - b.Property("ProductId") - .HasColumnType("uniqueidentifier"); - - b.Property("ProductName") - .IsRequired() - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Quantity") - .HasColumnType("int"); - - b.Property("TotalPrice") - .HasPrecision(18, 2) - .HasColumnType("decimal(18,2)"); - - b.HasKey("Id"); - - b.HasIndex("OrderId"); - - b.ToTable("POrderItem", (string)null); - }); - modelBuilder.Entity("Kurs.Settings.Entities.SettingDefinition", b => { b.Property("Id") @@ -6622,7 +6485,7 @@ namespace Kurs.Platform.Migrations b.HasOne("Kurs.Platform.Entities.Bank", "Bank") .WithMany() .HasForeignKey("BankId") - .OnDelete(DeleteBehavior.Cascade) + .OnDelete(DeleteBehavior.Restrict) .IsRequired(); b.HasOne("Kurs.Platform.Entities.Currency", "Currency") @@ -6741,6 +6604,16 @@ namespace Kurs.Platform.Migrations .IsRequired(); }); + modelBuilder.Entity("Kurs.Platform.Entities.OrderItem", b => + { + b.HasOne("Kurs.Platform.Entities.Order", "Order") + .WithMany("Items") + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Order"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.ReportGenerated", b => { b.HasOne("Kurs.Platform.Entities.ReportTemplate", "Template") @@ -6835,16 +6708,6 @@ namespace Kurs.Platform.Migrations b.Navigation("Category"); }); - modelBuilder.Entity("Kurs.Platform.Orders.OrderItem", b => - { - b.HasOne("Kurs.Platform.Orders.Order", "Order") - .WithMany("Items") - .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Order"); - }); - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => { b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) @@ -7021,6 +6884,11 @@ namespace Kurs.Platform.Migrations b.Navigation("Fields"); }); + modelBuilder.Entity("Kurs.Platform.Entities.Order", b => + { + b.Navigation("Items"); + }); + modelBuilder.Entity("Kurs.Platform.Entities.ReportCategory", b => { b.Navigation("ReportTemplates"); @@ -7058,11 +6926,6 @@ namespace Kurs.Platform.Migrations b.Navigation("Posts"); }); - modelBuilder.Entity("Kurs.Platform.Orders.Order", b => - { - b.Navigation("Items"); - }); - modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => { b.Navigation("Actions"); diff --git a/ui/src/proxy/admin/list-form/models.ts b/ui/src/proxy/admin/list-form/models.ts index a5c51cf2..638d25f3 100644 --- a/ui/src/proxy/admin/list-form/models.ts +++ b/ui/src/proxy/admin/list-form/models.ts @@ -1,3 +1,4 @@ +import { ListViewLayoutType } from '@/views/admin/listForm/edit/types' import { CommandColumnDto, EditingFormDto, @@ -52,3 +53,8 @@ export interface ListFormJsonRowDto { itemChartValueAxis?: ChartValueAxisDto } +export interface ListState { + listFormCode: string + layout: ListViewLayoutType + cardLayoutColumn?: number +} diff --git a/ui/src/store/admin.model.ts b/ui/src/store/admin.model.ts index 13fdd032..7beb8fe7 100644 --- a/ui/src/store/admin.model.ts +++ b/ui/src/store/admin.model.ts @@ -1,53 +1,65 @@ import type { Action, Thunk } from 'easy-peasy' import { action, thunk } from 'easy-peasy' import { Injections } from './store' -import { FieldsDefaultValueDto, GridOptionsEditDto } from '../proxy/form/models' +import { GridOptionsEditDto } from '../proxy/form/models' import setNull from '../utils/setNull' +import { ListState } from '@/proxy/admin/list-form/models' export interface AdminStoreModel { - listFormValues: GridOptionsEditDto | undefined + lists: { + values: GridOptionsEditDto | undefined + states: ListState[] + } } export interface AdminStoreActions { - setListFormValues: Action - setJsonValue: Action< - AdminStoreModel, - { field: keyof GridOptionsEditDto; data: any[] } - > - getListFormValues: Thunk - // onSetLang: ThunkOn + lists: { + setListFormValues: Action + setJsonValue: Action + getListFormValues: Thunk< + AdminStoreModel['lists'] & AdminStoreActions['lists'], + string | undefined, + Injections + > + setStates: Action + } } export type AdminModel = AdminStoreModel & AdminStoreActions const initialState: AdminStoreModel = { - listFormValues: undefined, + lists: { + values: undefined, + states: [], + }, } export const adminModel: AdminModel = { - ...initialState, - setListFormValues: action((state, payload) => { - state.listFormValues = { ...payload } - }), - setJsonValue: action((state, payload) => { - if (state.listFormValues) { - state.listFormValues[payload.field] = payload.data - } - }), - getListFormValues: thunk(async (actions, payload, helpers) => { - if (!payload) { - return - } - const service = helpers.injections.listFormService - const result = await service.getListFormByCode(payload) - setNull(result.data) - actions.setListFormValues(result.data) - }), - // onSetLang: thunkOn( - // (actions) => actions.setLang, - // async (actions, target, helpers) => { - // // Dil değiştiğince AppConfig ve Localizationları tekrar al - // helpers.getStoreActions().abpConfig.getConfig(false) - // }, - // ), + lists: { + ...initialState.lists, + setStates: action((state, payload) => { + const stateId = state.states.findIndex((s) => s.listFormCode === payload.listFormCode) + if (stateId !== -1) { + state.states[stateId] = payload + } else { + state.states = [...state.states, payload] + } + }), + + setListFormValues: action((state, payload) => { + state.values = { ...state.values, ...payload } + }), + setJsonValue: action((state, payload) => { + if (state.values) { + state.values[payload.field] = payload.data + } + }), + getListFormValues: thunk(async (actions, payload, helpers) => { + if (!payload) return + const service = helpers.injections.listFormService + const result = await service.getListFormByCode(payload) + setNull(result.data) + actions.setListFormValues(result.data) + }), + }, } diff --git a/ui/src/store/base.model.ts b/ui/src/store/base.model.ts index f4ef21f0..663cc85d 100644 --- a/ui/src/store/base.model.ts +++ b/ui/src/store/base.model.ts @@ -1,4 +1,3 @@ -import { ListViewLayoutType } from '@/views/admin/listForm/edit/types' import type { Action } from 'easy-peasy' import { action } from 'easy-peasy' @@ -28,12 +27,6 @@ export interface StoreError { statusCode?: string } -export interface ListState { - listFormCode: string - layout: ListViewLayoutType - cardLayoutColumn?: number -} - export interface BaseStoreModel { common: { currentRouteKey: string @@ -45,9 +38,6 @@ export interface BaseStoreModel { warning: string[] aiPosts: Message[] } - lists: { - states: ListState[] - } } export interface BaseStoreActions { @@ -63,9 +53,6 @@ export interface BaseStoreActions { addAiPost: Action setAiPosts: Action } - lists: { - setStates: Action - } } export type BaseModel = BaseStoreModel & BaseStoreActions @@ -78,9 +65,6 @@ const initialState: BaseStoreModel = { warning: [], aiPosts: [], }, - lists: { - states: [], - }, } export const baseModel: BaseModel = { @@ -116,15 +100,4 @@ export const baseModel: BaseModel = { state.aiPosts = payload }), }, - lists: { - ...initialState.lists, - setStates: action((state, payload) => { - const stateId = state.states.findIndex((s) => s.listFormCode === payload.listFormCode) - if (stateId !== -1) { - state.states[stateId] = payload - } else { - state.states = [...state.states, payload] - } - }), - }, } diff --git a/ui/src/store/store.ts b/ui/src/store/store.ts index 4b1f9033..7121973d 100644 --- a/ui/src/store/store.ts +++ b/ui/src/store/store.ts @@ -65,7 +65,7 @@ export const store = createStore( admin: adminModel, }, { - allow: ['auth', 'theme', 'locale', 'base'], + allow: ['auth', 'theme', 'locale', 'admin'], storage: 'localStorage', }, ), diff --git a/ui/src/views/admin/listForm/edit/ChartTabAnimation.tsx b/ui/src/views/admin/listForm/edit/ChartTabAnimation.tsx index dca26a1b..ea114470 100644 --- a/ui/src/views/admin/listForm/edit/ChartTabAnimation.tsx +++ b/ui/src/views/admin/listForm/edit/ChartTabAnimation.tsx @@ -13,7 +13,7 @@ const schema = object() function ChartTabAnimation(props: FormEditProps) { const { translate } = useLocalization() - const listFormValues = useStoreState((s) => s.admin.listFormValues) + const listFormValues = useStoreState((s) => s.admin.lists.values) if (!listFormValues) { return null } @@ -29,55 +29,55 @@ function ChartTabAnimation(props: FormEditProps) { {({ touched, errors, resetForm, isSubmitting, values }) => (
- - - + + + - - - {({ field, form }: FieldProps) => ( - option.value === values.animationDto.easing, + )} + onChange={(option) => form.setFieldValue(field.name, option?.value)} + /> + )} + + - - - + + + - - - + + +
+