seed/data Seeder PaymentMethods
This commit is contained in:
parent
3b93cd3895
commit
e80fc2337c
4 changed files with 23 additions and 38 deletions
|
|
@ -7448,6 +7448,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
|||
Description = $"{listFormName}.Description",
|
||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.PaymentMethod)),
|
||||
SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName),
|
||||
SeedSyncInsert = false,
|
||||
SeedSyncUpdate = false,
|
||||
SeedSyncDelete = false,
|
||||
KeyFieldName = "Id",
|
||||
KeyFieldDbSourceType = DbType.String,
|
||||
SortMode = GridOptions.SortModeSingle,
|
||||
|
|
|
|||
|
|
@ -362,18 +362,6 @@
|
|||
]
|
||||
}
|
||||
],
|
||||
"PaymentMethods": [
|
||||
{
|
||||
"name": "Kredi Kartı",
|
||||
"commission": 0,
|
||||
"logo": "💳"
|
||||
},
|
||||
{
|
||||
"name": "Havale/EFT",
|
||||
"commission": 0,
|
||||
"logo": "🏦"
|
||||
}
|
||||
],
|
||||
"InstallmentOptions": [
|
||||
{
|
||||
"installment": 1,
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ public class TenantSeederDto
|
|||
public List<HomeSeedDto> Homes { get; set; }
|
||||
public List<AboutSeedDto> Abouts { get; set; }
|
||||
public List<ServiceSeedDto> Services { get; set; }
|
||||
public List<PaymentMethodSeedDto> PaymentMethods { get; set; }
|
||||
public List<InstallmentOptionSeedDto> InstallmentOptions { get; set; }
|
||||
public List<ContactSeedDto> Contacts { get; set; }
|
||||
|
||||
|
|
@ -267,13 +266,6 @@ public class ForumCategorySeedDto
|
|||
public bool IsActive { get; set; }
|
||||
}
|
||||
|
||||
public class PaymentMethodSeedDto
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public decimal Commission { get; set; }
|
||||
public string Logo { get; set; }
|
||||
}
|
||||
|
||||
public class InstallmentOptionSeedDto
|
||||
{
|
||||
public int Installment { get; set; }
|
||||
|
|
@ -398,7 +390,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
private readonly IRepository<ReportTemplate, Guid> _reportTemplatesRepository;
|
||||
private readonly IRepository<Home, Guid> _homeRepository;
|
||||
private readonly IRepository<About, Guid> _aboutRepository;
|
||||
private readonly IRepository<PaymentMethod, Guid> _paymentMethodRepository;
|
||||
private readonly IRepository<InstallmentOption, Guid> _installmentOptionRepository;
|
||||
private readonly IRepository<Service, Guid> _servicesRepository;
|
||||
private readonly IRepository<Contact, Guid> _contactRepository;
|
||||
|
|
@ -442,7 +433,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
IRepository<Home, Guid> homeRepository,
|
||||
IRepository<About, Guid> aboutRepository,
|
||||
IRepository<Service, Guid> servicesRepository,
|
||||
IRepository<PaymentMethod, Guid> paymentMethodRepository,
|
||||
IRepository<InstallmentOption, Guid> installmentOptionRepository,
|
||||
IRepository<Contact, Guid> contactRepository,
|
||||
IRepository<WorkHour, Guid> workHourRepository,
|
||||
|
|
@ -473,7 +463,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
_skillTypeRepository = skillTypeRepository;
|
||||
_skillRepository = skillRepository;
|
||||
_skillLevelRepository = skillLevelRepository;
|
||||
_paymentMethodRepository = paymentMethodRepository;
|
||||
_installmentOptionRepository = installmentOptionRepository;
|
||||
_reportCategoriesRepository = reportCategoriesRepository;
|
||||
_reportTemplatesRepository = reportTemplatesRepository;
|
||||
|
|
@ -614,21 +603,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
|||
}
|
||||
}
|
||||
|
||||
foreach (var item in items.PaymentMethods)
|
||||
{
|
||||
var exists = await _paymentMethodRepository.AnyAsync(x => x.Name == item.Name);
|
||||
|
||||
if (!exists)
|
||||
{
|
||||
await _paymentMethodRepository.InsertAsync(new PaymentMethod
|
||||
{
|
||||
Name = item.Name,
|
||||
Commission = item.Commission,
|
||||
Logo = item.Logo,
|
||||
}, autoSave: true);
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var item in items.InstallmentOptions)
|
||||
{
|
||||
var exists = await _installmentOptionRepository.AnyAsync(x => x.Installment == item.Installment);
|
||||
|
|
|
|||
19
configs/seeds/host/data/App.Orders.PaymentMethods.json
Normal file
19
configs/seeds/host/data/App.Orders.PaymentMethods.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"ListFormCode": "App.Orders.PaymentMethods",
|
||||
"KeyFieldName": "Id",
|
||||
"GeneratedAt": "2026-09-04T00:00:00Z",
|
||||
"Rows": [
|
||||
{
|
||||
"Id": "5d1ce718-cc0a-59a4-8b6d-99455988c979",
|
||||
"Name": "Kredi Kartı",
|
||||
"Commission": 0,
|
||||
"Logo": "💳"
|
||||
},
|
||||
{
|
||||
"Id": "1b94d843-1fc2-5da1-ab01-f36612d9824e",
|
||||
"Name": "Havale/EFT",
|
||||
"Commission": 0,
|
||||
"Logo": "🏦"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Reference in a new issue