District içerisine Postal Code eklendi.

This commit is contained in:
Sedat Öztürk 2026-07-08 00:00:35 +03:00
parent c42a8d2bd1
commit cda9aa6a72
20 changed files with 5076 additions and 2525 deletions

View file

@ -52,7 +52,7 @@ public static class LookupQueryValues
$"\"AbpTenants\".\"Name\" AS \"Name\" " + $"\"AbpTenants\".\"Name\" AS \"Name\" " +
$"FROM \"AbpTenants\"" + $"FROM \"AbpTenants\"" +
$") AS \"List\" " + $") AS \"List\" " +
$"ORDER BY \"Name\""; $"ORDER BY \"Name\"";
} }
else else
{ {
@ -118,14 +118,15 @@ public static class LookupQueryValues
public static string TownshipValues = public static string TownshipValues =
$"SELECT " + $"SELECT " +
$"\"Township\" AS \"Key\", " + $"\"Township\" AS \"Key\", " +
$"\"Township\" AS \"Name\" " + $"\"Township\" AS \"Name\", " +
$"\"PostalCode\" AS \"Group\" " +
$"FROM \"{FullNameTable(TableNameEnum.District)}\" " + $"FROM \"{FullNameTable(TableNameEnum.District)}\" " +
$"WHERE " + $"WHERE " +
$"(\"Country\" = @param0 OR @param0 IS NULL) " + $"(\"Country\" = @param0 OR @param0 IS NULL) " +
$"AND (\"City\" = @param1 OR @param1 IS NULL) " + $"AND (\"City\" = @param1 OR @param1 IS NULL) " +
$"AND (\"Name\" = @param2 OR @param2 IS NULL) " + $"AND (\"Name\" = @param2 OR @param2 IS NULL) " +
$"AND \"IsDeleted\" = 'false' " + $"AND \"IsDeleted\" = 'false' " +
$"GROUP BY \"Township\" " + $"GROUP BY \"Township\", \"PostalCode\" " +
$"ORDER BY \"Township\";"; $"ORDER BY \"Township\";";
public static string RoleValues = public static string RoleValues =
@ -260,7 +261,7 @@ public static class LookupQueryValues
$"OR jp.\"ParentId\" IS NULL " + $"OR jp.\"ParentId\" IS NULL " +
$") " + $") " +
$"ORDER BY jp.\"Name\";"; $"ORDER BY jp.\"Name\";";
public static string SurveyQuestionValues = public static string SurveyQuestionValues =
$"SELECT " + $"SELECT " +
$"\"Id\" AS \"Key\", " + $"\"Id\" AS \"Key\", " +

View file

@ -9,4 +9,5 @@ public class DistrictDto : AuditedEntityDto<Guid>
public string City { get; set; } public string City { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string Township { get; set; } public string Township { get; set; }
public string PostalCode { get; set; }
} }

View file

@ -278,6 +278,7 @@ public class ListFormDynamicApiAppService : PlatformAppService, IListFormDynamic
Country = order.Country, Country = order.Country,
City = order.City, City = order.City,
District = order.District, District = order.District,
Township = order.Township,
Address1 = order.Address1, Address1 = order.Address1,
Address2 = order.Address2, Address2 = order.Address2,
PostalCode = order.PostalCode, PostalCode = order.PostalCode,

View file

@ -474,9 +474,10 @@ public class PublicAppService : PlatformAppService
TaxOffice = input.Tenant.TaxOffice, TaxOffice = input.Tenant.TaxOffice,
Address1 = input.Tenant.Address1, Address1 = input.Tenant.Address1,
Address2 = input.Tenant.Address2, Address2 = input.Tenant.Address2,
District = input.Tenant.District,
Country = input.Tenant.Country, Country = input.Tenant.Country,
City = input.Tenant.City, City = input.Tenant.City,
District = input.Tenant.District,
Township = input.Tenant.Township,
PostalCode = input.Tenant.PostalCode, PostalCode = input.Tenant.PostalCode,
MobileNumber = NormalizePhoneNumber(input.Tenant.MobileNumber, input.Tenant.Country), MobileNumber = NormalizePhoneNumber(input.Tenant.MobileNumber, input.Tenant.Country),
PhoneNumber = NormalizePhoneNumber(input.Tenant.PhoneNumber, input.Tenant.Country), PhoneNumber = NormalizePhoneNumber(input.Tenant.PhoneNumber, input.Tenant.Country),
@ -827,15 +828,14 @@ public class PublicAppService : PlatformAppService
.OrderBy(district => district.Name)); .OrderBy(district => district.Name));
return entities return entities
.GroupBy(district => district.Name, StringComparer.OrdinalIgnoreCase)
.Select(group => group.First())
.Select(district => new DistrictDto .Select(district => new DistrictDto
{ {
Id = district.Id, Id = district.Id,
Country = district.Country, Country = district.Country,
City = district.City, City = district.City,
Name = district.Name, Name = district.Name,
Township = district.Township Township = district.Township,
PostalCode = district.PostalCode
}) })
.ToList(); .ToList();
} }

File diff suppressed because it is too large Load diff

View file

@ -342,11 +342,11 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
// 1. Mevcut kayıtları çek (tek sorguda) // 1. Mevcut kayıtları çek (tek sorguda)
var existingDistricts = await dbCtx.Set<District>() var existingDistricts = await dbCtx.Set<District>()
.Select(d => new { d.Country, d.City, d.Name, d.Township }) .Select(d => new { d.Country, d.City, d.Name, d.Township, d.PostalCode })
.ToListAsync(); .ToListAsync();
var existingSet = existingDistricts var existingSet = existingDistricts
.Select(d => $"{d.Country}:{d.City}:{d.Name}:{d.Township}") .Select(d => $"{d.Country}:{d.City}:{d.Name}:{d.Township}:{d.PostalCode}")
.ToHashSet(); .ToHashSet();
var options = new JsonSerializerOptions var options = new JsonSerializerOptions
@ -362,7 +362,7 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
{ {
if (item == null) continue; if (item == null) continue;
var key = $"{item.Country}:{item.City}:{item.Name}:{item.Township}"; var key = $"{item.Country}:{item.City}:{item.Name}:{item.Township}:{item.PostalCode}";
if (existingSet.Contains(key)) continue; if (existingSet.Contains(key)) continue;
buffer.Add(new District( buffer.Add(new District(
@ -370,7 +370,8 @@ public class HostDataSeeder : IDataSeedContributor, ITransientDependency
item.Country, item.Country,
item.City, item.City,
item.Name, item.Name,
item.Township item.Township,
item.PostalCode
)); ));
if (buffer.Count >= 5000) // 3. Batch if (buffer.Count >= 5000) // 3. Batch

View file

@ -8223,8 +8223,8 @@
{ {
"resourceName": "Platform", "resourceName": "Platform",
"key": "Public.products.tenantForm.orgName", "key": "Public.products.tenantForm.orgName",
"tr": "Şirket Adı", "tr": "Kurum Adı",
"en": "Company Name" "en": "Organization Name"
}, },
{ {
"resourceName": "Platform", "resourceName": "Platform",
@ -14262,12 +14262,6 @@
"en": "Commission", "en": "Commission",
"tr": "Komisyon" "tr": "Komisyon"
}, },
{
"resourceName": "Platform",
"key": "App.Listform.ListformField.CompanyName",
"en": "Company Name",
"tr": "Şirket Adı"
},
{ {
"resourceName": "Platform", "resourceName": "Platform",
"key": "App.Listform.ListformField.ComponentPath", "key": "App.Listform.ListformField.ComponentPath",

View file

@ -95,8 +95,8 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
{ {
new() { Order=1, ColCount=4, ColSpan=1, ItemType="group", Items = new() { Order=1, ColCount=4, ColSpan=1, ItemType="group", Items =
[ [
new EditingFormItemDto { Order=1, DataField = "Name", ColSpan=1, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=1, DataField = "OrganizationName", ColSpan=4, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order=2, DataField = "OrganizationName", ColSpan=1, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=2, DataField = "Name", ColSpan=1, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order=3, DataField = "Founder", ColSpan=1, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=3, DataField = "Founder", ColSpan=1, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order=4, DataField = "VknTckn", ColSpan=1, EditorType2=EditorTypes.dxNumberBox }, new EditingFormItemDto { Order=4, DataField = "VknTckn", ColSpan=1, EditorType2=EditorTypes.dxNumberBox },
new EditingFormItemDto { Order=5, DataField = "TaxOffice", ColSpan=1, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=5, DataField = "TaxOffice", ColSpan=1, EditorType2=EditorTypes.dxTextBox },
@ -107,17 +107,13 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
new EditingFormItemDto { Order=10, DataField = "Email", ColSpan=1, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=10, DataField = "Email", ColSpan=1, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order=11, DataField = "Website", ColSpan=1, EditorType2=EditorTypes.dxTextBox }, new EditingFormItemDto { Order=11, DataField = "Website", ColSpan=1, EditorType2=EditorTypes.dxTextBox },
new EditingFormItemDto { Order=12, DataField = "IsActive", ColSpan=1, EditorType2=EditorTypes.dxCheckBox }, new EditingFormItemDto { Order=12, DataField = "IsActive", ColSpan=1, EditorType2=EditorTypes.dxCheckBox },
] new EditingFormItemDto { Order=13, DataField = "Country", ColSpan=1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
}, new EditingFormItemDto { Order=14, DataField = "City", ColSpan=1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new() { Order=2, ColCount=4, ColSpan=1, ItemType="group", Items = new EditingFormItemDto { Order=15, DataField = "District", ColSpan=1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
[ new EditingFormItemDto { Order=16, DataField = "Township", ColSpan=1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton, EditorScript = PlatformConsts.EditorScriptValues.SourceFieldItemWritetoDestination("Township", "Group", "PostalCode") },
new EditingFormItemDto { Order=1, DataField = "Country", ColSpan=1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order=17, DataField = "PostalCode", ColSpan=1, EditorType2=EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order=2, DataField = "City", ColSpan=1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order=18, DataField = "Address1", ColSpan=4, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order=3, DataField = "District", ColSpan=1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order=19, DataField = "Address2", ColSpan=4, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order=4, DataField = "Township", ColSpan=1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order=5, DataField = "PostalCode", ColSpan=1, EditorType2=EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order=6, DataField = "Address1", ColSpan=3, EditorType2=EditorTypes.dxTextArea },
new EditingFormItemDto { Order=7, DataField = "Address2", ColSpan=4, EditorType2=EditorTypes.dxTextArea },
] ]
} }
}), }),
@ -2139,6 +2135,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
new EditingFormItemDto { Order = 2, DataField = "City", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 2, DataField = "City", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 3, DataField = "Name", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 4, DataField = "Township", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 4, DataField = "Township", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 5, DataField = "PostalCode", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox },
] ]
} }
}), }),
@ -2246,6 +2243,23 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
Visible = true, Visible = true,
IsActive = true, IsActive = true,
AllowSearch = false,
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(listForm.Name),
},
new()
{
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "PostalCode",
CaptionName = "App.Listform.ListformField.PostalCode",
Width = 0,
ListOrderNo = 6,
Visible = true,
IsActive = true,
AllowSearch = false, AllowSearch = false,
ValidationRuleJson = DefaultValidationRuleRequiredJson, ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson, ColumnCustomizationJson = DefaultColumnCustomizationJson,
@ -6991,26 +7005,27 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
new EditingFormItemDto { Order = 9, DataField = "Country", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 9, DataField = "Country", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 10, DataField = "City", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 10, DataField = "City", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 11, DataField = "District", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 11, DataField = "District", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 12, DataField = "PostalCode", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 12, DataField = "Township", ColSpan=1, EditorType2=EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton, EditorScript = PlatformConsts.EditorScriptValues.SourceFieldItemWritetoDestination("Township", "Group", "PostalCode") },
new EditingFormItemDto { Order = 13, DataField = "PhoneNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions }, new EditingFormItemDto { Order = 13, DataField = "PostalCode", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 14, DataField = "MobileNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions }, new EditingFormItemDto { Order = 14, DataField = "PhoneNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions },
new EditingFormItemDto { Order = 15, DataField = "FaxNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions }, new EditingFormItemDto { Order = 15, DataField = "MobileNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions },
new EditingFormItemDto { Order = 16, DataField = "FaxNumber", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox, EditorOptions=EditorOptionValues.PhoneEditorOptions },
] ]
}, },
new() { Order=2, ColCount=4, ColSpan=1, ItemType="group", Items = new() { Order=2, ColCount=4, ColSpan=1, ItemType="group", Items =
[ [
new EditingFormItemDto { Order = 16, DataField = "PaymentMethodId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 1, DataField = "PaymentMethodId", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 17, DataField = "Installment", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 2, DataField = "Installment", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 18, DataField = "LicenseStartTime", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, new EditingFormItemDto { Order = 3, DataField = "LicenseStartTime", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox },
new EditingFormItemDto { Order = 19, DataField = "BillingCycle", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton }, new EditingFormItemDto { Order = 4, DataField = "BillingCycle", ColSpan = 1, EditorType2 = EditorTypes.dxSelectBox, EditorOptions=EditorOptionValues.ShowClearButton },
new EditingFormItemDto { Order = 20, DataField = "Period", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox }, new EditingFormItemDto { Order = 5, DataField = "Period", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox },
new EditingFormItemDto { Order = 21, DataField = "LicenseEndTime", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox }, new EditingFormItemDto { Order = 6, DataField = "LicenseEndTime", ColSpan = 1, EditorType2 = EditorTypes.dxDateBox },
new EditingFormItemDto { Order = 22, DataField = "Email", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 7, DataField = "Email", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 23, DataField = "Website", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox }, new EditingFormItemDto { Order = 8, DataField = "Website", ColSpan = 1, EditorType2 = EditorTypes.dxTextBox },
new EditingFormItemDto { Order = 24, DataField = "Subtotal", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat() }, new EditingFormItemDto { Order = 9, DataField = "Subtotal", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat() },
new EditingFormItemDto { Order = 25, DataField = "VatTotal", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat() }, new EditingFormItemDto { Order = 10, DataField = "VatTotal", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat() },
new EditingFormItemDto { Order = 26, DataField = "Commission", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat() }, new EditingFormItemDto { Order = 11, DataField = "Commission", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat() },
new EditingFormItemDto { Order = 27, DataField = "Total", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat() }, new EditingFormItemDto { Order = 12, DataField = "Total", ColSpan = 1, EditorType2 = EditorTypes.dxNumberBox, EditorOptions=EditorOptionValues.NumberStandartFormat() },
] ]
} }
}), }),
@ -7359,6 +7374,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
CascadeRelationField = "City", CascadeRelationField = "City",
CascadeFilterOperator="=", CascadeFilterOperator="=",
CascadeParentFields = "Country,City", CascadeParentFields = "Country,City",
CascadeEmptyFields = "Township"
}), }),
ValidationRuleJson = DefaultValidationRuleRequiredJson, ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson, ColumnCustomizationJson = DefaultColumnCustomizationJson,
@ -7366,6 +7382,33 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
PivotSettingsJson = DefaultPivotSettingsJson, PivotSettingsJson = DefaultPivotSettingsJson,
}, },
new() new()
{
ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En,
SourceDbType = DbType.String,
FieldName = "Township",
CaptionName = "App.Listform.ListformField.Township",
Width = 0,
ListOrderNo = 17,
Visible = true,
IsActive = true,
AllowSearch = true,
LookupJson = JsonSerializer.Serialize(new LookupDto
{
DataSourceType = UiLookupDataSourceTypeEnum.Query,
DisplayExpr = "Name",
ValueExpr = "Key",
LookupQuery = LookupQueryValues.TownshipValues,
CascadeRelationField = "District",
CascadeFilterOperator="=",
CascadeParentFields = "Country,City,District"
}),
ValidationRuleJson = DefaultValidationRuleRequiredJson,
ColumnCustomizationJson = DefaultColumnCustomizationJson,
PermissionJson = DefaultFieldPermissionJson(TenantManagementPermissions.Tenants.Create, TenantManagementPermissions.Tenants.Default, TenantManagementPermissions.Tenants.Update, true, true, false),
PivotSettingsJson = DefaultPivotSettingsJson
},
new()
{ {
ListFormCode = listForm.ListFormCode, ListFormCode = listForm.ListFormCode,
CultureName = LanguageCodes.En, CultureName = LanguageCodes.En,
@ -7373,7 +7416,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
FieldName = "PhoneNumber", FieldName = "PhoneNumber",
CaptionName = "Abp.Identity.User.UserInformation.PhoneNumber", CaptionName = "Abp.Identity.User.UserInformation.PhoneNumber",
Width = 0, Width = 0,
ListOrderNo = 17, ListOrderNo = 18,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -7392,7 +7435,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
FieldName = "MobileNumber", FieldName = "MobileNumber",
CaptionName = "App.Listform.ListformField.MobileNumber", CaptionName = "App.Listform.ListformField.MobileNumber",
Width = 0, Width = 0,
ListOrderNo = 18, ListOrderNo = 19,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -7411,7 +7454,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
FieldName = "FaxNumber", FieldName = "FaxNumber",
CaptionName = "App.Listform.ListformField.FaxNumber", CaptionName = "App.Listform.ListformField.FaxNumber",
Width = 0, Width = 0,
ListOrderNo = 19, ListOrderNo = 20,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -7429,7 +7472,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
FieldName = "Website", FieldName = "Website",
CaptionName = "App.Listform.ListformField.Website", CaptionName = "App.Listform.ListformField.Website",
Width = 0, Width = 0,
ListOrderNo = 20, ListOrderNo = 21,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -7448,7 +7491,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
CaptionName = "App.Listform.ListformField.Subtotal", CaptionName = "App.Listform.ListformField.Subtotal",
Alignment = "right", Alignment = "right",
Width = 0, Width = 0,
ListOrderNo = 21, ListOrderNo = 22,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -7468,7 +7511,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
CaptionName = "App.Listform.ListformField.VatTotal", CaptionName = "App.Listform.ListformField.VatTotal",
Alignment = "right", Alignment = "right",
Width = 0, Width = 0,
ListOrderNo = 22, ListOrderNo = 23,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -7488,7 +7531,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
CaptionName = "App.Listform.ListformField.Commission", CaptionName = "App.Listform.ListformField.Commission",
Alignment = "right", Alignment = "right",
Width = 0, Width = 0,
ListOrderNo = 23, ListOrderNo = 24,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -7527,7 +7570,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
FieldName = "PaymentMethodId", FieldName = "PaymentMethodId",
CaptionName = "App.Listform.ListformField.PaymentMethodId", CaptionName = "App.Listform.ListformField.PaymentMethodId",
Width = 0, Width = 0,
ListOrderNo = 24, ListOrderNo = 26,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -7546,7 +7589,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
FieldName = "Installment", FieldName = "Installment",
CaptionName = "App.Listform.ListformField.Installment", CaptionName = "App.Listform.ListformField.Installment",
Width = 0, Width = 0,
ListOrderNo = 26, ListOrderNo = 27,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -7565,7 +7608,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
FieldName = "IsActive", FieldName = "IsActive",
CaptionName = "App.Listform.ListformField.IsActive", CaptionName = "App.Listform.ListformField.IsActive",
Width = 0, Width = 0,
ListOrderNo = 27, ListOrderNo = 28,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -7582,7 +7625,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
FieldName = "PostalCode", FieldName = "PostalCode",
CaptionName = "App.Listform.ListformField.PostalCode", CaptionName = "App.Listform.ListformField.PostalCode",
Width = 0, Width = 0,
ListOrderNo = 27, ListOrderNo = 29,
Visible = true, Visible = true,
IsActive = true, IsActive = true,
@ -7600,7 +7643,7 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
FieldName = "Email", FieldName = "Email",
CaptionName = "App.Listform.ListformField.Email", CaptionName = "App.Listform.ListformField.Email",
Width = 0, Width = 0,
ListOrderNo = 28, ListOrderNo = 30,
Visible = true, Visible = true,
IsActive = true, IsActive = true,

View file

@ -513,7 +513,7 @@
"ParentCode": "App.Saas", "ParentCode": "App.Saas",
"Code": "App.Public", "Code": "App.Public",
"DisplayName": "App.Public", "DisplayName": "App.Public",
"Order": 0, "Order": 1,
"Url": null, "Url": null,
"Icon": "FcTemplate", "Icon": "FcTemplate",
"RequiredPermissionName": null, "RequiredPermissionName": null,
@ -630,32 +630,11 @@
"IsDisabled": false "IsDisabled": false
}, },
{
"ParentCode": "App.Saas",
"Code": "AbpTenantManagement.Tenants",
"DisplayName": "AbpTenantManagement.Tenants",
"Order": 1,
"Url": "/admin/list/AbpTenantManagement.Tenants",
"Icon": "FcDepartment",
"RequiredPermissionName": "AbpTenantManagement.Tenants",
"IsDisabled": false
},
{
"ParentCode": "App.Saas",
"Code": "App.Branches",
"DisplayName": "App.Branches",
"Order": 2,
"Url": "/admin/list/App.Branches",
"Icon": "FcTreeStructure",
"RequiredPermissionName": "App.Branches",
"IsDisabled": false
},
{ {
"ParentCode": "App.Saas", "ParentCode": "App.Saas",
"Code": "App.Saas.Definitions", "Code": "App.Saas.Definitions",
"DisplayName": "App.Definitions", "DisplayName": "App.Definitions",
"Order": 3, "Order": 2,
"Url": null, "Url": null,
"Icon": "FcFilingCabinet", "Icon": "FcFilingCabinet",
"RequiredPermissionName": null, "RequiredPermissionName": null,
@ -771,6 +750,27 @@
"RequiredPermissionName": "App.Definitions.Sequence", "RequiredPermissionName": "App.Definitions.Sequence",
"IsDisabled": false "IsDisabled": false
}, },
{
"ParentCode": "App.Saas",
"Code": "AbpTenantManagement.Tenants",
"DisplayName": "AbpTenantManagement.Tenants",
"Order": 3,
"Url": "/admin/list/AbpTenantManagement.Tenants",
"Icon": "FcDepartment",
"RequiredPermissionName": "AbpTenantManagement.Tenants",
"IsDisabled": false
},
{
"ParentCode": "App.Saas",
"Code": "App.Branches",
"DisplayName": "App.Branches",
"Order": 4,
"Url": "/admin/list/App.Branches",
"Icon": "FcTreeStructure",
"RequiredPermissionName": "App.Branches",
"IsDisabled": false
},
{ {
"ParentCode": "App.Saas", "ParentCode": "App.Saas",
"Code": "App.SettingDefinitions", "Code": "App.SettingDefinitions",

View file

@ -36,6 +36,7 @@ public static class PlatformConsts
public static string CalcTotalHoursFromTimes = "(()=>{const toD=v=>!v?null:(v instanceof Date?v:new Date(v));const next={...formData,[e.dataField]:e.value};const s=toD(next.StartTime),t=toD(next.EndTime);let h=null;if(s&&t){h=(t-s)/36e5;if(h<0)h+=24;h=Math.round(h*10)/10;}setFormData({...next,TotalHours:h});})();"; public static string CalcTotalHoursFromTimes = "(()=>{const toD=v=>!v?null:(v instanceof Date?v:new Date(v));const next={...formData,[e.dataField]:e.value};const s=toD(next.StartTime),t=toD(next.EndTime);let h=null;if(s&&t){h=(t-s)/36e5;if(h<0)h+=24;h=Math.round(h*10)/10;}setFormData({...next,TotalHours:h});})();";
public static string MaterialOnChange = "(() => { const p=e.component.option('selectedItem')||{}; const q=Math.round((parseFloat(p.Quantity)||0)*100); const u=Math.round((parseFloat(p.UnitPrice)||0)*100); setFormData({ ...formData, Quantity:q/100, UnitPrice:u/100, UomId:p.UomId, TotalAmount:Math.round((q*u)/100)/100 }); })();"; public static string MaterialOnChange = "(() => { const p=e.component.option('selectedItem')||{}; const q=Math.round((parseFloat(p.Quantity)||0)*100); const u=Math.round((parseFloat(p.UnitPrice)||0)*100); setFormData({ ...formData, Quantity:q/100, UnitPrice:u/100, UomId:p.UomId, TotalAmount:Math.round((q*u)/100)/100 }); })();";
public static string CalcTotalAmount = "(() => { const n={...formData,[e.dataField]:e.value}; const q=Math.round((parseFloat(n.Quantity)||0)*100); const u=Math.round((parseFloat(n.UnitPrice)||0)*100); setFormData({ ...n, TotalAmount:Math.round((q*u)/100)/100 }); })();"; public static string CalcTotalAmount = "(() => { const n={...formData,[e.dataField]:e.value}; const q=Math.round((parseFloat(n.Quantity)||0)*100); const u=Math.round((parseFloat(n.UnitPrice)||0)*100); setFormData({ ...n, TotalAmount:Math.round((q*u)/100)/100 }); })();";
public static string SourceFieldItemWritetoDestination(string sourceField = "Township", string itemName = "Group", string destinationField = "PostalCode") => $"(async()=>{{const townshipField=\"{sourceField}\",groupField=\"{itemName}\",postalCodeField=\"{destinationField}\";const currentField=(typeof editor!=='undefined'&&editor?.dataField)||e?.dataField||townshipField;const next={{...formData,[currentField]:e?.value}};const isReady=e?.scriptEvent===\"contentReady\";const selectedItem=(()=>{{try{{return e?.component?.option?e.component.option(\"selectedItem\"):null;}}catch{{return null;}}}})();if(!isReady)next[postalCodeField]=selectedItem?selectedItem[groupField]:next[postalCodeField];if(!isReady&&typeof setFormData===\"function\")setFormData(next);}})();";
} }
public static class Prefix public static class Prefix

View file

@ -9,16 +9,18 @@ public class District : FullAuditedEntity<Guid>
public string City { get; set; } public string City { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string Township { get; set; } public string Township { get; set; }
public string PostalCode { get; set; }
protected District() { } protected District() { }
public District(Guid id, string country, string city, string name, string township) public District(Guid id, string country, string city, string name, string township, string postalCode)
: base(id) : base(id)
{ {
Country = country; Country = country;
City = city; City = city;
Name = name; Name = name;
Township = township; Township = township;
PostalCode = postalCode;
} }
} }

View file

@ -11,12 +11,13 @@ public class Order : FullAuditedEntity<Guid>
public string Founder { get; set; } public string Founder { get; set; }
public long? VknTckn { get; set; } public long? VknTckn { get; set; }
public string TaxOffice { get; set; } public string TaxOffice { get; set; }
public string Address1 { get; set; }
public string Address2 { get; set; }
public string District { get; set; }
public string Country { get; set; } public string Country { get; set; }
public string City { get; set; } public string City { get; set; }
public string District { get; set; }
public string Township { get; set; }
public string PostalCode { get; set; } public string PostalCode { get; set; }
public string Address1 { get; set; }
public string Address2 { get; set; }
public string MobileNumber { get; set; } public string MobileNumber { get; set; }
public string PhoneNumber { get; set; } public string PhoneNumber { get; set; }
public string FaxNumber { get; set; } public string FaxNumber { get; set; }

View file

@ -1024,12 +1024,13 @@ public class PlatformDbContext :
b.Property(o => o.OrganizationName).HasMaxLength(128); b.Property(o => o.OrganizationName).HasMaxLength(128);
b.Property(o => o.Founder).HasMaxLength(128); b.Property(o => o.Founder).HasMaxLength(128);
b.Property(o => o.TaxOffice).HasMaxLength(128); b.Property(o => o.TaxOffice).HasMaxLength(128);
b.Property(o => o.Address1).HasMaxLength(512);
b.Property(o => o.Address2).HasMaxLength(512);
b.Property(o => o.District).HasMaxLength(128);
b.Property(o => o.Country).HasMaxLength(128); b.Property(o => o.Country).HasMaxLength(128);
b.Property(o => o.City).HasMaxLength(128); b.Property(o => o.City).HasMaxLength(128);
b.Property(o => o.District).HasMaxLength(128);
b.Property(o => o.Township).HasMaxLength(128);
b.Property(o => o.PostalCode).HasMaxLength(16); b.Property(o => o.PostalCode).HasMaxLength(16);
b.Property(o => o.Address1).HasMaxLength(512);
b.Property(o => o.Address2).HasMaxLength(512);
b.Property(o => o.MobileNumber).HasMaxLength(20); b.Property(o => o.MobileNumber).HasMaxLength(20);
b.Property(o => o.PhoneNumber).HasMaxLength(20); b.Property(o => o.PhoneNumber).HasMaxLength(20);
b.Property(o => o.FaxNumber).HasMaxLength(20); b.Property(o => o.FaxNumber).HasMaxLength(20);

