251213:1509 Docunment Number Businee Rule not correct
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled

This commit is contained in:
admin
2025-12-13 15:09:01 +07:00
parent d964546c8d
commit ec35521258
64 changed files with 11956 additions and 223 deletions
@@ -4,7 +4,7 @@ import { ShopDrawingRevision } from '../../drawing/entities/shop-drawing-revisio
@Entity('rfa_items')
export class RfaItem {
@PrimaryColumn({ name: 'rfarev_correspondence_id' })
@PrimaryColumn({ name: 'rfa_revision_id' })
rfaRevisionId!: number;
@PrimaryColumn({ name: 'shop_drawing_revision_id' })
@@ -14,11 +14,7 @@ export class RfaItem {
@ManyToOne(() => RfaRevision, (rfaRev) => rfaRev.items, {
onDelete: 'CASCADE',
})
@JoinColumn({ name: 'rfarev_correspondence_id' }) // Link to correspondence_id of the revision (as per SQL schema) OR id
// Note: ตาม SQL Schema "rfarev_correspondence_id" FK ไปที่ correspondence_revisions(correspondence_id)
// แต่เพื่อให้ TypeORM ใช้ง่าย ปกติเราจะ Link ไปที่ PK ของ RfaRevision
// **แต่** ตาม SQL: FOREIGN KEY (rfarev_correspondence_id) REFERENCES correspondences(id)
// ดังนั้นต้องระวังจุดนี้ ใน Service เราจะใช้ correspondenceId เป็น Key
@JoinColumn({ name: 'rfa_revision_id' })
rfaRevision!: RfaRevision;
@ManyToOne(() => ShopDrawingRevision)