Genel tanımlama Entitiy ve Seeder değişiklikleri

This commit is contained in:
Sedat ÖZTÜRK 2025-06-18 13:29:25 +03:00
parent 7986f6eec1
commit 6b348ff3ac
36 changed files with 19220 additions and 265 deletions

View file

@ -0,0 +1,18 @@
using System;
using Volo.Abp.Application.Dtos;
public class BankAccountDto : AuditedEntityDto<Guid>
{
public string AccountNumber { get; set; }
public Guid BankId { get; set; }
public string BankName { get; set; }
public string AccountOwner { get; set; }
public Guid? CurrencyId { get; set; }
public string CurrencyCode { get; set; }
public bool CanTransferMoney { get; set; }
public string Company { get; set; }
}

View file

@ -0,0 +1,18 @@
using System;
using Volo.Abp.Application.Dtos;
public class BankDto : AuditedEntityDto<Guid>
{
public string Name { get; set; }
public string IdentifierCode { get; set; }
public string AddressLine1 { get; set; }
public string AddressLine2 { get; set; }
public string District { get; set; }
public string City { get; set; }
public string PostalCode { get; set; }
public string Country { get; set; }
public string Phone { get; set; }
public string Email { get; set; }
}

View file

@ -0,0 +1,10 @@
using System;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Contacts;
public class ContactTagDto : AuditedEntityDto<Guid>
{
public string Name { get; set; }
public string Category { get; set; }
}

View file

@ -0,0 +1,10 @@
using System;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Contacts;
public class ContactTitleDto : AuditedEntityDto<Guid>
{
public string Title { get; set; }
public string Abbreviation { get; set; }
}

View file

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Contacts;
public class CountryDto : AuditedEntityDto<Guid>
{
public string Code { get; set; }
public string Name { get; set; }
public string CurrencyCode { get; set; }
public string PhoneCode { get; set; }
public string TaxLabel { get; set; }
public bool ZipRequired { get; set; }
public bool StateRequired { get; set; }
public List<StateDto> States { get; set; }
}

View file

@ -0,0 +1,9 @@
using System;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Contacts;
public class CountryGroupDto : AuditedEntityDto<Guid>
{
public string Name { get; set; }
}

View file

@ -0,0 +1,11 @@
using System;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Contacts;
public class StateDto : AuditedEntityDto<Guid>
{
public string Name { get; set; }
public string Code { get; set; }
public string CountryCode { get; set; }
}

View file

@ -0,0 +1,14 @@
using System;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Currencies;
public class CurrencyDto : AuditedEntityDto<Guid>
{
public string Code { get; set; }
public string Symbol { get; set; }
public string Name { get; set; }
public decimal Rate { get; set; }
public bool IsActive { get; set; }
public DateTime? LastUpdated { get; set; }
}

View file

@ -0,0 +1,10 @@
using System;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Sectors;
public class SectorDto : AuditedEntityDto<Guid>
{
public string Name { get; set; }
public string FullName { get; set; }
}

View file

@ -0,0 +1,10 @@
using System;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Skills;
public class SkillDto : AuditedEntityDto<Guid>
{
public string Name { get; set; }
public string TypeName { get; set; }
}

View file

@ -0,0 +1,12 @@
using System;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Skills;
public class SkillLevelDto : AuditedEntityDto<Guid>
{
public string Name { get; set; }
public int Progress { get; set; }
public bool IsDefault { get; set; }
public string TypeName { get; set; }
}

View file

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Skills;
public class SkillTypeDto : AuditedEntityDto<Guid>
{
public string Name { get; set; }
public List<SkillDto> Skills { get; set; }
public List<SkillLevelDto> Levels { get; set; }
}

View file

@ -0,0 +1,9 @@
using System;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Uoms;
public class UomCategoryDto : AuditedEntityDto<Guid>
{
public string Name { get; set; }
}

View file

@ -0,0 +1,17 @@
using System;
using Kurs.Platform.Enums;
using Volo.Abp.Application.Dtos;
namespace Kurs.Platform.Uoms;
public class UomDto : AuditedEntityDto<Guid>
{
public string Name { get; set; }
public UomType Type { get; set; }
public decimal Ratio { get; set; }
public bool IsActive { get; set; }
public decimal Rounding { get; set; }
public Guid UomCategoryId { get; set; }
public string UomCategoryName { get; set; } // Listelemede gösterim için opsiyonel
}

View file

@ -1,7 +1,12 @@
using AutoMapper; using AutoMapper;
using Kurs.Platform.Contacts;
using Kurs.Platform.Currencies;
using Kurs.Platform.Entities; using Kurs.Platform.Entities;
using Kurs.Platform.GlobalSearchs; using Kurs.Platform.GlobalSearchs;
using Kurs.Platform.OrganizationUnits; using Kurs.Platform.OrganizationUnits;
using Kurs.Platform.Sectors;
using Kurs.Platform.Skills;
using Kurs.Platform.Uoms;
using Volo.Abp.Identity; using Volo.Abp.Identity;
namespace Kurs.Platform; namespace Kurs.Platform;
@ -16,5 +21,22 @@ public class PlatformApplicationAutoMapperProfile : Profile
CreateMap<GlobalSearch, GlobalSearchResultDto>(); CreateMap<GlobalSearch, GlobalSearchResultDto>();
CreateMap<Sector, SectorDto>();
CreateMap<UomCategory, UomCategoryDto>();
CreateMap<Uom, UomDto>()
.ForMember(dest => dest.UomCategoryName, opt => opt.MapFrom(src => src.UomCategory.Name));
CreateMap<Currency, CurrencyDto>();
CreateMap<Bank, BankDto>();
CreateMap<BankAccount, BankAccountDto>()
.ForMember(dest => dest.BankName, opt => opt.MapFrom(src => src.Bank.Name))
.ForMember(dest => dest.CurrencyCode, opt => opt.MapFrom(src => src.Currency.Code));
CreateMap<CountryGroup, CountryGroupDto>();
CreateMap<Country, CountryDto>();
CreateMap<State, StateDto>();
CreateMap<SkillType, SkillTypeDto>();
CreateMap<SkillLevel, SkillLevelDto>();
CreateMap<Skill, SkillDto>();
CreateMap<ContactTag, ContactTagDto>();
CreateMap<ContactTitle, ContactTitleDto>();
} }
} }

