seed/data Seeder InstallmentOptions
This commit is contained in:
parent
e80fc2337c
commit
2e4e089e4a
4 changed files with 47 additions and 58 deletions
|
|
@ -7593,6 +7593,10 @@ public class ListFormSeeder_Saas : IDataSeedContributor, ITransientDependency
|
||||||
Description = $"{listFormName}.Description",
|
Description = $"{listFormName}.Description",
|
||||||
SelectCommandType = SelectCommandTypeEnum.Table,
|
SelectCommandType = SelectCommandTypeEnum.Table,
|
||||||
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.InstallmentOption)),
|
SelectCommand = TableNameResolver.GetFullTableName(nameof(TableNameEnum.InstallmentOption)),
|
||||||
|
SeedFilePath = SeedPathResolver.GetDataFilePath(listFormName),
|
||||||
|
SeedSyncInsert = false,
|
||||||
|
SeedSyncUpdate = false,
|
||||||
|
SeedSyncDelete = false,
|
||||||
KeyFieldName = "Id",
|
KeyFieldName = "Id",
|
||||||
KeyFieldDbSourceType = DbType.Guid,
|
KeyFieldDbSourceType = DbType.Guid,
|
||||||
SortMode = GridOptions.SortModeSingle,
|
SortMode = GridOptions.SortModeSingle,
|
||||||
|
|
|
||||||
|
|
@ -362,38 +362,6 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"InstallmentOptions": [
|
|
||||||
{
|
|
||||||
"installment": 1,
|
|
||||||
"name": "Tek Çekim",
|
|
||||||
"commission": 0.038
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"installment": 2,
|
|
||||||
"name": "2 Taksit",
|
|
||||||
"commission": 0.08
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"installment": 3,
|
|
||||||
"name": "3 Taksit",
|
|
||||||
"commission": 0.11
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"installment": 6,
|
|
||||||
"name": "6 Taksit",
|
|
||||||
"commission": 0.165
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"installment": 9,
|
|
||||||
"name": "9 Taksit",
|
|
||||||
"commission": 0.22
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"installment": 12,
|
|
||||||
"name": "12 Taksit",
|
|
||||||
"commission": 0.275
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"Contacts": [
|
"Contacts": [
|
||||||
{
|
{
|
||||||
"address": "App.ContactAddress.Full",
|
"address": "App.ContactAddress.Full",
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ public class TenantSeederDto
|
||||||
public List<HomeSeedDto> Homes { get; set; }
|
public List<HomeSeedDto> Homes { get; set; }
|
||||||
public List<AboutSeedDto> Abouts { get; set; }
|
public List<AboutSeedDto> Abouts { get; set; }
|
||||||
public List<ServiceSeedDto> Services { get; set; }
|
public List<ServiceSeedDto> Services { get; set; }
|
||||||
public List<InstallmentOptionSeedDto> InstallmentOptions { get; set; }
|
|
||||||
public List<ContactSeedDto> Contacts { get; set; }
|
public List<ContactSeedDto> Contacts { get; set; }
|
||||||
|
|
||||||
//Report Templates
|
//Report Templates
|
||||||
|
|
@ -266,13 +265,6 @@ public class ForumCategorySeedDto
|
||||||
public bool IsActive { get; set; }
|
public bool IsActive { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class InstallmentOptionSeedDto
|
|
||||||
{
|
|
||||||
public int Installment { get; set; }
|
|
||||||
public string Name { get; set; }
|
|
||||||
public decimal Commission { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ReportTemplateSeedDto
|
public class ReportTemplateSeedDto
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
@ -390,7 +382,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
private readonly IRepository<ReportTemplate, Guid> _reportTemplatesRepository;
|
private readonly IRepository<ReportTemplate, Guid> _reportTemplatesRepository;
|
||||||
private readonly IRepository<Home, Guid> _homeRepository;
|
private readonly IRepository<Home, Guid> _homeRepository;
|
||||||
private readonly IRepository<About, Guid> _aboutRepository;
|
private readonly IRepository<About, Guid> _aboutRepository;
|
||||||
private readonly IRepository<InstallmentOption, Guid> _installmentOptionRepository;
|
|
||||||
private readonly IRepository<Service, Guid> _servicesRepository;
|
private readonly IRepository<Service, Guid> _servicesRepository;
|
||||||
private readonly IRepository<Contact, Guid> _contactRepository;
|
private readonly IRepository<Contact, Guid> _contactRepository;
|
||||||
private readonly IRepository<SkillType, string> _skillTypeRepository;
|
private readonly IRepository<SkillType, string> _skillTypeRepository;
|
||||||
|
|
@ -433,7 +424,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
IRepository<Home, Guid> homeRepository,
|
IRepository<Home, Guid> homeRepository,
|
||||||
IRepository<About, Guid> aboutRepository,
|
IRepository<About, Guid> aboutRepository,
|
||||||
IRepository<Service, Guid> servicesRepository,
|
IRepository<Service, Guid> servicesRepository,
|
||||||
IRepository<InstallmentOption, Guid> installmentOptionRepository,
|
|
||||||
IRepository<Contact, Guid> contactRepository,
|
IRepository<Contact, Guid> contactRepository,
|
||||||
IRepository<WorkHour, Guid> workHourRepository,
|
IRepository<WorkHour, Guid> workHourRepository,
|
||||||
IRepository<ForumCategory, Guid> forumCategoryRepository,
|
IRepository<ForumCategory, Guid> forumCategoryRepository,
|
||||||
|
|
@ -463,7 +453,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
_skillTypeRepository = skillTypeRepository;
|
_skillTypeRepository = skillTypeRepository;
|
||||||
_skillRepository = skillRepository;
|
_skillRepository = skillRepository;
|
||||||
_skillLevelRepository = skillLevelRepository;
|
_skillLevelRepository = skillLevelRepository;
|
||||||
_installmentOptionRepository = installmentOptionRepository;
|
|
||||||
_reportCategoriesRepository = reportCategoriesRepository;
|
_reportCategoriesRepository = reportCategoriesRepository;
|
||||||
_reportTemplatesRepository = reportTemplatesRepository;
|
_reportTemplatesRepository = reportTemplatesRepository;
|
||||||
_homeRepository = homeRepository;
|
_homeRepository = homeRepository;
|
||||||
|
|
@ -603,21 +592,6 @@ public class TenantDataSeeder : IDataSeedContributor, ITransientDependency
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var item in items.InstallmentOptions)
|
|
||||||
{
|
|
||||||
var exists = await _installmentOptionRepository.AnyAsync(x => x.Installment == item.Installment);
|
|
||||||
|
|
||||||
if (!exists)
|
|
||||||
{
|
|
||||||
await _installmentOptionRepository.InsertAsync(new InstallmentOption
|
|
||||||
{
|
|
||||||
Installment = item.Installment,
|
|
||||||
Name = item.Name,
|
|
||||||
Commission = item.Commission
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var item in items.ReportCategories)
|
foreach (var item in items.ReportCategories)
|
||||||
{
|
{
|
||||||
var exists = await _reportCategoriesRepository.AnyAsync(x => x.Name == item.Name);
|
var exists = await _reportCategoriesRepository.AnyAsync(x => x.Name == item.Name);
|
||||||
|
|
|
||||||
43
configs/seeds/host/data/App.Orders.InstallmentOptions.json
Normal file
43
configs/seeds/host/data/App.Orders.InstallmentOptions.json
Normal file
|
|
@ -0,0 +1,43 @@
|
||||||
|
{
|
||||||
|
"ListFormCode": "App.Orders.InstallmentOptions",
|
||||||
|
"KeyFieldName": "Id",
|
||||||
|
"GeneratedAt": "2026-09-04T00:00:00Z",
|
||||||
|
"Rows": [
|
||||||
|
{
|
||||||
|
"Id": "9a09de26-074c-50a8-ae60-86516cd0f5a3",
|
||||||
|
"Installment": 1,
|
||||||
|
"Name": "Tek Çekim",
|
||||||
|
"Commission": 0.038
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "da2bae24-8866-5259-bd2d-5adc618bd77c",
|
||||||
|
"Installment": 2,
|
||||||
|
"Name": "2 Taksit",
|
||||||
|
"Commission": 0.08
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "b71f9db8-2819-5df2-a164-4235c6685262",
|
||||||
|
"Installment": 3,
|
||||||
|
"Name": "3 Taksit",
|
||||||
|
"Commission": 0.11
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "44985ebe-07b2-5c70-b64e-1293484133f1",
|
||||||
|
"Installment": 6,
|
||||||
|
"Name": "6 Taksit",
|
||||||
|
"Commission": 0.165
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "ea214ad5-c524-5428-84f0-e9fad7617955",
|
||||||
|
"Installment": 9,
|
||||||
|
"Name": "9 Taksit",
|
||||||
|
"Commission": 0.22
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"Id": "3bbcec24-b533-55b9-9800-77fdd5148c3f",
|
||||||
|
"Installment": 12,
|
||||||
|
"Name": "12 Taksit",
|
||||||
|
"Commission": 0.275
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue