Database — Core: HR¶
The employee master file and everything hanging off it: identity documents, family, contracts, positions, allowances and deductions, attachments, e-signatures, attendance and leave.
AppUser is the centre of the schema — more relationships point at it than at any other table, and
it is one of only four entities carrying a global query filter. See the
HR module for what these tables are used for, and
HR Onboarding for the order they are written in.
21 entities in NKO_DB, context NKO_DBEntities1.
How to read this page
Generated from the EF Core model in NKO.Lib/NKO.DataAccess/DbModel/ — class names,
property types, nullability, data annotations and the relationships configured in
NKO_DBEntities1.OnModelCreating.
Each heading is the table name. Where the C# class is named differently — it is often
singular where the table is plural (StockDetail the class, StockDetails the table) — the
class name is stated under the heading. The file name is not authoritative:
StockDetails.cs declares public class StockDetail.
A ✓ in Null means the column is nullable: a nullable value type, or a reference type
with no [Required] — so a [Required] string is shown as not-null. Foreign keys are shown
where the fluent configuration or the <Entity>Id naming convention identifies a target.
Entities¶
AppUser¶
[Table("AppUser")] · inherits BaseEntity · has a global query filter
NKO.Lib/NKO.DataAccess/DbModel/AppUser.cs
Global query filter
HasQueryFilter(x => !x.IsDeleted && x.Status == 1) — every query on AppUser is filtered unless it calls IgnoreQueryFilters().
erDiagram
direction LR
AppUser {
int UserId PK
int DistrictId FK
int ManagerId FK
int TechManagerId FK
int BranchId FK
int SubBranchId FK
int NatId FK
int SndNatId FK
int CountryId FK
int ApplicantId FK
string IdentityUserId FK
}
District {
int DistrictId PK
}
CommonBranch {
int BranchId PK
}
CommonSubBranch {
int SubBranchId PK
}
Nationality {
int NationalityId PK
}
CommonCountry {
int CommonCountryId PK
}
Applicants {
int ApplicantId PK
}
ApplicationUser {
int None PK
}
District |o--o{ AppUser : "DistrictId"
AppUser |o--o{ AppUser : "ManagerId, TechManagerId"
CommonBranch ||--o{ AppUser : "BranchId"
CommonSubBranch ||--o{ AppUser : "SubBranchId"
Nationality |o--o{ AppUser : "NatId, SndNatId"
CommonCountry |o--o{ AppUser : "CountryId"
Applicants |o--o{ AppUser : "ApplicantId"
ApplicationUser ||--o{ AppUser : "IdentityUserId"
Referenced by 51 tables — not drawn
AppUser is the target of 173 relationships from 51 tables. Drawing them would make this diagram unreadable, so each one is drawn in the referencing table's own diagram instead: Announcements, AppUserAdvance, AppUserAllocation, AppUserAllowance, AppUserAttachment, AppUserBankPayment, AppUserCharge, AppUserContract, AppUserDeduction, AppUserExtend, AppUserFamily, AppUserGroupMember, AppUserInsurance, AppUserOvertime, AppUserProjectPermission, AppUserRelative, AppUserReward, AppUserSalary, AppUserSign, ArchiveFile, Attendance, BudgetLinesUser, Comment, CommitteeUser, CommonBranch, CommonSharedPermission, Evaluation, EvaluationElement, EvaluationsDegree, GoodReceivedNote, Job, JobPermission, Leave, LeaveBalance, Note, Notification, PartnersContribution, PaymentOrder, Payroll, PayrollInfo, PurchaseOrder, PurchaseRequest, RFQProviderJustification, RFQTechnical, RFQs, RecruitmentTracker, RecruitmentTrackerInterview, TechnicalInterView, Timesheet, TrainingRequest, UpdatedUser.
| Column | Type | Null | Notes |
|---|---|---|---|
User |
int |
PK | |
User |
Guid |
||
Branch |
int |
FK → Common |
|
Firstname |
string |
✓ | [String |
Lastname |
string |
✓ | [String |
No |
bool |
||
Email |
string |
✓ | |
Private |
string |
✓ | |
Mobile |
string |
✓ | |
Is |
bool |
||
Whatsapp |
string |
✓ | |
Profile |
string |
✓ | |
Birthdate |
Date |
✓ | [Column(Type |
Birth |
string |
✓ | |
About |
string |
✓ | [Column(Type |
Identity |
string |
✓ | |
Identity |
int? |
✓ | |
Date |
Date |
[Column(Type |
|
Date |
Date |
✓ | [Column(Type |
Manager |
int? |
✓ | FK → App |
Tech |
int? |
✓ | FK → App |
Is |
bool |
||
Marital |
int? |
✓ | |
Project |
int? |
✓ | |
User |
string |
✓ | [String |
Qualification |
int? |
✓ | |
Specialization |
string |
✓ | |
Nat |
int? |
✓ | FK → Nationality |
Snd |
int? |
✓ | FK → Nationality |
Country |
int? |
✓ | FK → Common |
Father |
string |
✓ | [String |
District |
int? |
✓ | FK → District |
Res |
int? |
✓ | |
Governorate |
int? |
✓ | |
Languages |
string |
✓ | |
Sub |
int |
FK → Common |
|
Is |
bool |
||
Pin |
string |
✓ | |
Pin |
int |
||
Status |
int |
||
Allow |
bool |
||
Ignore |
bool |
||
Ack |
bool |
||
Is |
bool |
||
Is |
bool |
||
Created |
int |
||
Created |
Date |
||
Applicant |
int? |
✓ | FK → Applicants |
Identity |
string |
✓ | FK → Application |
Navigation: District → District, AppUserManager → AppUser, AppUserTechManager → AppUser, CommonBranch → CommonBranch, CommonSubBranch → CommonSubBranch, Nationality → Nationality, SndNationality → Nationality, CommonCountry → CommonCountry, AppUserExtend → AppUserExtend, Applicant → Applicants, User → ApplicationUser, AppUserAllowance → ICollection<AppUserAllowance>, AppUserAttachment → ICollection<AppUserAttachment>, AppUserBankPayment → ICollection<AppUserBankPayment>, AppUserContract → ICollection<AppUserContract>, AppUserGroupMember → ICollection<AppUserGroupMember>, AppUserInsurance → ICollection<AppUserInsurance>, AppUserSalaries → ICollection<AppUserSalary>, AppUserFamilies → ICollection<AppUserFamily>, AppUserManagers → ICollection<AppUser>, AppUserTechManagers → ICollection<AppUser>, AppUserReward → ICollection<AppUserReward>, AppUserDeductions → ICollection<AppUserDeduction>, AppUserSign → ICollection<AppUserSign>, ArchiveFile → ICollection<ArchiveFile>, Comment → ICollection<Comment>, CommitteeUser → ICollection<CommitteeUser>, CommonBranchTreasures → ICollection<CommonBranch>, CommonBranchManagers → ICollection<CommonBranch>, CommonBranchLogistics → ICollection<CommonBranch>, CommonBranchFinances → ICollection<CommonBranch>, CommonBranchHRs → ICollection<CommonBranch>, CommonBranchAccountings → ICollection<CommonBranch>, CommonSharedPermission → ICollection<CommonSharedPermission>, Evaluation → ICollection<Evaluation>, Evaluation1 → ICollection<Evaluation>, Evaluation2 → ICollection<Evaluation>, Evaluation3 → ICollection<Evaluation>, Evaluation4 → ICollection<Evaluation>, EvaluationElement → ICollection<EvaluationElement>, EvaluationsDegree → ICollection<EvaluationsDegree>, Job → ICollection<Job>, Job1 → ICollection<Job>, Job2 → ICollection<Job>, Job3 → ICollection<Job>, JobHRs → ICollection<Job>, Job4 → ICollection<Job>, Job5 → ICollection<Job>, Job6 → ICollection<Job>, Job7 → ICollection<Job>, Job8 → ICollection<Job>, Job9 → ICollection<Job>, JobPermission → ICollection<JobPermission>, Leave → ICollection<Leave>, Leave1 → ICollection<Leave>, Leave2 → ICollection<Leave>, LeaveGMs → ICollection<Leave>, Leave3 → ICollection<Leave>, LeaveCancels → ICollection<Leave>, LeaveNextUsers → ICollection<Leave>, LeaveSubtitutes → ICollection<Leave>, LeaveBalance → ICollection<LeaveBalance>, Note → ICollection<Note>, Notification → ICollection<Notification>, ReqNotification → ICollection<Notification>, PartnersContribution → ICollection<PartnersContribution>, Payroll → ICollection<Payroll>, Payroll1 → ICollection<Payroll>, Payroll2 → ICollection<Payroll>, Payroll4 → ICollection<Payroll>, Payroll5 → ICollection<Payroll>, Payroll6 → ICollection<Payroll>, PayrollInfo → ICollection<PayrollInfo>, AppUserProjectPermissions → ICollection<AppUserProjectPermission>, PurchaseOrder → ICollection<PurchaseOrder>, PurchaseOrderCancels → ICollection<PurchaseOrder>, PurchaseOrder1 → ICollection<PurchaseOrder>, PurchaseOrder2 → ICollection<PurchaseOrder>, PurchaseOrder3 → ICollection<PurchaseOrder>, PurchaseOrderBH2s → ICollection<PurchaseOrder>, PurchaseOrder4 → ICollection<PurchaseOrder>, PurchaseRequest → ICollection<PurchaseRequest>, PurchaseRequest1 → ICollection<PurchaseRequest>, PurchaseRequest2 → ICollection<PurchaseRequest>, PurchaseRequest3 → ICollection<PurchaseRequest>, PurchaseRequest4 → ICollection<PurchaseRequest>, PurchaseRequest6 → ICollection<PurchaseRequest>, PurchaseRequest8 → ICollection<PurchaseRequest>, PurchaseRequest9 → ICollection<PurchaseRequest>, PurchaseRequestSOD1 → ICollection<PurchaseRequest>, PurchaseRequestSOD2 → ICollection<PurchaseRequest>, PurchaseRequestSOD3 → ICollection<PurchaseRequest>, PurchaseRequestSOD4 → ICollection<PurchaseRequest>, RecruitmentTracker → ICollection<RecruitmentTracker>, RecruitmentTracker1 → ICollection<RecruitmentTracker>, RecruitmentTracker2 → ICollection<RecruitmentTracker>, RecruitmentTracker3 → ICollection<RecruitmentTracker>, RecruitmentTrackerInterview → ICollection<RecruitmentTrackerInterview>, RFQs → ICollection<RFQs>, RFQs1 → ICollection<RFQs>, RFQs2 → ICollection<RFQs>, RFQs3 → ICollection<RFQs>, RFQs4 → ICollection<RFQs>, RFQs6 → ICollection<RFQs>, RFQs8 → ICollection<RFQs>, RFQsCancels → ICollection<RFQs>, RFQsPMs → ICollection<RFQs>, RFQResponsibles → ICollection<RFQs>, RFQTechnicalComs1 → ICollection<RFQTechnical>, RFQTechnicalComs2 → ICollection<RFQTechnical>, RFQTechnicalComs3 → ICollection<RFQTechnical>, RFQTechnicalRefuse → ICollection<RFQTechnical>, RFQTechnicalNext → ICollection<RFQTechnical>, RFQTechnicalCancel → ICollection<RFQTechnical>, TechnicalInterView1 → ICollection<TechnicalInterView>, TechnicalInterView2 → ICollection<TechnicalInterView>, TechnicalInterView3 → ICollection<TechnicalInterView>, TechnicalInterView4 → ICollection<TechnicalInterView>, TechnicalInterView5 → ICollection<TechnicalInterView>, TechnicalInterView6 → ICollection<TechnicalInterView>, Timesheet → ICollection<Timesheet>, Timesheet1 → ICollection<Timesheet>, Timesheet2 → ICollection<Timesheet>, Timesheet4 → ICollection<Timesheet>, Timesheet5 → ICollection<Timesheet>, Timesheet6 → ICollection<Timesheet>, UpdatedUser → ICollection<UpdatedUser>, CreatedByTrainingRequests → ICollection<TrainingRequest>, ManagerTrainingRequests → ICollection<TrainingRequest>, HRTrainingRequests → ICollection<TrainingRequest>, FinanceTrainingRequests → ICollection<TrainingRequest>, CountryTrainingRequests → ICollection<TrainingRequest>, NextTrainingRequests → ICollection<TrainingRequest>, RefuseTrainingRequests → ICollection<TrainingRequest>, CreatedByAdvances → ICollection<AppUserAdvance>, ManagerAdvances → ICollection<AppUserAdvance>, DeptAdvances → ICollection<AppUserAdvance>, FinanceAdvances → ICollection<AppUserAdvance>, HRAdvances → ICollection<AppUserAdvance>, _1GuarantorAdvances → ICollection<AppUserAdvance>, _2GuarantorAdvances → ICollection<AppUserAdvance>, CountryAdvances → ICollection<AppUserAdvance>, AccountingBranchAdvances → ICollection<AppUserAdvance>, RefuseAdvances → ICollection<AppUserAdvance>, CancelAdvances → ICollection<AppUserAdvance>, NextUserAdvances → ICollection<AppUserAdvance>, AppUserRelatives → ICollection<AppUserRelative>, Announcements → ICollection<Announcements>, AppUserCharges → ICollection<AppUserCharge>, PaymentOrderCreatedBys → ICollection<PaymentOrder>, PaymentOrderBHs → ICollection<PaymentOrder>, PaymentOrderFinances → ICollection<PaymentOrder>, PaymentOrderSODs → ICollection<PaymentOrder>, PaymentOrderNexts → ICollection<PaymentOrder>, PaymentOrderRefuses → ICollection<PaymentOrder>, PaymentOrderCancels → ICollection<PaymentOrder>, PaymentOrderPayers → ICollection<PaymentOrder>, GoodReceivedNotesCreatedBy → ICollection<GoodReceivedNote>, GoodReceivedNotesRecipient → ICollection<GoodReceivedNote>, GoodReceivedNotesRefuse → ICollection<GoodReceivedNote>, GoodReceivedNotesCancel → ICollection<GoodReceivedNote>, GoodReceivedNotesNext → ICollection<GoodReceivedNote>, RFQProviderJustificationsCreatedBy → ICollection<RFQProviderJustification>, RFQProviderJustificationsNext → ICollection<RFQProviderJustification>, RFQProviderJustificationsRefuse → ICollection<RFQProviderJustification>, RFQProviderJustificationsCancel → ICollection<RFQProviderJustification>, RFQProviderJustificationsCom1 → ICollection<RFQProviderJustification>, RFQProviderJustificationsCom2 → ICollection<RFQProviderJustification>, RFQProviderJustificationsCom3 → ICollection<RFQProviderJustification>, RFQProviderJustificationsSC → ICollection<RFQProviderJustification>, Attendances → ICollection<Attendance>, AppUserOvertimeReqs → ICollection<AppUserOvertime>, AppUserOvertimeEmployees → ICollection<AppUserOvertime>, AppUserOvertimeManagers → ICollection<AppUserOvertime>, AppUserOvertimeDepts → ICollection<AppUserOvertime>, AppUserOvertimeHRs → ICollection<AppUserOvertime>, AppUserOvertimeGMs → ICollection<AppUserOvertime>, AppUserOvertimeFinances → ICollection<AppUserOvertime>, AppUserOvertimeRefuses → ICollection<AppUserOvertime>, AppUserOvertimeCancels → ICollection<AppUserOvertime>, AppUserOvertimeNextUsers → ICollection<AppUserOvertime>, BudgetLinesUsers → ICollection<BudgetLinesUser>
AppUserAttachment¶
[Table("AppUserAttachment")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/AppUserAttachment.cs
erDiagram
AppUserAttachment {
int AppUserAttachmentId PK
int UserId FK
}
AppUser {
int UserId PK
}
AppUser ||--o{ AppUserAttachment : "UserId"
| Column | Type | Null | Notes |
|---|---|---|---|
App |
int |
PK | |
Attachment |
Guid |
||
User |
int |
FK → App |
|
App |
App |
||
Id |
string |
✓ | |
Is |
bool? |
✓ | |
Start |
Date |
✓ | |
End |
Date |
✓ | |
File |
string |
✓ | |
File |
string |
✓ | |
Description |
string |
✓ | [Column(Type |
Qualification |
int? |
✓ | |
Created |
int |
||
Created |
Date |
||
SGKList |
bool? |
✓ | |
Donor |
int? |
✓ | |
Main |
Main |
Navigation: AppUser → AppUser
AppUserContract¶
[Table("AppUserContract")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/AppUserContract.cs
erDiagram
direction LR
AppUserContract {
int ContractId PK
int UserId FK
int PositionId FK
int ProjectId FK
int DepartmentId FK
int DefaultNatId FK
}
AppUser {
int UserId PK
}
AppUserPosition {
int PositionId PK
}
Project {
int ProjectId PK
}
CommonDepartment {
int DepartmentId PK
}
Nationality {
int NationalityId PK
}
AppUserOvertime {
int OverTimeId PK
int ContractId FK
}
Leave {
int LeaveId PK
int ContractId FK
}
AppUser ||--o{ AppUserContract : "UserId"
AppUserPosition ||--o{ AppUserContract : "PositionId"
Project |o--o{ AppUserContract : "ProjectId"
CommonDepartment |o--o{ AppUserContract : "DepartmentId"
Nationality |o--o{ AppUserContract : "DefaultNatId"
AppUserContract ||--o{ AppUserOvertime : "ContractId"
AppUserContract |o--o{ Leave : "ContractId"
| Column | Type | Null | Notes |
|---|---|---|---|
Contract |
int |
PK | |
User |
int |
FK → App |
|
Start |
Date |
[Required] · [Column(Type |
|
End |
Date |
[Required] · [Column(Type |
|
Contract |
Date |
[Required] |
|
File |
string |
✓ | |
File |
string |
✓ | |
Amount |
decimal |
[Required] |
|
Work |
int |
||
Contract |
int |
[Required] |
|
Is |
bool |
||
Created |
int |
||
Created |
Date |
||
Position |
int |
FK → App · [Required] |
|
Currency |
int |
[Required] |
|
Project |
int? |
✓ | FK → Project |
Level |
int? |
✓ | |
Step |
int? |
✓ | |
Allowance |
decimal? |
✓ | |
Trail |
int? |
✓ | |
Working |
int? |
✓ | |
Working |
int? |
✓ | |
Leave |
double? |
✓ | |
Firstname |
string |
✓ | |
Id |
int? |
✓ | |
Identity |
string |
✓ | |
Lastname |
string |
✓ | |
Birth |
string |
✓ | |
Nat |
int? |
✓ | |
NKOProfile |
int |
||
Department |
int? |
✓ | FK → Common |
Default |
int? |
✓ | FK → Nationality |
Salary |
int? |
✓ | |
Position |
string |
✓ | |
Position |
string |
✓ | |
Auto |
bool |
Navigation: AppUser → AppUser, AppUserPosition → AppUserPosition, Project → Project, CommonDepartment → CommonDepartment, DefaultNationality → Nationality, Leaves → ICollection<Leave>, AppUserOvertimes → ICollection<AppUserOvertime>
AppUserExtend¶
[Table("AppUserExtend")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/AppUserExtend.cs
erDiagram
AppUserExtend {
int UserId PK,FK
int BankId FK
}
AppUser {
int UserId PK
}
Bank {
int Id PK
}
AppUser ||--o| AppUserExtend : "UserId"
Bank |o--o{ AppUserExtend : "BankId"
| Column | Type | Null | Notes |
|---|---|---|---|
User |
int |
PK · FK → App (1:1) |
|
Firstname |
string |
✓ | [String |
Lastname |
string |
✓ | [String |
Fathername |
string |
✓ | [String |
Birth |
string |
✓ | [String |
Specialization |
string |
✓ | |
Em |
string |
✓ | |
Relationship |
int? |
✓ | |
Blood |
int? |
✓ | |
Em |
string |
✓ | |
Is |
bool |
||
Em |
string |
✓ | |
Em |
string |
✓ | |
Em |
string |
✓ | |
Is |
bool |
||
Continuos |
string |
✓ | |
Handicap |
string |
✓ | |
Em |
string |
✓ | |
Em |
string |
✓ | |
Em |
string |
✓ | |
Em |
string |
✓ | |
Em |
string |
✓ | |
Em |
string |
✓ | |
Address |
string |
✓ | |
Facebook |
string |
✓ | |
Twitter |
string |
✓ | |
Instagram |
string |
✓ | |
Linkedin |
string |
✓ | |
Has |
bool |
||
Work |
string |
✓ | |
Work |
Date |
✓ | |
Work |
Date |
✓ | |
Has |
bool |
||
Passport |
string |
✓ | |
Passport |
Date |
✓ | |
Passport |
Date |
✓ | |
Iban |
string |
✓ | |
Bank |
string |
✓ | |
Bank |
int? |
✓ | FK → Bank |
Bank |
bool |
[Required] |
|
Recipient |
string |
✓ | |
Policy |
bool |
||
House |
string |
✓ |
Navigation: AppUser → AppUser, Bank → Bank
AppUserFamily¶
DbSet AppUserFamilies · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/AppUserFamily.cs
erDiagram
AppUserFamily {
int AppUserFamilyId PK
int UserId FK
int NationalityId FK
}
AppUser {
int UserId PK
}
Nationality {
int NationalityId PK
}
AppUser ||--o{ AppUserFamily : "UserId"
Nationality ||--o{ AppUserFamily : "NationalityId"
| Column | Type | Null | Notes |
|---|---|---|---|
App |
int |
PK | |
User |
int |
FK → App |
|
Member |
bool |
||
Name |
string |
✓ | [String |
Birth |
Date |
✓ | [Column(Type |
Nationality |
int |
FK → Nationality |
|
File |
string |
✓ | |
File |
string |
✓ | |
Created |
int |
||
Created |
Date |
Navigation: AppUser → AppUser, Nationality → Nationality
AppUserInsurance¶
[Table("AppUserInsurance")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/AppUserInsurance.cs
erDiagram
AppUserInsurance {
int AppUserInsuranceId PK
int UserId FK
}
AppUser {
int UserId PK
}
AppUser ||--o{ AppUserInsurance : "UserId"
| Column | Type | Null | Notes |
|---|---|---|---|
App |
int |
PK | |
User |
int |
FK → App |
|
Amount |
decimal |
||
Amount |
decimal? |
✓ | |
Month |
int |
||
Year |
int |
||
Created |
int |
||
Created |
Date |
Navigation: AppUser → AppUser
AppUserPosition¶
[Table("AppUserPosition")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/AppUserPosition.cs
erDiagram
direction LR
AppUserPosition {
int PositionId PK
int DepartmentId FK
int LineManagerPositionId FK
}
CommonDepartment {
int DepartmentId PK
int PositionId FK
}
Job {
int JobId PK
int PositionId FK
}
PositionQuestion {
int PositionQuestionId PK
int PositionId FK
}
AppUserContract {
int ContractId PK
int PositionId FK
}
AppUserCharge {
int Id PK
int PositionId FK
}
BudgetLine {
int Id PK
int PositionId FK
}
PayrollInfo {
int PayrollInfoId PK
int PositionId FK
}
CommonDepartment |o--o{ AppUserPosition : "DepartmentId"
AppUserPosition |o--o{ AppUserPosition : "LineManagerPositionId"
AppUserPosition ||--o{ Job : "PositionId"
AppUserPosition ||--o{ PositionQuestion : "PositionId"
AppUserPosition ||--o{ AppUserContract : "PositionId"
AppUserPosition |o--o{ CommonDepartment : "PositionId"
AppUserPosition ||--o{ AppUserCharge : "PositionId"
AppUserPosition |o--o{ BudgetLine : "PositionId"
AppUserPosition |o--o{ PayrollInfo : "PositionId"
| Column | Type | Null | Notes |
|---|---|---|---|
Position |
int |
PK | |
Position |
string |
[Required] |
|
Name |
string |
✓ | |
Name |
string |
✓ | |
Abb |
string |
✓ | |
Line |
int? |
✓ | FK → App |
Department |
int? |
✓ | FK → Common |
Is |
bool |
Navigation: Department → CommonDepartment, AppUserPositionLineManager → AppUserPosition, AppUserPositionLineManagers → ICollection<AppUserPosition>, BudgetLines → ICollection<BudgetLine>, Job → ICollection<Job>, PayrollInfo → ICollection<PayrollInfo>, AppUserContracts → ICollection<AppUserContract>, AppUserCharges → ICollection<AppUserCharge>, PositionQuestions → ICollection<PositionQuestion>
AppUserRelative¶
DbSet AppUserRelatives · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/AppUserRelative.cs
erDiagram
AppUserRelative {
int AppUserRelativeId PK
int UserId FK
}
AppUser {
int UserId PK
}
AppUser ||--o{ AppUserRelative : "UserId"
| Column | Type | Null | Notes |
|---|---|---|---|
App |
int |
PK | |
App |
Guid |
||
Relative |
int |
||
User |
int |
FK → App |
|
Relative |
int |
||
Created |
Date |
||
Created |
int |
Navigation: AppUser → AppUser
AppUserSign¶
[Table("AppUserSign")] · inherits BaseEntity · has a global query filter
NKO.Lib/NKO.DataAccess/DbModel/AppUserSign.cs
Global query filter
HasQueryFilter(x => !x.Deleted) — every query on AppUserSign is filtered unless it calls IgnoreQueryFilters().
erDiagram
AppUserSign {
int AppUserSignId PK
int UserId FK
}
AppUser {
int UserId PK
}
AppUser ||--o{ AppUserSign : "UserId"
| Column | Type | Null | Notes |
|---|---|---|---|
App |
int |
PK | |
User |
int |
FK → App |
|
Sign |
string |
[Required] · [Column(Type |
|
Sign |
string |
✓ | |
Start |
Date |
||
End |
Date |
||
Is |
Sign |
||
Approved |
int? |
✓ | |
Approve |
Date |
✓ | |
Deleted |
bool |
||
Created |
int |
||
Created |
Date |
||
Refuse |
Sign |
✓ |
Navigation: AppUser → AppUser
ApplicationUser¶
DbSet ApplicationUsers · implements IBaseEntity directly
NKO.Lib/NKO.DataAccess/DbModel/ApplicationUser.cs
erDiagram
ApplicationUser {
int Id
}
AppUser {
int UserId PK
string IdentityUserId FK
}
ApplicationUser ||--o{ AppUser : "IdentityUserId"
| Column | Type | Null | Notes |
|---|---|---|---|
Is |
bool |
||
Is2 |
bool? |
✓ | |
Last |
Date |
✓ | |
Is |
bool? |
✓ | |
Date |
Date |
✓ | |
Date |
Date |
✓ | |
Created |
int? |
✓ | |
Updated |
int? |
✓ | |
Deleted |
int? |
✓ | |
Date |
Date |
✓ |
Attendance¶
DbSet Attendances
NKO.Lib/NKO.DataAccess/DbModel/Attendance.cs
erDiagram
Attendance {
int Id PK
int UserId FK
}
AppUser {
int UserId PK
}
AppUser ||--o{ Attendance : "UserId"
| Column | Type | Null | Notes |
|---|---|---|---|
Id |
int |
PK | |
Check |
string |
✓ | [String |
Check |
string |
✓ | [String |
Day |
int |
[Required] |
|
Month |
int |
[Required] |
|
Year |
int |
[Required] |
|
Tasks |
string |
✓ | |
Auto |
bool |
||
Auto |
bool |
||
Type |
Day |
||
Leave |
Leave |
✓ | |
Created |
Date |
[Required] |
|
User |
int |
FK → App · [Required] |
Navigation: AppUser → AppUser
CalendarProfile¶
[Table("CalendarProfile")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/CalendarProfile.cs
erDiagram
CalendarProfile {
int CalendarProfileId PK
int CommonBranchId FK
}
CommonBranch {
int BranchId PK
}
CalenderConfiguration {
int CalenderConfigId PK
int CalProfileId FK
}
PositionLevelMatrix {
int LevelMatrixId PK
int CalProfileId FK
}
CommonBranch |o--o{ CalendarProfile : "CommonBranchId"
CalendarProfile ||--o{ CalenderConfiguration : "CalProfileId"
CalendarProfile ||--o{ PositionLevelMatrix : "CalProfileId"
| Column | Type | Null | Notes |
|---|---|---|---|
Calendar |
int |
PK | |
Name |
string |
[Required] · [String |
|
Start |
Date |
[Required] |
|
End |
Date |
[Required] |
|
Daily |
int |
[Required] |
|
Daily |
int |
[Required] |
|
Common |
int? |
✓ | FK → Common |
Navigation: CommonBranch → CommonBranch, CalenderConfiguration → ICollection<CalenderConfiguration>, PositionLevelMatrix → ICollection<PositionLevelMatrix>
CalendayDays¶
inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/CalendayDays.cs
erDiagram
CalendayDays {
int DayId PK
}
CalenderConfiguration {
int CalenderConfigId PK
int DayId FK
}
CalendayDays ||--o{ CalenderConfiguration : "DayId"
| Column | Type | Null | Notes |
|---|---|---|---|
Day |
int |
PK | |
Day |
string |
[Required] · [String |
Navigation: CalenderConfiguration → ICollection<CalenderConfiguration>
CalenderConfiguration¶
[Table("CalenderConfiguration")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/CalenderConfiguration.cs
erDiagram
CalenderConfiguration {
int CalenderConfigId PK
int CalProfileId FK
int DayId FK
}
CalendarProfile {
int CalendarProfileId PK
}
CalendayDays {
int DayId PK
}
CalendarProfile ||--o{ CalenderConfiguration : "CalProfileId"
CalendayDays ||--o{ CalenderConfiguration : "DayId"
| Column | Type | Null | Notes |
|---|---|---|---|
Calender |
int |
PK | |
Day |
int |
FK → Calenday |
|
Is |
bool |
||
Is |
bool |
||
Attendance |
Time |
✓ | |
Attendance |
Time |
✓ | |
Cal |
int |
FK → Calendar |
Navigation: CalendarProfile → CalendarProfile, CalendayDays → CalendayDays
Comment¶
[Table("Comment")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/Comment.cs
erDiagram
Comment {
int CommentId PK
int CreatedBy FK
}
AppUser {
int UserId PK
}
AppUser ||--o{ Comment : "CreatedBy"
| Column | Type | Null | Notes |
|---|---|---|---|
Comment |
int |
PK | |
Reference |
int |
||
Area |
int |
||
Sub |
int? |
✓ | |
Message |
string |
[Required] · [Column(Type |
|
Created |
int |
FK → App |
|
Created |
Date |
Navigation: AppUser → AppUser
Leave¶
[Table("Leave")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/Leave.cs
erDiagram
direction LR
Leave {
int LeaveId PK
int ReqId FK
int ManagerId FK
int HRId FK
int GMId FK
int RefusedBy FK
int CancelId FK
int SubstituteUserId FK
int NextUserId FK
int LeaveTypeId FK
int ContractId FK
}
AppUser {
int UserId PK
}
LeaveType {
int LeaveTypeId PK
}
AppUserContract {
int ContractId PK
}
AppUserOvertimeConsumption {
int Id PK
int LeaveId FK
}
AppUser ||--o{ Leave : "ReqId"
AppUser |o--o{ Leave : "ManagerId, HRId, GMId +4 more"
LeaveType ||--o{ Leave : "LeaveTypeId"
AppUserContract |o--o{ Leave : "ContractId"
Leave ||--o{ AppUserOvertimeConsumption : "LeaveId"
| Column | Type | Null | Notes |
|---|---|---|---|
Leave |
int |
PK | |
Leave |
Guid |
||
Req |
int |
FK → App |
|
Req |
bool |
||
Req |
string |
✓ | [String |
Req |
Date |
✓ | |
Manager |
int? |
✓ | FK → App |
Manager |
bool |
||
Manager |
string |
✓ | [String |
Manager |
Date |
✓ | |
HRId |
int? |
✓ | FK → App |
HRSign |
bool |
||
HRNote |
string |
✓ | [String |
HRSign |
Date |
✓ | |
GMId |
int? |
✓ | FK → App |
GMSign |
bool |
||
GMNote |
string |
✓ | [String |
GMSign |
Date |
✓ | |
Days |
int |
||
From |
Date |
[Required] · [Column(Type |
|
To |
Date |
[Column(Type |
|
From |
string |
✓ | |
To |
string |
✓ | |
Contact |
string |
[Required] · [String |
|
Description |
string |
✓ | [Column(Type |
Misson |
int? |
✓ | |
Leave |
int |
FK → Leave |
|
Substitute |
int? |
✓ | FK → App |
Status |
int |
||
Refused |
int? |
✓ | FK → App |
Refuse |
bool |
||
Refuse |
string |
✓ | [Column(Type |
Refuse |
Date |
✓ | |
Cancel |
int? |
✓ | FK → App |
Is |
bool |
||
Cancel |
Date |
✓ | |
Cancel |
string |
✓ | [String |
Next |
int? |
✓ | FK → App |
Created |
int |
||
Created |
Date |
||
Is |
bool |
||
Is |
bool |
||
Is |
bool |
||
Exact |
double |
||
Dead |
int? |
✓ | |
Education |
int? |
✓ | |
University |
string |
✓ | |
Specialization |
string |
✓ | |
Stud |
string |
✓ | |
Branch |
int |
||
Sub |
int |
||
Absent |
int? |
✓ | |
Contract |
int? |
✓ | FK → App |
Is |
bool |
||
Auto |
bool |
||
Employee |
bool |
||
Manager |
bool |
Navigation: AppUserReq → AppUser, AppUserManager → AppUser, AppUserHR → AppUser, AppUserGM → AppUser, AppUserRefuse → AppUser, AppUserCancel → AppUser, AppUserSubtitute → AppUser, AppUserNextUser → AppUser, LeaveType → LeaveType, AppUserContract → AppUserContract, AppUserOvertimeConsumptions → ICollection<AppUserOvertimeConsumption>
LeaveBalance¶
[Table("LeaveBalance")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/LeaveBalance.cs
erDiagram
LeaveBalance {
int LeaveBalanceId PK
int UserId FK
}
AppUser {
int UserId PK
}
AppUser ||--o{ LeaveBalance : "UserId"
| Column | Type | Null | Notes |
|---|---|---|---|
Leave |
int |
PK | |
User |
int |
FK → App |
|
Year |
int |
||
Balance |
double? |
✓ | |
Hours |
int |
||
Desc |
string |
✓ |
Navigation: AppUser → AppUser
LeaveType¶
[Table("LeaveType")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/LeaveType.cs
erDiagram
LeaveType {
int LeaveTypeId PK
}
Leave {
int LeaveId PK
int LeaveTypeId FK
}
LeaveType ||--o{ Leave : "LeaveTypeId"
| Column | Type | Null | Notes |
|---|---|---|---|
Leave |
int |
PK | |
Name |
string |
[Required] · [String |
|
Name |
string |
✓ | [String |
Leave |
string |
[Required] · [String |
|
Attach |
bool |
||
Is |
bool |
||
Can |
bool |
Navigation: Leave → ICollection<Leave>
Note¶
[Table("Note")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/Note.cs
erDiagram
Note {
int NoteId PK
int CreatedBy FK
}
AppUser {
int UserId PK
}
AppUser ||--o{ Note : "CreatedBy"
| Column | Type | Null | Notes |
|---|---|---|---|
Note |
int |
PK | |
Note |
Guid |
||
Title |
string |
✓ | [String |
Description |
string |
✓ | [Column(Type |
Area |
int |
||
Reference |
int |
||
Reminder |
Date |
✓ | |
Show |
bool |
||
Type |
int? |
✓ | |
Created |
int |
FK → App |
|
Created |
Date |
Navigation: AppUser → AppUser
Reference¶
DbSet References · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/Reference.cs
erDiagram
Reference {
int ReferenceId PK
int ApplicantId FK
}
Applicants {
int ApplicantId PK
}
Applicants ||--o{ Reference : "ApplicantId"
| Column | Type | Null | Notes |
|---|---|---|---|
Reference |
int |
PK | |
Reference |
Guid |
||
Applicant |
int |
FK → Applicants |
|
Created |
Date |
||
Name |
string |
[Required] |
|
Email |
string |
[Required] |
|
Phone |
string |
[Required] |
|
Relationship |
string |
[Required] |
|
Date |
Date |
✓ | [Required] |
Reason |
string |
[Required] |
|
Position |
string |
[Required] |
|
Last |
string |
[Required] |
|
Describe |
string |
[Required] |
|
Greatest |
string |
[Required] |
|
Areas |
string |
[Required] |
|
Initiative |
int |
||
Initiative |
string |
✓ | |
Teamwork |
int |
||
Teamwork |
string |
✓ | |
Leadership |
int |
||
Leadership |
string |
✓ | |
Decision |
int |
||
Decision |
string |
✓ | |
Communication |
int |
||
Communication |
string |
✓ | |
Quality |
int |
||
Quality |
string |
✓ | |
Productivity |
int |
||
Productivity |
string |
✓ | |
Dependability |
int |
||
Dependability |
string |
✓ | |
Reputation |
int |
||
Reputation |
string |
✓ | |
High |
int |
||
High |
string |
✓ | |
Attitude |
int |
||
Attitude |
string |
✓ | |
Reemploy |
int |
||
Reemploy |
string |
✓ | |
Additional |
int |
||
Additional |
string |
✓ | |
Sexual |
bool |
||
First |
string |
✓ | |
Second |
string |
✓ | |
Third |
string |
✓ |
Navigation: Applicant → Applicants
SpecialHoliday¶
[Table("SpecialHoliday")] · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/SpecialHoliday.cs
erDiagram
SpecialHoliday {
int HolidayDateId PK
}
| Column | Type | Null | Notes |
|---|---|---|---|
Holiday |
int |
PK | |
From |
Date |
[Column(Type |
|
To |
Date |
[Column(Type |
|
Is |
bool |
[Required] |
|
Is |
bool |
||
Description |
string |
✓ | |
NKOProfiles |
string |
✓ |