Tenant seeder çalışmaları
This commit is contained in:
parent
f847986631
commit
2cacec19c7
33 changed files with 1473 additions and 827 deletions
|
|
@ -1,8 +1,9 @@
|
|||
using System;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
|
||||
namespace Kurs.Platform.Orders;
|
||||
|
||||
public class PaymentMethodDto : EntityDto<string>
|
||||
public class PaymentMethodDto : EntityDto<Guid>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public decimal Commission { get; set; }
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class PublicAppService : PlatformAppService
|
|||
private readonly IRepository<BlogPost, Guid> _postRepository;
|
||||
private readonly IRepository<BlogCategory, Guid> _categoryRepository;
|
||||
private readonly IRepository<Product, Guid> _productRepository;
|
||||
private readonly IRepository<PaymentMethod, string> _paymentMethodRepository;
|
||||
private readonly IRepository<PaymentMethod, Guid> _paymentMethodRepository;
|
||||
private readonly IRepository<InstallmentOption> _installmentOptionRepository;
|
||||
private readonly IRepository<Order, Guid> _orderRepository;
|
||||
private readonly IRepository<About, Guid> _aboutRepository;
|
||||
|
|
@ -43,7 +43,7 @@ public class PublicAppService : PlatformAppService
|
|||
IRepository<BlogPost, Guid> postRepository,
|
||||
IRepository<BlogCategory, Guid> categoryRepository,
|
||||
IRepository<Product, Guid> productRepository,
|
||||
IRepository<PaymentMethod, string> paymentMethodRepository,
|
||||
IRepository<PaymentMethod, Guid> paymentMethodRepository,
|
||||
IRepository<InstallmentOption> installmentOptionRepository,
|
||||
IRepository<Order, Guid> orderRepository,
|
||||
IRepository<About, Guid> aboutRepository,
|
||||
|
|
|
|||
|
|
@ -1116,6 +1116,752 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region Tenant
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Forms.FormTenant))
|
||||
{
|
||||
var formTenant = await _listFormRepository.InsertAsync(
|
||||
new ListForm()
|
||||
{
|
||||
ListFormType = ListFormTypeEnum.Form,
|
||||
IsSubForm = false,
|
||||
LayoutJson = JsonSerializer.Serialize(new LayoutDto()
|
||||
{
|
||||
Grid = true,
|
||||
Card = true,
|
||||
Pivot = true,
|
||||
Chart = true,
|
||||
DefaultLayout = "grid",
|
||||
CardLayoutColumn = 4
|
||||
}),
|
||||
SubFormsJson = JsonSerializer.Serialize(new List<dynamic>() {
|
||||
new {
|
||||
TabTitle = "Branches",
|
||||
TabType = ListFormTabTypeEnum.List,
|
||||
Code = ListFormCodes.Lists.Branch,
|
||||
Relation = new List<dynamic>() {
|
||||
new {
|
||||
ParentFieldName = "Id",
|
||||
ChildFieldName = "TenantId"
|
||||
}
|
||||
}
|
||||
}
|
||||
}),
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = ListFormCodes.Forms.FormTenant,
|
||||
Name = TenantManagementPermissions.Tenants.Default,
|
||||
Title = TenantManagementPermissions.Tenants.Default,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = false,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = TenantManagementPermissions.Tenants.Default,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = "AbpTenants",
|
||||
KeyFieldName = "Id",
|
||||
KeyFieldDbSourceType = DbType.Guid,
|
||||
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 = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
D = TenantManagementPermissions.Tenants.Delete,
|
||||
E = TenantManagementPermissions.Tenants.Default + ".Export",
|
||||
I = TenantManagementPermissions.Tenants.Default + ".Import"
|
||||
}),
|
||||
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 = "Tenant Form",
|
||||
Width = 900,
|
||||
Height = 450
|
||||
},
|
||||
AllowDeleting = true,
|
||||
AllowAdding = true,
|
||||
AllowUpdating = true,
|
||||
SendOnlyChangedFormValuesUpdate = false,
|
||||
}),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
new() { Order=1, ColCount=2, ColSpan=1, ItemType="group", Items =
|
||||
[
|
||||
new EditingFormItemDto { Order=1, DataField="Name", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=2, DataField="OrganizationName", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=3, DataField="Founder", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=4, DataField="VknTckn", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxNumberBox },
|
||||
new EditingFormItemDto { Order=5, DataField="TaxOffice", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=6, DataField="Mobile", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxNumberBox },
|
||||
new EditingFormItemDto { Order=7, DataField="Phone", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxNumberBox },
|
||||
new EditingFormItemDto { Order=8, DataField="Fax", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=9, DataField="IsActive", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxCheckBox },
|
||||
]
|
||||
},
|
||||
new() { Order=2, ColCount=1, ColSpan=1, ItemType="group", Items =
|
||||
[
|
||||
new EditingFormItemDto { Order=1, DataField="Country", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=4, DataField="Street", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=5, DataField="PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=6, DataField="Address", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=7, DataField="Address2", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=8, DataField="Email", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=9, DataField="Website", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
]
|
||||
}
|
||||
}),
|
||||
CommandColumnJson = JsonSerializer.Serialize(new CommandColumnDto[] {
|
||||
new() {
|
||||
Hint = "Manage",
|
||||
Text = "Manage",
|
||||
AuthName = TenantManagementPermissions.Tenants.ManageConnectionStrings,
|
||||
DialogName = "TenantsConnectionString",
|
||||
DialogParameters = JsonSerializer.Serialize(new {
|
||||
name = "@Name",
|
||||
id = "@Id"
|
||||
})
|
||||
},
|
||||
}),
|
||||
InsertServiceAddress = "list-form-dynamic-api/tenant-insert",
|
||||
UpdateServiceAddress = "list-form-dynamic-api/tenant-update",
|
||||
DeleteCommand = "DELETE FROM \"AbpTenants\" WHERE \"Id\"=@Id",
|
||||
DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
|
||||
new() {
|
||||
FieldName = "Id",
|
||||
FieldDbType = DbType.Guid,
|
||||
Value = "@ID",
|
||||
CustomValueType = FieldCustomValueTypeEnum.CustomKey }
|
||||
}),
|
||||
FormFieldsDefaultValueJson = JsonSerializer.Serialize(new FieldsDefaultValue[] {
|
||||
new() {
|
||||
FieldName = "IsActive",
|
||||
FieldDbType = DbType.Boolean,
|
||||
Value = "true",
|
||||
CustomValueType = FieldCustomValueTypeEnum.Value }
|
||||
})
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
#region Tenants Fields
|
||||
await _listFormFieldRepository.InsertManyAsync(
|
||||
[
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.Guid,
|
||||
FieldName = "Id",
|
||||
Width = 500,
|
||||
ListOrderNo = 1,
|
||||
Visible = false,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Name",
|
||||
Width = 100,
|
||||
ListOrderNo = 2,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "OrganizationName",
|
||||
Width = 200,
|
||||
ListOrderNo = 3,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Founder",
|
||||
Width = 200,
|
||||
ListOrderNo = 4,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "VknTckn",
|
||||
Width = 100,
|
||||
ListOrderNo = 5,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "TaxOffice",
|
||||
Width = 150,
|
||||
ListOrderNo = 6,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Country",
|
||||
Width = 100,
|
||||
ListOrderNo = 7,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
LookupJson = JsonSerializer.Serialize(new LookupDto
|
||||
{
|
||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||
DisplayExpr = "Name",
|
||||
ValueExpr = "Key",
|
||||
LookupQuery = lookupQueryCountryValues,
|
||||
CascadeEmptyFields = "City,District,Street"
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "City",
|
||||
Width = 100,
|
||||
ListOrderNo = 8,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
LookupJson = JsonSerializer.Serialize(new LookupDto
|
||||
{
|
||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||
DisplayExpr = "Name",
|
||||
ValueExpr = "Key",
|
||||
LookupQuery = lookupQueryCityValues,
|
||||
CascadeRelationField = "Country",
|
||||
CascadeFilterOperator="=",
|
||||
CascadeParentFields = "Country",
|
||||
CascadeEmptyFields = "District,Street"
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "District",
|
||||
Width = 100,
|
||||
ListOrderNo = 9,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
LookupJson = JsonSerializer.Serialize(new LookupDto
|
||||
{
|
||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||
DisplayExpr = "Name",
|
||||
ValueExpr = "Key",
|
||||
LookupQuery = lookupQueryDistrictValues,
|
||||
CascadeRelationField = "City",
|
||||
CascadeFilterOperator="=",
|
||||
CascadeParentFields = "Country,City",
|
||||
CascadeEmptyFields = "Street",
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Street",
|
||||
Width = 100,
|
||||
ListOrderNo = 10,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
LookupJson = JsonSerializer.Serialize(new LookupDto
|
||||
{
|
||||
DataSourceType = UiLookupDataSourceTypeEnum.Query,
|
||||
DisplayExpr = "Name",
|
||||
ValueExpr = "Key",
|
||||
LookupQuery = lookupQueryStreetValues,
|
||||
CascadeRelationField = "District",
|
||||
CascadeFilterOperator="=",
|
||||
CascadeParentFields = "Country,City,District"
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Address",
|
||||
Width = 150,
|
||||
ListOrderNo = 11,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Address2",
|
||||
Width = 150,
|
||||
ListOrderNo = 12,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "PostalCode",
|
||||
Width = 100,
|
||||
ListOrderNo = 13,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Email",
|
||||
Width = 170,
|
||||
ListOrderNo = 14,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Website",
|
||||
Width = 170,
|
||||
ListOrderNo = 15,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Mobile",
|
||||
Width = 100,
|
||||
ListOrderNo = 16,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Phone",
|
||||
Width = 100,
|
||||
ListOrderNo = 17,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Fax",
|
||||
Width = 100,
|
||||
ListOrderNo = 18,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
new ListFormField
|
||||
{
|
||||
ListFormCode = formTenant.ListFormCode,
|
||||
RoleId = null,
|
||||
UserId = null,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.Boolean,
|
||||
FieldName = "IsActive",
|
||||
Width = 100,
|
||||
ListOrderNo = 19,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = TenantManagementPermissions.Tenants.Create,
|
||||
R = TenantManagementPermissions.Tenants.Default,
|
||||
U = TenantManagementPermissions.Tenants.Update,
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
}),
|
||||
PivotSettingsJson = JsonSerializer.Serialize(new ListFormFieldPivotSettingsDto
|
||||
{
|
||||
IsPivot = true
|
||||
})
|
||||
},
|
||||
]);
|
||||
#endregion
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region List
|
||||
|
|
@ -1214,30 +1960,30 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
}),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>()
|
||||
{
|
||||
new() { Order=1, ColCount=1, ColSpan=1, ItemType="group", Items =
|
||||
new() { Order=1, ColCount=2, ColSpan=1, ItemType="group", Items =
|
||||
[
|
||||
new EditingFormItemDto { Order=1, DataField="Name", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=2, DataField="OrganizationName", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=3, DataField="Founder", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=4, DataField="VknTckn", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxNumberBox },
|
||||
new EditingFormItemDto { Order=5, DataField="TaxOffice", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=6, DataField="Mobile", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxNumberBox },
|
||||
new EditingFormItemDto { Order=7, DataField="Phone", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxNumberBox },
|
||||
new EditingFormItemDto { Order=8, DataField="Fax", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=9, DataField="IsActive", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxCheckBox },
|
||||
new EditingFormItemDto { Order=1, DataField="Name", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=2, DataField="OrganizationName", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=3, DataField="Founder", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=4, DataField="VknTckn", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxNumberBox },
|
||||
new EditingFormItemDto { Order=5, DataField="TaxOffice", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=6, DataField="Mobile", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxNumberBox },
|
||||
new EditingFormItemDto { Order=7, DataField="Phone", ColSpan=1, IsRequired=false, EditorType2=EditorTypes.dxNumberBox },
|
||||
new EditingFormItemDto { Order=8, DataField="Fax", ColSpan=1, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=9, DataField="IsActive", ColSpan=1, IsRequired=false, EditorType2=EditorTypes.dxCheckBox },
|
||||
]
|
||||
},
|
||||
new() { Order=2, ColCount=1, ColSpan=1, ItemType="group", Items =
|
||||
new() { Order=2, ColCount=2, ColSpan=1, ItemType="group", Items =
|
||||
[
|
||||
new EditingFormItemDto { Order=1, DataField="Country", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=2, DataField="City", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=3, DataField="District", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=4, DataField="Street", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=5, DataField="PostalCode", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=6, DataField="Address", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=7, DataField="Address2", ColSpan=2, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=8, DataField="Email", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=9, DataField="Website", ColSpan=2, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=1, DataField="Country", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=2, DataField="City", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=3, DataField="District", ColSpan=1, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=4, DataField="Street", ColSpan=1, IsRequired=false, EditorType2=EditorTypes.dxSelectBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=5, DataField="PostalCode", ColSpan=1, IsRequired=false, EditorType2=EditorTypes.dxTextBox, EditorOptions=showClearButton },
|
||||
new EditingFormItemDto { Order=6, DataField="Address", ColSpan=1, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=7, DataField="Address2", ColSpan=1, IsRequired=false, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=8, DataField="Email", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order=9, DataField="Website", ColSpan=1, IsRequired=true, EditorType2=EditorTypes.dxTextBox },
|
||||
]
|
||||
}
|
||||
}),
|
||||
|
|
@ -1259,6 +2005,12 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
AuthName = AppCodes.Branches,
|
||||
Url = "/admin/list/list-branch",
|
||||
},
|
||||
new() {
|
||||
Hint = "Branches",
|
||||
Text = "Branches",
|
||||
AuthName = AppCodes.Branches,
|
||||
Url = "/admin/form/form-tenant/@Id",
|
||||
},
|
||||
}),
|
||||
InsertServiceAddress = "list-form-dynamic-api/tenant-insert",
|
||||
UpdateServiceAddress = "list-form-dynamic-api/tenant-update",
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
private readonly IRepository<Route, Guid> _routeRepository;
|
||||
private readonly IRepository<CustomEndpoint, Guid> _customEndpointRepository;
|
||||
private readonly IRepository<Product, Guid> _productRepository;
|
||||
private readonly IRepository<PaymentMethod, String> _paymentMethodRepository;
|
||||
private readonly IRepository<PaymentMethod, Guid> _paymentMethodRepository;
|
||||
private readonly IRepository<InstallmentOption, Guid> _installmentOptionRepository;
|
||||
private readonly IRepository<CustomComponent, Guid> _customComponentRepository;
|
||||
private readonly IRepository<ReportCategory, Guid> _reportCategoriesRepository;
|
||||
|
|
@ -126,7 +126,7 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
IRepository<About, Guid> aboutRepository,
|
||||
IRepository<Service, Guid> servicesRepository,
|
||||
IRepository<Product, Guid> productRepository,
|
||||
IRepository<PaymentMethod, String> paymentMethodRepository,
|
||||
IRepository<PaymentMethod, Guid> paymentMethodRepository,
|
||||
IRepository<InstallmentOption, Guid> installmentOptionRepository,
|
||||
IRepository<BlogCategory, Guid> blogCategoryRepository,
|
||||
IRepository<BlogPost, Guid> blogPostsRepository,
|
||||
|
|
@ -704,7 +704,7 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _uomCategoryRepository.InsertAsync(new UomCategory(item.Id, item.Name));
|
||||
await _uomCategoryRepository.InsertAsync(new UomCategory { Name = item.Name });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -714,15 +714,20 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _uomRepository.InsertAsync(new Uom
|
||||
var category = await _uomCategoryRepository.FirstOrDefaultAsync(x => x.Name == item.UomCategoryName);
|
||||
if (category != null)
|
||||
{
|
||||
Name = item.Name,
|
||||
Type = item.Type,
|
||||
Ratio = item.Ratio,
|
||||
IsActive = item.IsActive,
|
||||
Rounding = item.Rounding,
|
||||
UomCategoryId = item.UomCategoryId
|
||||
});
|
||||
|
||||
await _uomRepository.InsertAsync(new Uom
|
||||
{
|
||||
Name = item.Name,
|
||||
Type = item.Type,
|
||||
Ratio = item.Ratio,
|
||||
IsActive = item.IsActive,
|
||||
Rounding = item.Rounding,
|
||||
UomCategoryId = category.Id
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -750,38 +755,49 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
{
|
||||
await _skillTypeRepository.InsertAsync
|
||||
(
|
||||
new SkillType(item.Id, item.Name)
|
||||
);
|
||||
new SkillType
|
||||
{
|
||||
Name = item.Name
|
||||
}
|
||||
, autoSave: true);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in items.Skills)
|
||||
{
|
||||
var exists = await _skillRepository.AnyAsync(x => x.Name == item.Name && x.SkillTypeId == item.SkillTypeId);
|
||||
var exists = await _skillRepository.AnyAsync(x => x.Name == item.Name);
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
await _skillRepository.InsertAsync(new Skill
|
||||
var skillType = await _skillTypeRepository.FirstOrDefaultAsync(x => x.Name == item.SkillTypeName);
|
||||
if (skillType != null)
|
||||
{
|
||||
Name = item.Name,
|
||||
SkillTypeId = item.SkillTypeId
|
||||
});
|
||||
await _skillRepository.InsertAsync(new Skill
|
||||
{
|
||||
Name = item.Name,
|
||||
SkillTypeId = skillType.Id
|
||||
}, autoSave: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in items.SkillLevels)
|
||||
{
|
||||
var exists = await _skillLevelRepository.AnyAsync(x => x.Name == item.Name && x.SkillTypeId == item.SkillTypeId);
|
||||
var exists = await _skillLevelRepository.AnyAsync(x => x.Name == item.Name);
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
await _skillLevelRepository.InsertAsync(new SkillLevel
|
||||
var skillType = await _skillTypeRepository.FirstOrDefaultAsync(x => x.Name == item.SkillTypeName);
|
||||
if (skillType != null)
|
||||
{
|
||||
Name = item.Name,
|
||||
Progress = item.Progress,
|
||||
IsDefault = item.IsDefault,
|
||||
SkillTypeId = item.SkillTypeId,
|
||||
});
|
||||
await _skillLevelRepository.InsertAsync(new SkillLevel
|
||||
{
|
||||
Name = item.Name,
|
||||
Progress = item.Progress,
|
||||
IsDefault = item.IsDefault,
|
||||
SkillTypeId = skillType.Id,
|
||||
}, autoSave: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -819,13 +835,11 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
var newCategory = new BlogCategory(
|
||||
item.Id,
|
||||
item.Name,
|
||||
item.Slug,
|
||||
item.Description
|
||||
)
|
||||
var newCategory = new BlogCategory
|
||||
{
|
||||
Name = item.Name,
|
||||
Slug = item.Slug,
|
||||
Description = item.Description,
|
||||
DisplayOrder = item.DisplayOrder,
|
||||
PostCount = item.PostCount
|
||||
};
|
||||
|
|
@ -840,20 +854,24 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _blogPostsRepository.InsertAsync(new BlogPost(
|
||||
Guid.NewGuid(),
|
||||
item.Title,
|
||||
item.Slug,
|
||||
item.ContentTr,
|
||||
item.ContentEn,
|
||||
item.Summary,
|
||||
item.ReadTime,
|
||||
item.CoverImage,
|
||||
item.CategoryId,
|
||||
item.AuthorId,
|
||||
true,
|
||||
DateTime.UtcNow
|
||||
));
|
||||
var category = await _blogCategoryRepository.FirstOrDefaultAsync(x => x.Name == item.CategoryName);
|
||||
if (category != null)
|
||||
{
|
||||
await _blogPostsRepository.InsertAsync(new BlogPost
|
||||
{
|
||||
Title = item.Title,
|
||||
Slug = item.Slug,
|
||||
ContentTr = item.ContentTr,
|
||||
ContentEn = item.ContentEn,
|
||||
Summary = item.Summary,
|
||||
CoverImage = item.CoverImage,
|
||||
ReadTime = item.ReadTime,
|
||||
CategoryId = category.Id,
|
||||
AuthorId = item.AuthorId,
|
||||
IsPublished = true,
|
||||
PublishedAt = DateTime.UtcNow
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -863,14 +881,14 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
var newCategory = new ForumCategory(
|
||||
Guid.NewGuid(),
|
||||
item.Name,
|
||||
item.Slug,
|
||||
item.Description,
|
||||
item.Icon,
|
||||
item.DisplayOrder
|
||||
);
|
||||
var newCategory = new ForumCategory
|
||||
{
|
||||
Name = item.Name,
|
||||
Slug = item.Slug,
|
||||
Description = item.Description,
|
||||
Icon = item.Icon,
|
||||
DisplayOrder = item.DisplayOrder
|
||||
};
|
||||
|
||||
await _forumCategoryRepository.InsertAsync(newCategory);
|
||||
}
|
||||
|
|
@ -882,10 +900,10 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _aiBotRepository.InsertAsync(new AiBot(
|
||||
Guid.NewGuid(),
|
||||
item.BotName
|
||||
));
|
||||
await _aiBotRepository.InsertAsync(new AiBot
|
||||
{
|
||||
BotName = item.BotName,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -930,17 +948,17 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _productRepository.InsertAsync(new Product(
|
||||
Guid.NewGuid(),
|
||||
item.Name,
|
||||
item.Description,
|
||||
item.Category,
|
||||
item.Order,
|
||||
item.MonthlyPrice,
|
||||
item.YearlyPrice,
|
||||
item.IsQuantityBased,
|
||||
item.ImageUrl
|
||||
));
|
||||
await _productRepository.InsertAsync(new Product
|
||||
{
|
||||
Name = item.Name,
|
||||
Description = item.Description,
|
||||
Category = item.Category,
|
||||
Order = item.Order,
|
||||
MonthlyPrice = item.MonthlyPrice,
|
||||
YearlyPrice = item.YearlyPrice,
|
||||
IsQuantityBased = item.IsQuantityBased,
|
||||
ImageUrl = item.ImageUrl
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -950,12 +968,12 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _paymentMethodRepository.InsertAsync(new PaymentMethod(
|
||||
item.Id,
|
||||
item.Name,
|
||||
item.Commission,
|
||||
item.Logo
|
||||
));
|
||||
await _paymentMethodRepository.InsertAsync(new PaymentMethod
|
||||
{
|
||||
Name = item.Name,
|
||||
Commission = item.Commission,
|
||||
Logo = item.Logo
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -994,11 +1012,12 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _reportCategoriesRepository.InsertAsync(new ReportCategory(
|
||||
Guid.NewGuid(),
|
||||
item.Name,
|
||||
item.Description,
|
||||
item.Icon));
|
||||
await _reportCategoriesRepository.InsertAsync(new ReportCategory
|
||||
{
|
||||
Name = item.Name,
|
||||
Description = item.Description,
|
||||
Icon = item.Icon
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1008,14 +1027,14 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _servicesRepository.InsertAsync(new Service(
|
||||
Guid.NewGuid(),
|
||||
item.Icon,
|
||||
item.Title,
|
||||
item.Description,
|
||||
item.Type,
|
||||
item.Features
|
||||
));
|
||||
await _servicesRepository.InsertAsync(new Service
|
||||
{
|
||||
Icon = item.Icon,
|
||||
Title = item.Title,
|
||||
Description = item.Description,
|
||||
Type = item.Type,
|
||||
Features = item.Features
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1024,12 +1043,12 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
var exists = await _aboutRepository.FirstOrDefaultAsync();
|
||||
if (exists == null)
|
||||
{
|
||||
await _aboutRepository.InsertAsync(new About(
|
||||
Guid.NewGuid(),
|
||||
JsonSerializer.Serialize(item.Stats),
|
||||
JsonSerializer.Serialize(item.Descriptions),
|
||||
JsonSerializer.Serialize(item.Sections)
|
||||
));
|
||||
await _aboutRepository.InsertAsync(new About
|
||||
{
|
||||
StatsJson = JsonSerializer.Serialize(item.Stats),
|
||||
DescriptionsJson = JsonSerializer.Serialize(item.Descriptions),
|
||||
SectionsJson = JsonSerializer.Serialize(item.Sections)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1038,17 +1057,17 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
var exists = await _contactRepository.FirstOrDefaultAsync();
|
||||
if (exists == null)
|
||||
{
|
||||
await _contactRepository.InsertAsync(new Contact(
|
||||
Guid.NewGuid(),
|
||||
item.Address,
|
||||
item.Phone,
|
||||
item.Email,
|
||||
item.Location,
|
||||
item.TaxNumber,
|
||||
JsonSerializer.Serialize(item.Bank),
|
||||
JsonSerializer.Serialize(item.WorkHour),
|
||||
JsonSerializer.Serialize(item.Map)
|
||||
));
|
||||
await _contactRepository.InsertAsync(new Contact
|
||||
{
|
||||
Address = item.Address,
|
||||
Phone = item.Phone,
|
||||
Email = item.Email,
|
||||
Location = item.Location,
|
||||
TaxNumber = item.TaxNumber,
|
||||
BankJson = JsonSerializer.Serialize(item.Bank),
|
||||
WorkHoursJson = JsonSerializer.Serialize(item.WorkHour),
|
||||
MapJson = JsonSerializer.Serialize(item.Map)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1058,19 +1077,19 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _classroomRepository.InsertAsync(new Classroom(
|
||||
Guid.NewGuid(),
|
||||
item.Name,
|
||||
item.Description,
|
||||
item.Subject,
|
||||
item.TeacherId,
|
||||
item.TeacherName,
|
||||
item.ScheduledStartTime,
|
||||
item.ScheduledEndTime,
|
||||
item.Duration,
|
||||
item.MaxParticipants,
|
||||
item.SettingsJson
|
||||
));
|
||||
await _classroomRepository.InsertAsync(new Classroom
|
||||
{
|
||||
Name = item.Name,
|
||||
Description = item.Description,
|
||||
Subject = item.Subject,
|
||||
TeacherId = item.TeacherId,
|
||||
TeacherName = item.TeacherName,
|
||||
ScheduledStartTime = item.ScheduledStartTime,
|
||||
ScheduledEndTime = item.ScheduledEndTime,
|
||||
Duration = item.Duration,
|
||||
MaxParticipants = item.MaxParticipants,
|
||||
SettingsJson = item.SettingsJson
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1292,7 +1311,10 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _eventTypeRepository.InsertAsync(new EventType(item.Id, item.Name));
|
||||
await _eventTypeRepository.InsertAsync(new EventType
|
||||
{
|
||||
Name = item.Name
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1302,7 +1324,10 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _eventCategoryRepository.InsertAsync(new EventCategory(item.Id, item.Name));
|
||||
await _eventCategoryRepository.InsertAsync(new EventCategory
|
||||
{
|
||||
Name = item.Name
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1354,11 +1379,11 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _registrationTypeRepository.InsertAsync(new RegistrationType(
|
||||
item.Id,
|
||||
item.Name,
|
||||
item.Status
|
||||
));
|
||||
await _registrationTypeRepository.InsertAsync(new RegistrationType
|
||||
{
|
||||
Name = item.Name,
|
||||
Status = item.Status
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1368,12 +1393,16 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _registrationMethodRepository.InsertAsync(new RegistrationMethod
|
||||
var registrationType = await _registrationTypeRepository.FirstOrDefaultAsync(x => x.Name == item.RegistrationTypeName);
|
||||
if (registrationType != null)
|
||||
{
|
||||
RegistrationTypeId = item.RegistrationTypeId,
|
||||
Name = item.Name,
|
||||
Status = item.Status
|
||||
});
|
||||
await _registrationMethodRepository.InsertAsync(new RegistrationMethod
|
||||
{
|
||||
RegistrationTypeId = registrationType.Id,
|
||||
Name = item.Name,
|
||||
Status = item.Status
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1383,14 +1412,18 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _classTypeRepository.InsertAsync(new ClassType(
|
||||
item.Id,
|
||||
item.RegistrationTypeId,
|
||||
item.Name,
|
||||
item.MinStudentCount,
|
||||
item.MaxStudentCount,
|
||||
item.Status
|
||||
));
|
||||
var registrationType = await _registrationTypeRepository.FirstOrDefaultAsync(x => x.Name == item.RegistrationTypeName);
|
||||
if (registrationType != null)
|
||||
{
|
||||
await _classTypeRepository.InsertAsync(new ClassType
|
||||
{
|
||||
RegistrationTypeId = registrationType.Id,
|
||||
Name = item.Name,
|
||||
MinStudentCount = item.MinStudentCount,
|
||||
MaxStudentCount = item.MaxStudentCount,
|
||||
Status = item.Status
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1400,12 +1433,16 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _classRepository.InsertAsync(new()
|
||||
var classType = await _classTypeRepository.FirstOrDefaultAsync(x => x.Name == item.ClassTypeName);
|
||||
if (classType != null)
|
||||
{
|
||||
ClassTypeId = item.ClassTypeId,
|
||||
Name = item.Name,
|
||||
Status = item.Status,
|
||||
});
|
||||
await _classRepository.InsertAsync(new()
|
||||
{
|
||||
ClassTypeId = classType.Id,
|
||||
Name = item.Name,
|
||||
Status = item.Status,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1415,16 +1452,20 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
if (!exists)
|
||||
{
|
||||
await _levelRepository.InsertAsync(new Level
|
||||
var classType = await _classTypeRepository.FirstOrDefaultAsync(x => x.Name == item.ClassTypeName);
|
||||
if (classType != null)
|
||||
{
|
||||
ClassTypeId = item.ClassTypeId,
|
||||
Name = item.Name,
|
||||
LevelType = item.LevelType,
|
||||
LessonCount = item.LessonCount,
|
||||
Status = item.Status,
|
||||
LessonDuration = item.LessonDuration,
|
||||
MonthlyPaymentRate = item.MonthlyPaymentRate
|
||||
});
|
||||
await _levelRepository.InsertAsync(new Level
|
||||
{
|
||||
ClassTypeId = classType.Id,
|
||||
Name = item.Name,
|
||||
LevelType = item.LevelType,
|
||||
LessonCount = item.LessonCount,
|
||||
Status = item.Status,
|
||||
LessonDuration = item.LessonDuration,
|
||||
MonthlyPaymentRate = item.MonthlyPaymentRate
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -157,7 +157,7 @@ public class UomSeedDto
|
|||
public decimal Ratio { get; set; }
|
||||
public bool IsActive { get; set; }
|
||||
public decimal Rounding { get; set; }
|
||||
public Guid UomCategoryId { get; set; }
|
||||
public string UomCategoryName { get; set; }
|
||||
}
|
||||
|
||||
public class CurrencySeedDto
|
||||
|
|
@ -170,14 +170,13 @@ public class CurrencySeedDto
|
|||
|
||||
public class SkillTypeSeedDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
|
||||
public class SkillSeedDto
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public Guid SkillTypeId { get; set; }
|
||||
public string SkillTypeName { get; set; }
|
||||
}
|
||||
|
||||
public class SkillLevelSeedDto
|
||||
|
|
@ -185,7 +184,7 @@ public class SkillLevelSeedDto
|
|||
public string Name { get; set; }
|
||||
public int Progress { get; set; }
|
||||
public bool IsDefault { get; set; }
|
||||
public Guid SkillTypeId { get; set; }
|
||||
public string SkillTypeName { get; set; }
|
||||
}
|
||||
|
||||
public class ContactTagSeedDto
|
||||
|
|
@ -202,7 +201,6 @@ public class ContactTitleSeedDto
|
|||
|
||||
public class BlogCategorySeedDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Slug { get; set; }
|
||||
public string Description { get; set; }
|
||||
|
|
@ -219,7 +217,7 @@ public class BlogPostSeedDto
|
|||
public string ReadTime { get; set; }
|
||||
public string Summary { get; set; }
|
||||
public string CoverImage { get; set; }
|
||||
public Guid CategoryId { get; set; }
|
||||
public string CategoryName { get; set; }
|
||||
public Guid AuthorId { get; set; }
|
||||
public Boolean IsPublished { get; set; }
|
||||
public DateTime PublishedAt { get; set; }
|
||||
|
|
@ -263,7 +261,6 @@ public class CustomEndpointSeedDto
|
|||
|
||||
public class ProductSeedDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Category { get; set; }
|
||||
|
|
@ -276,7 +273,6 @@ public class ProductSeedDto
|
|||
|
||||
public class PaymentMethodSeedDto
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public decimal Commission { get; set; }
|
||||
public string Logo { get; set; }
|
||||
|
|
@ -500,22 +496,20 @@ public class ProgramSeedDto
|
|||
|
||||
public class RegistrationTypeSeedDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Status { get; set; }
|
||||
}
|
||||
|
||||
public class RegistrationMethodSeedDto
|
||||
{
|
||||
public Guid RegistrationTypeId { get; set; }
|
||||
public string RegistrationTypeName { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Status { get; set; }
|
||||
}
|
||||
|
||||
public class ClassTypeSeedDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid RegistrationTypeId { get; set; }
|
||||
public string RegistrationTypeName { get; set; }
|
||||
public string Name { get; set; }
|
||||
public int? MinStudentCount { get; set; }
|
||||
public int? MaxStudentCount { get; set; }
|
||||
|
|
@ -524,14 +518,14 @@ public class ClassTypeSeedDto
|
|||
|
||||
public class ClassSeedDto
|
||||
{
|
||||
public Guid ClassTypeId { get; set; }
|
||||
public string ClassTypeName { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Status { get; set; }
|
||||
}
|
||||
|
||||
public class LevelSeedDto
|
||||
{
|
||||
public Guid ClassTypeId { get; set; }
|
||||
public string ClassTypeName { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string LevelType { get; set; }
|
||||
public int LessonCount { get; set; }
|
||||
|
|
|
|||
|
|
@ -367,6 +367,7 @@ public static class PlatformConsts
|
|||
{
|
||||
public static class Forms
|
||||
{
|
||||
public const string FormTenant = "form-tenant";
|
||||
public const string FormLanguage = "form-language";
|
||||
public const string FormUomCategory = "form-uomcategory";
|
||||
public const string FormSkillType = "form-skilltype";
|
||||
|
|
|
|||
|
|
@ -22,20 +22,5 @@ public class ClassType : FullAuditedEntity<Guid>, IMultiTenant
|
|||
// Navigation
|
||||
public RegistrationType RegistrationType { get; set; }
|
||||
public ICollection<Class> Classes { get; set; }
|
||||
public ICollection<Level> Levels { get; set; }
|
||||
|
||||
public ClassType()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public ClassType(Guid id, Guid registrationTypeId, string name, int? minStudentCount, int? maxStudentCount, string status)
|
||||
{
|
||||
Id = id;
|
||||
RegistrationTypeId = registrationTypeId;
|
||||
Name = name;
|
||||
MinStudentCount = minStudentCount;
|
||||
MaxStudentCount = maxStudentCount;
|
||||
Status = status;
|
||||
}
|
||||
public ICollection<Level> Levels { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,15 +15,4 @@ public class EventCategory : FullAuditedEntity<Guid>, IMultiTenant
|
|||
public ICollection<Event> Events { get; set; }
|
||||
|
||||
Guid? IMultiTenant.TenantId => TenantId;
|
||||
|
||||
public EventCategory()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public EventCategory(Guid id, string name)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,15 +15,4 @@ public class EventType : FullAuditedEntity<Guid>, IMultiTenant
|
|||
public ICollection<Event> Events { get; set; }
|
||||
|
||||
Guid? IMultiTenant.TenantId => TenantId;
|
||||
|
||||
public EventType()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public EventType(Guid id, string name)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,11 +18,4 @@ public class RegistrationType : FullAuditedEntity<Guid>, IMultiTenant
|
|||
// Navigation
|
||||
public ICollection<RegistrationMethod> Methods { get; set; }
|
||||
public ICollection<ClassType> ClassTypes { get; set; }
|
||||
|
||||
public RegistrationType(Guid id, string name, string status)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
Status = status;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,4 @@ public class SkillType : FullAuditedEntity<Guid>, IMultiTenant
|
|||
|
||||
public ICollection<Skill> Skills { get; set; }
|
||||
public ICollection<SkillLevel> Levels { get; set; }
|
||||
|
||||
public SkillType()
|
||||
{
|
||||
}
|
||||
|
||||
public SkillType(Guid id, string name) : base(id)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
|
|
@ -14,11 +14,4 @@ public class UomCategory : FullAuditedEntity<Guid>, IMultiTenant
|
|||
public ICollection<Uom> Uoms { get; set; }
|
||||
|
||||
Guid? IMultiTenant.TenantId => TenantId;
|
||||
|
||||
protected UomCategory() { }
|
||||
|
||||
public UomCategory(Guid id, string name) : base(id)
|
||||
{
|
||||
Name = name;
|
||||
}
|
||||
}
|
||||
|
|
@ -22,44 +22,7 @@ public class Classroom : FullAuditedEntity<Guid>
|
|||
public string SettingsJson { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public virtual ICollection<ClassroomParticipant> Participants { get; set; }
|
||||
public virtual ICollection<ClassroomAttandance> AttendanceRecords { get; set; }
|
||||
public virtual ICollection<ClassroomChat> ChatMessages { get; set; }
|
||||
|
||||
protected Classroom()
|
||||
{
|
||||
Participants = new HashSet<ClassroomParticipant>();
|
||||
AttendanceRecords = new HashSet<ClassroomAttandance>();
|
||||
ChatMessages = new HashSet<ClassroomChat>();
|
||||
}
|
||||
|
||||
public Classroom(
|
||||
Guid id,
|
||||
string name,
|
||||
string description,
|
||||
string subject,
|
||||
Guid? teacherId,
|
||||
string teacherName,
|
||||
DateTime scheduledStartTime,
|
||||
DateTime? scheduledEndTime,
|
||||
int duration,
|
||||
int maxParticipants,
|
||||
string settingsJson
|
||||
) : base(id)
|
||||
{
|
||||
Name = name;
|
||||
Description = description;
|
||||
Subject = subject;
|
||||
TeacherId = teacherId;
|
||||
TeacherName = teacherName;
|
||||
ScheduledStartTime = scheduledStartTime;
|
||||
ScheduledEndTime = scheduledEndTime;
|
||||
Duration = duration;
|
||||
MaxParticipants = maxParticipants;
|
||||
SettingsJson = settingsJson;
|
||||
|
||||
Participants = new HashSet<ClassroomParticipant>();
|
||||
AttendanceRecords = new HashSet<ClassroomAttandance>();
|
||||
ChatMessages = new HashSet<ClassroomChat>();
|
||||
}
|
||||
public virtual ICollection<ClassroomParticipant> Participants { get; set; } = new HashSet<ClassroomParticipant>();
|
||||
public virtual ICollection<ClassroomAttandance> AttendanceRecords { get; set; } = new HashSet<ClassroomAttandance>();
|
||||
public virtual ICollection<ClassroomChat> ChatMessages { get; set; } = new HashSet<ClassroomChat>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,11 +6,5 @@ namespace Kurs.Platform.Entities;
|
|||
public class AiBot : Entity<Guid>
|
||||
{
|
||||
public string BotName { get; set; }
|
||||
|
||||
public AiBot(Guid id, string botName)
|
||||
{
|
||||
Id = Id;
|
||||
BotName = botName;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,24 +20,7 @@ public class ForumCategory : FullAuditedEntity<Guid>
|
|||
public Guid? LastPostUserId { get; set; }
|
||||
public string LastPostUserName { get; set; }
|
||||
|
||||
public ICollection<ForumTopic> Topics { get; set; }
|
||||
public ICollection<ForumTopic> Topics { get; set; } = [];
|
||||
|
||||
public Guid? TenantId { get; set; }
|
||||
|
||||
protected ForumCategory() { }
|
||||
|
||||
public ForumCategory(Guid id, string name, string slug, string description, string icon, int displayOrder, Guid? tenantId = null) : base(id)
|
||||
{
|
||||
Name = name;
|
||||
Slug = slug;
|
||||
Description = description;
|
||||
Icon = icon;
|
||||
DisplayOrder = displayOrder;
|
||||
IsActive = true;
|
||||
IsLocked = false;
|
||||
TopicCount = 0;
|
||||
PostCount = 0;
|
||||
TenantId = tenantId;
|
||||
Topics = [];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,18 +11,4 @@ public class About : FullAuditedEntity<Guid>, IMultiTenant
|
|||
public string StatsJson { get; set; }
|
||||
public string DescriptionsJson { get; set; }
|
||||
public string SectionsJson { get; set; }
|
||||
|
||||
protected About() { }
|
||||
|
||||
public About(
|
||||
Guid id,
|
||||
string statsJson,
|
||||
string descriptionsJson,
|
||||
string sectionsJson
|
||||
) : base(id)
|
||||
{
|
||||
StatsJson = statsJson;
|
||||
DescriptionsJson = descriptionsJson;
|
||||
SectionsJson = sectionsJson;
|
||||
}
|
||||
}
|
||||
|
|
@ -18,29 +18,6 @@ public class BlogCategory : FullAuditedEntity<Guid>, IMultiTenant
|
|||
|
||||
public virtual ICollection<BlogPost> Posts { get; set; }
|
||||
|
||||
protected BlogCategory()
|
||||
{
|
||||
Posts = new HashSet<BlogPost>();
|
||||
}
|
||||
|
||||
public BlogCategory(
|
||||
Guid id,
|
||||
string name,
|
||||
string slug,
|
||||
string description = null,
|
||||
Guid? tenantId = null) : base(id)
|
||||
{
|
||||
Name = name;
|
||||
Slug = slug;
|
||||
Description = description;
|
||||
TenantId = tenantId;
|
||||
Icon = null;
|
||||
DisplayOrder = 0;
|
||||
IsActive = true;
|
||||
PostCount = 0;
|
||||
Posts = new HashSet<BlogPost>();
|
||||
}
|
||||
|
||||
public void IncrementPostCount()
|
||||
{
|
||||
PostCount++;
|
||||
|
|
|
|||
|
|
@ -27,43 +27,6 @@ public class BlogPost : FullAuditedEntity<Guid>, IMultiTenant
|
|||
public bool IsPublished { get; set; } = false;
|
||||
public DateTime? PublishedAt { get; set; }
|
||||
|
||||
protected BlogPost()
|
||||
{
|
||||
}
|
||||
|
||||
public BlogPost(
|
||||
Guid id,
|
||||
string title,
|
||||
string slug,
|
||||
string contentTr,
|
||||
string contentEn,
|
||||
string summary,
|
||||
string readTime,
|
||||
string coverImage,
|
||||
Guid categoryId,
|
||||
Guid authorId,
|
||||
bool isPublished,
|
||||
DateTime? publishedAt = null,
|
||||
Guid? tenantId = null) : base(id)
|
||||
{
|
||||
Title = title;
|
||||
Slug = slug;
|
||||
ContentTr = contentTr;
|
||||
ContentEn = contentEn;
|
||||
Summary = summary;
|
||||
ReadTime = readTime;
|
||||
CoverImage = coverImage;
|
||||
CategoryId = categoryId;
|
||||
AuthorId = authorId;
|
||||
IsPublished = isPublished;
|
||||
PublishedAt = publishedAt;
|
||||
TenantId = tenantId;
|
||||
|
||||
ViewCount = 0;
|
||||
LikeCount = 0;
|
||||
CommentCount = 0;
|
||||
}
|
||||
|
||||
public void Publish()
|
||||
{
|
||||
IsPublished = true;
|
||||
|
|
|
|||
|
|
@ -18,28 +18,4 @@ public class Contact : FullAuditedEntity<Guid>, IMultiTenant
|
|||
public string BankJson { get; set; }
|
||||
public string WorkHoursJson { get; set; }
|
||||
public string MapJson { get; set; }
|
||||
|
||||
protected Contact() { }
|
||||
|
||||
public Contact(
|
||||
Guid id,
|
||||
string address,
|
||||
string phone,
|
||||
string email,
|
||||
string location,
|
||||
string taxNumber,
|
||||
string bankJson,
|
||||
string workHoursJson,
|
||||
string mapJson
|
||||
) : base(id)
|
||||
{
|
||||
Address = address;
|
||||
Phone = phone;
|
||||
Email = email;
|
||||
Location = location;
|
||||
TaxNumber = taxNumber;
|
||||
BankJson = bankJson;
|
||||
WorkHoursJson = workHoursJson;
|
||||
MapJson = mapJson;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +1,11 @@
|
|||
using Volo.Abp.Domain.Entities;
|
||||
using System;
|
||||
using Volo.Abp.Domain.Entities.Auditing;
|
||||
|
||||
namespace Kurs.Platform.Entities;
|
||||
|
||||
public class PaymentMethod : Entity<string>
|
||||
public class PaymentMethod : FullAuditedEntity<Guid>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public decimal Commission { get; set; }
|
||||
public string Logo { get; set; }
|
||||
|
||||
public PaymentMethod() { }
|
||||
|
||||
public PaymentMethod(string id, string name, decimal commission, string logo)
|
||||
{
|
||||
Id = id;
|
||||
Name = name;
|
||||
Commission = commission;
|
||||
Logo = logo;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,30 +13,4 @@ public class Product : FullAuditedEntity<Guid>
|
|||
public decimal? YearlyPrice { get; set; }
|
||||
public bool IsQuantityBased { get; set; } = false;
|
||||
public string ImageUrl { get; set; }
|
||||
|
||||
public Product()
|
||||
{
|
||||
}
|
||||
|
||||
public Product(
|
||||
Guid id,
|
||||
string name,
|
||||
string description,
|
||||
string category,
|
||||
int order,
|
||||
decimal? monthlyPrice,
|
||||
decimal? yearlyPrice,
|
||||
bool isQuantityBased,
|
||||
string imageUrl
|
||||
) : base(id)
|
||||
{
|
||||
Name = name;
|
||||
Description = description;
|
||||
Category = category;
|
||||
Order = order;
|
||||
MonthlyPrice = monthlyPrice;
|
||||
YearlyPrice = yearlyPrice;
|
||||
IsQuantityBased = isQuantityBased;
|
||||
ImageUrl = imageUrl;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,17 +14,5 @@ public class Service : FullAuditedEntity<Guid>, IMultiTenant
|
|||
|
||||
// JSON olarak saklanacak
|
||||
public string[] Features { get; set; } = [];
|
||||
|
||||
protected Service() { }
|
||||
|
||||
public Service(Guid id, string icon, string title, string description, string type, string[] features)
|
||||
: base(id)
|
||||
{
|
||||
Icon = icon;
|
||||
Title = title;
|
||||
Description = description;
|
||||
Type = type;
|
||||
Features = features;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,21 +11,5 @@ namespace Kurs.Platform.Entities
|
|||
public string Icon { get; set; }
|
||||
|
||||
public ICollection<ReportTemplate> ReportTemplates { get; set; }
|
||||
|
||||
public ReportCategory()
|
||||
{
|
||||
}
|
||||
|
||||
public ReportCategory(
|
||||
Guid id,
|
||||
string name,
|
||||
string description,
|
||||
string icon = null
|
||||
) : base(id)
|
||||
{
|
||||
Name = name;
|
||||
Description = description;
|
||||
Icon = icon;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -855,8 +855,6 @@ public class PlatformDbContext :
|
|||
|
||||
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
|
||||
|
||||
b.HasIndex(x => x.Name).IsUnique();
|
||||
|
||||
b.HasMany(x => x.Skills)
|
||||
.WithOne(x => x.SkillType)
|
||||
.HasForeignKey(x => x.SkillTypeId)
|
||||
|
|
@ -897,7 +895,6 @@ public class PlatformDbContext :
|
|||
|
||||
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
|
||||
|
||||
b.HasIndex(x => x.Name).IsUnique();
|
||||
});
|
||||
|
||||
builder.Entity<Uom>(b =>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
|
|||
namespace Kurs.Platform.Migrations
|
||||
{
|
||||
[DbContext(typeof(PlatformDbContext))]
|
||||
[Migration("20251006121303_Initial")]
|
||||
[Migration("20251006221403_Initial")]
|
||||
partial class Initial
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
|
@ -3311,10 +3311,6 @@ namespace Kurs.Platform.Migrations
|
|||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("City")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("ContactPerson")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
|
@ -4706,13 +4702,43 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.PaymentMethod", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Commission")
|
||||
.HasPrecision(5, 3)
|
||||
.HasColumnType("decimal(5,3)");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("Logo")
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("nvarchar(32)");
|
||||
|
|
@ -5860,9 +5886,6 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DSkillType", (string)null);
|
||||
});
|
||||
|
||||
|
|
@ -6035,9 +6058,6 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DUomCategory", (string)null);
|
||||
});
|
||||
|
||||
|
|
@ -719,7 +719,6 @@ namespace Kurs.Platform.Migrations
|
|||
ContactPerson = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
Email = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: true),
|
||||
Address = table.Column<string>(type: "nvarchar(250)", maxLength: 250, nullable: true),
|
||||
City = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
TaxOffice = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
|
||||
TaxNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
Phone1 = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
|
||||
|
|
@ -1945,10 +1944,17 @@ namespace Kurs.Platform.Migrations
|
|||
name: "WPaymentMethod",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<string>(type: "nvarchar(450)", nullable: false),
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
||||
Commission = table.Column<decimal>(type: "decimal(5,3)", precision: 5, scale: 3, nullable: false),
|
||||
Logo = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true)
|
||||
Logo = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: true),
|
||||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
|
||||
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
|
|
@ -3767,23 +3773,11 @@ namespace Kurs.Platform.Migrations
|
|||
table: "DSkillLevel",
|
||||
column: "SkillTypeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DSkillType_Name",
|
||||
table: "DSkillType",
|
||||
column: "Name",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DUom_UomCategoryId",
|
||||
table: "DUom",
|
||||
column: "UomCategoryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DUomCategory_Name",
|
||||
table: "DUomCategory",
|
||||
column: "Name",
|
||||
unique: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_OpenIddictApplications_ClientId",
|
||||
table: "OpenIddictApplications",
|
||||
|
|
@ -3308,10 +3308,6 @@ namespace Kurs.Platform.Migrations
|
|||
.HasMaxLength(250)
|
||||
.HasColumnType("nvarchar(250)");
|
||||
|
||||
b.Property<string>("City")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
||||
b.Property<string>("ContactPerson")
|
||||
.HasMaxLength(50)
|
||||
.HasColumnType("nvarchar(50)");
|
||||
|
|
@ -4703,13 +4699,43 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.PaymentMethod", b =>
|
||||
{
|
||||
b.Property<string>("Id")
|
||||
.HasColumnType("nvarchar(450)");
|
||||
b.Property<Guid>("Id")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<decimal>("Commission")
|
||||
.HasPrecision(5, 3)
|
||||
.HasColumnType("decimal(5,3)");
|
||||
|
||||
b.Property<DateTime>("CreationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("CreationTime");
|
||||
|
||||
b.Property<Guid?>("CreatorId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("CreatorId");
|
||||
|
||||
b.Property<Guid?>("DeleterId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("DeleterId");
|
||||
|
||||
b.Property<DateTime?>("DeletionTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("DeletionTime");
|
||||
|
||||
b.Property<bool>("IsDeleted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("bit")
|
||||
.HasDefaultValue(false)
|
||||
.HasColumnName("IsDeleted");
|
||||
|
||||
b.Property<DateTime?>("LastModificationTime")
|
||||
.HasColumnType("datetime2")
|
||||
.HasColumnName("LastModificationTime");
|
||||
|
||||
b.Property<Guid?>("LastModifierId")
|
||||
.HasColumnType("uniqueidentifier")
|
||||
.HasColumnName("LastModifierId");
|
||||
|
||||
b.Property<string>("Logo")
|
||||
.HasMaxLength(32)
|
||||
.HasColumnType("nvarchar(32)");
|
||||
|
|
@ -5857,9 +5883,6 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DSkillType", (string)null);
|
||||
});
|
||||
|
||||
|
|
@ -6032,9 +6055,6 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("Name")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("DUomCategory", (string)null);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ export const tabVisibilityConfig: Record<string, string[]> = {
|
|||
'legendSettings',
|
||||
'exportSettings',
|
||||
'crosshairOptions',
|
||||
'subForms',
|
||||
],
|
||||
Form: [
|
||||
'details',
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@ export const dynamicFetch = (
|
|||
url: '/api/app/' + url,
|
||||
params,
|
||||
data,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
})
|
||||
} catch (error) {
|
||||
if (error instanceof AxiosError) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import { GridBoxEditorComponent } from './editors/GridBoxEditorComponent'
|
|||
import { TagBoxEditorComponent } from './editors/TagBoxEditorComponent'
|
||||
import { RowMode, SimpleItemWithColData } from './types'
|
||||
import { PlatformEditorTypes } from '@/proxy/form/models'
|
||||
import dxSelectBox from 'devextreme/ui/select_box'
|
||||
|
||||
const FormDevExpress = (props: {
|
||||
listFormCode: string
|
||||
|
|
|
|||
|
|
@ -251,7 +251,7 @@ const useGridData = (props: {
|
|||
...editorOptions,
|
||||
...(colData?.lookupDto?.dataSourceType
|
||||
? {
|
||||
dataSource: getLookupDataSource(colData?.editorOptions, colData),
|
||||
dataSource: getLookupDataSource(colData?.editorOptions, colData, formData),
|
||||
valueExpr: colData?.lookupDto?.valueExpr?.toLowerCase(),
|
||||
displayExpr: colData?.lookupDto?.displayExpr?.toLowerCase(),
|
||||
}
|
||||
|
|
@ -288,7 +288,7 @@ const useGridData = (props: {
|
|||
})
|
||||
setFormItems(items)
|
||||
setGridReady(true)
|
||||
}, [gridDto])
|
||||
}, [gridDto, formData])
|
||||
|
||||
useEffect(() => {
|
||||
if (!gridReady) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ const createLookupQueryDataSource = (
|
|||
if (!isSubForm && listFormCode && !window.location.pathname.includes(listFormCode)) {
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await dynamicFetch('list-form-select/lookup', 'POST', null, {
|
||||
listFormCode,
|
||||
|
|
@ -107,9 +106,17 @@ export const useLookupDataSource = ({
|
|||
isSubForm?: boolean
|
||||
}) => {
|
||||
const getLookupDataSource = useCallback(
|
||||
(options: any, colData: any) => {
|
||||
(options: any, colData: any, data: any) => {
|
||||
const { lookupDto } = colData
|
||||
const filters = []
|
||||
|
||||
//Eğer cascadeParentFields varsa ve data yoksa boş döneriz.
|
||||
if (lookupDto.cascadeParentFields && !data) {
|
||||
return {
|
||||
store: [],
|
||||
}
|
||||
}
|
||||
|
||||
if (lookupDto.cascadeParentFields) {
|
||||
if (lookupDto.dataSourceType == UiLookupDataSourceTypeEnum.StaticData) {
|
||||
filters.push([
|
||||
|
|
@ -118,7 +125,6 @@ export const useLookupDataSource = ({
|
|||
options?.data[lookupDto?.cascadeParentField],
|
||||
])
|
||||
} else {
|
||||
const data = options?.data ?? options
|
||||
for (const cascadeParentField of lookupDto.cascadeParentFields.split(',')) {
|
||||
filters.push(data?.[cascadeParentField] ?? null)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue