Skip to content

0.6 · คำศัพท์ที่ต้องรู้

บทนี้รวม 50 คำศัพท์ที่จะเจอบ่อยใน volume อื่น เป็นคำคัดมาจาก codebase จริง — ถ้าเจอคำที่ไม่อยู่ในรายการนี้ ลองดูใน Volume 17 · Glossary ที่เก็บครบกว่า

จัดเป็น 5 หมวด

Identity & Auth

คำคำอธิบายที่พบ
apiKeyheader ที่ระบุ "ตัวตนของแอป" — เป็น UUID ที่ map ไปยัง APP_TYPEvtrc-api/api/src/config.js:41-148
APP_TYPEประเภทแอป — WEB, MOBILE, WEB_ADMIN, INTEGRATE_APP, TWOWAY, MEETINGvtrc-api/api/src/config.js
JWTJSON Web Token — เซ็นด้วย JWT_SECRET, TTL 15 นาที, carry { sessionId, uid }vtrc-api/api/src/lib/repositories/auth/auth.js
accessTokenJWT ที่ใช้แนบใน Authorization: Bearer <token> — TTL 15m
refreshTokentoken ยาวสำหรับขอ accessToken ใหม่ — SHA-384 of uuidv4auth.js:293
Sessionแถวในตาราง Session เก็บ session ของ user — TTL 1 วันmodels/core/session/
LoginSessionsession ชั่วคราวก่อน login สำเร็จ — TTL 15 นาที — จำกัด 3 attemptsloginSession.js:43
tokenCDChula SSO token — cached ใน Session.tokenCD สำหรับ CU-affiliated usersmodels/core/session/
@auth directiveApollo GraphQL directive ที่บังคับ RBAC — @auth(accessRole: ["USER"], accessMenu: ["Leave"])directives/auth.js
role JSON blobคอลัมน์ Users.role เก็บ role IDs เป็น JSON — ไม่ใช่ relation tablemodels/centralize/user/user.js:19-28

Data & Persistence

คำคำอธิบายที่พบ
HRMIHR Management Information — ระบบ HR ภายนอกของสภากาชาด/จุฬา — VTRC เป็น read-mostly consumerทั่วระบบ
MariaDBdatabase engine สำหรับ application state — 2 schemas: vtrc + vtrc-centralizevtrc-api/api/src/connector.js
MSSQLMicrosoft SQL Server — เก็บ HR master data (dbHRMI_Center, dbHRMI_Center_NBC)centralize-api entities / SQL; cu-central connector
db, db2Sequelize ของ vtrc-apidb = schema vtrc, db2 = vtrc-centralizeไม่มี dbHr ในไฟล์นี้vtrc-api/api/src/connector.js (export { db, db2 })
dbHrSequelize MSSQL ของ cu-central-api — ไม่ใช่ของ vtrc-apicu-central-api/main-api/src/connector.js
EmpCodeรหัสพนักงาน (string) — business key ที่ HRMI ใช้ และ VTRC ใช้อ้างอิงข้าม domainทุกที่
EmpIDUUID 36 ตัวอักษร (string) — primary key ของ Employee ใน MSSQLcentralize-api entities / cu-central models
identityCardเลขบัตรประชาชน 13 หลัก — ใช้เป็น password ของ PDFroutes.js:73
orgCodeรหัสหน่วยงาน — ใช้ในการกำหนดผู้อนุมัติ (MasterApprover)MasterApprover.orgCode
SequelizeORM ที่ใช้ใน vtrc-api และ cu-central-api (Node.js)models/core/
TypeORMORM ที่ใช้ใน centralize-api (NestJS/TypeScript) — modernization templatecentralize-api/src/entities/

Architecture