View file

@ -16,6 +16,7 @@ using Microsoft.Extensions.Configuration;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement; using Volo.Abp.PermissionManagement;
using static Kurs.Settings.SettingsConsts; using static Kurs.Settings.SettingsConsts;
@ -35,6 +36,18 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
private readonly IRepository<Menu, Guid> _menuRepository; private readonly IRepository<Menu, Guid> _menuRepository;
private readonly IRepository<PermissionGroupDefinitionRecord, Guid> _permissionGroupRepository; private readonly IRepository<PermissionGroupDefinitionRecord, Guid> _permissionGroupRepository;
private readonly IRepository<PermissionDefinitionRecord, Guid> _permissionRepository; private readonly IRepository<PermissionDefinitionRecord, Guid> _permissionRepository;
private readonly IRepository<Sector, Guid> _sectorRepository;
private readonly IRepository<UomCategory, Guid> _uomCategoryRepository;
private readonly IRepository<Uom, Guid> _uomRepository;
private readonly IRepository<Currency, Guid> _currencyRepository;
private readonly IRepository<CountryGroup, Guid> _countryGroupRepository;
private readonly IRepository<Country, Guid> _countryRepository;
private readonly IRepository<State, Guid> _stateRepository;
private readonly IRepository<SkillType, Guid> _skillTypeRepository;
private readonly IRepository<Skill, Guid> _skillRepository;
private readonly IRepository<SkillLevel, Guid> _skillLevelRepository;
private readonly IRepository<ContactTag, Guid> _contactTagRepository;
private readonly IRepository<ContactTitle, Guid> _contactTitleRepository;
public PlatformDataSeeder( public PlatformDataSeeder(
IRepository<Language, Guid> languages, IRepository<Language, Guid> languages,
@ -48,7 +61,20 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
IRepository<NotificationRule, Guid> notificationRuleRepository, IRepository<NotificationRule, Guid> notificationRuleRepository,
IRepository<Menu, Guid> menuRepository, IRepository<Menu, Guid> menuRepository,
IRepository<PermissionGroupDefinitionRecord, Guid> permissionGroupRepository, IRepository<PermissionGroupDefinitionRecord, Guid> permissionGroupRepository,
IRepository<PermissionDefinitionRecord, Guid> permissionRepository) IRepository<PermissionDefinitionRecord, Guid> permissionRepository,
IRepository<Sector, Guid> sectorRepository,
IRepository<UomCategory, Guid> uomCategoryRepository,
IRepository<Uom, Guid> uomRepository,
IRepository<Currency, Guid> currencyRepository,
IRepository<CountryGroup, Guid> countryGroupRepository,
IRepository<Country, Guid> countryRepository,
IRepository<State, Guid> stateRepository,
IRepository<SkillType, Guid> skillTypeRepository,
IRepository<Skill, Guid> skillRepository,
IRepository<SkillLevel, Guid> skillLevelRepository,
IRepository<ContactTag, Guid> contactTagRepository,
IRepository<ContactTitle, Guid> contactTitleRepository
)
{ {
_languages = languages; _languages = languages;
_languageKey = languageKey; _languageKey = languageKey;
@ -62,6 +88,18 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
_menuRepository = menuRepository; _menuRepository = menuRepository;
_permissionGroupRepository = permissionGroupRepository; _permissionGroupRepository = permissionGroupRepository;
_permissionRepository = permissionRepository; _permissionRepository = permissionRepository;
_sectorRepository = sectorRepository;
_uomCategoryRepository = uomCategoryRepository;
_uomRepository = uomRepository;
_currencyRepository = currencyRepository;
_countryGroupRepository = countryGroupRepository;
_countryRepository = countryRepository;
_stateRepository = stateRepository;
_skillTypeRepository = skillTypeRepository;
_skillRepository = skillRepository;
_skillLevelRepository = skillLevelRepository;
_contactTagRepository = contactTagRepository;
_contactTitleRepository = contactTitleRepository;
} }
private static IConfigurationRoot BuildConfiguration() private static IConfigurationRoot BuildConfiguration()
@ -323,7 +361,185 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
ParentName = string.IsNullOrWhiteSpace(item.ParentName) ? null : item.ParentName, ParentName = string.IsNullOrWhiteSpace(item.ParentName) ? null : item.ParentName,
DisplayName = item.DisplayName, DisplayName = item.DisplayName,
IsEnabled = item.IsEnabled, IsEnabled = item.IsEnabled,
MultiTenancySide = item.MultiTenancySide MultiTenancySide = (MultiTenancySides)item.MultiTenancySide
});
}
}
foreach (var item in items.Sectors)
{
var exists = await _sectorRepository.AnyAsync(x => x.Name == item.Name);
if (!exists)
{
await _sectorRepository.InsertAsync(new Sector
{
Name = item.Name,
FullName = item.FullName
});
}
}
foreach (var item in items.UomCategories)
{
var exists = await _uomCategoryRepository.AnyAsync(x => x.Name == item.Name);
if (!exists)
{
await _uomCategoryRepository.InsertAsync(new UomCategory
{
Name = item.Name
});
}
}
foreach (var item in items.Uoms)
{
var exists = await _uomRepository.AnyAsync(x => x.Name == item.Name);
if (!exists)
{
await _uomRepository.InsertAsync(new Uom
{
Name = item.Name,
Type = item.Type,
Ratio = item.Ratio,
IsActive = item.IsActive,
Rounding = item.Rounding,
CategoryName = item.CategoryName
});
}
}
foreach (var item in items.Currencies)
{
var exists = await _currencyRepository.AnyAsync(x => x.Code == item.Code);
if (!exists)
{
await _currencyRepository.InsertAsync(new Currency
{
Code = item.Code,
Symbol = item.Symbol,
Name = item.Name,
IsActive = item.IsActive
});
}
}
foreach (var item in items.CountryGroups)
{
var exists = await _countryGroupRepository.AnyAsync(x => x.Name == item.Name);
if (!exists)
{
await _countryGroupRepository.InsertAsync(new CountryGroup
{
Name = item.Name,
});
}
}
foreach (var item in items.Countries)
{
var exists = await _countryRepository.AnyAsync(x => x.Code == item.Code);
if (!exists)
{
await _countryRepository.InsertAsync(new Country
{
Code = item.Code,
Name = item.Name,
CurrencyCode = item.CurrencyCode,
PhoneCode = item.PhoneCode,
TaxLabel = item.TaxLabel,
GroupName = item.GroupName
});
}
}
foreach (var item in items.States)
{
var exists = await _stateRepository.AnyAsync(x => x.Name == item.Name && x.CountryCode == item.CountryCode);
if (!exists)
{
await _stateRepository.InsertAsync(new State
{
Code = item.Code,
Name = item.Name,
CountryCode = item.CountryCode
});
}
}
foreach (var item in items.SkillTypes)
{
var exists = await _skillTypeRepository.AnyAsync(x => x.Name == item.Name);
if (!exists)
{
await _skillTypeRepository.InsertAsync(new SkillType
{
Name = item.Name,
});
}
}
foreach (var item in items.Skills)
{
var exists = await _skillRepository.AnyAsync(x => x.Name == item.Name && x.TypeName == item.TypeName);
if (!exists)
{
await _skillRepository.InsertAsync(new Skill
{
Name = item.Name,
TypeName = item.TypeName
});
}
}
foreach (var item in items.SkillLevels)
{
var exists = await _skillLevelRepository.AnyAsync(x => x.Name == item.Name && x.TypeName == item.TypeName);
if (!exists)
{
await _skillLevelRepository.InsertAsync(new SkillLevel
{
Name = item.Name,
TypeName = item.TypeName,
Progress = item.Progress,
IsDefault = item.IsDefault
});
}
}
foreach (var item in items.ContactTags)
{
var exists = await _contactTagRepository.AnyAsync(x => x.Name == item.Name);
if (!exists)
{
await _contactTagRepository.InsertAsync(new ContactTag
{
Name = item.Name,
Category = item.Category,
});
}
}
foreach (var item in items.ContactTitles)
{
var exists = await _contactTitleRepository.AnyAsync(x => x.Title == item.Title);
if (!exists)
{
await _contactTitleRepository.InsertAsync(new ContactTitle
{
Title = item.Title,
Abbreviation = item.Abbreviation,
}); });
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,6 @@ using Kurs.Platform.Charts.Dto;
using Kurs.Platform.Entities; using Kurs.Platform.Entities;
using Kurs.Platform.ListForms; using Kurs.Platform.ListForms;
using Kurs.Settings.Entities; using Kurs.Settings.Entities;
using Volo.Abp.PermissionManagement;
namespace Kurs.Platform.Seeds; namespace Kurs.Platform.Seeds;
@ -15,13 +14,24 @@ public class SeederDto
public List<DataSource> DataSources { get; set; } public List<DataSource> DataSources { get; set; }
public List<SettingDefinition> Settings { get; set; } public List<SettingDefinition> Settings { get; set; }
public List<ChartsSeedDto> Charts { get; set; } public List<ChartsSeedDto> Charts { get; set; }
public List<GlobalSearchDto> GlobalSearch { get; set; } public List<GlobalSearchSeedDto> GlobalSearch { get; set; }
public List<BackgroundWorkerDto> BackgroundWorkers { get; set; } public List<BackgroundWorkerSeedDto> BackgroundWorkers { get; set; }
public List<NotificationRuleDto> NotificationRules { get; set; } public List<NotificationRuleSeedDto> NotificationRules { get; set; }
public List<MenuDto> Menus { get; set; } public List<MenuSeedDto> Menus { get; set; }
public List<PermissionGroupDefinitionRecordDto> PermissionGroupDefinitionRecords { get; set; } public List<PermissionGroupDefinitionRecordSeedDto> PermissionGroupDefinitionRecords { get; set; }
public List<PermissionDefinitionRecord> PermissionDefinitionRecords { get; set; } public List<PermissionDefinitionRecordSeedDto> PermissionDefinitionRecords { get; set; }
public List<SectorSeedDto> Sectors { get; set; }
public List<UomCategorySeedDto> UomCategories { get; set; }
public List<UomSeedDto> Uoms { get; set; }
public List<CurrencySeedDto> Currencies { get; set; }
public List<CountryGroupSeedDto> CountryGroups { get; set; }
public List<CountrySeedDto> Countries { get; set; }
public List<StateSeedDto> States { get; set; }
public List<SkillTypeSeedDto> SkillTypes { get; set; }
public List<SkillSeedDto> Skills { get; set; }
public List<SkillLevelSeedDto> SkillLevels { get; set; }
public List<ContactTagSeedDto> ContactTags { get; set; }
public List<ContactTitleSeedDto> ContactTitles { get; set; }
} }
public class ChartsSeedDto public class ChartsSeedDto
@ -48,7 +58,7 @@ public class LanguageTextsSeedDto
public string Tr { get; set; } public string Tr { get; set; }
} }
public class GlobalSearchDto public class GlobalSearchSeedDto
{ {
public string System { get; set; } public string System { get; set; }
public string Group { get; set; } public string Group { get; set; }
@ -57,7 +67,7 @@ public class GlobalSearchDto
public string Url { get; set; } public string Url { get; set; }
} }
public class BackgroundWorkerDto public class BackgroundWorkerSeedDto
{ {
public string Name { get; set; } public string Name { get; set; }
public string Cron { get; set; } public string Cron { get; set; }
@ -66,7 +76,7 @@ public class BackgroundWorkerDto
public string DataSourceCode { get; set; } public string DataSourceCode { get; set; }
} }
public class NotificationRuleDto public class NotificationRuleSeedDto
{ {
public string NotificationType { get; set; } public string NotificationType { get; set; }
public string RecipientType { get; set; } public string RecipientType { get; set; }
@ -77,7 +87,7 @@ public class NotificationRuleDto
public bool IsCustomized { get; set; } public bool IsCustomized { get; set; }
} }
public class MenuDto public class MenuSeedDto
{ {
public string ParentCode { get; set; } public string ParentCode { get; set; }
public string Code { get; set; } public string Code { get; set; }
@ -89,13 +99,13 @@ public class MenuDto
public bool IsDisabled { get; set; } public bool IsDisabled { get; set; }
} }
public class PermissionGroupDefinitionRecordDto public class PermissionGroupDefinitionRecordSeedDto
{ {
public string Name { get; set; } public string Name { get; set; }
public string DisplayName { get; set; } public string DisplayName { get; set; }
} }
public class PermissionDefinitionRecordDto public class PermissionDefinitionRecordSeedDto
{ {
public string GroupName { get; set; } public string GroupName { get; set; }
public string Name { get; set; } public string Name { get; set; }
@ -104,3 +114,85 @@ public class PermissionDefinitionRecordDto
public bool IsEnabled { get; set; } public bool IsEnabled { get; set; }
public int MultiTenancySide { get; set; } public int MultiTenancySide { get; set; }
} }
public class SectorSeedDto
{
public string Name { get; set; }
public string FullName { get; set; }
}
public class UomCategorySeedDto
{
public string Name { get; set; }
}
public class UomSeedDto
{
public string Name { get; set; }
public string Type { get; set; }
public decimal Ratio { get; set; }
public bool IsActive { get; set; }
public decimal Rounding { get; set; }
public string CategoryName { get; set; }
}
public class CurrencySeedDto
{
public string Code { get; set; }
public string Symbol { get; set; }
public string Name { get; set; }
public bool IsActive { get; set; }
}
public class CountryGroupSeedDto
{
public string Name { get; set; }
}
public class CountrySeedDto
{
public string Name { get; set; }
public string Code { get; set; }
public string CurrencyCode { get; set; }
public string PhoneCode { get; set; }
public string TaxLabel { get; set; }
public string GroupName { get; set; }
}
public class StateSeedDto
{
public string Name { get; set; }
public string Code { get; set; }
public string CountryCode { get; set; }
}
public class SkillTypeSeedDto
{
public string Name { get; set; }
}
public class SkillSeedDto
{
public string Name { get; set; }
public string TypeName { get; set; }
}
public class SkillLevelSeedDto
{
public string Name { get; set; }
public int Progress { get; set; }
public bool IsDefault { get; set; }
public string TypeName { get; set; }
}
public class ContactTagSeedDto
{
public string Name { get; set; }
public string Category { get; set; }
}
public class ContactTitleSeedDto
{
public string Title { get; set; }
public string Abbreviation { get; set; }
}