View file

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Sozsoft.Platform.Migrations namespace Sozsoft.Platform.Migrations
{ {
[DbContext(typeof(PlatformDbContext))] [DbContext(typeof(PlatformDbContext))]
[Migration("20260707105700_Initial")] [Migration("20260707205022_Initial")]
partial class Initial partial class Initial
{ {
/// <inheritdoc /> /// <inheritdoc />
@ -2260,6 +2260,9 @@ namespace Sozsoft.Platform.Migrations
.HasMaxLength(128) .HasMaxLength(128)
.HasColumnType("nvarchar(128)"); .HasColumnType("nvarchar(128)");
b.Property<string>("PostalCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Township") b.Property<string>("Township")
.HasMaxLength(128) .HasMaxLength(128)
.HasColumnType("nvarchar(128)"); .HasColumnType("nvarchar(128)");
@ -4213,6 +4216,10 @@ namespace Sozsoft.Platform.Migrations
.HasPrecision(18, 2) .HasPrecision(18, 2)
.HasColumnType("decimal(18,2)"); .HasColumnType("decimal(18,2)");
b.Property<string>("Township")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<decimal>("VatTotal") b.Property<decimal>("VatTotal")
.HasPrecision(18, 2) .HasPrecision(18, 2)
.HasColumnType("decimal(18,2)"); .HasColumnType("decimal(18,2)");

View file

@ -1575,12 +1575,13 @@ namespace Sozsoft.Platform.Migrations
Founder = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true), Founder = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
VknTckn = table.Column<long>(type: "bigint", nullable: true), VknTckn = table.Column<long>(type: "bigint", nullable: true),
TaxOffice = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true), TaxOffice = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
Address1 = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
Address2 = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
District = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
Country = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true), Country = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
City = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true), City = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
District = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
Township = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
PostalCode = table.Column<string>(type: "nvarchar(16)", maxLength: 16, nullable: true), PostalCode = table.Column<string>(type: "nvarchar(16)", maxLength: 16, nullable: true),
Address1 = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
Address2 = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
MobileNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true), MobileNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
PhoneNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true), PhoneNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
FaxNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true), FaxNumber = table.Column<string>(type: "nvarchar(20)", maxLength: 20, nullable: true),
@ -3418,6 +3419,7 @@ namespace Sozsoft.Platform.Migrations
City = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), City = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false), Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Township = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true), Township = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
PostalCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
CityId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), CityId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),

