Merge remote-tracking branch 'devops.sozsoft.com/main'
# Conflicts: # ui/dev-dist/sw.js # ui/src/main.tsx
This commit is contained in:
commit
06c59824bd
15 changed files with 80737 additions and 5001 deletions
|
|
@ -5,7 +5,8 @@ namespace Kurs.Platform.Contacts;
|
|||
|
||||
public class CityDto : AuditedEntityDto<Guid>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string PlateCode { get; set; }
|
||||
public string CountryCode { get; set; }
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
using System;
|
||||
using Volo.Abp.Application.Dtos;
|
||||
|
||||
namespace Kurs.Platform.Contacts;
|
||||
|
||||
public class DistrictDto : AuditedEntityDto<Guid>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string CityCode { get; set; }
|
||||
public string Township { get; set; }
|
||||
public string Street { get; set; }
|
||||
public string ZipCode { get; set; }
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -10375,20 +10375,20 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
#endregion
|
||||
|
||||
#region City
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.State))
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.City))
|
||||
{
|
||||
var listFormState = await _listFormRepository.InsertAsync(
|
||||
var listFormCity = await _listFormRepository.InsertAsync(
|
||||
new ListForm
|
||||
{
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = ListFormCodes.Lists.State,
|
||||
Name = AppCodes.Definitions.State,
|
||||
Title = AppCodes.Definitions.State,
|
||||
ListFormCode = ListFormCodes.Lists.City,
|
||||
Name = AppCodes.Definitions.City,
|
||||
Title = AppCodes.Definitions.City,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = false,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = AppCodes.Definitions.State,
|
||||
Description = AppCodes.Definitions.City,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = SelectCommandByTableName("City"),
|
||||
KeyFieldName = "Id",
|
||||
|
|
@ -10410,12 +10410,12 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto
|
||||
{
|
||||
C = AppCodes.Definitions.State + ".Create",
|
||||
R = AppCodes.Definitions.State,
|
||||
U = AppCodes.Definitions.State + ".Update",
|
||||
D = AppCodes.Definitions.State + ".Delete",
|
||||
E = AppCodes.Definitions.State + ".Export",
|
||||
I = AppCodes.Definitions.State + ".Import"
|
||||
C = AppCodes.Definitions.City + ".Create",
|
||||
R = AppCodes.Definitions.City,
|
||||
U = AppCodes.Definitions.City + ".Update",
|
||||
D = AppCodes.Definitions.City + ".Delete",
|
||||
E = AppCodes.Definitions.City + ".Export",
|
||||
I = AppCodes.Definitions.City + ".Import"
|
||||
}),
|
||||
DeleteCommand = $"UPDATE \"{DbTablePrefix}City\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id",
|
||||
DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[]
|
||||
|
|
@ -10471,9 +10471,13 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
ItemType = "group",
|
||||
Items =
|
||||
[
|
||||
new EditingFormItemDto { Order = 1, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 2, DataField = "Code", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 3, DataField = "CountryCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" }
|
||||
new EditingFormItemDto { Order = 1, DataField = "CountryCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox, EditorOptions="{ \"showClearButton\" : true }" },
|
||||
new EditingFormItemDto { Order = 2, DataField = "Name", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 3, DataField = "Code", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 4, DataField = "District", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 5, DataField = "Township", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 6, DataField = "Street", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 7, DataField = "ZipCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }
|
||||
]
|
||||
}
|
||||
}),
|
||||
|
|
@ -10496,11 +10500,11 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
})
|
||||
});
|
||||
|
||||
#region State Fields
|
||||
#region City Fields
|
||||
await _listFormFieldRepository.InsertManyAsync([
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormState.ListFormCode,
|
||||
ListFormCode = listFormCity.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.Guid,
|
||||
FieldName = "Id",
|
||||
|
|
@ -10511,9 +10515,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
IsDeleted = false,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.State + ".Create",
|
||||
R = AppCodes.Definitions.State,
|
||||
U = AppCodes.Definitions.State + ".Update",
|
||||
C = AppCodes.Definitions.City + ".Create",
|
||||
R = AppCodes.Definitions.City,
|
||||
U = AppCodes.Definitions.City + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
|
|
@ -10521,7 +10525,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormState.ListFormCode,
|
||||
ListFormCode = listFormCity.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Name",
|
||||
|
|
@ -10537,9 +10541,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.State + ".Create",
|
||||
R = AppCodes.Definitions.State,
|
||||
U = AppCodes.Definitions.State + ".Update",
|
||||
C = AppCodes.Definitions.City + ".Create",
|
||||
R = AppCodes.Definitions.City,
|
||||
U = AppCodes.Definitions.City + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
|
|
@ -10547,7 +10551,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormState.ListFormCode,
|
||||
ListFormCode = listFormCity.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Code",
|
||||
|
|
@ -10563,9 +10567,9 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.State + ".Create",
|
||||
R = AppCodes.Definitions.State,
|
||||
U = AppCodes.Definitions.State + ".Update",
|
||||
C = AppCodes.Definitions.City + ".Create",
|
||||
R = AppCodes.Definitions.City,
|
||||
U = AppCodes.Definitions.City + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
|
|
@ -10573,7 +10577,7 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormState.ListFormCode,
|
||||
ListFormCode = listFormCity.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "CountryCode",
|
||||
|
|
@ -10596,9 +10600,113 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.State + ".Create",
|
||||
R = AppCodes.Definitions.State,
|
||||
U = AppCodes.Definitions.State + ".Update",
|
||||
C = AppCodes.Definitions.City + ".Create",
|
||||
R = AppCodes.Definitions.City,
|
||||
U = AppCodes.Definitions.City + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
})
|
||||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormCity.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "District",
|
||||
Width = 100,
|
||||
ListOrderNo = 5,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = false,
|
||||
ValidationRuleJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new ValidationRuleDto { Type = "required" }
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.City + ".Create",
|
||||
R = AppCodes.Definitions.City,
|
||||
U = AppCodes.Definitions.City + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
})
|
||||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormCity.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Street",
|
||||
Width = 100,
|
||||
ListOrderNo = 6,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = false,
|
||||
ValidationRuleJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new ValidationRuleDto { Type = "required" }
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.City + ".Create",
|
||||
R = AppCodes.Definitions.City,
|
||||
U = AppCodes.Definitions.City + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
})
|
||||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormCity.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Township",
|
||||
Width = 100,
|
||||
ListOrderNo = 7,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = false,
|
||||
ValidationRuleJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new ValidationRuleDto { Type = "required" }
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.City + ".Create",
|
||||
R = AppCodes.Definitions.City,
|
||||
U = AppCodes.Definitions.City + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
})
|
||||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormCity.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "ZipCode",
|
||||
Width = 100,
|
||||
ListOrderNo = 8,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = false,
|
||||
ValidationRuleJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new ValidationRuleDto { Type = "required" }
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.City + ".Create",
|
||||
R = AppCodes.Definitions.City,
|
||||
U = AppCodes.Definitions.City + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
|
|
@ -10609,6 +10717,295 @@ public class ListFormsSeeder : IDataSeedContributor, ITransientDependency
|
|||
}
|
||||
#endregion
|
||||
|
||||
#region District
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.District))
|
||||
{
|
||||
var listFormDistrict = await _listFormRepository.InsertAsync(
|
||||
new ListForm
|
||||
{
|
||||
CultureName = LanguageCodes.En,
|
||||
ListFormCode = ListFormCodes.Lists.District,
|
||||
Name = AppCodes.Definitions.District,
|
||||
Title = AppCodes.Definitions.District,
|
||||
DataSourceCode = SeedConsts.DataSources.DefaultCode,
|
||||
IsTenant = false,
|
||||
IsBranch = false,
|
||||
IsOrganizationUnit = false,
|
||||
Description = AppCodes.Definitions.District,
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = SelectCommandByTableName("District"),
|
||||
KeyFieldName = "Id",
|
||||
KeyFieldDbSourceType = DbType.Guid,
|
||||
DefaultFilter = "\"IsDeleted\" = 'false'",
|
||||
SortMode = GridOptions.SortModeSingle,
|
||||
FilterRowJson = JsonSerializer.Serialize(new GridFilterRowDto { Visible = true }),
|
||||
HeaderFilterJson = JsonSerializer.Serialize(new { Visible = true }),
|
||||
SearchPanelJson = JsonSerializer.Serialize(new { Visible = true }),
|
||||
GroupPanelJson = JsonSerializer.Serialize(new { Visible = false }),
|
||||
SelectionJson = JsonSerializer.Serialize(new SelectionDto
|
||||
{
|
||||
Mode = GridOptions.SelectionModeSingle,
|
||||
AllowSelectAll = false
|
||||
}),
|
||||
ColumnOptionJson = JsonSerializer.Serialize(new
|
||||
{
|
||||
ColumnFixingEnabled = true,
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new PermissionCrudDto
|
||||
{
|
||||
C = AppCodes.Definitions.City + ".Create",
|
||||
R = AppCodes.Definitions.City,
|
||||
U = AppCodes.Definitions.City + ".Update",
|
||||
D = AppCodes.Definitions.City + ".Delete",
|
||||
E = AppCodes.Definitions.City + ".Export",
|
||||
I = AppCodes.Definitions.City + ".Import"
|
||||
}),
|
||||
DeleteCommand = $"UPDATE \"{DbTablePrefix}District\" SET \"DeleterId\"=@DeleterId, \"DeletionTime\"=CURRENT_TIMESTAMP, \"IsDeleted\"='true' WHERE \"Id\"=@Id",
|
||||
DeleteFieldsDefaultValueJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new FieldsDefaultValue
|
||||
{
|
||||
FieldName = "DeleterId",
|
||||
FieldDbType = DbType.Guid,
|
||||
Value = "@USERID",
|
||||
CustomValueType = FieldCustomValueTypeEnum.CustomKey
|
||||
},
|
||||
new FieldsDefaultValue
|
||||
{
|
||||
FieldName = "Id",
|
||||
FieldDbType = DbType.Guid,
|
||||
Value = "@ID",
|
||||
CustomValueType = FieldCustomValueTypeEnum.CustomKey
|
||||
}
|
||||
}),
|
||||
PagerOptionJson = JsonSerializer.Serialize(new GridPagerOptionDto
|
||||
{
|
||||
Visible = true,
|
||||
AllowedPageSizes = "10,20,50,100",
|
||||
ShowPageSizeSelector = true,
|
||||
ShowNavigationButtons = true,
|
||||
ShowInfo = false,
|
||||
InfoText = "Page {0} of {1} ({2} items)",
|
||||
DisplayMode = GridColumnOptions.PagerDisplayModeAdaptive,
|
||||
ScrollingMode = GridColumnOptions.ScrollingModeStandard,
|
||||
LoadPanelEnabled = "auto",
|
||||
LoadPanelText = "Loading..."
|
||||
}),
|
||||
EditingOptionJson = JsonSerializer.Serialize(new GridEditingDto
|
||||
{
|
||||
Popup = new GridEditingPopupDto
|
||||
{
|
||||
Title = "District Form",
|
||||
Width = 500,
|
||||
Height = 300
|
||||
},
|
||||
AllowDeleting = true,
|
||||
AllowAdding = true,
|
||||
AllowUpdating = true,
|
||||
SendOnlyChangedFormValuesUpdate = false
|
||||
}),
|
||||
EditingFormJson = JsonSerializer.Serialize(new List<EditingFormDto>
|
||||
{
|
||||
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 = "CityCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxSelectBox },
|
||||
new EditingFormItemDto { Order = 3, DataField = "Township", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 4, DataField = "Street", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox },
|
||||
new EditingFormItemDto { Order = 5, DataField = "ZipCode", ColSpan = 2, IsRequired = true, EditorType2 = EditorTypes.dxTextBox }
|
||||
]
|
||||
}
|
||||
}),
|
||||
InsertFieldsDefaultValueJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new FieldsDefaultValue
|
||||
{
|
||||
FieldName = "CreationTime",
|
||||
FieldDbType = DbType.DateTime,
|
||||
Value = "@NOW",
|
||||
CustomValueType = FieldCustomValueTypeEnum.CustomKey
|
||||
},
|
||||
new FieldsDefaultValue
|
||||
{
|
||||
FieldName = "CreatorId",
|
||||
FieldDbType = DbType.Guid,
|
||||
Value = "@USERID",
|
||||
CustomValueType = FieldCustomValueTypeEnum.CustomKey
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
#region City Fields
|
||||
await _listFormFieldRepository.InsertManyAsync([
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormDistrict.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.Guid,
|
||||
FieldName = "Id",
|
||||
Width = 100,
|
||||
ListOrderNo = 1,
|
||||
Visible = false,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.District + ".Create",
|
||||
R = AppCodes.Definitions.District,
|
||||
U = AppCodes.Definitions.District + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
})
|
||||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormDistrict.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Name",
|
||||
Width = 200,
|
||||
ListOrderNo = 2,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = true,
|
||||
ValidationRuleJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new ValidationRuleDto { Type = "required" }
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.District + ".Create",
|
||||
R = AppCodes.Definitions.District,
|
||||
U = AppCodes.Definitions.District + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
})
|
||||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormDistrict.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "CityCode",
|
||||
Width = 120,
|
||||
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}City\".\"Code\" AS \"Key\", \"{DbTablePrefix}City\".\"Name\" as \"Name\" FROM \"{DbTablePrefix}City\" ORDER BY \"{DbTablePrefix}City\".\"Name\""
|
||||
}),
|
||||
ValidationRuleJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new ValidationRuleDto { Type = "required" }
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.District + ".Create",
|
||||
R = AppCodes.Definitions.District,
|
||||
U = AppCodes.Definitions.District + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
})
|
||||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormDistrict.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Township",
|
||||
Width = 120,
|
||||
ListOrderNo = 4,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = false,
|
||||
ValidationRuleJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new ValidationRuleDto { Type = "required" }
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.District + ".Create",
|
||||
R = AppCodes.Definitions.District,
|
||||
U = AppCodes.Definitions.District + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
})
|
||||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormDistrict.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "Street",
|
||||
Width = 100,
|
||||
ListOrderNo = 5,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = false,
|
||||
ValidationRuleJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new ValidationRuleDto { Type = "required" }
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.District + ".Create",
|
||||
R = AppCodes.Definitions.District,
|
||||
U = AppCodes.Definitions.District + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
})
|
||||
},
|
||||
new()
|
||||
{
|
||||
ListFormCode = listFormDistrict.ListFormCode,
|
||||
CultureName = LanguageCodes.En,
|
||||
SourceDbType = DbType.String,
|
||||
FieldName = "ZipCode",
|
||||
Width = 100,
|
||||
ListOrderNo = 6,
|
||||
Visible = true,
|
||||
IsActive = true,
|
||||
IsDeleted = false,
|
||||
AllowSearch = false,
|
||||
ValidationRuleJson = JsonSerializer.Serialize(new[]
|
||||
{
|
||||
new ValidationRuleDto { Type = "required" }
|
||||
}),
|
||||
PermissionJson = JsonSerializer.Serialize(new ListFormFieldPermissionDto
|
||||
{
|
||||
C = AppCodes.Definitions.District + ".Create",
|
||||
R = AppCodes.Definitions.District,
|
||||
U = AppCodes.Definitions.District + ".Update",
|
||||
E = true,
|
||||
I = true,
|
||||
Deny = false
|
||||
})
|
||||
},
|
||||
]);
|
||||
#endregion
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region SkillType
|
||||
if (!await _listFormRepository.AnyAsync(a => a.ListFormCode == ListFormCodes.Lists.SkillType))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
|
@ -44,7 +43,8 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
private readonly IRepository<Currency, Guid> _currencyRepository;
|
||||
private readonly IRepository<CountryGroup, Guid> _countryGroupRepository;
|
||||
private readonly IRepository<Country, Guid> _countryRepository;
|
||||
private readonly IRepository<City, Guid> _stateRepository;
|
||||
private readonly IRepository<City, Guid> _cityRepository;
|
||||
private readonly IRepository<District, Guid> _districtRepository;
|
||||
private readonly IRepository<SkillType, Guid> _skillTypeRepository;
|
||||
private readonly IRepository<Skill, Guid> _skillRepository;
|
||||
private readonly IRepository<SkillLevel, Guid> _skillLevelRepository;
|
||||
|
|
@ -81,7 +81,8 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
IRepository<Currency, Guid> currencyRepository,
|
||||
IRepository<CountryGroup, Guid> countryGroupRepository,
|
||||
IRepository<Country, Guid> countryRepository,
|
||||
IRepository<City, Guid> stateRepository,
|
||||
IRepository<City, Guid> cityRepository,
|
||||
IRepository<District, Guid> districtRepository,
|
||||
IRepository<SkillType, Guid> skillTypeRepository,
|
||||
IRepository<Skill, Guid> skillRepository,
|
||||
IRepository<SkillLevel, Guid> skillLevelRepository,
|
||||
|
|
@ -118,7 +119,8 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
_currencyRepository = currencyRepository;
|
||||
_countryGroupRepository = countryGroupRepository;
|
||||
_countryRepository = countryRepository;
|
||||
_stateRepository = stateRepository;
|
||||
_cityRepository = cityRepository;
|
||||
_districtRepository = districtRepository;
|
||||
_skillTypeRepository = skillTypeRepository;
|
||||
_skillRepository = skillRepository;
|
||||
_skillLevelRepository = skillLevelRepository;
|
||||
|
|
@ -494,19 +496,37 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
|
||||
foreach (var item in items.Cities)
|
||||
{
|
||||
var exists = await _stateRepository.AnyAsync(x => x.Name == item.Name && x.CountryCode == item.CountryCode);
|
||||
var exists = await _cityRepository.AnyAsync(x => x.Name == item.Name && x.CountryCode == item.CountryCode);
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
await _stateRepository.InsertAsync(new City
|
||||
await _cityRepository.InsertAsync(new City
|
||||
{
|
||||
Code = item.Code,
|
||||
Name = item.Name,
|
||||
PlateCode = item.PlateCode,
|
||||
CountryCode = item.CountryCode
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in items.Districts)
|
||||
{
|
||||
var exists = await _districtRepository.AnyAsync(x => x.Name == item.Name && x.CityCode == item.CityCode);
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
await _districtRepository.InsertAsync(new District
|
||||
{
|
||||
Name = item.Name,
|
||||
CityCode = item.CityCode,
|
||||
Township = item.Township,
|
||||
Street = item.Street,
|
||||
ZipCode = item.ZipCode
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in items.SkillTypes)
|
||||
{
|
||||
var exists = await _skillTypeRepository.AnyAsync(x => x.Name == item.Name);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -28,6 +28,7 @@ public class SeederDto
|
|||
public List<CountryGroupSeedDto> CountryGroups { get; set; }
|
||||
public List<CountrySeedDto> Countries { get; set; }
|
||||
public List<CitySeedDto> Cities { get; set; }
|
||||
public List<DistrictSeedDto> Districts { get; set; }
|
||||
public List<SkillTypeSeedDto> SkillTypes { get; set; }
|
||||
public List<SkillSeedDto> Skills { get; set; }
|
||||
public List<SkillLevelSeedDto> SkillLevels { get; set; }
|
||||
|
|
@ -175,9 +176,19 @@ public class CitySeedDto
|
|||
{
|
||||
public string Name { get; set; }
|
||||
public string Code { get; set; }
|
||||
public string PlateCode { get; set; }
|
||||
public string CountryCode { get; set; }
|
||||
}
|
||||
|
||||
public class DistrictSeedDto
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string CityCode { get; set; }
|
||||
public string Township { get; set; }
|
||||
public string Street { get; set; }
|
||||
public string ZipCode { get; set; }
|
||||
}
|
||||
|
||||
public class SkillTypeSeedDto
|
||||
{
|
||||
public string Name { get; set; }
|
||||
|
|
|
|||
|
|
@ -357,7 +357,8 @@ public static class PlatformConsts
|
|||
public const string Currency = "list-currency";
|
||||
public const string CountryGroup = "list-countrygroup";
|
||||
public const string Country = "list-country";
|
||||
public const string State = "list-city";
|
||||
public const string City = "list-city";
|
||||
public const string District = "list-district";
|
||||
public const string SkillType = "list-skilltype";
|
||||
public const string UomCategory = "list-uomcategory";
|
||||
public const string BlogCategory = "list-blogcategory";
|
||||
|
|
|
|||
|
|
@ -379,7 +379,8 @@ public static class SeedConsts
|
|||
public const string Currency = Default + ".Currency";
|
||||
public const string CountryGroup = Default + ".CountryGroup";
|
||||
public const string Country = Default + ".Country";
|
||||
public const string State = Default + ".State";
|
||||
public const string City = Default + ".City";
|
||||
public const string District = Default + ".District";
|
||||
public const string SkillType = Default + ".SkillType";
|
||||
public const string UomCategory = Default + ".UomCategory";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Volo.Abp.Domain.Entities.Auditing;
|
||||
|
||||
|
|
@ -6,14 +7,11 @@ namespace Kurs.Platform.Entities;
|
|||
|
||||
public class City : FullAuditedEntity<Guid>
|
||||
{
|
||||
[Required]
|
||||
[MaxLength(128)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[MaxLength(16)]
|
||||
public string Code { get; set; }
|
||||
|
||||
[MaxLength(8)]
|
||||
public string Name { get; set; }
|
||||
public string PlateCode { get; set; }
|
||||
public string CountryCode { get; set; }
|
||||
public Country Country { get; set; }
|
||||
public ICollection<District> District { get; set; }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,33 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Volo.Abp.Domain.Entities.Auditing;
|
||||
|
||||
namespace Kurs.Platform.Entities;
|
||||
|
||||
public class Country : FullAuditedEntity<Guid>
|
||||
{
|
||||
[Required]
|
||||
[MaxLength(8)]
|
||||
public string Code { get; set; } // TR, US
|
||||
|
||||
[Required]
|
||||
[MaxLength(128)]
|
||||
public string Name { get; set; }
|
||||
|
||||
[MaxLength(128)]
|
||||
public string GroupName { get; set; }
|
||||
|
||||
[MaxLength(8)]
|
||||
public string CurrencyCode { get; set; }
|
||||
|
||||
public int PhoneCode { get; set; }
|
||||
|
||||
[MaxLength(64)]
|
||||
public string TaxLabel { get; set; }
|
||||
|
||||
public bool ZipRequired { get; set; }
|
||||
|
||||
public bool StateRequired { get; set; }
|
||||
|
||||
public ICollection<City> Cities { get; set; }
|
||||
|
|
@ -35,6 +20,5 @@ public class Country : FullAuditedEntity<Guid>
|
|||
|
||||
public class CountryGroup : FullAuditedEntity<Guid>
|
||||
{
|
||||
[Required, MaxLength(128)]
|
||||
public string Name { get; set; }
|
||||
}
|
||||
14
api/src/Kurs.Platform.Domain/Entities/District.cs
Normal file
14
api/src/Kurs.Platform.Domain/Entities/District.cs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using Volo.Abp.Domain.Entities.Auditing;
|
||||
|
||||
namespace Kurs.Platform.Entities;
|
||||
|
||||
public class District : FullAuditedEntity<Guid>
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string CityCode { get; set; }
|
||||
public string Township { get; set; }
|
||||
public string Street { get; set; }
|
||||
public string ZipCode { get; set; }
|
||||
public City City { get; set; }
|
||||
}
|
||||
|
|
@ -376,10 +376,26 @@ public class PlatformDbContext :
|
|||
b.ToTable(PlatformConsts.DbTablePrefix + nameof(City), PlatformConsts.DbSchema);
|
||||
b.ConfigureByConvention();
|
||||
|
||||
b.Property(x => x.CountryCode).HasMaxLength(8);
|
||||
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
|
||||
b.Property(x => x.Code).HasMaxLength(16);
|
||||
b.Property(x => x.Code).IsRequired().HasMaxLength(16);
|
||||
b.Property(x => x.PlateCode).HasMaxLength(20);
|
||||
|
||||
b.HasIndex(x => new { x.CountryCode, x.Code }).IsUnique();
|
||||
b.HasIndex(x => new { x.CountryCode, x.Name }).IsUnique();
|
||||
});
|
||||
|
||||
builder.Entity<District>(b =>
|
||||
{
|
||||
b.ToTable(PlatformConsts.DbTablePrefix + nameof(District), PlatformConsts.DbSchema);
|
||||
b.ConfigureByConvention();
|
||||
|
||||
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
|
||||
b.Property(x => x.CityCode).IsRequired().HasMaxLength(16);
|
||||
b.Property(x => x.Township).HasMaxLength(128);
|
||||
b.Property(x => x.Street).HasMaxLength(256);
|
||||
b.Property(x => x.ZipCode).HasMaxLength(16);
|
||||
|
||||
b.HasIndex(x => new { x.CityCode, x.Name }).IsUnique();
|
||||
});
|
||||
|
||||
builder.Entity<SkillType>(b =>
|
||||
|
|
|
|||
|
|
@ -945,7 +945,7 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Banks");
|
||||
b.ToTable("Banks", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.BankAccount", b =>
|
||||
|
|
@ -1011,7 +1011,7 @@ namespace Kurs.Platform.Migrations
|
|||
|
||||
b.HasIndex("CurrencyId");
|
||||
|
||||
b.ToTable("BankAccounts");
|
||||
b.ToTable("BankAccounts", (string)null);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b =>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { Notification, toast } from '@/components/ui'
|
||||
import { generateBackgroundWorkers } from '@/services/background-worker.service'
|
||||
import { useLocalization } from '@/utils/hooks/useLocalization'
|
||||
import { getLocalization } from '@/services/localization.service'
|
||||
import { store } from '@/store'
|
||||
|
||||
export abstract class UiEvalService {
|
||||
static Init = () => {
|
||||
|
|
@ -8,7 +9,22 @@ export abstract class UiEvalService {
|
|||
}
|
||||
|
||||
static ApiGenerateBackgroundWorkers = () => {
|
||||
const { translate } = useLocalization()
|
||||
// Get store state directly instead of using hook
|
||||
const state = store.getState()
|
||||
const { texts, config } = state.abpConfig
|
||||
|
||||
// Create translate function similar to useLocalization hook
|
||||
const translate = (localizationKey: string, params?: Record<string, string | number>, defaultResourceName?: string): string => {
|
||||
if (!texts) {
|
||||
return localizationKey
|
||||
}
|
||||
return getLocalization(
|
||||
texts,
|
||||
defaultResourceName ?? config?.localization?.defaultResourceName,
|
||||
localizationKey,
|
||||
params
|
||||
)
|
||||
}
|
||||
|
||||
const asyncCall = async () => {
|
||||
await generateBackgroundWorkers()
|
||||
|
|
|
|||
Loading…
Reference in a new issue