View file

@ -0,0 +1,8 @@
namespace Kurs.Platform.Enums;
public class UomType
{
public const string Reference = "Reference";
public const string SmallerThanReference = "SmallerThanReference";
public const string BiggerThanReference = "BiggerThanReference";
}

View file

@ -0,0 +1,40 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;
public class Bank : FullAuditedEntity<Guid>
{
[Required]
[MaxLength(256)]
public string Name { get; set; }
[MaxLength(64)]
public string IdentifierCode { get; set; }
// Adres alanları
[MaxLength(256)]
public string AddressLine1 { get; set; }
[MaxLength(256)]
public string AddressLine2 { get; set; }
[MaxLength(128)]
public string District { get; set; }
[MaxLength(128)]
public string City { get; set; }
[MaxLength(16)]
public string PostalCode { get; set; }
[MaxLength(128)]
public string Country { get; set; }
[MaxLength(64)]
public string Phone { get; set; }
[MaxLength(128)]
public string Email { get; set; }
}

View file

@ -0,0 +1,26 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;
public class BankAccount : FullAuditedEntity<Guid>
{
[Required]
[MaxLength(64)]
public string AccountNumber { get; set; }
public Guid BankId { get; set; }
public Bank Bank { get; set; }
[MaxLength(256)]
public string AccountOwner { get; set; }
public Guid? CurrencyId { get; set; } // Currency entity'sine referans
public Currency Currency { get; set; }
public bool CanTransferMoney { get; set; }
[MaxLength(256)]
public string Company { get; set; }
}