View file

@ -2257,6 +2257,9 @@ namespace Sozsoft.Platform.Migrations
.HasMaxLength(128) .HasMaxLength(128)
.HasColumnType("nvarchar(128)"); .HasColumnType("nvarchar(128)");
b.Property<string>("PostalCode")
.HasColumnType("nvarchar(max)");
b.Property<string>("Township") b.Property<string>("Township")
.HasMaxLength(128) .HasMaxLength(128)
.HasColumnType("nvarchar(128)"); .HasColumnType("nvarchar(128)");
@ -4210,6 +4213,10 @@ namespace Sozsoft.Platform.Migrations
.HasPrecision(18, 2) .HasPrecision(18, 2)
.HasColumnType("decimal(18,2)"); .HasColumnType("decimal(18,2)");
b.Property<string>("Township")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<decimal>("VatTotal") b.Property<decimal>("VatTotal")
.HasPrecision(18, 2) .HasPrecision(18, 2)
.HasColumnType("decimal(18,2)"); .HasColumnType("decimal(18,2)");

View file

@ -1,5 +1,5 @@
{ {
"commit": "708bfd0", "commit": "c42a8d2",
"releases": [ "releases": [
{ {
"version": "1.1.06", "version": "1.1.06",

View file

@ -47,6 +47,7 @@ const REQUIRED_NEW_CUSTOMER_FIELDS: Array<keyof CustomTenantDto> = [
'country', 'country',
'city', 'city',
'district', 'district',
'township',
'postalCode', 'postalCode',
'address1', 'address1',
'phoneNumber', 'phoneNumber',
@ -62,6 +63,7 @@ const REQUIRED_EXISTING_CUSTOMER_FIELDS: Array<keyof CustomTenantDto> = [
'country', 'country',
'city', 'city',
'district', 'district',
'township',
'address1', 'address1',
'email', 'email',
] ]
@ -139,6 +141,33 @@ const hasRequiredFields = (
const normalizeCode = (value?: string) => value?.trim().toLowerCase() || '' const normalizeCode = (value?: string) => value?.trim().toLowerCase() || ''
const getDistrictPostalCode = (district?: DistrictDto) =>
district?.postalCode ||
(district as (DistrictDto & { PostalCode?: string }) | undefined)?.PostalCode ||
''
const getUniqueLocationOptions = <T,>(
items: T[],
getKey: (item: T) => string,
getLabel: (item: T) => string,
): LocationOption<T>[] => {
const seen = new Set<string>()
return items.reduce<LocationOption<T>[]>((options, item) => {
const key = getKey(item)
if (!key || seen.has(key)) return options
seen.add(key)
options.push({
label: getLabel(item),
value: key,
data: item,
})
return options
}, [])
}
type TenantFormDraft = Partial<CustomTenantDto> & { type TenantFormDraft = Partial<CustomTenantDto> & {
isExisting?: boolean isExisting?: boolean
foundTenantName?: string foundTenantName?: string
@ -200,6 +229,8 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
country: defaultCountry.name, country: defaultCountry.name,
city: '', city: '',
district: '', district: '',
township: '',
postalCode: '',
phoneNumber: `+${defaultCountry.phoneCode}`, phoneNumber: `+${defaultCountry.phoneCode}`,
}, },
) )
@ -349,6 +380,8 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
country: defaultCountry.name, country: defaultCountry.name,
city: '', city: '',
district: '', district: '',
township: '',
postalCode: '',
phoneNumber: `+${defaultCountry.phoneCode}`, phoneNumber: `+${defaultCountry.phoneCode}`,
} }
: {} : {}
@ -383,6 +416,8 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
country: country?.name || '', country: country?.name || '',
city: '', city: '',
district: '', district: '',
township: '',
postalCode: '',
phoneNumber: country ? `+${country.phoneCode}` : '', phoneNumber: country ? `+${country.phoneCode}` : '',
})) }))
setCities([]) setCities([])
@ -403,7 +438,13 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
const handleCityChange = async (option: LocationOption<CityDto> | null) => { const handleCityChange = async (option: LocationOption<CityDto> | null) => {
const city = option?.data const city = option?.data
setFormData((prev) => ({ ...prev, city: city?.name || '', district: '' })) setFormData((prev) => ({
...prev,
city: city?.name || '',
district: '',
township: '',
postalCode: '',
}))
setDistricts([]) setDistricts([])
if (!city || !formData.country) return if (!city || !formData.country) return
@ -418,6 +459,23 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
} }
} }
const handleDistrictChange = (option: LocationOption<DistrictDto> | null) => {
setFormData((prev) => ({
...prev,
district: option?.data.name || '',
township: '',
postalCode: '',
}))
}
const handleTownshipChange = (option: LocationOption<DistrictDto> | null) => {
setFormData((prev) => ({
...prev,
township: option?.data.township || '',
postalCode: getDistrictPostalCode(option?.data),
}))
}
const countryOptions: LocationOption<CountryDto>[] = countries.map((country) => ({ const countryOptions: LocationOption<CountryDto>[] = countries.map((country) => ({
label: country.name, label: country.name,
value: country.name, value: country.name,
@ -428,11 +486,16 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
value: city.name, value: city.name,
data: city, data: city,
})) }))
const districtOptions: LocationOption<DistrictDto>[] = districts.map((district) => ({ const districtOptions = getUniqueLocationOptions(
label: district.name, districts,
value: district.name, (district) => district.name,
data: district, (district) => district.name,
})) )
const townshipOptions = getUniqueLocationOptions(
districts.filter((district) => district.name === formData.district && district.township),
(district) => `${district.township || ''}:${getDistrictPostalCode(district)}`,
(district) => district.township || '',
)
const getTenantInfo = async () => { const getTenantInfo = async () => {
const tenantName = formData.name?.trim() const tenantName = formData.name?.trim()
@ -458,6 +521,7 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
country: tenant.data.country, country: tenant.data.country,
city: tenant.data.city, city: tenant.data.city,
district: tenant.data.district, district: tenant.data.district,
township: tenant.data.township,
postalCode: tenant.data.postalCode, postalCode: tenant.data.postalCode,
phoneNumber: tenant.data.phoneNumber, phoneNumber: tenant.data.phoneNumber,
mobileNumber: tenant.data.mobileNumber, mobileNumber: tenant.data.mobileNumber,
@ -648,6 +712,14 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
<span>{formData.district}</span> <span>{formData.district}</span>
</div> </div>
<div className="flex items-center gap-2">
<FaMap className="w-4 h-4 text-gray-500" />
<span className="font-medium">
{translate('::App.Listform.ListformField.Township')}:
</span>
<span>{formData.township}</span>
</div>
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
<FaMapPin className="w-4 h-4 text-gray-500" /> <FaMapPin className="w-4 h-4 text-gray-500" />
<span className="font-medium"> <span className="font-medium">
@ -686,24 +758,24 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
</div> </div>
) : ( ) : (
<div className="space-y-4"> <div className="space-y-4">
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4"> <div>
<div> <label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> {translate('::Public.products.tenantForm.orgName')}
{translate('::Public.products.tenantForm.orgName')} </label>
</label> <div className="relative">
<div className="relative"> <FaBuilding className="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 w-5 h-5" />
<FaBuilding className="absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 w-5 h-5" /> <input
<input type="text"
type="text" required
required autoFocus
autoFocus placeholder="Enter your organization name"
placeholder="Enter your organization name" value={formData.organizationName || ''}
value={formData.organizationName || ''} onChange={(e) => handleInputChange('organizationName', e.target.value)}
onChange={(e) => handleInputChange('organizationName', e.target.value)} className="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg bg-white text-gray-900 placeholder-gray-500 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100 dark:placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all"
className="w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg bg-white text-gray-900 placeholder-gray-500 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100 dark:placeholder-gray-400 focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all" />
/>
</div>
</div> </div>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div> <div>
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> <label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
{translate('::LoginPanel.Profil')} {translate('::LoginPanel.Profil')}
@ -720,9 +792,6 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
/> />
</div> </div>
</div> </div>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div> <div>
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> <label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
{translate('::Public.payment.customer.country')} {translate('::Public.payment.customer.country')}
@ -741,6 +810,9 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
/> />
</div> </div>
</div> </div>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div> <div>
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> <label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
{translate('::Public.common.city')} {translate('::Public.common.city')}
@ -758,9 +830,6 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
/> />
</div> </div>
</div> </div>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div> <div>
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> <label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
{translate('::Public.payment.customer.district')} {translate('::Public.payment.customer.district')}
@ -776,13 +845,35 @@ export const TenantForm: React.FC<TenantFormProps> = ({ onSubmit }) => {
districtOptions.find((option) => option.value === formData.district) || districtOptions.find((option) => option.value === formData.district) ||
null null
} }
onChange={(option) => onChange={handleDistrictChange}
handleInputChange('district', option?.data.name || '')
}
placeholder={formData.city ? 'İlçe seçin' : 'Önce şehir seçin'} placeholder={formData.city ? 'İlçe seçin' : 'Önce şehir seçin'}
/> />
</div> </div>
</div> </div>
</div>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
{translate('::App.Listform.ListformField.Township')}
</label>
<div className="relative">
<Select<LocationOption<DistrictDto>>
required
isClearable
isDisabled={!formData.district}
options={townshipOptions}
value={
townshipOptions.find(
(option) => option.data.township === formData.township,
) || null
}
onChange={handleTownshipChange}
placeholder={formData.district ? 'Township seçin' : 'Önce ilçe seçin'}
/>
</div>
</div>
<div> <div>
<label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2"> <label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">
{translate('::Public.payment.customer.postalCode')} {translate('::Public.payment.customer.postalCode')}

View file

@ -29,6 +29,7 @@ export interface CustomTenantDto extends TenantDto {
country: string country: string
city: string city: string
district: string district: string
township: string
address1: string address1: string
address2: string address2: string
postalCode: string postalCode: string

View file

@ -22,6 +22,7 @@ export interface DistrictDto {
city: string city: string
name: string name: string
township?: string township?: string
postalCode?: string
} }
export const getCountries = () => export const getCountries = () =>