คำคำอธิบายที่พบ
multi-repo monorepoรูปแบบการจัดระเบียบ — 5 repos ใน workspace เดียว แต่ละ repo มี .git ของตัวเองworkspace root
typeDefsGraphQL type definitions — เขียนด้วยมือใน vtrc-api/api/src/typeDefs/*.js (43 ไฟล์)api/src/typeDefs/
resolverfunction ที่ resolve GraphQL field — orchestrate controller → repositoryapi/src/resolvers/
controllerbusiness logic layer — อยู่ใน lib/controllers/ (31 โฟลเดอร์)lib/controllers/
repositorydata access layer — อยู่ใน lib/repositories/ (31 โฟลเดอร์)lib/repositories/
centralize bridgelayer ใน vtrc-api ที่ proxy calls ไป cu-central-api ผ่าน END_POINT_CENTRALIZE (โฟลเดอร์ชื่อ centralize/ แต่ปลายทางคือ cu-central ไม่ใช่ NestJS)api/src/centralize/controllers/
Apollo v2GraphQL server/client เวอร์ชัน 2 — EOL แล้ว — ใช้ในทุก backend/frontendpackage.json
NestJSframework TypeScript ที่ใช้ใน centralize-api — เป็น modernization template แยกจาก live HR hopcentralize-api/
checkLinkURL()function เลือก GraphQL endpoint ตาม window.location.href — มีคนละไฟล์ใน vtrc-web และ vtrc-rc-backoffice*/src/config/apollo.js
replica (APP_NO)instance ของ vtrc-api — รัน 4 replicas (#1,2,3,5) บน host เดียวกันdocker-compose.yml

Business Domain

คำคำอธิบายที่พบ
WDHospitalWelfare Withdrawal Hospital — คำขอเบิกค่ารักษาพยาบาล — 13-state machinemodels/core/withdraw/hospital.js
WDExportbatch การ export การเบิกไปยังธนาคารmodels/core/withdraw/
KBANKธนาคารกสิกรไทย — ธนาคารหลักที่ใช้ automated payout (K-Cash)config.js:389, statusKcash ที่ 488-518
K-Cashระบบ batch ของธนาคารกสิกรไทยสำหรับโอนเงินหมู่ — นำเข้าผลด้วยมือ ไม่มี cron ใน crons.jsconfig.js:488-518 (statusKcash)
Approverตารางที่เก็บ chain การอนุมัติ — shared ระหว่าง Leave และ WDHospitalmodels/core/withdraw/approver.js
MasterApproverconfig ผู้อนุมัติตาม org — key ด้วย orgCodeMasterApprover table
LeaveDocumentตารางหลักของคำขอลา — status ENUM มี typo (PEDDING_CANCLE)models/core/leave/leave.js:59
provident fundกองทุนสงเคราะห์ — มี module providentFund.jstypeDefs/providentFund.js
conicleระบบ training/learning ภายนอก — APP_TYPE: INTEGRATE_APPtypeDefs/conicle.js
study leaveลาไปศึกษาต่อ — module studyLeave.js + studyLeaveRequest.jstypeDefs/studyLeave*.js

Tools & Processes

คำคำอธิบายที่พบ
qpdfCLI tool สำหรับ encrypt PDF — vtrc-api เรียกผ่าน execSyncroutes.js:73
ejstemplate engine สำหรับ render PDF (HTML → html-pdf → PDF)*.ejs ไฟล์
Redisin-memory store ที่ vtrc-api เชื่อมผ่าน lib/redis.js — path สลิปไม่เขียน payslip:{emp}:{date}lib/redis.js
node-schedulecron-like scheduler ใน vtrc-api — ไม่มี HA; ไม่มี K-Cash jobapi/src/crons.js
multermultipart upload middleware — maxCount: 100 filesroutes.js:45
graphql-uploadmultipart GraphQL uploads — maxFileSize: 20MB, maxFiles: 100index.js:25
SwaggerOpenAPI doc — มีเฉพาะใน centralize-api ที่ /docscentralize-api
firebase-adminSDK สำหรับ FCM push notificationpackage.json
LDAP / ADActive Directory ของจุฬา — cu-central-api ใช้ bind เพื่อ verify identityldapjs in cu-central-api
_bk / _bak filesไฟล์ backup/legacy ที่ commit ไว้ใน repo (~131 ไฟล์) — ไม่ควร edit ตามกฎ workspaceทั่วระบบ

อ่านเพิ่ม


ขั้นตอนถัดไป

ไป บท 0.7 อ่านเล่มไหนต่อ →