View file

@ -0,0 +1,12 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
public class ContactTag : FullAuditedEntity<Guid>
{
[Required, MaxLength(128)]
public string Name { get; set; }
[MaxLength(128)]
public string Category { get; set; }
}

View file

@ -0,0 +1,12 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
public class ContactTitle : FullAuditedEntity<Guid>
{
[Required, MaxLength(128)]
public string Title { get; set; }
[MaxLength(64)]
public string Abbreviation { get; set; }
}

View file

@ -0,0 +1,41 @@
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; }
[MaxLength(16)]
public string PhoneCode { get; set; }
[MaxLength(64)]
public string TaxLabel { get; set; }
public bool ZipRequired { get; set; }
public bool StateRequired { get; set; }
public ICollection<State> States { get; set; }
}
public class CountryGroup : FullAuditedEntity<Guid>
{
[Required, MaxLength(128)]
public string Name { get; set; }
}

View file

@ -0,0 +1,25 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;
public class Currency : FullAuditedEntity<Guid>
{
[Required]
[MaxLength(8)]
public string Code { get; set; } // TRY, USD, EUR
[MaxLength(8)]
public string Symbol { get; set; } // ₺, $, etc.
[Required]
[MaxLength(128)]
public string Name { get; set; } // Turkish lira, US dollar, ...
public decimal Rate { get; set; } // TRY başına değer
public bool IsActive { get; set; }
public DateTime? LastUpdated { get; set; }
}

