Skip to content

Database — Core: Training

The smallest module in the system: one entity. A TrainingRequest carries its own five-step approval inline — a <Role>Id / <Role>Sign / <Role>SignDate / <Role>Note block for the requester, manager, HR, finance and country director — rather than in a separate workflow table.

This is the clearest example of the workflow-column pattern used across every other document type. See the Training module.

1 entity 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

TrainingRequest

DbSet TrainingRequests · inherits BaseEntity
NKO.Lib/NKO.DataAccess/DbModel/TrainingRequest.cs

erDiagram
    TrainingRequest {
        int TrainingRequestId PK
        int ProjectId FK
        int CreatedBy FK
        int ManagerId FK
        int HRId FK
        int FinanceId FK
        int CountryId FK
        int NextUserId FK
        int RefuseId FK
    }
    Project {
        int ProjectId PK
    }
    AppUser {
        int UserId PK
    }
    Project ||--o{ TrainingRequest : "ProjectId"
    AppUser ||--o{ TrainingRequest : "CreatedBy"
    AppUser |o--o{ TrainingRequest : "ManagerId, HRId, FinanceId +3 more"
Column Type Null Notes
TrainingRequestId int PK
TrainingRequestGuid Guid
Name string [Required]
TrainingDate DateTime [Required]
TrainerOrgName string [Required]
Description string [Required]
TransCost decimal [Required]
TrainingCost decimal [Required]
ProjectId int FK → Project · [Required]
Location string ✓
Planned int? ✓
TrainingNeed int? ✓
IsAttendIn6Months bool
DetailsOfOtherCosts string ✓
Currency int? ✓
ReqSign bool
ReqNote string ✓ [StringLength(50)]
ReqSignDate DateTime? ✓
ManagerId int? ✓ FK → AppUser
ManagerSign bool
ManagerSignDate DateTime? ✓
ManagerNote string ✓ [StringLength(50)]
HRId int? ✓ FK → AppUser
HRSign bool
HRNote string ✓ [StringLength(50)]
HRSignDate DateTime? ✓
FinanceId int? ✓ FK → AppUser
FinanceSign bool
FinanceSignDate DateTime? ✓
FinanceNote string ✓ [StringLength(50)]
CountryId int? ✓ FK → AppUser
CountrySign bool
CountryNote string ✓ [StringLength(50)]
CountrySignDate DateTime? ✓
RefuseId int? ✓ FK → AppUser
IsRefused bool
RefuseDate DateTime? ✓
RefuseNote string ✓ [StringLength(50)]
NextUserId int? ✓ FK → AppUser
StatusId int
CreatedOn DateTime
CreatedBy int FK → AppUser

Navigation: Project → Project, AppUserCreatedBy → AppUser, AppUserManager → AppUser, AppUserHR → AppUser, AppUserFinance → AppUser, AppUserCountry → AppUser, AppUserNext → AppUser, AppUserRefuse → AppUser