Skip to content

Database — Core: Procurement

The purchasing chain: Purchase Request → RFQ (with CBA supplier analysis) → Purchase Order → Goods Received Note → Payment Order, plus the provider registry and material catalogue.

Every document in the chain carries the same workflow columns — StatusId, NextUserId, a <Role>Id / <Role>Sign / <Role>SignDate / <Role>Note block per approver, and RefuseId / IsRefused / RefuseDate / RefuseNote. See the Procurement module and the Procurement cycle.

17 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

GoodReceivedNote

DbSet GoodReceivedNotes
NKO.Lib/NKO.DataAccess/DbModel/GoodReceivedNote.cs

erDiagram
    direction LR
    GoodReceivedNote {
        int GoodReceivedNoteId PK
        int CreatedBy FK
        int RecipientId FK
        int RefusedBy FK
        int CancelId FK
        int NextUserId FK
        int PurchaseOrderId FK
    }
    AppUser {
        int UserId PK
    }
    PurchaseOrder {
        int POId PK
    }
    PaymentOrder {
        int PtoId PK
        int GoodReceivedNoteId FK
    }
    GoodReceivedNoteMat {
        int GoodReceivedNoteMatId PK
        int GoodReceivedNoteId FK
    }
    AppUser ||--o{ GoodReceivedNote : "CreatedBy"
    AppUser |o--o{ GoodReceivedNote : "RecipientId, RefusedBy, CancelId +1 more"
    PurchaseOrder ||--o{ GoodReceivedNote : "PurchaseOrderId"
    GoodReceivedNote |o--o{ PaymentOrder : "GoodReceivedNoteId"
    GoodReceivedNote ||--o{ GoodReceivedNoteMat : "GoodReceivedNoteId"
Column Type Null Notes
GoodReceivedNoteId int PK
GoodReceivedNoteGuid Guid
FullId string ✓
InvoiceNumber string ✓
GRNDeliveryDate DateTime
IsAllAccepted bool
Type int
IsTransfareToWarehouse bool
PurchaseOrderId int FK → PurchaseOrder
ReqSign bool
ReqDate DateTime? ✓
RecipientId int? ✓ FK → AppUser
RecipientSign bool
RecipientDate DateTime? ✓
RecipientNote string ✓ [Column(TypeName = "ntext")]
NextUserId int? ✓ FK → AppUser
StatusId int
RefusedBy int? ✓ FK → AppUser
RefuseSign bool
RefuseNote string ✓ [Column(TypeName = "ntext")]
RefuseDate DateTime? ✓
CancelSign bool
CancelNote string ✓ [Column(TypeName = "ntext")]
CancelDate DateTime? ✓
CancelId int? ✓ FK → AppUser
Notes string ✓
CreatedBy int FK → AppUser
CreatedOn DateTime

Navigation: AppUserCreatedBy → AppUser, AppUserRecipient → AppUser, AppUserRefuse → AppUser, AppUserCancel → AppUser, AppUserNext → AppUser, PurchaseOrder → PurchaseOrder, PaymentOrders → ICollection<PaymentOrder>, GoodReceivedNoteMats → ICollection<GoodReceivedNoteMat>

GoodReceivedNoteMat

DbSet GoodReceivedNoteMats
NKO.Lib/NKO.DataAccess/DbModel/GoodReceivedNoteMat.cs

erDiagram
    GoodReceivedNoteMat {
        int GoodReceivedNoteMatId PK
        int GoodReceivedNoteId FK
        int PurchaseOrderMatId FK
    }
    GoodReceivedNote {
        int GoodReceivedNoteId PK
    }
    PurchaseOrderMat {
        int PurchaseOrderMatId PK
    }
    PaymentOrderMat {
        int PaymentOrderMatId PK
        int GoodReceivedNoteMatId FK
    }
    GoodReceivedNote ||--o{ GoodReceivedNoteMat : "GoodReceivedNoteId"
    PurchaseOrderMat ||--o{ GoodReceivedNoteMat : "PurchaseOrderMatId"
    GoodReceivedNoteMat |o--o{ PaymentOrderMat : "GoodReceivedNoteMatId"
Column Type Null Notes
GoodReceivedNoteMatId int PK
GoodReceivedNoteId int FK → GoodReceivedNote
PurchaseOrderMatId int FK → PurchaseOrderMat
Qty decimal
QualityType int
Description string ✓
Notes string ✓

Navigation: GoodReceivedNote → GoodReceivedNote, PurchaseOrderMat → PurchaseOrderMat, PaymentOrderMats → ICollection<PaymentOrderMat>

Materials

NKO.Lib/NKO.DataAccess/DbModel/Materials.cs

erDiagram
    Materials {
        int MaterialId PK
        int UnitId FK
        int ProcBudgetLineId FK
    }
    CommonUnit {
        int CommonUnitId PK
    }
    BudgetLine {
        int Id PK
    }
    RFQMat {
        int RFQMatId PK
        int MatId FK
    }
    CommonUnit ||--o{ Materials : "UnitId"
    BudgetLine ||--o{ Materials : "ProcBudgetLineId"
    Materials ||--o{ RFQMat : "MatId"
Column Type Null Notes
MaterialId int PK
SeqId int? ✓
Description string ✓
StockSpecificationId int [Required]
UnitId int FK → CommonUnit · [Required]
Quantity decimal [Required]
Duration double [Required]
EstPrice decimal [Required]
EstTotalPrice decimal
Place string ✓
AreaId int? ✓
ReferenceId int? ✓
IsAsset bool [Required]
ProcBudgetLineId int FK → BudgetLine
CreatedBy int
CreatedOn DateTime

Navigation: CommonUnit → CommonUnit, BudgetLine → BudgetLine, RFQMat → ICollection<RFQMat>

PaymentOrder

DbSet PaymentOrders
NKO.Lib/NKO.DataAccess/DbModel/PaymentOrder.cs

erDiagram
    PaymentOrder {
        int PtoId PK
        int GoodReceivedNoteId FK
        int CreatedBy FK
        int BudgetHolderId FK
        int FinId FK
        int SODId FK
        int PayerId FK
        int RefuseId FK
        int CancelledId FK
        int NextUserId FK
    }
    GoodReceivedNote {
        int GoodReceivedNoteId PK
    }
    AppUser {
        int UserId PK
    }
    PaymentOrderMat {
        int PaymentOrderMatId PK
        int PaymentOrderId FK
    }
    GoodReceivedNote |o--o{ PaymentOrder : "GoodReceivedNoteId"
    AppUser ||--o{ PaymentOrder : "CreatedBy"
    AppUser |o--o{ PaymentOrder : "BudgetHolderId, FinId, SODId +4 more"
    PaymentOrder ||--o{ PaymentOrderMat : "PaymentOrderId"
Column Type Null Notes
PtoId int PK
PtoGuid Guid
FullId string ✓
ReferenceCode string [Required]
GoodReceivedNoteId int? ✓ FK → GoodReceivedNote
InvoiceNumber int
TypeGoodsServices string ✓
PaymentMethodId int
CashByHandTo string ✓
CashByHandLocation string ✓
TransferCompanyName string ✓
TransferPhoneNum string ✓
TransferAddress string ✓
TransferBankTransfer string ✓
TransferThroughPttTransfer string ✓
TransferFullNameOnTheBankAccount string ✓
TransferAccountNumber double? ✓
TransferIbanNumber string ✓
TransferSwiftCode int? ✓
EPaymentLink string ✓
EPaymentAccountNumber string ✓
SaleTax decimal? ✓
DeliveryCharge decimal? ✓
OtherCharge decimal? ✓
Notes string ✓
IsDirect bool
ProviderCompanyName string ✓
ProviderName string ✓
ProviderEmail string ✓
ProviderMobile string ✓
ProviderAdress string ✓
ReqDate DateTime? ✓
ReqSign bool
BudgetHolderId int? ✓ FK → AppUser
BudgetHolderNotes string ✓
BudgetHolderDate DateTime? ✓
BudgetHolderSign bool
FinId int? ✓ FK → AppUser
FinNotes string ✓
FinDate DateTime? ✓
FinSign bool
SODId int? ✓ FK → AppUser
SODNotes string ✓
SODDate DateTime? ✓
SODSign bool
PayerId int? ✓ FK → AppUser
PayerNotes string ✓
PayerDate DateTime? ✓
PayerSign bool
RefuseId int? ✓ FK → AppUser
IsRefused bool
RefuseDate DateTime? ✓
RefuseNotes string ✓
CancelledId int? ✓ FK → AppUser
IsCancelled bool
CancelledDate DateTime? ✓
CancelledNotes string ✓
StatusId int
Deleted bool
NextUserId int? ✓ FK → AppUser
Currency int? ✓
CreatedBy int FK → AppUser
CreatedOn DateTime

Navigation: GoodReceivedNote → GoodReceivedNote, AppUserCreatedBy → AppUser, AppUserBudgetHolder → AppUser, AppUserFinance → AppUser, AppUserSOD → AppUser, AppUserPayer → AppUser, AppUserRefuse → AppUser, AppUserCancel → AppUser, AppUserNext → AppUser, PaymentOrderMats → ICollection<PaymentOrderMat>

PaymentOrderMat

DbSet PaymentOrderMats
NKO.Lib/NKO.DataAccess/DbModel/PaymentOrderMat.cs

erDiagram
    PaymentOrderMat {
        int PaymentOrderMatId PK
        int GoodReceivedNoteMatId FK
        int PaymentOrderId FK
    }
    GoodReceivedNoteMat {
        int GoodReceivedNoteMatId PK
    }
    PaymentOrder {
        int PtoId PK
    }
    GoodReceivedNoteMat |o--o{ PaymentOrderMat : "GoodReceivedNoteMatId"
    PaymentOrder ||--o{ PaymentOrderMat : "PaymentOrderId"
Column Type Null Notes
PaymentOrderMatId int PK
PaymentOrderId int FK → PaymentOrder
GoodReceivedNoteMatId int? ✓ FK → GoodReceivedNoteMat
Description string ✓
Qty decimal
UnitPrice decimal
Total decimal

Navigation: GoodReceivedNoteMat → GoodReceivedNoteMat, PaymentOrder → PaymentOrder

Provider

DbSet Providers
NKO.Lib/NKO.DataAccess/DbModel/Provider.cs

erDiagram
    Provider {
        int ProviderId PK
    }
    RFQProvider {
        int RFQProviderId PK
        int ProviderId FK
    }
    Provider |o--o{ RFQProvider : "ProviderId"
Column Type Null Notes
ProviderId int PK
ProviderGuid Guid
CompanyName string ✓
ContactName string ✓
Position string ✓
Email string ✓
Phone string ✓
Fax string ✓
MobileType int? ✓
MainMobile string ✓
Address string ✓
AccountRecipientName string ✓
AccountIBan string ✓
AccountNumber string ✓
CreatedOn DateTime

Navigation: RFQProviders → ICollection<RFQProvider>

PurchaseOrder

[Table("PurchaseOrder")]
NKO.Lib/NKO.DataAccess/DbModel/PurchaseOrder.cs

erDiagram
    direction LR
    PurchaseOrder {
        int POId PK
        int CreatedBy FK
        int PMId FK
        int ExceptionalId FK
        int FOId FK
        int NextUserId FK
        int RefusedBy FK
        int CancelId FK
        int PrId FK
        int ProviderId FK
    }
    AppUser {
        int UserId PK
    }
    PurchaseRequest {
        int PrId PK
    }
    RFQProvider {
        int RFQProviderId PK
    }
    PurchaseOrderMat {
        int PurchaseOrderMatId PK
        int POId FK
    }
    GoodReceivedNote {
        int GoodReceivedNoteId PK
        int PurchaseOrderId FK
    }
    AppUser ||--o{ PurchaseOrder : "CreatedBy"
    AppUser |o--o{ PurchaseOrder : "PMId, ExceptionalId, FOId +3 more"
    PurchaseRequest ||--o{ PurchaseOrder : "PrId"
    RFQProvider ||--o{ PurchaseOrder : "ProviderId"
    PurchaseOrder ||--o{ PurchaseOrderMat : "POId"
    PurchaseOrder ||--o{ GoodReceivedNote : "PurchaseOrderId"
Column Type Null Notes
POId int PK
ProviderId int FK → RFQProvider
POGuid Guid
PoDate DateTime
PrId int FK → PurchaseRequest
PoNote string ✓ [Column(TypeName = "ntext")]
DeliveryDate string ✓ [Required]
FrameworkAgreement bool
PaymentTerms string ✓
IsReset bool
SaleTax decimal? ✓
DeliveryCharge decimal? ✓
OtherCharge decimal? ✓
Score decimal? ✓
PoSeqId int? ✓
PoMId int
FullId string [Required] · [StringLength(50)]
ReqSign bool
ReqDate DateTime? ✓
PMId int? ✓ FK → AppUser
PMSign bool
PMDate DateTime? ✓
PMNote string ✓ [Column(TypeName = "ntext")]
ExceptionalSign bool
ExceptionalDate DateTime? ✓
ExceptionalNote string ✓ [Column(TypeName = "ntext")]
ExceptionalId int? ✓ FK → AppUser
FOId int? ✓ FK → AppUser
FOSign bool
FODate DateTime? ✓
FONote string ✓ [Column(TypeName = "ntext")]
NextUserId int? ✓ FK → AppUser
StatusId int
RefusedBy int? ✓ FK → AppUser
RefuseSign bool
RefuseNote string ✓ [Column(TypeName = "ntext")]
RefuseDate DateTime? ✓
CancelSign bool
CancelNote string ✓ [Column(TypeName = "ntext")]
CancelDate DateTime? ✓
CancelId int? ✓ FK → AppUser
Deleted bool
CreatedBy int FK → AppUser
CreatedOn DateTime

Navigation: AppUserCreatedBy → AppUser, AppUserPM → AppUser, AppUserExceptional → AppUser, AppUserFO → AppUser, AppUserNext → AppUser, AppUserRefuse → AppUser, AppUserCancel → AppUser, PurchaseRequest → PurchaseRequest, RFQProvider → RFQProvider, PurchaseOrderMats → ICollection<PurchaseOrderMat>, GoodReceivedNotes → ICollection<GoodReceivedNote>

PurchaseOrderMat

DbSet PurchaseOrderMats
NKO.Lib/NKO.DataAccess/DbModel/PurchaseOrderMat.cs

erDiagram
    direction LR
    PurchaseOrderMat {
        int PurchaseOrderMatId PK
        int RFQMatId FK
        int POId FK
        int BudgetLine FK
    }
    RFQMat {
        int RFQMatId PK
    }
    PurchaseOrder {
        int POId PK
    }
    BudgetLine {
        int Id PK
    }
    GoodReceivedNoteMat {
        int GoodReceivedNoteMatId PK
        int PurchaseOrderMatId FK
    }
    RFQMat ||--o{ PurchaseOrderMat : "RFQMatId"
    PurchaseOrder ||--o{ PurchaseOrderMat : "POId"
    BudgetLine ||--o{ PurchaseOrderMat : "BudgetLine"
    PurchaseOrderMat ||--o{ GoodReceivedNoteMat : "PurchaseOrderMatId"
Column Type Null Notes
PurchaseOrderMatId int PK
POId int FK → PurchaseOrder
RFQMatId int FK → RFQMat
Description string ✓
BudgetLine int FK → BudgetLine
UnitId int? ✓
Qty decimal
UnitPrice decimal
Total decimal
CountryOfOrigin string ✓
Warranty string ✓
ValidDate DateTime? ✓
Manufacturer string ✓
Model string ✓
Brand string ✓

Navigation: RFQMat → RFQMat, PurchaseOrder → PurchaseOrder, ProcBudgetLine → BudgetLine, GoodReceivedNoteMats → ICollection<GoodReceivedNoteMat>

PurchaseRequest

[Table("PurchaseRequest")]
NKO.Lib/NKO.DataAccess/DbModel/PurchaseRequest.cs

erDiagram
    direction LR
    PurchaseRequest {
        int PrId PK
        int CreatedBy FK
        int PMId FK
        int FOId FK
        int ProcMId FK
        int SOD1Id FK
        int SOD2Id FK
        int SOD3Id FK
        int SOD4Id FK
        int NextUserId FK
        int RefuseId FK
        int CancelId FK
        int AssignedId FK
        int ProjectId FK
        int CatId FK
    }
    AppUser {
        int UserId PK
    }
    Project {
        int ProjectId PK
    }
    CommonMainCategory {
        int CommonMainCategoryId PK
    }
    RFQs {
        int RFQId PK
        int PrId FK
    }
    PurchaseOrder {
        int POId PK
        int PrId FK
    }
    AppUser ||--o{ PurchaseRequest : "CreatedBy"
    AppUser |o--o{ PurchaseRequest : "PMId, FOId, ProcMId +8 more"
    Project ||--o{ PurchaseRequest : "ProjectId"
    CommonMainCategory |o--o{ PurchaseRequest : "CatId"
    PurchaseRequest ||--o{ RFQs : "PrId"
    PurchaseRequest ||--o{ PurchaseOrder : "PrId"
Column Type Null Notes
PrId int PK
PrGuid Guid
PrDate DateTime
PrMId int
FullId string [Required] · [StringLength(50)]
PrNote string ✓ [Column(TypeName = "ntext")]
ReqSign bool
ReqDate DateTime? ✓
PMId int? ✓ FK → AppUser
PMSign bool
PMDate DateTime? ✓
PMNote string ✓ [Column(TypeName = "ntext")]
FOId int? ✓ FK → AppUser
FOSign bool
FODate DateTime? ✓
FONote string ✓ [Column(TypeName = "ntext")]
ProcMId int? ✓ FK → AppUser
ProcMSign bool
ProcMDate DateTime? ✓
ProcMNote string ✓ [Column(TypeName = "ntext")]
SOD1Id int? ✓ FK → AppUser
SOD1Sign bool
SOD1Date DateTime? ✓
SOD1Note string ✓ [Column(TypeName = "ntext")]
SOD2Id int? ✓ FK → AppUser
SOD2Sign bool
SOD2Date DateTime? ✓
SOD2Note string ✓ [Column(TypeName = "ntext")]
SOD3Id int? ✓ FK → AppUser
SOD3Sign bool
SOD3Date DateTime? ✓
SOD3Note string ✓ [Column(TypeName = "ntext")]
SOD4Id int? ✓ FK → AppUser
SOD4Sign bool
SOD4Date DateTime? ✓
SOD4Note string ✓ [Column(TypeName = "ntext")]
CancelSign bool
CancelNote string ✓ [Column(TypeName = "ntext")]
CancelDate DateTime? ✓
CancelId int? ✓ FK → AppUser
NextUserId int? ✓ FK → AppUser
AssignedId int? ✓ FK → AppUser
StatusId int
RefuseId int? ✓ FK → AppUser
IsRefused bool
RefuseDate DateTime? ✓
RefuseNote string ✓
NeededByDate DateTime [Required] · [Column(TypeName = "date")]
DeliveryToAddress string ✓
DeliveryToName string ✓
DeliveryToPhone string ✓
DeliveryToEmail string ✓
DeliveryTerms string ✓
PurchaseLocation string ✓
IsSampleRequired bool
IsReset bool
CatId int? ✓ FK → CommonMainCategory
ProjectId int FK → Project
PRSubmitType int
Currency int
TrackerStatus int? ✓
Deleted bool
CreatedBy int FK → AppUser
CreatedOn DateTime

Navigation: AppUserCreatedBy → AppUser, AppUserPM → AppUser, AppUserFO → AppUser, AppUserProcM → AppUser, AppUserSOD1 → AppUser, AppUserSOD2 → AppUser, AppUserSOD3 → AppUser, AppUserSOD4 → AppUser, AppUserNext → AppUser, AppUserRefuse → AppUser, AppUserCancel → AppUser, AppUserAssigned → AppUser, Project → Project, CommonMainCategory → CommonMainCategory, PurchaseOrders → ICollection<PurchaseOrder>, RFQs → ICollection<RFQs>

RFQJustifiedMat

DbSet RFQJustifiedMats
NKO.Lib/NKO.DataAccess/DbModel/RFQJustifiedMat.cs

erDiagram
    RFQJustifiedMat {
        int Id PK
    }
Column Type Null Notes
Id int PK
RFQId int
RFQMatId int
ProviderMatId int
ProviderId int

RFQJustifiedProvider

DbSet RFQJustifiedProviders
NKO.Lib/NKO.DataAccess/DbModel/RFQJustifiedProvider.cs

erDiagram
    RFQJustifiedProvider {
        int Id PK
    }
Column Type Null Notes
Id int PK
NewProviderId int
ProviderId int

RFQMat

[Table("RFQMat")]
NKO.Lib/NKO.DataAccess/DbModel/RFQMat.cs

erDiagram
    direction LR
    RFQMat {
        int RFQMatId PK
        int MatId FK
        int RFQId FK
    }
    Materials {
        int MaterialId PK
    }
    RFQs {
        int RFQId PK
    }
    PurchaseOrderMat {
        int PurchaseOrderMatId PK
        int RFQMatId FK
    }
    RFQProviderMats {
        int RFQProviderMatId PK
        int RFQMatId FK
    }
    Materials ||--o{ RFQMat : "MatId"
    RFQs ||--o{ RFQMat : "RFQId"
    RFQMat ||--o{ PurchaseOrderMat : "RFQMatId"
    RFQMat ||--o{ RFQProviderMats : "RFQMatId"
Column Type Null Notes
RFQMatId int PK
RFQId int FK → RFQs
MatId int FK → Materials
BaseUnitPrice decimal? ✓
BaseTotalPrice decimal? ✓

Navigation: Materials → Materials, RFQs → RFQs, RFQProviderMats → ICollection<RFQProviderMats>, PurchaseOrderMats → ICollection<PurchaseOrderMat>

RFQProvider

[Table("RFQProvider")]
NKO.Lib/NKO.DataAccess/DbModel/RFQProvider.cs

erDiagram
    direction LR
    RFQProvider {
        int RFQProviderId PK
        int RFQId FK
        int ProviderId FK
    }
    RFQs {
        int RFQId PK
    }
    Provider {
        int ProviderId PK
    }
    RFQProviderMats {
        int RFQProviderMatId PK
        int ProviderId FK
    }
    RFQProviderJustification {
        int JustificationId PK
        int ProviderId FK
    }
    PurchaseOrder {
        int POId PK
        int ProviderId FK
    }
    RFQs ||--o{ RFQProvider : "RFQId"
    Provider |o--o{ RFQProvider : "ProviderId"
    RFQProvider ||--o{ RFQProviderMats : "ProviderId"
    RFQProvider ||--o{ RFQProviderJustification : "ProviderId"
    RFQProvider ||--o{ PurchaseOrder : "ProviderId"
Column Type Null Notes
RFQProviderId int PK
REGProviderGuid Guid
RFQId int FK → RFQs
CompanyName string ✓
ContactName string ✓
Position string ✓
Email string ✓
Phone string ✓
MobileType int
MainMobile string ✓
Fax string ✓
Mobile string ✓
Address string ✓
PaymentTerms string ✓
DeliveryMethod string ✓
QuoteValidityPeriod DateTime [Column(TypeName = "date")]
LeadTime DateTime [Column(TypeName = "date")]
SaleTax decimal? ✓
DeliveryCharge decimal? ✓
OtherCharge decimal? ✓
IsSamplesProvided bool
IsReferenceProvided bool
Justification string ✓ [Column(TypeName = "ntext")]
OtherJustification string ✓
IsExceptionalRefused bool
IsWinner bool
WinType int
AccountRecipientName string ✓
AccountIBan string ✓
AccountNumber string ✓
SeqId int? ✓
IP string ✓
Duration int
Quality int
Experience int
Legality int
StatusId int
CreatedOn DateTime
ProviderId int? ✓ FK → Provider

Navigation: RFQs → RFQs, Provider → Provider, RFQProviderMats → ICollection<RFQProviderMats>, PurchaseOrders → ICollection<PurchaseOrder>, RFQProviderJustifications → ICollection<RFQProviderJustification>

RFQProviderJustification

DbSet RFQProviderJustifications
NKO.Lib/NKO.DataAccess/DbModel/RFQProviderJustification.cs

erDiagram
    RFQProviderJustification {
        int JustificationId PK
        int ProviderId FK
        int CreatedBy FK
        int NextUserId FK
        int RefusedBy FK
        int CancelId FK
        int SCId FK
        int Com1Id FK
        int Com2Id FK
        int Com3Id FK
    }
    RFQProvider {
        int RFQProviderId PK
    }
    AppUser {
        int UserId PK
    }
    RFQProvider ||--o{ RFQProviderJustification : "ProviderId"
    AppUser ||--o{ RFQProviderJustification : "CreatedBy"
    AppUser |o--o{ RFQProviderJustification : "NextUserId, RefusedBy, CancelId +4 more"
Column Type Null Notes
JustificationId int PK
JustificationGuid Guid
ProviderId int FK → RFQProvider
SeqId int? ✓
FullId string ✓ [StringLength(50)]
PoDate DateTime
ProviderAnalyse bool
IsReset bool
OriginJustification string ✓
Justification string ✓
ReqSign bool
ReqDate DateTime? ✓
Com1Id int? ✓ FK → AppUser
IsCom1Signed bool
Com1Date DateTime? ✓
Com1Note string ✓ [StringLength(50)]
Com2Id int? ✓ FK → AppUser
IsCom2Signed bool
Com2Date DateTime? ✓
Com2Note string ✓ [StringLength(50)]
Com3Id int? ✓ FK → AppUser
IsCom3Signed bool
Com3Date DateTime? ✓
Com3Note string ✓ [StringLength(50)]
SCId int? ✓ FK → AppUser
IsSCSigned bool
SCDate DateTime? ✓
SCNote string ✓ [StringLength(50)]
NextUserId int? ✓ FK → AppUser
StatusId int
RefusedBy int? ✓ FK → AppUser
RefuseSign bool
RefuseNote string ✓ [Column(TypeName = "ntext")]
RefuseDate DateTime? ✓
CancelSign bool
CancelNote string ✓ [Column(TypeName = "ntext")]
CancelDate DateTime? ✓
CancelId int? ✓ FK → AppUser
Deleted bool
CreatedBy int FK → AppUser
CreatedOn DateTime

Navigation: RFQProvider → RFQProvider, AppUserCreatedBy → AppUser, AppUserNext → AppUser, AppUserRefuse → AppUser, AppUserCancel → AppUser, AppUserSC → AppUser, AppUserCom1 → AppUser, AppUserCom2 → AppUser, AppUserCom3 → AppUser

RFQProviderMats

NKO.Lib/NKO.DataAccess/DbModel/RFQProviderMats.cs

erDiagram
    RFQProviderMats {
        int RFQProviderMatId PK
        int RFQMatId FK
        int ProviderId FK
    }
    RFQMat {
        int RFQMatId PK
    }
    RFQProvider {
        int RFQProviderId PK
    }
    RFQMat ||--o{ RFQProviderMats : "RFQMatId"
    RFQProvider ||--o{ RFQProviderMats : "ProviderId"
Column Type Null Notes
RFQProviderMatId int PK
ProviderId int FK → RFQProvider
RFQMatId int FK → RFQMat
UnitPrice decimal
Total decimal
CountryOfOrigin string ✓
Warranty string ✓
ValidDate DateTime? ✓
Manufacturer string ✓
Model string ✓
Brand string ✓
AvailabilityDate DateTime? ✓ [Column(TypeName = "date")]
IsExisted bool
IsAccepted bool
MatMark decimal
PriceMatMark decimal
IsFinanceAccepted bool
Justification string ✓
Note string ✓

Navigation: RFQMat → RFQMat, RFQProvider → RFQProvider

RFQTechnical

DbSet RFQTechnicals
NKO.Lib/NKO.DataAccess/DbModel/RFQTechnical.cs

erDiagram
    RFQTechnical {
        int RFQTechnicalId PK,FK
        int TechCom1Id FK
        int TechCom2Id FK
        int TechCom3Id FK
        int RefuseId FK
        int CancelId FK
        int NextUserId FK
    }
    AppUser {
        int UserId PK
    }
    RFQs {
        int RFQId PK
    }
    AppUser |o--o{ RFQTechnical : "TechCom1Id, TechCom2Id, TechCom3Id +3 more"
    RFQs ||--o| RFQTechnical : "RFQTechnicalId"
Column Type Null Notes
RFQTechnicalId int PK · FK → RFQs (1:1) · [ForeignKey("RFQ")]
RFQTechnicalGuid Guid
TechCom1Id int? ✓ FK → AppUser
IsTechCom1Signed bool
TechCom1Date DateTime? ✓
TechCom1Note string ✓ [StringLength(200)]
TechCom2Id int? ✓ FK → AppUser
IsTechCom2Signed bool
TechCom2Date DateTime? ✓
TechCom2Note string ✓ [StringLength(200)]
TechCom3Id int? ✓ FK → AppUser
IsTechCom3Signed bool
TechCom3Date DateTime? ✓
TechCom3Note string ✓ [StringLength(200)]
GeneralJustification string ✓
RefuseId int? ✓ FK → AppUser
IsRefused bool
RefuseDate DateTime? ✓
RefuseNote string ✓
CancelId int? ✓ FK → AppUser
IsCancel bool
CancelDate DateTime? ✓
CancelNote string ✓
IsReset bool
NextUserId int? ✓ FK → AppUser
StatusId int

Navigation: AppUserTechCom1 → AppUser, AppUserTechCom2 → AppUser, AppUserTechCom3 → AppUser, AppUserRefuse → AppUser, AppUserCancel → AppUser, AppUserNext → AppUser, RFQ → RFQs

RFQs

NKO.Lib/NKO.DataAccess/DbModel/RFQs.cs

erDiagram
    direction LR
    RFQs {
        int RFQId PK
        int CreatedBy FK
        int Com1Id FK
        int Com2Id FK
        int Com3Id FK
        int RefuseId FK
        int AllowedBy FK
        int NextUserId FK
        int ResponsibleId FK
        int CancelId FK
        int PMId FK
        int PrId FK
    }
    AppUser {
        int UserId PK
    }
    PurchaseRequest {
        int PrId PK
    }
    RFQProvider {
        int RFQProviderId PK
        int RFQId FK
    }
    RFQMat {
        int RFQMatId PK
        int RFQId FK
    }
    CommitteeUser {
        int CommitteeUserId PK
        int RFQId FK
    }
    RFQTechnical {
        int RFQTechnicalId PK,FK
    }
    AppUser ||--o{ RFQs : "CreatedBy, ResponsibleId"
    AppUser |o--o{ RFQs : "Com1Id, Com2Id, Com3Id +5 more"
    PurchaseRequest ||--o{ RFQs : "PrId"
    RFQs ||--o{ RFQProvider : "RFQId"
    RFQs ||--o{ RFQMat : "RFQId"
    RFQs ||--o{ CommitteeUser : "RFQId"
    RFQs ||--o| RFQTechnical : "RFQTechnicalId"
Column Type Null Notes
RFQId int PK
RFQGuid Guid
PrId int FK → PurchaseRequest
SentOutDate DateTime [Required]
DueBackDate DateTime [Required]
ReferenceRequired bool [Required]
AccountRequired bool [Required]
TechRequired bool [Required]
Justification string ✓
ResponsibleId int FK → AppUser · [Required]
Com1Id int? ✓ FK → AppUser
IsCom1Signed bool
Com1Date DateTime? ✓
Com1Note string ✓ [StringLength(50)]
Com2Id int? ✓ FK → AppUser
IsCom2Signed bool
Com2Date DateTime? ✓
Com2Note string ✓ [StringLength(50)]
Com3Id int? ✓ FK → AppUser
IsCom3Signed bool
Com3Date DateTime? ✓
Com3Note string ✓ [StringLength(50)]
RefuseId int? ✓ FK → AppUser
IsRefused bool
RefuseDate DateTime? ✓
RefuseNote string ✓
CancelSign bool
CancelNote string ✓ [Column(TypeName = "ntext")]
CancelDate DateTime? ✓
CancelId int? ✓ FK → AppUser
PMId int? ✓ FK → AppUser
IsPMSigned bool
PMDate DateTime? ✓
PMNote string ✓ [StringLength(50)]
NextUserId int? ✓ FK → AppUser
IsReset bool
IsFullReset bool
StatusId int
IsAllowedForTech bool
AllowedBy int? ✓ FK → AppUser
AllowedDate DateTime? ✓
IsClosedQuotation bool
IsReady bool
ReadyDate DateTime? ✓
QuotationType int
PricePercent decimal
VerifyToken string ✓
IsVerified bool
IsCountryOfOrigin bool
IsWarranty bool
IsValidDate bool
IsManufacturer bool
IsModel bool
IsBrand bool
IsDeleted bool
VerificationAskedDate DateTime? ✓
TechSuccessPercent decimal
ScheduledJob string ✓
AnalyseType int
DeliveryAddress string ✓
AnalysePatttern int [Required]
CreatedBy int FK → AppUser
CreatedOn DateTime

Navigation: AppUserCreatedBy → AppUser, AppUserCom1 → AppUser, AppUserCom2 → AppUser, AppUserCom3 → AppUser, AppUserRefuse → AppUser, AppUserAllowedBy → AppUser, AppUserNext → AppUser, AppUserResponsible → AppUser, AppUserCancel → AppUser, AppUserPM → AppUser, PurchaseRequest → PurchaseRequest, RFQTechnical → RFQTechnical, RFQMat → ICollection<RFQMat>, RFQProvider → ICollection<RFQProvider>, CommitteeUsers → ICollection<CommitteeUser>