View file

@ -0,0 +1,15 @@
using System;
using Volo.Abp.Domain.Entities.Auditing;
using System.ComponentModel.DataAnnotations;
namespace Kurs.Platform.Entities;
public class Sector : FullAuditedEntity<Guid>
{
[Required]
[MaxLength(128)]
public string Name { get; set; }
[MaxLength(256)]
public string FullName { get; set; }
}

View file

@ -0,0 +1,11 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
public class Skill : FullAuditedEntity<Guid>
{
[Required, MaxLength(128)]
public string Name { get; set; }
public string TypeName { get; set; }
}

View file

@ -0,0 +1,14 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
public class SkillLevel : FullAuditedEntity<Guid>
{
[Required, MaxLength(128)]
public string Name { get; set; }
public int Progress { get; set; }
public bool IsDefault { get; set; }
public string TypeName { get; set; }
}

View file

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
public class SkillType : FullAuditedEntity<Guid>
{
[Required, MaxLength(128)]
public string Name { get; set; }
public ICollection<Skill> Skills { get; set; }
public ICollection<SkillLevel> Levels { get; set; }
}

View file

@ -0,0 +1,19 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;
public class State : FullAuditedEntity<Guid>
{
[Required]
[MaxLength(128)]
public string Name { get; set; }
[MaxLength(16)]
public string Code { get; set; }
[MaxLength(8)]
public string CountryCode { get; set; }
public Country Country { get; set; }
}

View file

@ -0,0 +1,26 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;
public class Uom : FullAuditedEntity<Guid>
{
[Required]
[MaxLength(64)]
public string Name { get; set; }
[Required]
public string Type { get; set; } // Referans birime göre durumu
public decimal Ratio { get; set; }
public bool IsActive { get; set; }
public decimal Rounding { get; set; }
public string CategoryName { get; set; }
public UomCategory UomCategory { get; set; }
}

View file

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;
public class UomCategory : FullAuditedEntity<Guid>
{
[Required]
[MaxLength(128)]
public string Name { get; set; }
public ICollection<Uom> Units { get; set; }
}

View file

@ -24,11 +24,11 @@ namespace Kurs.Platform.EntityFrameworkCore;
[ReplaceDbContext(typeof(IIdentityDbContext))] [ReplaceDbContext(typeof(IIdentityDbContext))]
[ReplaceDbContext(typeof(ITenantManagementDbContext))] [ReplaceDbContext(typeof(ITenantManagementDbContext))]
[ConnectionStringName(DefaultDatabaseProvider)] [ConnectionStringName(DefaultDatabaseProvider)]
public class PlatformDbContext : public class PlatformDbContext :
AbpDbContext<PlatformDbContext>, AbpDbContext<PlatformDbContext>,
IIdentityDbContext, IIdentityDbContext,
ITenantManagementDbContext ITenantManagementDbContext
{ {
public DbSet<Branch> Branches { get; set; } public DbSet<Branch> Branches { get; set; }
public DbSet<BranchUsers> BranchUsers { get; set; } public DbSet<BranchUsers> BranchUsers { get; set; }
public DbSet<ListForm> ListForms { get; set; } public DbSet<ListForm> ListForms { get; set; }
@ -42,6 +42,20 @@ namespace Kurs.Platform.EntityFrameworkCore;
public DbSet<PublicApi> PublicApis { get; set; } public DbSet<PublicApi> PublicApis { get; set; }
public DbSet<GlobalSearch> GlobalSearchs { get; set; } public DbSet<GlobalSearch> GlobalSearchs { get; set; }
public DbSet<AiBot> AiBots { get; set; } public DbSet<AiBot> AiBots { get; set; }
public DbSet<Sector> Sectors { get; set; }
public DbSet<UomCategory> UomCategories { get; set; }
public DbSet<Uom> Uoms { get; set; }
public DbSet<Currency> Currencies { get; set; }
public DbSet<Bank> Banks { get; set; }
public DbSet<BankAccount> BankAccounts { get; set; }
public DbSet<CountryGroup> CountryGroups { get; set; }
public DbSet<Country> Countries { get; set; }
public DbSet<State> States { get; set; }
public DbSet<SkillType> SkillTypes { get; set; }
public DbSet<Skill> Skills { get; set; }
public DbSet<SkillLevel> SkillLevels { get; set; }
public DbSet<ContactTag> ContactTags { get; set; }
public DbSet<ContactTitle> ContactTitles { get; set; }
#region Entities from the modules #region Entities from the modules
@ -225,5 +239,158 @@ namespace Kurs.Platform.EntityFrameworkCore;
b.HasKey(x => new { x.UserId, x.BranchId }); b.HasKey(x => new { x.UserId, x.BranchId });
b.ConfigureByConvention(); b.ConfigureByConvention();
}); });
builder.Entity<Sector>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Sector), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
b.Property(x => x.FullName).HasMaxLength(256);
});
builder.Entity<UomCategory>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(UomCategory), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name)
.IsRequired()
.HasMaxLength(128);
b.HasIndex(x => x.Name)
.IsUnique();
});
builder.Entity<Uom>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Uom), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(64);
b.Property(x => x.Type)
.HasConversion<string>()
.HasMaxLength(32)
.IsRequired();
b.Property(x => x.Ratio).HasPrecision(18, 6);
b.Property(x => x.Rounding).HasPrecision(18, 6);
b.Property(x => x.CategoryName)
.IsRequired()
.HasMaxLength(128);
b.HasOne(x => x.UomCategory)
.WithMany(x => x.Units)
.HasPrincipalKey(x => x.Name)
.HasForeignKey(x => x.CategoryName)
.OnDelete(DeleteBehavior.Restrict);
});
builder.Entity<Currency>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Currency), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Code).IsRequired().HasMaxLength(8);
b.Property(x => x.Symbol).HasMaxLength(8);
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
b.Property(x => x.Rate).HasColumnType("decimal(18,6)");
b.Property(x => x.IsActive);
b.Property(x => x.LastUpdated);
});
builder.Entity<CountryGroup>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(CountryGroup), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
b.HasIndex(x => x.Name).IsUnique();
});
builder.Entity<Country>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Country), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Code).IsRequired().HasMaxLength(8);
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
b.Property(x => x.GroupName).HasMaxLength(128);
b.Property(x => x.CurrencyCode).HasMaxLength(8);
b.Property(x => x.PhoneCode).HasMaxLength(16);
b.Property(x => x.TaxLabel).HasMaxLength(64);
b.HasIndex(x => x.Code).IsUnique();
b.HasIndex(x => x.GroupName);
b.HasMany(x => x.States)
.WithOne(x => x.Country)
.HasForeignKey(x => x.CountryCode)
.HasPrincipalKey(x => x.Code)
.OnDelete(DeleteBehavior.Cascade);
b.HasOne<CountryGroup>()
.WithMany()
.HasPrincipalKey(x => x.Name)
.HasForeignKey(x => x.GroupName)
.OnDelete(DeleteBehavior.Restrict);
});
builder.Entity<State>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(State), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
b.Property(x => x.Code).HasMaxLength(16);
b.HasIndex(x => new { x.CountryCode, x.Code }).IsUnique();
});
builder.Entity<SkillType>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(SkillType), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
b.HasIndex(x => x.Name).IsUnique();
});
builder.Entity<Skill>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Skill), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
b.Property(x => x.TypeName).IsRequired().HasMaxLength(128);
});
builder.Entity<SkillLevel>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(SkillLevel), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
b.Property(x => x.TypeName).IsRequired().HasMaxLength(128);
b.Property(x => x.Progress);
b.Property(x => x.IsDefault);
});
builder.Entity<ContactTag>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ContactTag), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
b.Property(x => x.Category).HasMaxLength(128);
});
builder.Entity<ContactTitle>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ContactTitle), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Title).IsRequired().HasMaxLength(128);
b.Property(x => x.Abbreviation).HasMaxLength(64);
});
} }
} }

View file

@ -0,0 +1,472 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Kurs.Platform.Migrations
{
/// <inheritdoc />
public partial class NewDefitinationTables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Banks",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
IdentifierCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
AddressLine1 = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
AddressLine2 = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
District = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
City = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
PostalCode = table.Column<string>(type: "nvarchar(16)", maxLength: 16, nullable: true),
Country = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
Phone = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
Email = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Banks", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PContactTag",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Category = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PContactTag", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PContactTitle",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Title = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Abbreviation = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PContactTitle", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PCountryGroup",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PCountryGroup", x => x.Id);
table.UniqueConstraint("AK_PCountryGroup_Name", x => x.Name);
});
migrationBuilder.CreateTable(
name: "PCurrency",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Code = table.Column<string>(type: "nvarchar(8)", maxLength: 8, nullable: false),
Symbol = table.Column<string>(type: "nvarchar(8)", maxLength: 8, nullable: true),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Rate = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
IsActive = table.Column<bool>(type: "bit", nullable: false),
LastUpdated = table.Column<DateTime>(type: "datetime2", nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PCurrency", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PSector",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
FullName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PSector", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PSkillType",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PSkillType", x => x.Id);
});
migrationBuilder.CreateTable(
name: "PUomCategory",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PUomCategory", x => x.Id);
table.UniqueConstraint("AK_PUomCategory_Name", x => x.Name);
});
migrationBuilder.CreateTable(
name: "PCountry",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Code = table.Column<string>(type: "nvarchar(8)", maxLength: 8, nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
GroupName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
CurrencyCode = table.Column<string>(type: "nvarchar(8)", maxLength: 8, nullable: true),
PhoneCode = table.Column<string>(type: "nvarchar(16)", maxLength: 16, nullable: true),
TaxLabel = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
ZipRequired = table.Column<bool>(type: "bit", nullable: false),
StateRequired = table.Column<bool>(type: "bit", nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PCountry", x => x.Id);
table.UniqueConstraint("AK_PCountry_Code", x => x.Code);
table.ForeignKey(
name: "FK_PCountry_PCountryGroup_GroupName",
column: x => x.GroupName,
principalTable: "PCountryGroup",
principalColumn: "Name",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "BankAccounts",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
AccountNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
BankId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
AccountOwner = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
CurrencyId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CanTransferMoney = table.Column<bool>(type: "bit", nullable: false),
Company = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_BankAccounts", x => x.Id);
table.ForeignKey(
name: "FK_BankAccounts_Banks_BankId",
column: x => x.BankId,
principalTable: "Banks",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_BankAccounts_PCurrency_CurrencyId",
column: x => x.CurrencyId,
principalTable: "PCurrency",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "PSkill",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
TypeName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
SkillTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PSkill", x => x.Id);
table.ForeignKey(
name: "FK_PSkill_PSkillType_SkillTypeId",
column: x => x.SkillTypeId,
principalTable: "PSkillType",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "PSkillLevel",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Progress = table.Column<int>(type: "int", nullable: false),
IsDefault = table.Column<bool>(type: "bit", nullable: false),
TypeName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
SkillTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PSkillLevel", x => x.Id);
table.ForeignKey(
name: "FK_PSkillLevel_PSkillType_SkillTypeId",
column: x => x.SkillTypeId,
principalTable: "PSkillType",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "PUom",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
Type = table.Column<string>(type: "nvarchar(32)", maxLength: 32, nullable: false),
Ratio = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
IsActive = table.Column<bool>(type: "bit", nullable: false),
Rounding = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false),
CategoryName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PUom", x => x.Id);
table.ForeignKey(
name: "FK_PUom_PUomCategory_CategoryName",
column: x => x.CategoryName,
principalTable: "PUomCategory",
principalColumn: "Name",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "PState",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Code = table.Column<string>(type: "nvarchar(16)", maxLength: 16, nullable: true),
CountryCode = table.Column<string>(type: "nvarchar(8)", maxLength: 8, nullable: true),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true),
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
IsDeleted = table.Column<bool>(type: "bit", nullable: false, defaultValue: false),
DeleterId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
DeletionTime = table.Column<DateTime>(type: "datetime2", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PState", x => x.Id);
table.ForeignKey(
name: "FK_PState_PCountry_CountryCode",
column: x => x.CountryCode,
principalTable: "PCountry",
principalColumn: "Code",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_BankAccounts_BankId",
table: "BankAccounts",
column: "BankId");
migrationBuilder.CreateIndex(
name: "IX_BankAccounts_CurrencyId",
table: "BankAccounts",
column: "CurrencyId");
migrationBuilder.CreateIndex(
name: "IX_PCountry_Code",
table: "PCountry",
column: "Code",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_PCountry_GroupName",
table: "PCountry",
column: "GroupName");
migrationBuilder.CreateIndex(
name: "IX_PCountryGroup_Name",
table: "PCountryGroup",
column: "Name",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_PSkill_SkillTypeId",
table: "PSkill",
column: "SkillTypeId");
migrationBuilder.CreateIndex(
name: "IX_PSkillLevel_SkillTypeId",
table: "PSkillLevel",
column: "SkillTypeId");
migrationBuilder.CreateIndex(
name: "IX_PSkillType_Name",
table: "PSkillType",
column: "Name",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_PState_CountryCode_Code",
table: "PState",
columns: new[] { "CountryCode", "Code" },
unique: true,
filter: "[CountryCode] IS NOT NULL AND [Code] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "IX_PUom_CategoryName",
table: "PUom",
column: "CategoryName");
migrationBuilder.CreateIndex(
name: "IX_PUomCategory_Name",
table: "PUomCategory",
column: "Name",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "BankAccounts");
migrationBuilder.DropTable(
name: "PContactTag");
migrationBuilder.DropTable(
name: "PContactTitle");
migrationBuilder.DropTable(
name: "PSector");
migrationBuilder.DropTable(
name: "PSkill");
migrationBuilder.DropTable(
name: "PSkillLevel");
migrationBuilder.DropTable(
name: "PState");
migrationBuilder.DropTable(
name: "PUom");
migrationBuilder.DropTable(
name: "Banks");
migrationBuilder.DropTable(
name: "PCurrency");
migrationBuilder.DropTable(
name: "PSkillType");
migrationBuilder.DropTable(
name: "PCountry");
migrationBuilder.DropTable(
name: "PUomCategory");
migrationBuilder.DropTable(
name: "PCountryGroup");
}
}
}

View file

@ -24,6 +24,104 @@ namespace Kurs.Platform.Migrations
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
modelBuilder.Entity("ContactTag", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("Category")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.HasKey("Id");
b.ToTable("PContactTag", (string)null);
});
modelBuilder.Entity("ContactTitle", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("Abbreviation")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Title")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.HasKey("Id");
b.ToTable("PContactTitle", (string)null);
});
modelBuilder.Entity("Kurs.Languages.Entities.Language", b => modelBuilder.Entity("Kurs.Languages.Entities.Language", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@ -636,6 +734,153 @@ namespace Kurs.Platform.Migrations
b.ToTable("PBackgroundWorker", (string)null); b.ToTable("PBackgroundWorker", (string)null);
}); });
modelBuilder.Entity("Kurs.Platform.Entities.Bank", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("AddressLine1")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("AddressLine2")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("City")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("Country")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("District")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("Email")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("IdentifierCode")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("Phone")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("PostalCode")
.HasMaxLength(16)
.HasColumnType("nvarchar(16)");
b.HasKey("Id");
b.ToTable("Banks");
});
modelBuilder.Entity("Kurs.Platform.Entities.BankAccount", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("AccountNumber")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("AccountOwner")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<Guid>("BankId")
.HasColumnType("uniqueidentifier");
b.Property<bool>("CanTransferMoney")
.HasColumnType("bit");
b.Property<string>("Company")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("CurrencyId")
.HasColumnType("uniqueidentifier");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.HasKey("Id");
b.HasIndex("BankId");
b.HasIndex("CurrencyId");
b.ToTable("BankAccounts");
});
modelBuilder.Entity("Kurs.Platform.Entities.Branch", b => modelBuilder.Entity("Kurs.Platform.Entities.Branch", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@ -882,6 +1127,194 @@ namespace Kurs.Platform.Migrations
b.ToTable("PChart", (string)null); b.ToTable("PChart", (string)null);
}); });
modelBuilder.Entity("Kurs.Platform.Entities.Country", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(8)
.HasColumnType("nvarchar(8)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<string>("CurrencyCode")
.HasMaxLength(8)
.HasColumnType("nvarchar(8)");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("GroupName")
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<string>("PhoneCode")
.HasMaxLength(16)
.HasColumnType("nvarchar(16)");
b.Property<bool>("StateRequired")
.HasColumnType("bit");
b.Property<string>("TaxLabel")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<bool>("ZipRequired")
.HasColumnType("bit");
b.HasKey("Id");
b.HasIndex("Code")
.IsUnique();
b.HasIndex("GroupName");
b.ToTable("PCountry", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.CountryGroup", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("PCountryGroup", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.Currency", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("Code")
.IsRequired()
.HasMaxLength(8)
.HasColumnType("nvarchar(8)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<DateTime?>("LastUpdated")
.HasColumnType("datetime2");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<decimal>("Rate")
.HasColumnType("decimal(18,6)");
b.Property<string>("Symbol")
.HasMaxLength(8)
.HasColumnType("nvarchar(8)");
b.HasKey("Id");
b.ToTable("PCurrency", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.DataSource", b => modelBuilder.Entity("Kurs.Platform.Entities.DataSource", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@ -1594,6 +2027,228 @@ namespace Kurs.Platform.Migrations
b.ToTable("PPublicApi", (string)null); b.ToTable("PPublicApi", (string)null);
}); });
modelBuilder.Entity("Kurs.Platform.Entities.Sector", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<string>("FullName")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.HasKey("Id");
b.ToTable("PSector", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.State", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("Code")
.HasMaxLength(16)
.HasColumnType("nvarchar(16)");
b.Property<string>("CountryCode")
.HasMaxLength(8)
.HasColumnType("nvarchar(8)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.HasKey("Id");
b.HasIndex("CountryCode", "Code")
.IsUnique()
.HasFilter("[CountryCode] IS NOT NULL AND [Code] IS NOT NULL");
b.ToTable("PState", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.Uom", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("CategoryName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("IsActive")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<decimal>("Ratio")
.HasPrecision(18, 6)
.HasColumnType("decimal(18,6)");
b.Property<decimal>("Rounding")
.HasPrecision(18, 6)
.HasColumnType("decimal(18,6)");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(32)
.HasColumnType("nvarchar(32)");
b.HasKey("Id");
b.HasIndex("CategoryName");
b.ToTable("PUom", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("PUomCategory", (string)null);
});
modelBuilder.Entity("Kurs.Settings.Entities.SettingDefinition", b => modelBuilder.Entity("Kurs.Settings.Entities.SettingDefinition", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@ -1691,6 +2346,170 @@ namespace Kurs.Platform.Migrations
b.ToTable("PSettingDefinition", (string)null); b.ToTable("PSettingDefinition", (string)null);
}); });
modelBuilder.Entity("Skill", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<Guid?>("SkillTypeId")
.HasColumnType("uniqueidentifier");
b.Property<string>("TypeName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.HasKey("Id");
b.HasIndex("SkillTypeId");
b.ToTable("PSkill", (string)null);
});
modelBuilder.Entity("SkillLevel", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDefault")
.HasColumnType("bit");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.Property<int>("Progress")
.HasColumnType("int");
b.Property<Guid?>("SkillTypeId")
.HasColumnType("uniqueidentifier");
b.Property<string>("TypeName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.HasKey("Id");
b.HasIndex("SkillTypeId");
b.ToTable("PSkillLevel", (string)null);
});
modelBuilder.Entity("SkillType", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<Guid?>("CreatorId")
.HasColumnType("uniqueidentifier")
.HasColumnName("CreatorId");
b.Property<Guid?>("DeleterId")
.HasColumnType("uniqueidentifier")
.HasColumnName("DeleterId");
b.Property<DateTime?>("DeletionTime")
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
b.Property<Guid?>("LastModifierId")
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("PSkillType", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{ {
b.Property<Guid>("Id") b.Property<Guid>("Id")
@ -3503,6 +4322,32 @@ namespace Kurs.Platform.Migrations
.OnDelete(DeleteBehavior.SetNull); .OnDelete(DeleteBehavior.SetNull);
}); });
modelBuilder.Entity("Kurs.Platform.Entities.BankAccount", b =>
{
b.HasOne("Kurs.Platform.Entities.Bank", "Bank")
.WithMany()
.HasForeignKey("BankId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kurs.Platform.Entities.Currency", "Currency")
.WithMany()
.HasForeignKey("CurrencyId");
b.Navigation("Bank");
b.Navigation("Currency");
});
modelBuilder.Entity("Kurs.Platform.Entities.Country", b =>
{
b.HasOne("Kurs.Platform.Entities.CountryGroup", null)
.WithMany()
.HasForeignKey("GroupName")
.HasPrincipalKey("Name")
.OnDelete(DeleteBehavior.Restrict);
});
modelBuilder.Entity("Kurs.Platform.Entities.ListFormCustomization", b => modelBuilder.Entity("Kurs.Platform.Entities.ListFormCustomization", b =>
{ {
b.HasOne("Kurs.Platform.Entities.ListForm", null) b.HasOne("Kurs.Platform.Entities.ListForm", null)
@ -3523,6 +4368,43 @@ namespace Kurs.Platform.Migrations
.IsRequired(); .IsRequired();
}); });
modelBuilder.Entity("Kurs.Platform.Entities.State", b =>
{
b.HasOne("Kurs.Platform.Entities.Country", "Country")
.WithMany("States")
.HasForeignKey("CountryCode")
.HasPrincipalKey("Code")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("Country");
});
modelBuilder.Entity("Kurs.Platform.Entities.Uom", b =>
{
b.HasOne("Kurs.Platform.Entities.UomCategory", "UomCategory")
.WithMany("Units")
.HasForeignKey("CategoryName")
.HasPrincipalKey("Name")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("UomCategory");
});
modelBuilder.Entity("Skill", b =>
{
b.HasOne("SkillType", null)
.WithMany("Skills")
.HasForeignKey("SkillTypeId");
});
modelBuilder.Entity("SkillLevel", b =>
{
b.HasOne("SkillType", null)
.WithMany("Levels")
.HasForeignKey("SkillTypeId");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{ {
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
@ -3670,6 +4552,23 @@ namespace Kurs.Platform.Migrations
b.Navigation("Texts"); b.Navigation("Texts");
}); });
modelBuilder.Entity("Kurs.Platform.Entities.Country", b =>
{
b.Navigation("States");
});
modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b =>
{
b.Navigation("Units");
});
modelBuilder.Entity("SkillType", b =>
{
b.Navigation("Levels");
b.Navigation("Skills");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{ {
b.Navigation("Actions"); b.Navigation("Actions");