summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordujinkim <dujin.kim@dtsolution.co.kr>2025-07-18 07:52:02 +0000
committerdujinkim <dujin.kim@dtsolution.co.kr>2025-07-18 07:52:02 +0000
commit48a2255bfc45ffcfb0b39ffefdd57cbacf8b36df (patch)
tree0c88b7c126138233875e8d372a4e999e49c38a62
parent2ef02e27dbe639876fa3b90c30307dda183545ec (diff)
(대표님) 파일관리변경, 클라IP추적, 실시간알림, 미들웨어변경, 알림API
-rw-r--r--app/[lng]/partners/(partners)/system/layout.tsx6
-rw-r--r--app/[lng]/qna/layout.tsx18
-rw-r--r--app/[lng]/qna/page.tsx8
-rw-r--r--app/api/client-logs/route.ts259
-rw-r--r--app/api/notifications/[id]/deleate/route.ts34
-rw-r--r--app/api/notifications/[id]/read/route.ts34
-rw-r--r--app/api/notifications/read-all/route.ts26
-rw-r--r--app/api/notifications/route.ts37
-rw-r--r--app/api/notifications/stats/route.ts28
-rw-r--r--app/api/notifications/stream/route.ts54
-rw-r--r--app/api/rfq-attachments/download/route.ts371
-rw-r--r--app/api/rfq-download/route.ts262
-rw-r--r--app/api/tbe-download/route.ts432
-rw-r--r--app/api/tech-sales-rfq-download/route.ts436
-rw-r--r--components/layout/Header.tsx6
-rw-r--r--components/layout/NotificationDropdown.tsx146
-rw-r--r--components/layout/providers.tsx5
-rw-r--r--db/migrations/0213_ordinary_orphan.sql17
-rw-r--r--db/migrations/meta/0213_snapshot.json38995
-rw-r--r--db/migrations/meta/_journal.json7
-rw-r--r--db/notification.sql57
-rw-r--r--db/schema/history.ts40
-rw-r--r--db/schema/index.ts1
-rw-r--r--db/schema/notification.ts65
-rw-r--r--lib/file-download-log/service.ts353
-rw-r--r--lib/file-download-log/validation.ts37
-rw-r--r--lib/file-download.ts471
-rw-r--r--lib/file-stroage.ts588
-rw-r--r--lib/network/get-client-ip.ts116
-rw-r--r--lib/notification/NotificationContext.tsx219
-rw-r--r--lib/notification/service.ts342
-rw-r--r--lib/rate-limit.ts63
-rw-r--r--lib/realtime/NotificationManager.ts223
-rw-r--r--lib/realtime/RealtimeNotificationService.ts362
-rw-r--r--lib/sedp/get-form-tags.ts18
-rw-r--r--lib/tags/form-mapping-service.ts28
-rw-r--r--middleware.ts3
37 files changed, 43744 insertions, 423 deletions
diff --git a/app/[lng]/partners/(partners)/system/layout.tsx b/app/[lng]/partners/(partners)/system/layout.tsx
index 54330176..66f0f9cc 100644
--- a/app/[lng]/partners/(partners)/system/layout.tsx
+++ b/app/[lng]/partners/(partners)/system/layout.tsx
@@ -29,15 +29,15 @@ export default async function SettingsLayout({
{
title: "사용자",
- href: `/${lng}/evcp/system`,
+ href: `/${lng}/partners/system`,
},
{
title: "Roles",
- href: `/${lng}/evcp/system/roles`,
+ href: `/${lng}/partners/system/roles`,
},
{
title: "권한 통제",
- href: `/${lng}/evcp/system/permissions`,
+ href: `/${lng}/partners/system/permissions`,
},
]
diff --git a/app/[lng]/qna/layout.tsx b/app/[lng]/qna/layout.tsx
deleted file mode 100644
index 87651e92..00000000
--- a/app/[lng]/qna/layout.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { ReactNode } from 'react';
-
-
-export default function EvcpLayout({ children }: { children: ReactNode }) {
- return (
- <div className="relative flex min-h-svh flex-col bg-background">
- <main className="flex flex-1 flex-col">
- <div className='container-wrapper'>
- <div className="container flex-1 items-start md:grid md:grid-cols-[220px_minmax(0,1fr)] md:gap-6 lg:grid-cols-[240px_minmax(0,1fr)] lg:gap-10">
- {children}
- </div>
-
- </div>
-
- </main>
- </div>
- );
-} \ No newline at end of file
diff --git a/app/[lng]/qna/page.tsx b/app/[lng]/qna/page.tsx
deleted file mode 100644
index 10280464..00000000
--- a/app/[lng]/qna/page.tsx
+++ /dev/null
@@ -1,8 +0,0 @@
-
-export default function Pages() {
- return (
- <>
- qna
- </>
- )
- } \ No newline at end of file
diff --git a/app/api/client-logs/route.ts b/app/api/client-logs/route.ts
new file mode 100644
index 00000000..42e7db63
--- /dev/null
+++ b/app/api/client-logs/route.ts
@@ -0,0 +1,259 @@
+// app/api/client-logs/route.ts
+import { NextRequest, NextResponse } from 'next/server';
+import { getServerSession } from 'next-auth';
+import { authOptions } from '@/app/api/auth/[...nextauth]/route';
+import { createFileDownloadLog } from '@/lib/file-download-log/service';
+import rateLimit from '@/lib/rate-limit';
+import { z } from 'zod';
+import { getRequestInfo } from '@/lib/network/get-client-ip';
+
+// 클라이언트 로그 이벤트 스키마
+const clientLogSchema = z.object({
+ event: z.enum(['download_attempt', 'download_success', 'download_error', 'security_violation']),
+ data: z.object({
+ // 파일 관련 정보
+ filePath: z.string(),
+ fileName: z.string(),
+ fileExtension: z.string().optional(),
+ fileSize: z.number().optional(),
+ duration: z.number().optional(),
+
+ // 액션 관련 정보
+ action: z.string().optional(),
+
+ // 에러 관련 정보
+ error: z.string().optional(),
+
+ // 보안 위반 관련 정보
+ type: z.string().optional(), // security_violation의 타입
+
+ // 클라이언트 환경 정보
+ timestamp: z.string(),
+ userAgent: z.string(),
+ url: z.string(),
+ sessionId: z.string(),
+
+ // 기타 정보
+ userInitiated: z.boolean().optional(),
+ disableLogging: z.boolean().optional(),
+ }),
+});
+
+
+// 클라이언트 로그를 파일 다운로드 로그 형식으로 변환
+function mapClientLogToDownloadLog(event: string, data: any, requestInfo: any, userId: string) {
+ // 파일 ID는 클라이언트에서 알 수 없으므로 0으로 설정 (또는 파일 경로로 조회 시도)
+ const fileId = 0;
+
+ // 성공 여부 판단
+ const success = event === 'download_success';
+
+ // 에러 메시지 설정
+ let errorMessage = undefined;
+ if (event === 'download_error') {
+ errorMessage = data.error || 'Unknown client error';
+ } else if (event === 'security_violation') {
+ errorMessage = `Security violation: ${data.type || 'unknown'} - ${data.error || ''}`;
+ }
+
+ // 요청 ID 생성 (클라이언트 세션 ID 활용)
+ const requestId = data.sessionId || crypto.randomUUID();
+
+ return {
+ fileId,
+ success,
+ errorMessage,
+ requestId,
+ downloadDurationMs: data.duration,
+ fileInfo: {
+ fileName: data.fileName,
+ filePath: data.filePath,
+ fileSize: data.fileSize || 0,
+ },
+ // 클라이언트 로그 추가 정보
+ clientEventType: event,
+ clientUserAgent: data.userAgent,
+ clientUrl: data.url,
+ clientTimestamp: data.timestamp,
+ serverIp: requestInfo.ip,
+ serverUserAgent: requestInfo.userAgent,
+ };
+}
+
+export async function POST(request: NextRequest) {
+ const requestInfo = getRequestInfo(request);
+
+ try {
+ // Rate limiting 체크
+ const limiterResult = await rateLimit(request);
+ if (!limiterResult.success) {
+ console.warn('🚨 클라이언트 로그 Rate limit 초과:', {
+ ip: requestInfo.ip,
+ userAgent: requestInfo.userAgent
+ });
+
+ return NextResponse.json(
+ { error: "Too many requests" },
+ { status: 429 }
+ );
+ }
+
+ // 세션 확인
+ const session = await getServerSession(authOptions);
+ if (!session?.user) {
+ console.warn('🚨 인증되지 않은 클라이언트 로그 요청:', {
+ ip: requestInfo.ip,
+ userAgent: requestInfo.userAgent
+ });
+
+ return NextResponse.json(
+ { error: "Unauthorized" },
+ { status: 401 }
+ );
+ }
+
+ // 요청 본문 파싱 및 검증
+ const body = await request.json();
+ const validatedData = clientLogSchema.parse(body);
+
+ const { event, data } = validatedData;
+
+ // 로깅이 비활성화된 경우 스킵 (하지만 보안 위반은 항상 기록)
+ if (data.disableLogging && event !== 'security_violation') {
+ return NextResponse.json({ success: true, logged: false });
+ }
+
+ // 클라이언트 로그를 서버 로그 형식으로 변환
+ const downloadLogData = mapClientLogToDownloadLog(event, data, requestInfo, session.user.id);
+
+ // 기존 파일 다운로드 로그 서비스 사용
+ const result = await createFileDownloadLog(downloadLogData);
+
+ if (!result.success) {
+ console.error('클라이언트 로그 저장 실패:', result.error);
+ return NextResponse.json(
+ { error: "Failed to save log" },
+ { status: 500 }
+ );
+ }
+
+ // 성공 로그 (보안 위반은 경고 레벨로)
+ if (event === 'security_violation') {
+ console.warn('🚨 클라이언트 보안 위반 기록:', {
+ type: data.type,
+ filePath: data.filePath,
+ fileName: data.fileName,
+ userId: session.user.id,
+ ip: requestInfo.ip,
+ clientInfo: {
+ userAgent: data.userAgent,
+ url: data.url,
+ sessionId: data.sessionId,
+ }
+ });
+ } else {
+ console.log('📝 클라이언트 로그 기록:', {
+ event,
+ fileName: data.fileName,
+ userId: session.user.id,
+ success: event === 'download_success',
+ logId: result.logId,
+ });
+ }
+
+ return NextResponse.json({
+ success: true,
+ logged: true,
+ logId: result.logId
+ });
+
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : String(error);
+
+ console.error('❌ 클라이언트 로그 API 오류:', {
+ error: errorMessage,
+ userId: (await getServerSession(authOptions))?.user?.id,
+ ip: requestInfo.ip,
+ userAgent: requestInfo.userAgent,
+ });
+
+ // Zod 검증 에러 처리
+ if (error instanceof z.ZodError) {
+ return NextResponse.json(
+ {
+ error: 'Invalid log data',
+ details: error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ')
+ },
+ { status: 400 }
+ );
+ }
+
+ return NextResponse.json(
+ {
+ error: 'Internal server error',
+ details: process.env.NODE_ENV === 'development' ? errorMessage : undefined
+ },
+ { status: 500 }
+ );
+ }
+}
+
+// GET 요청으로 클라이언트 로그 조회 (관리자용)
+export async function GET(request: NextRequest) {
+ try {
+ const session = await getServerSession(authOptions);
+ if (!session?.user || !session.user.roles?.includes('admin')) {
+ return NextResponse.json(
+ { error: "Admin access required" },
+ { status: 403 }
+ );
+ }
+
+ // 쿼리 파라미터 파싱
+ const searchParams = request.nextUrl.searchParams;
+ const page = parseInt(searchParams.get('page') || '1', 10);
+ const limit = parseInt(searchParams.get('limit') || '50', 10);
+ const event = searchParams.get('event');
+ const userId = searchParams.get('userId');
+ const startDate = searchParams.get('startDate');
+ const endDate = searchParams.get('endDate');
+
+ // 여기서는 기존 로그 조회 함수를 사용하거나
+ // 클라이언트 로그 전용 조회 함수를 만들어야 합니다
+ // 현재는 간단한 응답으로 대체
+
+ return NextResponse.json({
+ message: "Client logs retrieval - implement with your existing log service",
+ filters: { page, limit, event, userId, startDate, endDate }
+ });
+
+ } catch (error) {
+ console.error('❌ 클라이언트 로그 조회 오류:', error);
+ return NextResponse.json(
+ { error: 'Failed to retrieve logs' },
+ { status: 500 }
+ );
+ }
+}
+
+// 클라이언트 로그 통계 조회 (관리자용)
+export async function HEAD(request: NextRequest) {
+ try {
+ const session = await getServerSession(authOptions);
+ if (!session?.user || !session.user.roles?.includes('admin')) {
+ return new NextResponse(null, { status: 403 });
+ }
+
+ // 간단한 통계 정보를 헤더로 반환
+ const headers = new Headers();
+ headers.set('X-Total-Logs', '0'); // 실제 구현 필요
+ headers.set('X-Security-Violations', '0'); // 실제 구현 필요
+ headers.set('X-Success-Rate', '0%'); // 실제 구현 필요
+
+ return new NextResponse(null, { status: 200, headers });
+
+ } catch (error) {
+ console.error('❌ 클라이언트 로그 통계 조회 오류:', error);
+ return new NextResponse(null, { status: 500 });
+ }
+} \ No newline at end of file
diff --git a/app/api/notifications/[id]/deleate/route.ts b/app/api/notifications/[id]/deleate/route.ts
new file mode 100644
index 00000000..21123c78
--- /dev/null
+++ b/app/api/notifications/[id]/deleate/route.ts
@@ -0,0 +1,34 @@
+// app/api/notifications/[id]/delete/route.ts
+import { NextRequest, NextResponse } from 'next/server';
+import { getServerSession } from 'next-auth';
+import { authOptions } from "@/app/api/auth/[...nextauth]/route"
+import { deleteNotification } from '@/lib/notification/service';
+
+export async function DELETE(
+ request: NextRequest,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const session = await getServerSession(authOptions);
+ if (!session?.user?.id) {
+ return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
+ }
+
+ const deletedNotification = await deleteNotification(params.id, session.user.id);
+
+ if (!deletedNotification) {
+ return NextResponse.json(
+ { error: 'Notification not found' },
+ { status: 404 }
+ );
+ }
+
+ return NextResponse.json({ success: true });
+ } catch (error) {
+ console.error('Error deleting notification:', error);
+ return NextResponse.json(
+ { error: 'Failed to delete notification' },
+ { status: 500 }
+ );
+ }
+} \ No newline at end of file
diff --git a/app/api/notifications/[id]/read/route.ts b/app/api/notifications/[id]/read/route.ts
new file mode 100644
index 00000000..ba894fad
--- /dev/null
+++ b/app/api/notifications/[id]/read/route.ts
@@ -0,0 +1,34 @@
+// app/api/notifications/[id]/read/route.ts
+import { NextRequest, NextResponse } from 'next/server';
+import { getServerSession } from 'next-auth';
+import { authOptions } from "@/app/api/auth/[...nextauth]/route"
+import { markNotificationAsRead } from '@/lib/notification/service';
+
+export async function PATCH(
+ request: NextRequest,
+ { params }: { params: { id: string } }
+) {
+ try {
+ const session = await getServerSession(authOptions);
+ if (!session?.user?.id) {
+ return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
+ }
+
+ const notification = await markNotificationAsRead(params.id, session.user.id);
+
+ if (!notification) {
+ return NextResponse.json(
+ { error: 'Notification not found' },
+ { status: 404 }
+ );
+ }
+
+ return NextResponse.json({ success: true, notification });
+ } catch (error) {
+ console.error('Error marking notification as read:', error);
+ return NextResponse.json(
+ { error: 'Failed to mark notification as read' },
+ { status: 500 }
+ );
+ }
+} \ No newline at end of file
diff --git a/app/api/notifications/read-all/route.ts b/app/api/notifications/read-all/route.ts
new file mode 100644
index 00000000..f53bbbbf
--- /dev/null
+++ b/app/api/notifications/read-all/route.ts
@@ -0,0 +1,26 @@
+// app/api/notifications/read-all/route.ts
+import { NextRequest, NextResponse } from 'next/server';
+import { getServerSession } from 'next-auth';
+import { authOptions } from "@/app/api/auth/[...nextauth]/route"
+
+export async function PATCH(request: NextRequest) {
+ try {
+ const session = await getServerSession(authOptions);
+ if (!session?.user?.id) {
+ return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
+ }
+
+ const notifications = await markAllNotificationsAsRead(session.user.id);
+
+ return NextResponse.json({
+ success: true,
+ updatedCount: notifications.length
+ });
+ } catch (error) {
+ console.error('Error marking all notifications as read:', error);
+ return NextResponse.json(
+ { error: 'Failed to mark all notifications as read' },
+ { status: 500 }
+ );
+ }
+}
diff --git a/app/api/notifications/route.ts b/app/api/notifications/route.ts
new file mode 100644
index 00000000..cab0b74e
--- /dev/null
+++ b/app/api/notifications/route.ts
@@ -0,0 +1,37 @@
+// app/api/notifications/route.ts
+import { NextRequest, NextResponse } from 'next/server';
+import { getServerSession } from 'next-auth';
+import { getUserNotifications,getUnreadNotificationCount } from '@/lib/notification/service';
+import { authOptions } from "@/app/api/auth/[...nextauth]/route"
+
+
+export async function GET(request: NextRequest) {
+ try {
+ const session = await getServerSession(authOptions);
+ if (!session?.user?.id) {
+ return NextResponse.json({ error: 'Unauthorized' }, { status: 401 });
+ }
+
+ const { searchParams } = new URL(request.url);
+ const limit = parseInt(searchParams.get('limit') || '20');
+ const offset = parseInt(searchParams.get('offset') || '0');
+ const unreadOnly = searchParams.get('unreadOnly') === 'true';
+
+ const [notifications, unreadCount] = await Promise.all([
+ getUserNotifications(session.user.id, { limit, offset, unreadOnly }),
+ getUnreadNotificationCount(session.user.id)
+ ]);
+
+ return NextResponse.json({
+ notifications,
+ unreadCount,
+ hasMore: notifications.length === limit
+ });
+ } catch (error) {
+ console.error('Error fetching notifications:', error);
+ return NextResponse.json(
+ { error: 'Failed to fetch notifications' },
+ { status: 500 }
+ );
+ }
+} \ No newline at end of file
diff --git a/app/api/notifications/stats/route.ts b/app/api/notifications/stats/route.ts
new file mode 100644
index 00000000..2e99eb3c
--- /dev/null
+++ b/app/api/notifications/stats/route.ts
@@ -0,0 +1,28 @@
+import { NextRequest, NextResponse } from 'next/server';
+import { getServerSession } from 'next-auth';
+import { authOptions } from "@/app/api/auth/[...nextauth]/route"
+import realtimeNotificationService from '@/lib/realtime/RealtimeNotificationService';
+import notificationManager from '@/lib/realtime/NotificationManager';
+
+export async function GET(request: NextRequest) {
+ try {
+ const session = await getServerSession(authOptions);
+ if (!session?.user?.roles || !session.user.roles.includes('admin')) {
+ return NextResponse.json({ error: 'Forbidden' }, { status: 403 });
+ }
+
+ const stats = {
+ connectedClients: realtimeNotificationService.getConnectedClientCount(),
+ dbConnectionStatus: notificationManager.getConnectionStatus(),
+ timestamp: new Date().toISOString()
+ };
+
+ return NextResponse.json(stats);
+ } catch (error) {
+ console.error('Error fetching notification stats:', error);
+ return NextResponse.json(
+ { error: 'Failed to fetch stats' },
+ { status: 500 }
+ );
+ }
+} \ No newline at end of file
diff --git a/app/api/notifications/stream/route.ts b/app/api/notifications/stream/route.ts
new file mode 100644
index 00000000..7ca6aab2
--- /dev/null
+++ b/app/api/notifications/stream/route.ts
@@ -0,0 +1,54 @@
+// app/api/notifications/stream/route.ts
+import { NextRequest } from 'next/server';
+import { getServerSession } from 'next-auth';
+import { authOptions } from "@/app/api/auth/[...nextauth]/route"
+import realtimeNotificationService from '@/lib/realtime/RealtimeNotificationService';
+
+
+export async function GET(request: NextRequest) {
+ try {
+ const session = await getServerSession(authOptions);
+ if (!session?.user?.id) {
+ return new Response('Unauthorized', { status: 401 });
+ }
+
+ const userId = session.user.id;
+ const encoder = new TextEncoder();
+
+ const stream = new ReadableStream({
+ start(controller) {
+ // 클라이언트 등록
+ const clientId = realtimeNotificationService.addClient(userId, controller);
+
+ console.log(`SSE stream started for user ${userId} (${clientId})`);
+
+ // 초기 연결 확인 메시지
+ controller.enqueue(encoder.encode("data: {\"type\":\"connected\"}\n\n"));
+
+ // 연결 해제 처리
+ request.signal.addEventListener('abort', () => {
+ console.log(`SSE stream ended for user ${userId} (${clientId})`);
+ realtimeNotificationService.removeClient(userId, controller);
+ controller.close();
+ });
+ },
+
+ cancel() {
+ console.log(`SSE stream cancelled for user ${userId}`);
+ realtimeNotificationService.removeClient(userId, controller);
+ }
+ });
+
+ return new Response(stream, {
+ headers: {
+ 'Content-Type': 'text/event-stream',
+ 'Cache-Control': 'no-cache, no-transform',
+ 'Connection': 'keep-alive',
+ 'X-Accel-Buffering': 'no', // Nginx 버퍼링 비활성화
+ },
+ });
+ } catch (error) {
+ console.error('Error creating SSE stream:', error);
+ return new Response('Internal Server Error', { status: 500 });
+ }
+ } \ No newline at end of file
diff --git a/app/api/rfq-attachments/download/route.ts b/app/api/rfq-attachments/download/route.ts
index 05e87906..5a07bc0b 100644
--- a/app/api/rfq-attachments/download/route.ts
+++ b/app/api/rfq-attachments/download/route.ts
@@ -1,44 +1,161 @@
// app/api/rfq-attachments/download/route.ts
import { NextRequest, NextResponse } from 'next/server';
-import { readFile, access, constants } from 'fs/promises';
-import { join } from 'path';
-import db from '@/db/db';
+import { readFile, access, constants, stat } from 'fs/promises';
+import { join, normalize, resolve } from 'path';
+import db from '@/db/db';
import { bRfqAttachmentRevisions, vendorResponseAttachmentsB } from '@/db/schema';
-import { eq, or } from 'drizzle-orm';
+import { eq } from 'drizzle-orm';
import { getServerSession } from 'next-auth';
import { authOptions } from '@/app/api/auth/[...nextauth]/route';
+import { createFileDownloadLog } from '@/lib/file-download-log/service';
+import rateLimit from '@/lib/rate-limit';
+import { z } from 'zod';
+import { getRequestInfo } from '@/lib/network/get-client-ip';
+
+// 허용된 파일 확장자
+const ALLOWED_EXTENSIONS = new Set([
+ 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',
+ 'txt', 'csv', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'svg',
+ 'dwg', 'dxf', 'zip', 'rar', '7z'
+]);
+
+// 최대 파일 크기 (50MB)
+const MAX_FILE_SIZE = 50 * 1024 * 1024;
+
+// 다운로드 요청 검증 스키마
+const downloadRequestSchema = z.object({
+ path: z.string().min(1, 'File path is required'),
+ type: z.enum(['client', 'vendor']).optional(),
+ revisionId: z.string().optional(),
+ responseFileId: z.string().optional(),
+});
+
+// 파일 정보 타입
+interface FileRecord {
+ id: number;
+ fileName: string;
+ originalFileName?: string;
+ filePath: string;
+ fileSize: number;
+ fileType?: string;
+}
+
+// 강화된 파일 경로 검증 함수
+function validateFilePath(filePath: string): boolean {
+ // null, undefined, 빈 문자열 체크
+ if (!filePath || typeof filePath !== 'string') {
+ return false;
+ }
+
+ // 위험한 패턴 체크
+ const dangerousPatterns = [
+ /\.\./, // 상위 디렉토리 접근
+ /\/\//, // 이중 슬래시
+ /[<>:"'|?*]/, // 특수문자
+ /[\x00-\x1f]/, // 제어문자
+ /\\+/ // 백슬래시
+ ];
+
+ if (dangerousPatterns.some(pattern => pattern.test(filePath))) {
+ return false;
+ }
+
+ // 시스템 파일 접근 방지
+ const dangerousPaths = ['/etc', '/proc', '/sys', '/var', '/usr', '/root', '/home'];
+ for (const dangerousPath of dangerousPaths) {
+ if (filePath.toLowerCase().startsWith(dangerousPath)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+// 파일 확장자 검증
+function validateFileExtension(fileName: string): boolean {
+ const extension = fileName.split('.').pop()?.toLowerCase() || '';
+ return ALLOWED_EXTENSIONS.has(extension);
+}
+
+// 안전한 파일명 생성
+function sanitizeFileName(fileName: string): string {
+ return fileName
+ .replace(/[^\w\s.-]/g, '_') // 안전하지 않은 문자 제거
+ .replace(/\s+/g, '_') // 공백을 언더스코어로
+ .substring(0, 255); // 파일명 길이 제한
+}
export async function GET(request: NextRequest) {
+ const startTime = Date.now();
+ const requestInfo = getRequestInfo(request);
+ let fileRecord: FileRecord | null = null;
+
try {
+ // Rate limiting 체크
+ const limiterResult = await rateLimit(request);
+ if (!limiterResult.success) {
+ console.warn('🚨 Rate limit 초과:', {
+ ip: requestInfo.ip,
+ userAgent: requestInfo.userAgent
+ });
+
+ return NextResponse.json(
+ { error: "Too many requests" },
+ { status: 429 }
+ );
+ }
+
// 세션 확인
const session = await getServerSession(authOptions);
if (!session?.user) {
+ console.warn('🚨 인증되지 않은 다운로드 시도:', {
+ ip: requestInfo.ip,
+ userAgent: requestInfo.userAgent,
+ path: request.nextUrl.searchParams.get("path")
+ });
+
return NextResponse.json(
{ error: "Unauthorized" },
{ status: 401 }
);
}
- // 파라미터 추출
- const path = request.nextUrl.searchParams.get("path");
- const type = request.nextUrl.searchParams.get("type"); // "client" | "vendor"
- const revisionId = request.nextUrl.searchParams.get("revisionId");
- const responseFileId = request.nextUrl.searchParams.get("responseFileId");
+ // 파라미터 검증
+ const searchParams = {
+ path: request.nextUrl.searchParams.get("path"),
+ type: request.nextUrl.searchParams.get("type"),
+ revisionId: request.nextUrl.searchParams.get("revisionId"),
+ responseFileId: request.nextUrl.searchParams.get("responseFileId"),
+ };
+
+ const validatedParams = downloadRequestSchema.parse(searchParams);
+ const { path, type, revisionId, responseFileId } = validatedParams;
- if (!path) {
+ // 파일 경로 보안 검증
+ if (!validateFilePath(path)) {
+ console.warn(`🚨 의심스러운 파일 경로 접근 시도: ${path}`, {
+ userId: session.user.id,
+ ip: requestInfo.ip,
+ userAgent: requestInfo.userAgent
+ });
+
return NextResponse.json(
- { error: "File path is required" },
+ { error: "Invalid file path" },
{ status: 400 }
);
}
+ // 경로 정규화
+ const normalizedPath = normalize(path.replace(/^\/+/, ""));
+
// DB에서 파일 정보 조회
- let dbRecord = null;
+ let dbRecord: FileRecord | null = null;
if (type === "client" && revisionId) {
// 발주처 첨부파일 리비전
const [record] = await db
.select({
+ id: bRfqAttachmentRevisions.id,
fileName: bRfqAttachmentRevisions.fileName,
originalFileName: bRfqAttachmentRevisions.originalFileName,
filePath: bRfqAttachmentRevisions.filePath,
@@ -54,6 +171,7 @@ export async function GET(request: NextRequest) {
// 벤더 응답 파일
const [record] = await db
.select({
+ id: vendorResponseAttachmentsB.id,
fileName: vendorResponseAttachmentsB.fileName,
originalFileName: vendorResponseAttachmentsB.originalFileName,
filePath: vendorResponseAttachmentsB.filePath,
@@ -66,9 +184,10 @@ export async function GET(request: NextRequest) {
dbRecord = record;
} else {
- // filePath로 직접 검색 (fallback)
+ // filePath로 직접 검색 (fallback) - 정규화된 경로로 검색
const [clientRecord] = await db
.select({
+ id: bRfqAttachmentRevisions.id,
fileName: bRfqAttachmentRevisions.fileName,
originalFileName: bRfqAttachmentRevisions.originalFileName,
filePath: bRfqAttachmentRevisions.filePath,
@@ -76,7 +195,7 @@ export async function GET(request: NextRequest) {
fileType: bRfqAttachmentRevisions.fileType,
})
.from(bRfqAttachmentRevisions)
- .where(eq(bRfqAttachmentRevisions.filePath, path));
+ .where(eq(bRfqAttachmentRevisions.filePath, normalizedPath));
if (clientRecord) {
dbRecord = clientRecord;
@@ -84,6 +203,7 @@ export async function GET(request: NextRequest) {
// 벤더 파일에서도 검색
const [vendorRecord] = await db
.select({
+ id: vendorResponseAttachmentsB.id,
fileName: vendorResponseAttachmentsB.fileName,
originalFileName: vendorResponseAttachmentsB.originalFileName,
filePath: vendorResponseAttachmentsB.filePath,
@@ -91,72 +211,142 @@ export async function GET(request: NextRequest) {
fileType: vendorResponseAttachmentsB.fileType,
})
.from(vendorResponseAttachmentsB)
- .where(eq(vendorResponseAttachmentsB.filePath, path));
+ .where(eq(vendorResponseAttachmentsB.filePath, normalizedPath));
dbRecord = vendorRecord;
}
}
- // 파일 정보 설정
- let fileName;
- let fileType;
+ // DB에서 파일 정보를 찾지 못한 경우
+ if (!dbRecord) {
+ console.warn("⚠️ DB에서 파일 정보를 찾지 못함:", {
+ path,
+ normalizedPath,
+ userId: session.user.id,
+ ip: requestInfo.ip
+ });
- if (dbRecord) {
- // DB에서 찾은 경우 원본 파일명 사용
- fileName = dbRecord.originalFileName || dbRecord.fileName;
- fileType = dbRecord.fileType;
- console.log("✅ DB에서 파일 정보 찾음:", { fileName, fileType, path: dbRecord.filePath });
- } else {
- // DB에서 찾지 못한 경우 경로에서 파일명 추출
- fileName = path.split('/').pop() || 'download';
- console.log("⚠️ DB에서 파일 정보를 찾지 못함, 경로에서 추출:", fileName);
+ return NextResponse.json(
+ { error: "File not found in database" },
+ { status: 404 }
+ );
+ }
+
+ fileRecord = dbRecord;
+
+ // 파일명 설정
+ const fileName = dbRecord.originalFileName || dbRecord.fileName;
+
+ // 파일 확장자 검증
+ if (!validateFileExtension(fileName)) {
+ console.warn(`🚨 허용되지 않은 파일 타입 다운로드 시도: ${fileName}`, {
+ userId: session.user.id,
+ ip: requestInfo.ip
+ });
+
+ // 실패 로그 기록
+ await createFileDownloadLog({
+ fileId: dbRecord.id,
+ success: false,
+ errorMessage: 'File type not allowed',
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName,
+ filePath: path,
+ fileSize: 0,
+ }
+ });
+
+ return NextResponse.json(
+ { error: "File type not allowed" },
+ { status: 403 }
+ );
}
- // 파일 경로 구성
- const storedPath = path.replace(/^\/+/, ""); // 앞쪽 슬래시 제거
+ // 안전한 파일 경로 구성
+ const allowedDirs = ["public", "uploads", "storage"];
+ let actualPath: string | null = null;
+ let baseDir: string | null = null;
- // 가능한 파일 경로들
- const possiblePaths = [
- join(process.cwd(), "public", storedPath),
- join(process.cwd(), "uploads", storedPath),
- join(process.cwd(), "storage", storedPath),
- join(process.cwd(), storedPath), // 절대 경로인 경우
- ];
+ // 각 허용된 디렉터리에서 파일 찾기
+ for (const dir of allowedDirs) {
+ baseDir = resolve(process.cwd(), dir);
+ const testPath = resolve(baseDir, normalizedPath);
+
+ // 경로 탐색 공격 방지 - 허용된 디렉터리 외부 접근 차단
+ if (!testPath.startsWith(baseDir)) {
+ continue;
+ }
- // 실제 파일 찾기
- let actualPath = null;
- for (const testPath of possiblePaths) {
try {
await access(testPath, constants.R_OK);
actualPath = testPath;
console.log("✅ 파일 발견:", testPath);
break;
} catch (err) {
- // 조용히 다음 경로 시도
+ // 조용히 다음 디렉터리 시도
}
}
- if (!actualPath) {
- console.error("❌ 모든 경로에서 파일을 찾을 수 없음:", possiblePaths);
+ if (!actualPath || !baseDir) {
+ console.error("❌ 모든 경로에서 파일을 찾을 수 없음:", {
+ normalizedPath,
+ userId: session.user.id,
+ requestedPath: path
+ });
+
+ // 실패 로그 기록
+ await createFileDownloadLog({
+ fileId: dbRecord.id,
+ success: false,
+ errorMessage: 'File not found on server',
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName,
+ filePath: path,
+ fileSize: dbRecord.fileSize || 0,
+ }
+ });
+
return NextResponse.json(
- {
- error: "File not found on server",
- details: {
- path: path,
- fileName: fileName,
- triedPaths: possiblePaths
- }
- },
+ { error: "File not found on server" },
{ status: 404 }
);
}
+ // 파일 크기 확인
+ const stats = await stat(actualPath);
+ if (stats.size > MAX_FILE_SIZE) {
+ console.warn(`🚨 파일 크기 초과: ${fileName} (${stats.size} bytes)`, {
+ userId: session.user.id,
+ ip: requestInfo.ip
+ });
+
+ // 실패 로그 기록
+ await createFileDownloadLog({
+ fileId: dbRecord.id,
+ success: false,
+ errorMessage: 'File too large',
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName,
+ filePath: path,
+ fileSize: stats.size,
+ }
+ });
+
+ return NextResponse.json(
+ { error: "File too large" },
+ { status: 413 }
+ );
+ }
+
// 파일 읽기
const fileBuffer = await readFile(actualPath);
// MIME 타입 결정
const fileExtension = fileName.split('.').pop()?.toLowerCase() || '';
- let contentType = fileType || 'application/octet-stream'; // DB의 fileType 우선 사용
+ let contentType = dbRecord.fileType || 'application/octet-stream';
// 확장자에 따른 MIME 타입 매핑 (fallback)
if (!contentType || contentType === 'application/octet-stream') {
@@ -168,8 +358,8 @@ export async function GET(request: NextRequest) {
'xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'ppt': 'application/vnd.ms-powerpoint',
'pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
- 'txt': 'text/plain',
- 'csv': 'text/csv',
+ 'txt': 'text/plain; charset=utf-8',
+ 'csv': 'text/csv; charset=utf-8',
'png': 'image/png',
'jpg': 'image/jpeg',
'jpeg': 'image/jpeg',
@@ -186,23 +376,44 @@ export async function GET(request: NextRequest) {
contentType = mimeTypes[fileExtension] || 'application/octet-stream';
}
- // 안전한 파일명 생성 (특수문자 처리)
- const safeFileName = fileName.replace(/[^\w\s.-]/gi, '_');
+ // 안전한 파일명 생성
+ const safeFileName = sanitizeFileName(fileName);
- // 다운로드용 헤더 설정
+ // 보안 헤더와 다운로드용 헤더 설정
const headers = new Headers();
headers.set('Content-Type', contentType);
headers.set('Content-Disposition', `attachment; filename*=UTF-8''${encodeURIComponent(safeFileName)}`);
headers.set('Content-Length', fileBuffer.length.toString());
+
+ // 보안 헤더
headers.set('Cache-Control', 'no-cache, no-store, must-revalidate');
headers.set('Pragma', 'no-cache');
headers.set('Expires', '0');
+ headers.set('X-Content-Type-Options', 'nosniff');
+ headers.set('X-Frame-Options', 'DENY');
+ headers.set('X-XSS-Protection', '1; mode=block');
+ headers.set('Referrer-Policy', 'strict-origin-when-cross-origin');
+
+ // 성공 로그 기록
+ await createFileDownloadLog({
+ fileId: dbRecord.id,
+ success: true,
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName: safeFileName,
+ filePath: path,
+ fileSize: fileBuffer.length,
+ }
+ });
console.log("✅ 파일 다운로드 성공:", {
fileName: safeFileName,
contentType,
size: fileBuffer.length,
- actualPath
+ actualPath,
+ userId: session.user.id,
+ ip: requestInfo.ip,
+ downloadDurationMs: Date.now() - startTime
});
return new NextResponse(fileBuffer, {
@@ -211,11 +422,51 @@ export async function GET(request: NextRequest) {
});
} catch (error) {
- console.error('❌ RFQ 첨부파일 다운로드 오류:', error);
+ const errorMessage = error instanceof Error ? error.message : String(error);
+
+ console.error('❌ RFQ 첨부파일 다운로드 오류:', {
+ error: errorMessage,
+ userId: (await getServerSession(authOptions))?.user?.id,
+ ip: requestInfo.ip,
+ path: request.nextUrl.searchParams.get("path"),
+ downloadDurationMs: Date.now() - startTime
+ });
+
+ // 에러 로그 기록
+ if (fileRecord?.id) {
+ try {
+ await createFileDownloadLog({
+ fileId: fileRecord.id,
+ success: false,
+ errorMessage,
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName: fileRecord.fileName || 'unknown',
+ filePath: request.nextUrl.searchParams.get("path") || '',
+ fileSize: fileRecord.fileSize || 0,
+ }
+ });
+ } catch (logError) {
+ console.error('로그 기록 실패:', logError);
+ }
+ }
+
+ // Zod 검증 에러 처리
+ if (error instanceof z.ZodError) {
+ return NextResponse.json(
+ {
+ error: 'Invalid request parameters',
+ details: error.errors.map(e => e.message).join(', ')
+ },
+ { status: 400 }
+ );
+ }
+
+ // 에러 정보 최소화 (정보 노출 방지)
return NextResponse.json(
{
- error: 'Failed to download file',
- details: error instanceof Error ? error.message : String(error)
+ error: 'Internal server error',
+ details: process.env.NODE_ENV === 'development' ? errorMessage : undefined
},
{ status: 500 }
);
diff --git a/app/api/rfq-download/route.ts b/app/api/rfq-download/route.ts
index 19991128..92607e05 100644
--- a/app/api/rfq-download/route.ts
+++ b/app/api/rfq-download/route.ts
@@ -1,85 +1,174 @@
// app/api/rfq-download/route.ts
import { NextRequest, NextResponse } from 'next/server';
-import { readFile, access, constants } from 'fs/promises';
-import { join } from 'path';
+import { readFile, access, constants, stat } from 'fs/promises';
+import { join, normalize, resolve } from 'path';
import db from '@/db/db';
import { rfqAttachments } from '@/db/schema/rfq';
import { eq } from 'drizzle-orm';
+import { getServerSession } from 'next-auth';
+import { authOptions } from '@/app/api/auth/[...nextauth]/route';
+import rateLimit from '@/lib/rate-limit'; // Rate limiting 함수
+import { createFileDownloadLog } from '@/lib/file-download-log/service';
+
+// 허용된 파일 확장자
+const ALLOWED_EXTENSIONS = new Set([
+ 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',
+ 'txt', 'csv', 'png', 'jpg', 'jpeg', 'gif'
+]);
+
+// 최대 파일 크기 (50MB)
+const MAX_FILE_SIZE = 50 * 1024 * 1024;
+
+// 파일 경로 검증 함수
+function validateFilePath(filePath: string): boolean {
+ // null, undefined, 빈 문자열 체크
+ if (!filePath || typeof filePath !== 'string') {
+ return false;
+ }
+
+ // 위험한 패턴 체크
+ const dangerousPatterns = [
+ /\.\./, // 상위 디렉토리 접근
+ /\/\//, // 이중 슬래시
+ /[<>:"'|?*]/, // 특수문자
+ /[\x00-\x1f]/, // 제어문자
+ /^\/+/, // 절대경로
+ /\\+/ // 백슬래시
+ ];
+
+ return !dangerousPatterns.some(pattern => pattern.test(filePath));
+}
+
+// 파일 확장자 검증
+function validateFileExtension(fileName: string): boolean {
+ const extension = fileName.split('.').pop()?.toLowerCase() || '';
+ return ALLOWED_EXTENSIONS.has(extension);
+}
+
+// 안전한 파일명 생성
+function sanitizeFileName(fileName: string): string {
+ return fileName
+ .replace(/[^\w\s.-]/g, '_') // 안전하지 않은 문자 제거
+ .replace(/\s+/g, '_') // 공백을 언더스코어로
+ .substring(0, 255); // 파일명 길이 제한
+}
+
+
export async function GET(request: NextRequest) {
try {
- // 파일 경로 파라미터 받기
- const path = request.nextUrl.searchParams.get("path");
-
- if (!path) {
+ // Rate limiting 체크
+ const limiterResult = await rateLimit(request);
+ if (!limiterResult.success) {
+ return NextResponse.json(
+ { error: "Too many requests" },
+ { status: 429 }
+ );
+ }
+
+ // 사용자 인증 확인
+ const session = await getServerSession(authOptions);
+ if (!session || !session.user) {
+ return NextResponse.json(
+ { error: "Unauthorized" },
+ { status: 401 }
+ );
+ }
+
+ // 파일 경로 파라미터 받기 및 검증
+ const rawPath = request.nextUrl.searchParams.get("path");
+
+ if (!rawPath) {
return NextResponse.json(
{ error: "File path is required" },
{ status: 400 }
);
}
-
- // DB에서 파일 정보 조회 (정확히 일치하는 filePath로 검색)
+
+ // 파일 경로 검증
+ if (!validateFilePath(rawPath)) {
+ return NextResponse.json(
+ { error: "Invalid file path" },
+ { status: 400 }
+ );
+ }
+
+ // 경로 정규화
+ const normalizedPath = normalize(rawPath.replace(/^\/+/, ""));
+
+ // DB에서 파일 정보 조회
const [dbRecord] = await db
.select({
+ id: rfqAttachments.id,
fileName: rfqAttachments.fileName,
- filePath: rfqAttachments.filePath
+ filePath: rfqAttachments.filePath,
})
.from(rfqAttachments)
- .where(eq(rfqAttachments.filePath, path));
-
- // 파일 정보 설정
- let fileName;
-
- if (dbRecord) {
- // DB에서 찾은 경우 원본 파일명 사용
- fileName = dbRecord.fileName;
- console.log("DB에서 원본 파일명 찾음:", fileName);
- } else {
- // DB에서 찾지 못한 경우 경로에서 파일명 추출
- fileName = path.split('/').pop() || 'download';
+ .where(eq(rfqAttachments.filePath, normalizedPath));
+
+ if (!dbRecord) {
+ return NextResponse.json(
+ { error: "File not found in database" },
+ { status: 404 }
+ );
}
-
- // 파일 경로 구성
- const storedPath = path.replace(/^\/+/, ""); // 앞쪽 슬래시 제거
-
- // 파일 경로 시도
- const possiblePaths = [
- join(process.cwd(), "public", storedPath)
- ];
-
- // 실제 파일 찾기
- let actualPath = null;
- for (const testPath of possiblePaths) {
- try {
- await access(testPath, constants.R_OK);
- actualPath = testPath;
- break;
- } catch (err) {
- console.log("❌ 경로에 파일 없음:", testPath);
- }
+
+ // 파일 확장자 검증
+ if (!validateFileExtension(dbRecord.fileName)) {
+ return NextResponse.json(
+ { error: "File type not allowed" },
+ { status: 403 }
+ );
+ }
+
+ // 사용자 권한 확인
+ const userId = session.user?.id || session.user?.email;
+ if (!userId) {
+ return NextResponse.json(
+ { error: "User ID not found" },
+ { status: 400 }
+ );
+ }
+
+ // 안전한 파일 경로 구성
+ const publicDir = resolve(process.cwd(), "public");
+ const fullPath = resolve(publicDir, normalizedPath);
+
+ // 경로 탐색 공격 방지 - public 디렉토리 외부 접근 차단
+ if (!fullPath.startsWith(publicDir)) {
+ return NextResponse.json(
+ { error: "Access denied" },
+ { status: 403 }
+ );
}
-
- if (!actualPath) {
+
+ // 파일 존재 및 읽기 권한 확인
+ try {
+ await access(fullPath, constants.R_OK);
+ } catch (error) {
return NextResponse.json(
- {
- error: "File not found on server",
- details: {
- path: path,
- triedPaths: possiblePaths
- }
- },
+ { error: "File not accessible" },
{ status: 404 }
);
}
-
- const fileBuffer = await readFile(actualPath);
-
+
+ // 파일 크기 확인
+ const stats = await stat(fullPath);
+ if (stats.size > MAX_FILE_SIZE) {
+ return NextResponse.json(
+ { error: "File too large" },
+ { status: 413 }
+ );
+ }
+
+ // 파일 읽기
+ const fileBuffer = await readFile(fullPath);
+
+ // 안전한 파일명 생성
+ const safeFileName = sanitizeFileName(dbRecord.fileName);
+
// MIME 타입 결정
- const fileExtension = fileName.split('.').pop()?.toLowerCase() || '';
-
- let contentType = 'application/octet-stream'; // 기본 바이너리
-
- // 확장자에 따른 MIME 타입 매핑
+ const fileExtension = safeFileName.split('.').pop()?.toLowerCase() || '';
const mimeTypes: Record<string, string> = {
'pdf': 'application/pdf',
'doc': 'application/msword',
@@ -88,33 +177,68 @@ export async function GET(request: NextRequest) {
'xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'ppt': 'application/vnd.ms-powerpoint',
'pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
- 'txt': 'text/plain',
- 'csv': 'text/csv',
+ 'txt': 'text/plain; charset=utf-8',
+ 'csv': 'text/csv; charset=utf-8',
'png': 'image/png',
'jpg': 'image/jpeg',
'jpeg': 'image/jpeg',
'gif': 'image/gif',
};
-
- contentType = mimeTypes[fileExtension] || contentType;
-
- // 다운로드용 헤더 설정
+
+ const contentType = mimeTypes[fileExtension] || 'application/octet-stream';
+
+ // 보안 헤더 설정
const headers = new Headers();
headers.set('Content-Type', contentType);
- headers.set('Content-Disposition', `attachment; filename="${encodeURIComponent(fileName)}"`);
+ headers.set('Content-Disposition', `attachment; filename*=UTF-8''${encodeURIComponent(safeFileName)}`);
headers.set('Content-Length', fileBuffer.length.toString());
-
+ headers.set('X-Content-Type-Options', 'nosniff');
+ headers.set('X-Frame-Options', 'DENY');
+ headers.set('X-XSS-Protection', '1; mode=block');
+ headers.set('Cache-Control', 'no-cache, no-store, must-revalidate');
+ headers.set('Pragma', 'no-cache');
+ headers.set('Expires', '0');
+
+ // 다운로드 로그 기록 (보안 감사를 위해)
+ console.log(`파일 다운로드: ${userId} - ${safeFileName} - ${new Date().toISOString()}`);
+
+ // 감사 로그 기록
+ await createFileDownloadLog({ fileId: dbRecord.id, success: true, fileInfo: { fileName: dbRecord.fileName, filePath: dbRecord.filePath } });
+
return new NextResponse(fileBuffer, {
status: 200,
headers,
});
+
} catch (error) {
console.error('❌ RFQ 파일 다운로드 오류:', error);
+
+ // 실패 감사 로그 기록
+ try {
+ const rawPath = request.nextUrl.searchParams.get("path");
+ if (rawPath) {
+ const normalizedPath = normalize(rawPath.replace(/^\/+/, ""));
+ const [dbRecord] = await db
+ .select({
+ id: rfqAttachments.id,
+ fileName: rfqAttachments.fileName,
+ filePath: rfqAttachments.filePath,
+ })
+ .from(rfqAttachments)
+ .where(eq(rfqAttachments.filePath, normalizedPath));
+
+ if (dbRecord) {
+ await createFileDownloadLog({ fileId: dbRecord.id, success: false, fileInfo: { fileName: dbRecord.fileName, filePath: dbRecord.filePath } });
+
+ }
+ }
+ } catch (logError) {
+ console.error('감사 로그 기록 실패:', logError);
+ }
+
+ // 에러 정보 최소화 (정보 노출 방지)
return NextResponse.json(
- {
- error: 'Failed to download file',
- details: String(error)
- },
+ { error: 'Internal server error' },
{ status: 500 }
);
}
diff --git a/app/api/tbe-download/route.ts b/app/api/tbe-download/route.ts
index 12e42920..93eb62db 100644
--- a/app/api/tbe-download/route.ts
+++ b/app/api/tbe-download/route.ts
@@ -1,119 +1,415 @@
-// app/api/rfq-download/route.ts
+// app/api/tbe-download/route.ts
import { NextRequest, NextResponse } from 'next/server';
-import { readFile, access, constants } from 'fs/promises';
-import { join } from 'path';
+import { readFile, access, constants, stat } from 'fs/promises';
+import { join, normalize, resolve } from 'path';
import db from '@/db/db';
import { rfqAttachments, vendorResponseAttachments } from '@/db/schema/rfq';
import { eq } from 'drizzle-orm';
+import { getServerSession } from 'next-auth';
+import { authOptions } from '@/app/api/auth/[...nextauth]/route';
+import { createFileDownloadLog } from '@/lib/file-download-log/service';
+import rateLimit from '@/lib/rate-limit';
+import { z } from 'zod';
+import { getRequestInfo } from '@/lib/network/get-client-ip';
+
+// 허용된 파일 확장자
+const ALLOWED_EXTENSIONS = new Set([
+ 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',
+ 'txt', 'csv', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'svg',
+ 'dwg', 'dxf', 'zip', 'rar', '7z'
+]);
+
+// 최대 파일 크기 (50MB)
+const MAX_FILE_SIZE = 50 * 1024 * 1024;
+
+// 다운로드 요청 검증 스키마
+const downloadRequestSchema = z.object({
+ path: z.string().min(1, 'File path is required'),
+});
+
+// 파일 정보 타입
+interface FileRecord {
+ id: number;
+ fileName: string;
+ filePath: string;
+ fileSize?: number;
+ fileType?: string;
+}
+
+
+// 강화된 파일 경로 검증 함수
+function validateFilePath(filePath: string): boolean {
+ // null, undefined, 빈 문자열 체크
+ if (!filePath || typeof filePath !== 'string') {
+ return false;
+ }
+
+ // 위험한 패턴 체크
+ const dangerousPatterns = [
+ /\.\./, // 상위 디렉토리 접근
+ /\/\//, // 이중 슬래시
+ /[<>:"'|?*]/, // 특수문자
+ /[\x00-\x1f]/, // 제어문자
+ /\\+/ // 백슬래시
+ ];
+
+ if (dangerousPatterns.some(pattern => pattern.test(filePath))) {
+ return false;
+ }
+
+ // 시스템 파일 접근 방지
+ const dangerousPaths = ['/etc', '/proc', '/sys', '/var', '/usr', '/root', '/home'];
+ for (const dangerousPath of dangerousPaths) {
+ if (filePath.toLowerCase().startsWith(dangerousPath)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+// 파일 확장자 검증
+function validateFileExtension(fileName: string): boolean {
+ const extension = fileName.split('.').pop()?.toLowerCase() || '';
+ return ALLOWED_EXTENSIONS.has(extension);
+}
+
+// 안전한 파일명 생성
+function sanitizeFileName(fileName: string): string {
+ return fileName
+ .replace(/[^\w\s.-]/g, '_') // 안전하지 않은 문자 제거
+ .replace(/\s+/g, '_') // 공백을 언더스코어로
+ .substring(0, 255); // 파일명 길이 제한
+}
export async function GET(request: NextRequest) {
+ const startTime = Date.now();
+ const requestInfo = getRequestInfo(request);
+ let fileRecord: FileRecord | null = null;
+
try {
- // 파일 경로 파라미터 받기
- const path = request.nextUrl.searchParams.get("path");
-
- if (!path) {
+ // Rate limiting 체크
+ const limiterResult = await rateLimit(request);
+ if (!limiterResult.success) {
+ console.warn('🚨 Rate limit 초과:', {
+ ip: requestInfo.ip,
+ userAgent: requestInfo.userAgent
+ });
+
+ return NextResponse.json(
+ { error: "Too many requests" },
+ { status: 429 }
+ );
+ }
+
+ // 세션 확인
+ const session = await getServerSession(authOptions);
+ if (!session?.user) {
+ console.warn('🚨 인증되지 않은 다운로드 시도:', {
+ ip: requestInfo.ip,
+ userAgent: requestInfo.userAgent,
+ path: request.nextUrl.searchParams.get("path")
+ });
+
+ return NextResponse.json(
+ { error: "Unauthorized" },
+ { status: 401 }
+ );
+ }
+
+ // 파라미터 검증
+ const searchParams = {
+ path: request.nextUrl.searchParams.get("path"),
+ };
+
+ const validatedParams = downloadRequestSchema.parse(searchParams);
+ const { path } = validatedParams;
+
+ // 파일 경로 보안 검증
+ if (!validateFilePath(path)) {
+ console.warn(`🚨 의심스러운 파일 경로 접근 시도: ${path}`, {
+ userId: session.user.id,
+ ip: requestInfo.ip,
+ userAgent: requestInfo.userAgent
+ });
+
return NextResponse.json(
- { error: "File path is required" },
+ { error: "Invalid file path" },
{ status: 400 }
);
}
-
+
+ // 경로 정규화
+ const normalizedPath = normalize(path.replace(/^\/+/, ""));
+
// DB에서 파일 정보 조회 (정확히 일치하는 filePath로 검색)
const [dbRecord] = await db
.select({
+ id: vendorResponseAttachments.id,
fileName: vendorResponseAttachments.fileName,
- filePath: vendorResponseAttachments.filePath
+ filePath: vendorResponseAttachments.filePath,
+ fileType: vendorResponseAttachments.fileType,
})
.from(vendorResponseAttachments)
- .where(eq(vendorResponseAttachments.filePath, path));
-
- // 파일 정보 설정
- let fileName;
-
- if (dbRecord) {
- // DB에서 찾은 경우 원본 파일명 사용
- fileName = dbRecord.fileName;
- console.log("DB에서 원본 파일명 찾음:", fileName);
- } else {
- // DB에서 찾지 못한 경우 경로에서 파일명 추출
- fileName = path.split('/').pop() || 'download';
+ .where(eq(vendorResponseAttachments.filePath, normalizedPath));
+
+ // DB에서 파일 정보를 찾지 못한 경우
+ if (!dbRecord) {
+ console.warn("⚠️ DB에서 파일 정보를 찾지 못함:", {
+ path,
+ normalizedPath,
+ userId: session.user.id,
+ ip: requestInfo.ip
+ });
+
+ return NextResponse.json(
+ { error: "File not found in database" },
+ { status: 404 }
+ );
}
-
- // 파일 경로 구성
- const storedPath = path.replace(/^\/+/, ""); // 앞쪽 슬래시 제거
-
- // 파일 경로 시도
- const possiblePaths = [
- join(process.cwd(), "public", storedPath)
- ];
-
- // 실제 파일 찾기
- let actualPath = null;
- for (const testPath of possiblePaths) {
+
+ fileRecord = dbRecord;
+
+ // 파일명 설정
+ const fileName = dbRecord.fileName;
+
+ // 파일 확장자 검증
+ if (!validateFileExtension(fileName)) {
+ console.warn(`🚨 허용되지 않은 파일 타입 다운로드 시도: ${fileName}`, {
+ userId: session.user.id,
+ ip: requestInfo.ip
+ });
+
+ // 실패 로그 기록
+ await createFileDownloadLog({
+ fileId: dbRecord.id,
+ success: false,
+ errorMessage: 'File type not allowed',
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName,
+ filePath: path,
+ fileSize: 0,
+ }
+ });
+
+ return NextResponse.json(
+ { error: "File type not allowed" },
+ { status: 403 }
+ );
+ }
+
+ // 안전한 파일 경로 구성
+ const allowedDirs = ["public", "uploads", "storage"];
+ let actualPath: string | null = null;
+ let baseDir: string | null = null;
+
+ // 각 허용된 디렉터리에서 파일 찾기
+ for (const dir of allowedDirs) {
+ baseDir = resolve(process.cwd(), dir);
+ const testPath = resolve(baseDir, normalizedPath);
+
+ // 경로 탐색 공격 방지 - 허용된 디렉터리 외부 접근 차단
+ if (!testPath.startsWith(baseDir)) {
+ continue;
+ }
+
try {
await access(testPath, constants.R_OK);
actualPath = testPath;
+ console.log("✅ 파일 발견:", testPath);
break;
} catch (err) {
console.log("❌ 경로에 파일 없음:", testPath);
}
}
-
- if (!actualPath) {
+
+ if (!actualPath || !baseDir) {
+ console.error("❌ 모든 경로에서 파일을 찾을 수 없음:", {
+ normalizedPath,
+ userId: session.user.id,
+ requestedPath: path,
+ triedDirs: allowedDirs
+ });
+
+ // 실패 로그 기록
+ await createFileDownloadLog({
+ fileId: dbRecord.id,
+ success: false,
+ errorMessage: 'File not found on server',
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName,
+ filePath: path,
+ fileSize: dbRecord.fileSize || 0,
+ }
+ });
+
return NextResponse.json(
- {
+ {
error: "File not found on server",
details: {
path: path,
- triedPaths: possiblePaths
+ fileName: fileName,
}
},
{ status: 404 }
);
}
-
+
+ // 파일 크기 확인
+ const stats = await stat(actualPath);
+ if (stats.size > MAX_FILE_SIZE) {
+ console.warn(`🚨 파일 크기 초과: ${fileName} (${stats.size} bytes)`, {
+ userId: session.user.id,
+ ip: requestInfo.ip
+ });
+
+ // 실패 로그 기록
+ await createFileDownloadLog({
+ fileId: dbRecord.id,
+ success: false,
+ errorMessage: 'File too large',
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName,
+ filePath: path,
+ fileSize: stats.size,
+ }
+ });
+
+ return NextResponse.json(
+ { error: "File too large" },
+ { status: 413 }
+ );
+ }
+
+ // 파일 읽기
const fileBuffer = await readFile(actualPath);
-
+
// MIME 타입 결정
const fileExtension = fileName.split('.').pop()?.toLowerCase() || '';
-
- let contentType = 'application/octet-stream'; // 기본 바이너리
-
- // 확장자에 따른 MIME 타입 매핑
- const mimeTypes: Record<string, string> = {
- 'pdf': 'application/pdf',
- 'doc': 'application/msword',
- 'docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
- 'xls': 'application/vnd.ms-excel',
- 'xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
- 'ppt': 'application/vnd.ms-powerpoint',
- 'pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
- 'txt': 'text/plain',
- 'csv': 'text/csv',
- 'png': 'image/png',
- 'jpg': 'image/jpeg',
- 'jpeg': 'image/jpeg',
- 'gif': 'image/gif',
- };
-
- contentType = mimeTypes[fileExtension] || contentType;
-
- // 다운로드용 헤더 설정
+ let contentType = dbRecord.fileType || 'application/octet-stream';
+
+ // 확장자에 따른 MIME 타입 매핑 (fallback)
+ if (!contentType || contentType === 'application/octet-stream') {
+ const mimeTypes: Record<string, string> = {
+ 'pdf': 'application/pdf',
+ 'doc': 'application/msword',
+ 'docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'xls': 'application/vnd.ms-excel',
+ 'xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'ppt': 'application/vnd.ms-powerpoint',
+ 'pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+ 'txt': 'text/plain; charset=utf-8',
+ 'csv': 'text/csv; charset=utf-8',
+ 'png': 'image/png',
+ 'jpg': 'image/jpeg',
+ 'jpeg': 'image/jpeg',
+ 'gif': 'image/gif',
+ 'bmp': 'image/bmp',
+ 'svg': 'image/svg+xml',
+ 'dwg': 'application/acad',
+ 'dxf': 'application/dxf',
+ 'zip': 'application/zip',
+ 'rar': 'application/x-rar-compressed',
+ '7z': 'application/x-7z-compressed',
+ };
+
+ contentType = mimeTypes[fileExtension] || 'application/octet-stream';
+ }
+
+ // 안전한 파일명 생성
+ const safeFileName = sanitizeFileName(fileName);
+
+ // 보안 헤더와 다운로드용 헤더 설정
const headers = new Headers();
headers.set('Content-Type', contentType);
- headers.set('Content-Disposition', `attachment; filename="${encodeURIComponent(fileName)}"`);
+ headers.set('Content-Disposition', `attachment; filename*=UTF-8''${encodeURIComponent(safeFileName)}`);
headers.set('Content-Length', fileBuffer.length.toString());
+ // 보안 헤더
+ headers.set('Cache-Control', 'no-cache, no-store, must-revalidate');
+ headers.set('Pragma', 'no-cache');
+ headers.set('Expires', '0');
+ headers.set('X-Content-Type-Options', 'nosniff');
+ headers.set('X-Frame-Options', 'DENY');
+ headers.set('X-XSS-Protection', '1; mode=block');
+ headers.set('Referrer-Policy', 'strict-origin-when-cross-origin');
+
+ // 성공 로그 기록
+ await createFileDownloadLog({
+ fileId: dbRecord.id,
+ success: true,
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName: safeFileName,
+ filePath: path,
+ fileSize: fileBuffer.length,
+ }
+ });
+
+ console.log("✅ TBE 파일 다운로드 성공:", {
+ fileName: safeFileName,
+ contentType,
+ size: fileBuffer.length,
+ actualPath,
+ userId: session.user.id,
+ ip: requestInfo.ip,
+ downloadDurationMs: Date.now() - startTime
+ });
+
return new NextResponse(fileBuffer, {
status: 200,
headers,
});
+
} catch (error) {
- console.error('❌ RFQ 파일 다운로드 오류:', error);
+ const errorMessage = error instanceof Error ? error.message : String(error);
+
+ console.error('❌ TBE 파일 다운로드 오류:', {
+ error: errorMessage,
+ userId: (await getServerSession(authOptions))?.user?.id,
+ ip: requestInfo.ip,
+ path: request.nextUrl.searchParams.get("path"),
+ downloadDurationMs: Date.now() - startTime
+ });
+
+ // 에러 로그 기록
+ if (fileRecord?.id) {
+ try {
+ await createFileDownloadLog({
+ fileId: fileRecord.id,
+ success: false,
+ errorMessage,
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName: fileRecord.fileName || 'unknown',
+ filePath: request.nextUrl.searchParams.get("path") || '',
+ fileSize: fileRecord.fileSize || 0,
+ }
+ });
+ } catch (logError) {
+ console.error('로그 기록 실패:', logError);
+ }
+ }
+
+ // Zod 검증 에러 처리
+ if (error instanceof z.ZodError) {
+ return NextResponse.json(
+ {
+ error: 'Invalid request parameters',
+ details: error.errors.map(e => e.message).join(', ')
+ },
+ { status: 400 }
+ );
+ }
+
+ // 에러 정보 최소화 (정보 노출 방지)
return NextResponse.json(
- {
- error: 'Failed to download file',
- details: String(error)
+ {
+ error: 'Internal server error',
+ details: process.env.NODE_ENV === 'development' ? errorMessage : undefined
},
{ status: 500 }
);
diff --git a/app/api/tech-sales-rfq-download/route.ts b/app/api/tech-sales-rfq-download/route.ts
index b9dd14d1..e0219787 100644
--- a/app/api/tech-sales-rfq-download/route.ts
+++ b/app/api/tech-sales-rfq-download/route.ts
@@ -1,85 +1,379 @@
-import { NextRequest } from "next/server"
-import { join } from "path"
-import { readFile } from "fs/promises"
+import { NextRequest, NextResponse } from "next/server";
+import { join, normalize, resolve } from "path";
+import { readFile, access, constants, stat } from "fs/promises";
+import { getServerSession } from 'next-auth';
+import { authOptions } from '@/app/api/auth/[...nextauth]/route';
+import { createFileDownloadLog } from '@/lib/file-download-log/service';
+import rateLimit from '@/lib/rate-limit';
+import { z } from 'zod';
+import { getRequestInfo } from "@/lib/network/get-client-ip";
-export async function GET(request: NextRequest) {
- try {
- const searchParams = request.nextUrl.searchParams
- const filePath = searchParams.get("path")
+// 허용된 파일 확장자
+const ALLOWED_EXTENSIONS = new Set([
+ 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',
+ 'txt', 'csv', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'svg',
+ 'dwg', 'dxf', 'zip', 'rar', '7z'
+]);
- if (!filePath) {
- return new Response("File path is required", { status: 400 })
- }
+// 최대 파일 크기 (50MB)
+const MAX_FILE_SIZE = 50 * 1024 * 1024;
+
+// 다운로드 요청 검증 스키마
+const downloadRequestSchema = z.object({
+ path: z.string()
+ .min(1, 'File path is required')
+ .refine(path => path.startsWith("/techsales-rfq/"), {
+ message: 'Invalid file path - must start with /techsales-rfq/'
+ })
+ .refine(path => !path.includes(".."), {
+ message: 'Invalid file path - directory traversal not allowed'
+ }),
+});
+
+
+// 강화된 파일 경로 검증
+function validateFilePath(filePath: string): boolean {
+ // null, undefined, 빈 문자열 체크
+ if (!filePath || typeof filePath !== 'string') {
+ return false;
+ }
+
+ // 위험한 패턴 체크
+ const dangerousPatterns = [
+ /\.\./, // 상위 디렉토리 접근
+ /\/\//, // 이중 슬래시
+ /[<>:"'|?*]/, // 특수문자
+ /[\x00-\x1f]/, // 제어문자
+ /\\+/ // 백슬래시
+ ];
- // 보안: 경로 조작 방지
- if (filePath.includes("..") || !filePath.startsWith("/techsales-rfq/")) {
- return new Response("Invalid file path", { status: 400 })
+ if (dangerousPatterns.some(pattern => pattern.test(filePath))) {
+ return false;
+ }
+
+ // techsales-rfq 경로만 허용
+ if (!filePath.startsWith('/techsales-rfq/')) {
+ return false;
+ }
+
+ // 시스템 파일 접근 방지
+ const dangerousPaths = ['/etc', '/proc', '/sys', '/var', '/usr', '/root', '/home'];
+ for (const dangerousPath of dangerousPaths) {
+ if (filePath.toLowerCase().includes(dangerousPath)) {
+ return false;
}
+ }
+
+ return true;
+}
- // 파일 경로 구성 (public 폴더 기준)
- const fullPath = join(process.cwd(), "public", filePath)
+// 파일 확장자 검증
+function validateFileExtension(fileName: string): boolean {
+ const extension = fileName.split('.').pop()?.toLowerCase() || '';
+ return ALLOWED_EXTENSIONS.has(extension);
+}
- try {
- // 파일 읽기
- const fileBuffer = await readFile(fullPath)
+// 안전한 파일명 생성
+function sanitizeFileName(fileName: string): string {
+ return fileName
+ .replace(/[^\w\s.-]/g, '_') // 안전하지 않은 문자 제거
+ .replace(/\s+/g, '_') // 공백을 언더스코어로
+ .substring(0, 255); // 파일명 길이 제한
+}
+
+// MIME 타입 결정
+function getMimeType(fileName: string): string {
+ const ext = fileName.split(".").pop()?.toLowerCase();
+
+ const mimeTypes: Record<string, string> = {
+ 'pdf': 'application/pdf',
+ 'doc': 'application/msword',
+ 'docx': 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'xls': 'application/vnd.ms-excel',
+ 'xlsx': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'ppt': 'application/vnd.ms-powerpoint',
+ 'pptx': 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
+ 'txt': 'text/plain; charset=utf-8',
+ 'csv': 'text/csv; charset=utf-8',
+ 'png': 'image/png',
+ 'jpg': 'image/jpeg',
+ 'jpeg': 'image/jpeg',
+ 'gif': 'image/gif',
+ 'bmp': 'image/bmp',
+ 'svg': 'image/svg+xml',
+ 'dwg': 'application/acad',
+ 'dxf': 'application/dxf',
+ 'zip': 'application/zip',
+ 'rar': 'application/x-rar-compressed',
+ '7z': 'application/x-7z-compressed',
+ };
+
+ return mimeTypes[ext || ''] || 'application/octet-stream';
+}
+
+export async function GET(request: NextRequest) {
+ const startTime = Date.now();
+ const requestInfo = getRequestInfo(request);
+
+ try {
+ // Rate limiting 체크
+ const limiterResult = await rateLimit(request);
+ if (!limiterResult.success) {
+ console.warn('🚨 Rate limit 초과:', {
+ ip: requestInfo.ip,
+ userAgent: requestInfo.userAgent
+ });
- // 파일명 추출
- const fileName = filePath.split("/").pop() || "download"
+ return NextResponse.json(
+ { error: "Too many requests" },
+ { status: 429 }
+ );
+ }
+
+ // 세션 확인
+ const session = await getServerSession(authOptions);
+ if (!session?.user) {
+ console.warn('🚨 인증되지 않은 다운로드 시도:', {
+ ip: requestInfo.ip,
+ userAgent: requestInfo.userAgent,
+ path: request.nextUrl.searchParams.get("path")
+ });
- // MIME 타입 결정
- const ext = fileName.split(".").pop()?.toLowerCase()
- let contentType = "application/octet-stream"
+ return NextResponse.json(
+ { error: "Unauthorized" },
+ { status: 401 }
+ );
+ }
+
+ // 파라미터 검증
+ const searchParams = request.nextUrl.searchParams;
+ const filePath = searchParams.get("path");
+
+ const validatedParams = downloadRequestSchema.parse({ path: filePath });
+ const { path } = validatedParams;
+
+ // 추가 보안 검증
+ if (!validateFilePath(path)) {
+ console.warn(`🚨 의심스러운 파일 경로 접근 시도: ${path}`, {
+ userId: session.user.id,
+ ip: requestInfo.ip,
+ userAgent: requestInfo.userAgent
+ });
- switch (ext) {
- case "pdf":
- contentType = "application/pdf"
- break
- case "doc":
- contentType = "application/msword"
- break
- case "docx":
- contentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
- break
- case "xls":
- contentType = "application/vnd.ms-excel"
- break
- case "xlsx":
- contentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
- break
- case "jpg":
- case "jpeg":
- contentType = "image/jpeg"
- break
- case "png":
- contentType = "image/png"
- break
- case "gif":
- contentType = "image/gif"
- break
- case "txt":
- contentType = "text/plain"
- break
- case "zip":
- contentType = "application/zip"
- break
- default:
- contentType = "application/octet-stream"
+ return NextResponse.json(
+ { error: "Invalid file path" },
+ { status: 400 }
+ );
+ }
+
+ // 경로 정규화
+ const normalizedPath = normalize(path);
+
+ // 파일명 추출 및 검증
+ const fileName = path.split("/").pop() || "download";
+
+ // 파일 확장자 검증
+ if (!validateFileExtension(fileName)) {
+ console.warn(`🚨 허용되지 않은 파일 타입 다운로드 시도: ${fileName}`, {
+ userId: session.user.id,
+ ip: requestInfo.ip
+ });
+
+ // 실패 로그 기록
+ await createFileDownloadLog({
+ fileId: 0, // techsales 파일은 별도 ID가 없으므로 0으로 기록
+ success: false,
+ errorMessage: 'File type not allowed',
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName,
+ filePath: path,
+ fileSize: 0,
+ }
+ });
+
+ return NextResponse.json(
+ { error: "File type not allowed" },
+ { status: 403 }
+ );
+ }
+
+ // 안전한 파일 경로 구성
+ const allowedDirs = ["public"];
+ let actualPath: string | null = null;
+ let baseDir: string | null = null;
+
+ // 허용된 디렉터리에서 파일 찾기
+ for (const dir of allowedDirs) {
+ baseDir = resolve(process.cwd(), dir);
+ const testPath = resolve(baseDir, normalizedPath.substring(1)); // leading slash 제거
+
+ // 경로 탐색 공격 방지 - 허용된 디렉터리 외부 접근 차단
+ if (!testPath.startsWith(baseDir)) {
+ continue;
+ }
+
+ try {
+ await access(testPath, constants.R_OK);
+ actualPath = testPath;
+ console.log("✅ 파일 발견:", testPath);
+ break;
+ } catch (err) {
+ // 조용히 다음 경로 시도
}
+ }
+
+ if (!actualPath || !baseDir) {
+ console.error("❌ 파일 접근 불가:", {
+ normalizedPath,
+ userId: session.user.id,
+ requestedPath: path,
+ triedDirs: allowedDirs
+ });
+
+ // 실패 로그 기록
+ await createFileDownloadLog({
+ fileId: 0,
+ success: false,
+ errorMessage: 'File not found on server',
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName,
+ filePath: path,
+ fileSize: 0,
+ }
+ });
- // 응답 헤더 설정
- const headers = new Headers({
- "Content-Type": contentType,
- "Content-Disposition": `attachment; filename="${encodeURIComponent(fileName)}"`,
- "Content-Length": fileBuffer.length.toString(),
- })
-
- return new Response(fileBuffer, { headers })
- } catch (fileError) {
- console.error("File read error:", fileError)
- return new Response("File not found", { status: 404 })
+ return NextResponse.json(
+ { error: "File not found" },
+ { status: 404 }
+ );
}
+
+ // 파일 크기 확인
+ const stats = await stat(actualPath);
+ if (stats.size > MAX_FILE_SIZE) {
+ console.warn(`🚨 파일 크기 초과: ${fileName} (${stats.size} bytes)`, {
+ userId: session.user.id,
+ ip: requestInfo.ip
+ });
+
+ // 실패 로그 기록
+ await createFileDownloadLog({
+ fileId: 0,
+ success: false,
+ errorMessage: 'File too large',
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName,
+ filePath: path,
+ fileSize: stats.size,
+ }
+ });
+
+ return NextResponse.json(
+ { error: "File too large" },
+ { status: 413 }
+ );
+ }
+
+ // 파일 읽기
+ const fileBuffer = await readFile(actualPath);
+
+ // MIME 타입 결정
+ const contentType = getMimeType(fileName);
+
+ // 안전한 파일명 생성 (특수문자 처리)
+ const safeFileName = sanitizeFileName(fileName);
+
+ // 보안 헤더와 다운로드용 헤더 설정
+ const headers = new Headers({
+ 'Content-Type': contentType,
+ 'Content-Disposition': `attachment; filename*=UTF-8''${encodeURIComponent(safeFileName)}`,
+ 'Content-Length': fileBuffer.length.toString(),
+
+ // 보안 헤더
+ 'Cache-Control': 'no-cache, no-store, must-revalidate',
+ 'Pragma': 'no-cache',
+ 'Expires': '0',
+ 'X-Content-Type-Options': 'nosniff',
+ 'X-Frame-Options': 'DENY',
+ 'X-XSS-Protection': '1; mode=block',
+ 'Referrer-Policy': 'strict-origin-when-cross-origin',
+ });
+
+ // 성공 로그 기록
+ await createFileDownloadLog({
+ fileId: 0, // techsales 파일용 ID
+ success: true,
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName: safeFileName,
+ filePath: path,
+ fileSize: fileBuffer.length,
+ }
+ });
+
+ console.log("✅ 파일 다운로드 성공:", {
+ fileName: safeFileName,
+ contentType,
+ size: fileBuffer.length,
+ actualPath,
+ userId: session.user.id,
+ ip: requestInfo.ip,
+ downloadDurationMs: Date.now() - startTime
+ });
+
+ return new Response(fileBuffer, { headers });
+
} catch (error) {
- console.error("Download error:", error)
- return new Response("Internal server error", { status: 500 })
+ const errorMessage = error instanceof Error ? error.message : String(error);
+
+ console.error('❌ Techsales 파일 다운로드 오류:', {
+ error: errorMessage,
+ userId: (await getServerSession(authOptions))?.user?.id,
+ ip: requestInfo.ip,
+ path: request.nextUrl.searchParams.get("path"),
+ downloadDurationMs: Date.now() - startTime
+ });
+
+ // 에러 로그 기록
+ try {
+ const filePath = request.nextUrl.searchParams.get("path") || '';
+ const fileName = filePath.split("/").pop() || 'unknown';
+
+ await createFileDownloadLog({
+ fileId: 0,
+ success: false,
+ errorMessage,
+ requestId: requestInfo.requestId,
+ fileInfo: {
+ fileName,
+ filePath,
+ fileSize: 0,
+ }
+ });
+ } catch (logError) {
+ console.error('로그 기록 실패:', logError);
+ }
+
+ // Zod 검증 에러 처리
+ if (error instanceof z.ZodError) {
+ return NextResponse.json(
+ {
+ error: 'Invalid request parameters',
+ details: error.errors.map(e => e.message).join(', ')
+ },
+ { status: 400 }
+ );
+ }
+
+ return NextResponse.json(
+ {
+ error: 'Internal server error',
+ details: process.env.NODE_ENV === 'development' ? errorMessage : undefined
+ },
+ { status: 500 }
+ );
}
-} \ No newline at end of file
+} \ No newline at end of file
diff --git a/components/layout/Header.tsx b/components/layout/Header.tsx
index 45768a57..a686da7a 100644
--- a/components/layout/Header.tsx
+++ b/components/layout/Header.tsx
@@ -43,6 +43,7 @@ import { CommandMenu } from "./command-menu";
import { useSession, signOut } from "next-auth/react";
import GroupedMenuRenderer from "./GroupedMenuRender";
import { useActiveMenus, filterActiveMenus, filterActiveAdditionalMenus } from "@/hooks/use-active-menus";
+import { NotificationDropdown } from "./NotificationDropdown";
export function Header() {
const params = useParams();
@@ -235,10 +236,7 @@ export function Header() {
</Button>
{/* 알림 버튼 */}
- <Button variant="ghost" size="icon" className="relative" aria-label="Notifications">
- <BellIcon className="h-5 w-5" />
- <span className="absolute -top-1 -right-1 inline-flex h-2 w-2 rounded-full bg-red-500"></span>
- </Button>
+ <NotificationDropdown />
{/* 사용자 메뉴 */}
<DropdownMenu>
diff --git a/components/layout/NotificationDropdown.tsx b/components/layout/NotificationDropdown.tsx
new file mode 100644
index 00000000..1030bbc0
--- /dev/null
+++ b/components/layout/NotificationDropdown.tsx
@@ -0,0 +1,146 @@
+"use client";
+
+import * as React from "react";
+import { BellIcon, CheckIcon, MoreHorizontal } from "lucide-react";
+import { Button } from "@/components/ui/button";
+import {
+ DropdownMenu,
+ DropdownMenuContent,
+ DropdownMenuItem,
+ DropdownMenuLabel,
+ DropdownMenuSeparator,
+ DropdownMenuTrigger,
+} from "@/components/ui/dropdown-menu";
+import { Badge } from "@/components/ui/badge";
+import { ScrollArea } from "@/components/ui/scroll-area";
+import { formatDistanceToNow } from "date-fns";
+import { ko } from "date-fns/locale";
+import { useNotifications } from "@/lib/notification/NotificationContext";
+
+export function NotificationDropdown() {
+ const { notifications, unreadCount, markAsRead, markAllAsRead } = useNotifications();
+
+ const handleNotificationClick = (notification: any) => {
+ if (!notification.isRead) {
+ markAsRead(notification.id);
+ }
+
+ // 관련 레코드로 이동
+ if (notification.relatedRecordId && notification.relatedRecordType) {
+ const url = getNotificationUrl(notification.relatedRecordType, notification.relatedRecordId);
+ window.location.href = url;
+ }
+ };
+
+ const getNotificationUrl = (type: string, id: string) => {
+ const baseUrl = window.location.pathname.split('/').slice(0, 3).join('/');
+
+ switch (type) {
+ case 'project':
+ return `${baseUrl}/projects/${id}`;
+ case 'task':
+ return `${baseUrl}/tasks/${id}`;
+ case 'order':
+ return `${baseUrl}/orders/${id}`;
+ default:
+ return baseUrl;
+ }
+ };
+
+ const getNotificationIcon = (type: string) => {
+ switch (type) {
+ case 'assignment':
+ return '📝';
+ case 'update':
+ return '🔄';
+ case 'reminder':
+ return '⏰';
+ case 'approval':
+ return '✅';
+ default:
+ return '🔔';
+ }
+ };
+
+ return (
+ <DropdownMenu>
+ <DropdownMenuTrigger asChild>
+ <Button variant="ghost" size="icon" className="relative" aria-label="Notifications">
+ <BellIcon className="h-5 w-5" />
+ {unreadCount > 0 && (
+ <Badge
+ variant="destructive"
+ className="absolute -top-1 -right-1 h-5 w-5 flex items-center justify-center p-0 text-xs"
+ >
+ {unreadCount > 99 ? '99+' : unreadCount}
+ </Badge>
+ )}
+ </Button>
+ </DropdownMenuTrigger>
+ <DropdownMenuContent className="w-80" align="end">
+ <div className="flex items-center justify-between p-2">
+ <DropdownMenuLabel className="p-0">알림</DropdownMenuLabel>
+ {unreadCount > 0 && (
+ <Button
+ variant="ghost"
+ size="sm"
+ onClick={markAllAsRead}
+ className="h-auto p-1 text-xs"
+ >
+ 모두 읽음
+ </Button>
+ )}
+ </div>
+ <DropdownMenuSeparator />
+
+ {notifications.length === 0 ? (
+ <div className="p-4 text-center text-sm text-muted-foreground">
+ 새로운 알림이 없습니다
+ </div>
+ ) : (
+ <ScrollArea className="h-80">
+ {notifications.slice(0, 10).map((notification) => (
+ <DropdownMenuItem
+ key={notification.id}
+ className="p-0 cursor-pointer"
+ onSelect={() => handleNotificationClick(notification)}
+ >
+ <div className={`w-full p-3 ${!notification.isRead ? 'bg-blue-50 dark:bg-blue-950/20' : ''}`}>
+ <div className="flex items-start gap-3">
+ <div className="text-lg">
+ {getNotificationIcon(notification.type)}
+ </div>
+ <div className="flex-1 min-w-0">
+ <div className="flex items-center justify-between">
+ <p className="text-sm font-medium truncate">
+ {notification.title}
+ </p>
+ {!notification.isRead && (
+ <div className="w-2 h-2 bg-blue-500 rounded-full flex-shrink-0 ml-2" />
+ )}
+ </div>
+ <p className="text-xs text-muted-foreground mt-1 line-clamp-2">
+ {notification.message}
+ </p>
+ <p className="text-xs text-muted-foreground mt-2">
+ {formatDistanceToNow(new Date(notification.createdAt), {
+ addSuffix: true,
+ locale: ko
+ })}
+ </p>
+ </div>
+ </div>
+ </div>
+ </DropdownMenuItem>
+ ))}
+ {notifications.length > 10 && (
+ <DropdownMenuItem className="p-3 text-center text-sm text-muted-foreground">
+ 더 많은 알림 보기...
+ </DropdownMenuItem>
+ )}
+ </ScrollArea>
+ )}
+ </DropdownMenuContent>
+ </DropdownMenu>
+ );
+} \ No newline at end of file
diff --git a/components/layout/providers.tsx b/components/layout/providers.tsx
index ca6f5c21..11ca23f0 100644
--- a/components/layout/providers.tsx
+++ b/components/layout/providers.tsx
@@ -11,6 +11,7 @@ import { TooltipProvider } from "@/components/ui/tooltip"
import { SessionManager } from "@/components/layout/SessionManager" // ✅ SessionManager 추가
import createEmotionCache from './createEmotionCashe'
import { PageVisitTracker } from "../tracking/page-visit-tracker"
+import { NotificationProvider } from "@/lib/notification/NotificationContext"
const cache = createEmotionCache()
@@ -66,7 +67,9 @@ export function ThemeProvider({
{/* ✅ 간소화된 SWR 설정 적용 */}
<SWRConfig value={swrConfig}>
<PageVisitTracker>
- {children}
+ <NotificationProvider>
+ {children}
+ </NotificationProvider>
</PageVisitTracker>
{/* ✅ SessionManager 추가 - 모든 프로바이더 내부에 위치 */}
<SessionManager lng={lng} />
diff --git a/db/migrations/0213_ordinary_orphan.sql b/db/migrations/0213_ordinary_orphan.sql
new file mode 100644
index 00000000..682418ed
--- /dev/null
+++ b/db/migrations/0213_ordinary_orphan.sql
@@ -0,0 +1,17 @@
+CREATE TABLE "notifications" (
+ "id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
+ "user_id" varchar(255) NOT NULL,
+ "title" varchar(255) NOT NULL,
+ "message" text NOT NULL,
+ "type" varchar(50) NOT NULL,
+ "related_record_id" varchar(255),
+ "related_record_type" varchar(100),
+ "is_read" boolean DEFAULT false NOT NULL,
+ "created_at" timestamp DEFAULT now() NOT NULL,
+ "read_at" timestamp
+);
+--> statement-breakpoint
+CREATE INDEX "idx_notifications_user_id" ON "notifications" USING btree ("user_id");--> statement-breakpoint
+CREATE INDEX "idx_notifications_created_at" ON "notifications" USING btree ("created_at" DESC NULLS LAST);--> statement-breakpoint
+CREATE INDEX "idx_notifications_is_read" ON "notifications" USING btree ("is_read");--> statement-breakpoint
+CREATE INDEX "idx_notifications_user_read" ON "notifications" USING btree ("user_id","is_read"); \ No newline at end of file
diff --git a/db/migrations/meta/0213_snapshot.json b/db/migrations/meta/0213_snapshot.json
new file mode 100644
index 00000000..f5edd732
--- /dev/null
+++ b/db/migrations/meta/0213_snapshot.json
@@ -0,0 +1,38995 @@
+{
+ "id": "9f73712d-cc81-46aa-9938-20bcd8605cfa",
+ "prevId": "0ec47853-d03d-45ba-b977-e28e56b755ca",
+ "version": "7",
+ "dialect": "postgresql",
+ "tables": {
+ "public.companies": {
+ "name": "companies",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "companies_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "taxID": {
+ "name": "taxID",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.contract_envelopes": {
+ "name": "contract_envelopes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "contract_envelopes_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "contract_id": {
+ "name": "contract_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "envelope_id": {
+ "name": "envelope_id",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "document_id": {
+ "name": "document_id",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "envelope_status": {
+ "name": "envelope_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "contract_envelopes_contract_id_contracts_id_fk": {
+ "name": "contract_envelopes_contract_id_contracts_id_fk",
+ "tableFrom": "contract_envelopes",
+ "tableTo": "contracts",
+ "columnsFrom": [
+ "contract_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.contract_items": {
+ "name": "contract_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "contract_items_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "contract_id": {
+ "name": "contract_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_id": {
+ "name": "item_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quantity": {
+ "name": "quantity",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "unit_price": {
+ "name": "unit_price",
+ "type": "numeric(10, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_rate": {
+ "name": "tax_rate",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_amount": {
+ "name": "tax_amount",
+ "type": "numeric(10, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_line_amount": {
+ "name": "total_line_amount",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "contract_items_contract_item_idx": {
+ "name": "contract_items_contract_item_idx",
+ "columns": [
+ {
+ "expression": "contract_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "item_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "contract_items_contract_id_contracts_id_fk": {
+ "name": "contract_items_contract_id_contracts_id_fk",
+ "tableFrom": "contract_items",
+ "tableTo": "contracts",
+ "columnsFrom": [
+ "contract_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "contract_items_item_id_items_id_fk": {
+ "name": "contract_items_item_id_items_id_fk",
+ "tableFrom": "contract_items",
+ "tableTo": "items",
+ "columnsFrom": [
+ "item_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "contract_items_contract_id_item_id_unique": {
+ "name": "contract_items_contract_id_item_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "contract_id",
+ "item_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.contract_signers": {
+ "name": "contract_signers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "contract_signers_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "envelope_id": {
+ "name": "envelope_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_contact_id": {
+ "name": "vendor_contact_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signer_type": {
+ "name": "signer_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'VENDOR'"
+ },
+ "signer_email": {
+ "name": "signer_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "signer_name": {
+ "name": "signer_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "signer_position": {
+ "name": "signer_position",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "signer_status": {
+ "name": "signer_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'PENDING'"
+ },
+ "signed_at": {
+ "name": "signed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "contract_signers_envelope_id_contract_envelopes_id_fk": {
+ "name": "contract_signers_envelope_id_contract_envelopes_id_fk",
+ "tableFrom": "contract_signers",
+ "tableTo": "contract_envelopes",
+ "columnsFrom": [
+ "envelope_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "contract_signers_vendor_contact_id_vendor_contacts_id_fk": {
+ "name": "contract_signers_vendor_contact_id_vendor_contacts_id_fk",
+ "tableFrom": "contract_signers",
+ "tableTo": "vendor_contacts",
+ "columnsFrom": [
+ "vendor_contact_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.contracts": {
+ "name": "contracts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "contracts_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contract_no": {
+ "name": "contract_no",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contract_name": {
+ "name": "contract_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ACTIVE'"
+ },
+ "start_date": {
+ "name": "start_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "end_date": {
+ "name": "end_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payment_terms": {
+ "name": "payment_terms",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_terms": {
+ "name": "delivery_terms",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_date": {
+ "name": "delivery_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_location": {
+ "name": "delivery_location",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'KRW'"
+ },
+ "total_amount": {
+ "name": "total_amount",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discount": {
+ "name": "discount",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax": {
+ "name": "tax",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shipping_fee": {
+ "name": "shipping_fee",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_total": {
+ "name": "net_total",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "partial_shipping_allowed": {
+ "name": "partial_shipping_allowed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "partial_payment_allowed": {
+ "name": "partial_payment_allowed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "remarks": {
+ "name": "remarks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "contracts_project_id_projects_id_fk": {
+ "name": "contracts_project_id_projects_id_fk",
+ "tableFrom": "contracts",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "contracts_vendor_id_vendors_id_fk": {
+ "name": "contracts_vendor_id_vendors_id_fk",
+ "tableFrom": "contracts",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "contracts_contract_no_unique": {
+ "name": "contracts_contract_no_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "contract_no"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.poa": {
+ "name": "poa",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "poa_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "contract_no": {
+ "name": "contract_no",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "original_contract_no": {
+ "name": "original_contract_no",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "original_contract_name": {
+ "name": "original_contract_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "original_status": {
+ "name": "original_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "delivery_terms": {
+ "name": "delivery_terms",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_date": {
+ "name": "delivery_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_location": {
+ "name": "delivery_location",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_amount": {
+ "name": "total_amount",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discount": {
+ "name": "discount",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax": {
+ "name": "tax",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shipping_fee": {
+ "name": "shipping_fee",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_total": {
+ "name": "net_total",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "change_reason": {
+ "name": "change_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "approval_status": {
+ "name": "approval_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'PENDING'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "poa_original_contract_no_contracts_contract_no_fk": {
+ "name": "poa_original_contract_no_contracts_contract_no_fk",
+ "tableFrom": "poa",
+ "tableTo": "contracts",
+ "columnsFrom": [
+ "original_contract_no"
+ ],
+ "columnsTo": [
+ "contract_no"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "poa_project_id_projects_id_fk": {
+ "name": "poa_project_id_projects_id_fk",
+ "tableFrom": "poa",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "poa_vendor_id_vendors_id_fk": {
+ "name": "poa_vendor_id_vendors_id_fk",
+ "tableFrom": "poa",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.item_offshore_hull": {
+ "name": "item_offshore_hull",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "work_type": {
+ "name": "work_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_list": {
+ "name": "item_list",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub_item_list": {
+ "name": "sub_item_list",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.item_offshore_top": {
+ "name": "item_offshore_top",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "work_type": {
+ "name": "work_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_list": {
+ "name": "item_list",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub_item_list": {
+ "name": "sub_item_list",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.item_shipbuilding": {
+ "name": "item_shipbuilding",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "work_type": {
+ "name": "work_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_list": {
+ "name": "item_list",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ship_types": {
+ "name": "ship_types",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'OPTION'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.items": {
+ "name": "items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_no": {
+ "name": "project_no",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_name": {
+ "name": "item_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "package_code": {
+ "name": "package_code",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sm_code": {
+ "name": "sm_code",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_item_code": {
+ "name": "parent_item_code",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_level": {
+ "name": "item_level",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delete_flag": {
+ "name": "delete_flag",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "unit_of_measure": {
+ "name": "unit_of_measure",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "steel_type": {
+ "name": "steel_type",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "grade_material": {
+ "name": "grade_material",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "change_date": {
+ "name": "change_date",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "base_unit_of_measure": {
+ "name": "base_unit_of_measure",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "project_item_unique": {
+ "name": "project_item_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "project_no",
+ "item_code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.materials": {
+ "name": "materials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_name": {
+ "name": "item_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "parent_item_code": {
+ "name": "parent_item_code",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_level": {
+ "name": "item_level",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delete_flag": {
+ "name": "delete_flag",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "unit_of_measure": {
+ "name": "unit_of_measure",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "steel_type": {
+ "name": "steel_type",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "grade_material": {
+ "name": "grade_material",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "change_date": {
+ "name": "change_date",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "base_unit_of_measure": {
+ "name": "base_unit_of_measure",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "materials_item_code_unique": {
+ "name": "materials_item_code_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "item_code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.pq_criterias": {
+ "name": "pq_criterias",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "code": {
+ "name": "code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "check_point": {
+ "name": "check_point",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remarks": {
+ "name": "remarks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "group_name": {
+ "name": "group_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.pq_criterias_extension": {
+ "name": "pq_criterias_extension",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "pq_criteria_id": {
+ "name": "pq_criteria_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contract_info": {
+ "name": "contract_info",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "additional_requirement": {
+ "name": "additional_requirement",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "pq_criterias_extension_pq_criteria_id_pq_criterias_id_fk": {
+ "name": "pq_criterias_extension_pq_criteria_id_pq_criterias_id_fk",
+ "tableFrom": "pq_criterias_extension",
+ "tableTo": "pq_criterias",
+ "columnsFrom": [
+ "pq_criteria_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "pq_criterias_extension_project_id_projects_id_fk": {
+ "name": "pq_criterias_extension_project_id_projects_id_fk",
+ "tableFrom": "pq_criterias_extension",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_criteria_attachments": {
+ "name": "vendor_criteria_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_criteria_answer_id": {
+ "name": "vendor_criteria_answer_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_criteria_attachments_vendor_criteria_answer_id_vendor_pq_criteria_answers_id_fk": {
+ "name": "vendor_criteria_attachments_vendor_criteria_answer_id_vendor_pq_criteria_answers_id_fk",
+ "tableFrom": "vendor_criteria_attachments",
+ "tableTo": "vendor_pq_criteria_answers",
+ "columnsFrom": [
+ "vendor_criteria_answer_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_investigation_attachments": {
+ "name": "vendor_investigation_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "investigation_id": {
+ "name": "investigation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mime_type": {
+ "name": "mime_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_type": {
+ "name": "attachment_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'REPORT'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_investigation_attachments_investigation_id_vendor_investigations_id_fk": {
+ "name": "vendor_investigation_attachments_investigation_id_vendor_investigations_id_fk",
+ "tableFrom": "vendor_investigation_attachments",
+ "tableTo": "vendor_investigations",
+ "columnsFrom": [
+ "investigation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_investigations": {
+ "name": "vendor_investigations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pq_submission_id": {
+ "name": "pq_submission_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requester_id": {
+ "name": "requester_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "qm_manager_id": {
+ "name": "qm_manager_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "investigation_status": {
+ "name": "investigation_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PLANNED'"
+ },
+ "evaluation_type": {
+ "name": "evaluation_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "investigation_address": {
+ "name": "investigation_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "investigation_method": {
+ "name": "investigation_method",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scheduled_start_at": {
+ "name": "scheduled_start_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scheduled_end_at": {
+ "name": "scheduled_end_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "forecasted_at": {
+ "name": "forecasted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requested_at": {
+ "name": "requested_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirmed_at": {
+ "name": "confirmed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_score": {
+ "name": "evaluation_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_result": {
+ "name": "evaluation_result",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "investigation_notes": {
+ "name": "investigation_notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_investigations_vendor_id_vendors_id_fk": {
+ "name": "vendor_investigations_vendor_id_vendors_id_fk",
+ "tableFrom": "vendor_investigations",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "vendor_investigations_pq_submission_id_vendor_pq_submissions_id_fk": {
+ "name": "vendor_investigations_pq_submission_id_vendor_pq_submissions_id_fk",
+ "tableFrom": "vendor_investigations",
+ "tableTo": "vendor_pq_submissions",
+ "columnsFrom": [
+ "pq_submission_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "cascade"
+ },
+ "vendor_investigations_requester_id_users_id_fk": {
+ "name": "vendor_investigations_requester_id_users_id_fk",
+ "tableFrom": "vendor_investigations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "requester_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "vendor_investigations_qm_manager_id_users_id_fk": {
+ "name": "vendor_investigations_qm_manager_id_users_id_fk",
+ "tableFrom": "vendor_investigations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "qm_manager_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_pq_submissions": {
+ "name": "vendor_pq_submissions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "pq_number": {
+ "name": "pq_number",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "requester_id": {
+ "name": "requester_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'REQUESTED'"
+ },
+ "submitted_at": {
+ "name": "submitted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "approved_at": {
+ "name": "approved_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rejected_at": {
+ "name": "rejected_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reject_reason": {
+ "name": "reject_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "unique_pq_submission": {
+ "name": "unique_pq_submission",
+ "columns": [
+ {
+ "expression": "vendor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "project_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vendor_pq_submissions_requester_id_users_id_fk": {
+ "name": "vendor_pq_submissions_requester_id_users_id_fk",
+ "tableFrom": "vendor_pq_submissions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "requester_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "vendor_pq_submissions_vendor_id_vendors_id_fk": {
+ "name": "vendor_pq_submissions_vendor_id_vendors_id_fk",
+ "tableFrom": "vendor_pq_submissions",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "vendor_pq_submissions_project_id_projects_id_fk": {
+ "name": "vendor_pq_submissions_project_id_projects_id_fk",
+ "tableFrom": "vendor_pq_submissions",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vendor_pq_submissions_pq_number_unique": {
+ "name": "vendor_pq_submissions_pq_number_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "pq_number"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_pq_criteria_answers": {
+ "name": "vendor_pq_criteria_answers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "criteria_id": {
+ "name": "criteria_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "answer": {
+ "name": "answer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_pq_criteria_answers_vendor_id_vendors_id_fk": {
+ "name": "vendor_pq_criteria_answers_vendor_id_vendors_id_fk",
+ "tableFrom": "vendor_pq_criteria_answers",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "vendor_pq_criteria_answers_criteria_id_pq_criterias_id_fk": {
+ "name": "vendor_pq_criteria_answers_criteria_id_pq_criterias_id_fk",
+ "tableFrom": "vendor_pq_criteria_answers",
+ "tableTo": "pq_criterias",
+ "columnsFrom": [
+ "criteria_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "vendor_pq_criteria_answers_project_id_projects_id_fk": {
+ "name": "vendor_pq_criteria_answers_project_id_projects_id_fk",
+ "tableFrom": "vendor_pq_criteria_answers",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_pq_review_logs": {
+ "name": "vendor_pq_review_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_pq_criteria_answer_id": {
+ "name": "vendor_pq_criteria_answer_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reviewer_comment": {
+ "name": "reviewer_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reviewer_name": {
+ "name": "reviewer_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_pq_review_logs_vendor_pq_criteria_answer_id_vendor_pq_criteria_answers_id_fk": {
+ "name": "vendor_pq_review_logs_vendor_pq_criteria_answer_id_vendor_pq_criteria_answers_id_fk",
+ "tableFrom": "vendor_pq_review_logs",
+ "tableTo": "vendor_pq_criteria_answers",
+ "columnsFrom": [
+ "vendor_pq_criteria_answer_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_project_pqs": {
+ "name": "vendor_project_pqs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'REQUESTED'"
+ },
+ "submitted_at": {
+ "name": "submitted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "approved_at": {
+ "name": "approved_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rejected_at": {
+ "name": "rejected_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reject_reason": {
+ "name": "reject_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_project_pqs_vendor_id_vendors_id_fk": {
+ "name": "vendor_project_pqs_vendor_id_vendors_id_fk",
+ "tableFrom": "vendor_project_pqs",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ },
+ "vendor_project_pqs_project_id_projects_id_fk": {
+ "name": "vendor_project_pqs_project_id_projects_id_fk",
+ "tableFrom": "vendor_project_pqs",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "cascade"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.bidding_projects": {
+ "name": "bidding_projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "pspid": {
+ "name": "pspid",
+ "type": "char(24)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "proj_nm": {
+ "name": "proj_nm",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sector": {
+ "name": "sector",
+ "type": "char(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "proj_msrm": {
+ "name": "proj_msrm",
+ "type": "numeric(3, 0)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kunnr": {
+ "name": "kunnr",
+ "type": "char(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kunnr_nm": {
+ "name": "kunnr_nm",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cls_1": {
+ "name": "cls_1",
+ "type": "char(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cls1_nm": {
+ "name": "cls1_nm",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ptype": {
+ "name": "ptype",
+ "type": "char(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ptype_nm": {
+ "name": "ptype_nm",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pmodel_cd": {
+ "name": "pmodel_cd",
+ "type": "char(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pmodel_nm": {
+ "name": "pmodel_nm",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pmodel_sz": {
+ "name": "pmodel_sz",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pmodel_uom": {
+ "name": "pmodel_uom",
+ "type": "char(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "txt04": {
+ "name": "txt04",
+ "type": "char(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "txt30": {
+ "name": "txt30",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "estm_pm": {
+ "name": "estm_pm",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pjt_type": {
+ "name": "pjt_type",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "bidding_projects_pspid_unique": {
+ "name": "bidding_projects_pspid_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "pspid"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.project_series": {
+ "name": "project_series",
+ "schema": "",
+ "columns": {
+ "pspid": {
+ "name": "pspid",
+ "type": "char(24)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sers_no": {
+ "name": "sers_no",
+ "type": "char(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sc_dt": {
+ "name": "sc_dt",
+ "type": "char(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "kl_dt": {
+ "name": "kl_dt",
+ "type": "char(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lc_dt": {
+ "name": "lc_dt",
+ "type": "char(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dl_dt": {
+ "name": "dl_dt",
+ "type": "char(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dock_no": {
+ "name": "dock_no",
+ "type": "char(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dock_nm": {
+ "name": "dock_nm",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "proj_no": {
+ "name": "proj_no",
+ "type": "char(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "post1": {
+ "name": "post1",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "project_sersNo_unique": {
+ "name": "project_sersNo_unique",
+ "columns": [
+ {
+ "expression": "pspid",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "sers_no",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "project_series_pspid_bidding_projects_pspid_fk": {
+ "name": "project_series_pspid_bidding_projects_pspid_fk",
+ "tableFrom": "project_series",
+ "tableTo": "bidding_projects",
+ "columnsFrom": [
+ "pspid"
+ ],
+ "columnsTo": [
+ "pspid"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.projects": {
+ "name": "projects",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "code": {
+ "name": "code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ship'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.cbe_evaluations": {
+ "name": "cbe_evaluations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "evaluated_by": {
+ "name": "evaluated_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluated_at": {
+ "name": "evaluated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "result": {
+ "name": "result",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_cost": {
+ "name": "total_cost",
+ "type": "numeric(18, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'USD'"
+ },
+ "payment_terms": {
+ "name": "payment_terms",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "incoterms": {
+ "name": "incoterms",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_schedule": {
+ "name": "delivery_schedule",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "cbe_evaluations_rfq_id_rfqs_id_fk": {
+ "name": "cbe_evaluations_rfq_id_rfqs_id_fk",
+ "tableFrom": "cbe_evaluations",
+ "tableTo": "rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "cbe_evaluations_vendor_id_vendors_id_fk": {
+ "name": "cbe_evaluations_vendor_id_vendors_id_fk",
+ "tableFrom": "cbe_evaluations",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "cbe_evaluations_evaluated_by_users_id_fk": {
+ "name": "cbe_evaluations_evaluated_by_users_id_fk",
+ "tableFrom": "cbe_evaluations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "evaluated_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.rfq_attachments": {
+ "name": "rfq_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "evaluation_id": {
+ "name": "evaluation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cbe_id": {
+ "name": "cbe_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "comment_id": {
+ "name": "comment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "rfq_attachments_rfq_id_rfqs_id_fk": {
+ "name": "rfq_attachments_rfq_id_rfqs_id_fk",
+ "tableFrom": "rfq_attachments",
+ "tableTo": "rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "rfq_attachments_vendor_id_vendors_id_fk": {
+ "name": "rfq_attachments_vendor_id_vendors_id_fk",
+ "tableFrom": "rfq_attachments",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "rfq_attachments_evaluation_id_rfq_evaluations_id_fk": {
+ "name": "rfq_attachments_evaluation_id_rfq_evaluations_id_fk",
+ "tableFrom": "rfq_attachments",
+ "tableTo": "rfq_evaluations",
+ "columnsFrom": [
+ "evaluation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "rfq_attachments_cbe_id_cbe_evaluations_id_fk": {
+ "name": "rfq_attachments_cbe_id_cbe_evaluations_id_fk",
+ "tableFrom": "rfq_attachments",
+ "tableTo": "cbe_evaluations",
+ "columnsFrom": [
+ "cbe_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "rfq_attachments_comment_id_rfq_comments_id_fk": {
+ "name": "rfq_attachments_comment_id_rfq_comments_id_fk",
+ "tableFrom": "rfq_attachments",
+ "tableTo": "rfq_comments",
+ "columnsFrom": [
+ "comment_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.rfq_comments": {
+ "name": "rfq_comments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment_text": {
+ "name": "comment_text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "commented_by": {
+ "name": "commented_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "evaluation_id": {
+ "name": "evaluation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cbe_id": {
+ "name": "cbe_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "rfq_comments_rfq_id_rfqs_id_fk": {
+ "name": "rfq_comments_rfq_id_rfqs_id_fk",
+ "tableFrom": "rfq_comments",
+ "tableTo": "rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "rfq_comments_vendor_id_vendors_id_fk": {
+ "name": "rfq_comments_vendor_id_vendors_id_fk",
+ "tableFrom": "rfq_comments",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "rfq_comments_commented_by_users_id_fk": {
+ "name": "rfq_comments_commented_by_users_id_fk",
+ "tableFrom": "rfq_comments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "commented_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "rfq_comments_evaluation_id_rfq_evaluations_id_fk": {
+ "name": "rfq_comments_evaluation_id_rfq_evaluations_id_fk",
+ "tableFrom": "rfq_comments",
+ "tableTo": "rfq_evaluations",
+ "columnsFrom": [
+ "evaluation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "rfq_comments_cbe_id_vendor_responses_id_fk": {
+ "name": "rfq_comments_cbe_id_vendor_responses_id_fk",
+ "tableFrom": "rfq_comments",
+ "tableTo": "vendor_responses",
+ "columnsFrom": [
+ "cbe_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.rfq_evaluations": {
+ "name": "rfq_evaluations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "eval_type": {
+ "name": "eval_type",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "result": {
+ "name": "result",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "rfq_evaluations_rfq_id_rfqs_id_fk": {
+ "name": "rfq_evaluations_rfq_id_rfqs_id_fk",
+ "tableFrom": "rfq_evaluations",
+ "tableTo": "rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "rfq_evaluations_vendor_id_vendors_id_fk": {
+ "name": "rfq_evaluations_vendor_id_vendors_id_fk",
+ "tableFrom": "rfq_evaluations",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.rfq_items": {
+ "name": "rfq_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quantity": {
+ "name": "quantity",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "uom": {
+ "name": "uom",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "rfq_items_rfq_id_rfqs_id_fk": {
+ "name": "rfq_items_rfq_id_rfqs_id_fk",
+ "tableFrom": "rfq_items",
+ "tableTo": "rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "rfq_items_item_code_items_item_code_fk": {
+ "name": "rfq_items_item_code_items_item_code_fk",
+ "tableFrom": "rfq_items",
+ "tableTo": "items",
+ "columnsFrom": [
+ "item_code"
+ ],
+ "columnsTo": [
+ "item_code"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.rfqs": {
+ "name": "rfqs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "bid_project_id": {
+ "name": "bid_project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'DRAFT'"
+ },
+ "rfq_type": {
+ "name": "rfq_type",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'PURCHASE'"
+ },
+ "parent_rfq_id": {
+ "name": "parent_rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "rfqs_project_id_projects_id_fk": {
+ "name": "rfqs_project_id_projects_id_fk",
+ "tableFrom": "rfqs",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "rfqs_bid_project_id_bidding_projects_id_fk": {
+ "name": "rfqs_bid_project_id_bidding_projects_id_fk",
+ "tableFrom": "rfqs",
+ "tableTo": "bidding_projects",
+ "columnsFrom": [
+ "bid_project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "rfqs_created_by_users_id_fk": {
+ "name": "rfqs_created_by_users_id_fk",
+ "tableFrom": "rfqs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "rfqs_parent_rfq_id_rfqs_id_fk": {
+ "name": "rfqs_parent_rfq_id_rfqs_id_fk",
+ "tableFrom": "rfqs",
+ "tableTo": "rfqs",
+ "columnsFrom": [
+ "parent_rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "rfqs_rfq_code_unique": {
+ "name": "rfqs_rfq_code_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "rfq_code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_commercial_responses": {
+ "name": "vendor_commercial_responses",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "response_id": {
+ "name": "response_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "response_status": {
+ "name": "response_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PENDING'"
+ },
+ "total_price": {
+ "name": "total_price",
+ "type": "numeric(18, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'USD'"
+ },
+ "payment_terms": {
+ "name": "payment_terms",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "incoterms": {
+ "name": "incoterms",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_period": {
+ "name": "delivery_period",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "warranty_period": {
+ "name": "warranty_period",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "validity_period": {
+ "name": "validity_period",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "price_breakdown": {
+ "name": "price_breakdown",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "commercial_notes": {
+ "name": "commercial_notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_commercial_responses_response_id_vendor_responses_id_fk": {
+ "name": "vendor_commercial_responses_response_id_vendor_responses_id_fk",
+ "tableFrom": "vendor_commercial_responses",
+ "tableTo": "vendor_responses",
+ "columnsFrom": [
+ "response_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_response_attachments": {
+ "name": "vendor_response_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "response_id": {
+ "name": "response_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "technical_response_id": {
+ "name": "technical_response_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "commercial_response_id": {
+ "name": "commercial_response_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_type": {
+ "name": "attachment_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploaded_at": {
+ "name": "uploaded_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "uploaded_by": {
+ "name": "uploaded_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_response_attachments_response_id_vendor_responses_id_fk": {
+ "name": "vendor_response_attachments_response_id_vendor_responses_id_fk",
+ "tableFrom": "vendor_response_attachments",
+ "tableTo": "vendor_responses",
+ "columnsFrom": [
+ "response_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vendor_response_attachments_technical_response_id_vendor_technical_responses_id_fk": {
+ "name": "vendor_response_attachments_technical_response_id_vendor_technical_responses_id_fk",
+ "tableFrom": "vendor_response_attachments",
+ "tableTo": "vendor_technical_responses",
+ "columnsFrom": [
+ "technical_response_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vendor_response_attachments_commercial_response_id_vendor_commercial_responses_id_fk": {
+ "name": "vendor_response_attachments_commercial_response_id_vendor_commercial_responses_id_fk",
+ "tableFrom": "vendor_response_attachments",
+ "tableTo": "vendor_commercial_responses",
+ "columnsFrom": [
+ "commercial_response_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_responses": {
+ "name": "vendor_responses",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "response_status": {
+ "name": "response_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'REVIEWING'"
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "responded_by": {
+ "name": "responded_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "responded_at": {
+ "name": "responded_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "vendor_response_unique": {
+ "name": "vendor_response_unique",
+ "columns": [
+ {
+ "expression": "rfq_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "vendor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vendor_responses_rfq_id_rfqs_id_fk": {
+ "name": "vendor_responses_rfq_id_rfqs_id_fk",
+ "tableFrom": "vendor_responses",
+ "tableTo": "rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vendor_responses_vendor_id_vendors_id_fk": {
+ "name": "vendor_responses_vendor_id_vendors_id_fk",
+ "tableFrom": "vendor_responses",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_technical_responses": {
+ "name": "vendor_technical_responses",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "response_id": {
+ "name": "response_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "response_status": {
+ "name": "response_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PENDING'"
+ },
+ "summary": {
+ "name": "summary",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_technical_responses_response_id_vendor_responses_id_fk": {
+ "name": "vendor_technical_responses_response_id_vendor_responses_id_fk",
+ "tableFrom": "vendor_technical_responses",
+ "tableTo": "vendor_responses",
+ "columnsFrom": [
+ "response_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.departments": {
+ "name": "departments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "department_code": {
+ "name": "department_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "department_name": {
+ "name": "department_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "departments_department_code_unique": {
+ "name": "departments_department_code_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "department_code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_attempts": {
+ "name": "login_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "login_attempts_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failure_reason": {
+ "name": "failure_reason",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempted_at": {
+ "name": "attempted_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "country": {
+ "name": "country",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "city": {
+ "name": "city",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "login_attempts_email_idx": {
+ "name": "login_attempts_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_attempts_attempted_at_idx": {
+ "name": "login_attempts_attempted_at_idx",
+ "columns": [
+ {
+ "expression": "attempted_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "login_attempts_ip_address_idx": {
+ "name": "login_attempts_ip_address_idx",
+ "columns": [
+ {
+ "expression": "ip_address",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "login_attempts_user_id_users_id_fk": {
+ "name": "login_attempts_user_id_users_id_fk",
+ "tableFrom": "login_attempts",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.mfa_tokens": {
+ "name": "mfa_tokens",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "mfa_tokens_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "token": {
+ "name": "token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "used_at": {
+ "name": "used_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "phone_number": {
+ "name": "phone_number",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attempts": {
+ "name": "attempts",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ }
+ },
+ "indexes": {
+ "mfa_tokens_user_id_idx": {
+ "name": "mfa_tokens_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mfa_tokens_token_idx": {
+ "name": "mfa_tokens_token_idx",
+ "columns": [
+ {
+ "expression": "token",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "mfa_tokens_expires_at_idx": {
+ "name": "mfa_tokens_expires_at_idx",
+ "columns": [
+ {
+ "expression": "expires_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "mfa_tokens_user_id_users_id_fk": {
+ "name": "mfa_tokens_user_id_users_id_fk",
+ "tableFrom": "mfa_tokens",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.otps": {
+ "name": "otps",
+ "schema": "",
+ "columns": {
+ "email": {
+ "name": "email",
+ "type": "varchar(256)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "code": {
+ "name": "code",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "otpToken": {
+ "name": "otpToken",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "otp_expires": {
+ "name": "otp_expires",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.password_history": {
+ "name": "password_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "password_history_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "salt": {
+ "name": "salt",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "replaced_at": {
+ "name": "replaced_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "password_history_user_id_idx": {
+ "name": "password_history_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "password_history_created_at_idx": {
+ "name": "password_history_created_at_idx",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "password_history_user_id_users_id_fk": {
+ "name": "password_history_user_id_users_id_fk",
+ "tableFrom": "password_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.passwords": {
+ "name": "passwords",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "passwords_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "password_hash": {
+ "name": "password_hash",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "salt": {
+ "name": "salt",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "strength": {
+ "name": "strength",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "has_uppercase": {
+ "name": "has_uppercase",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "has_lowercase": {
+ "name": "has_lowercase",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "has_numbers": {
+ "name": "has_numbers",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "has_symbols": {
+ "name": "has_symbols",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "length": {
+ "name": "length",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {
+ "passwords_user_id_idx": {
+ "name": "passwords_user_id_idx",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "passwords_active_idx": {
+ "name": "passwords_active_idx",
+ "columns": [
+ {
+ "expression": "is_active",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "passwords_user_id_users_id_fk": {
+ "name": "passwords_user_id_users_id_fk",
+ "tableFrom": "passwords",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.permissions": {
+ "name": "permissions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "permissions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "permission_key": {
+ "name": "permission_key",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.role_permissions": {
+ "name": "role_permissions",
+ "schema": "",
+ "columns": {
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission_id": {
+ "name": "permission_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "role_permissions_role_id_roles_id_fk": {
+ "name": "role_permissions_role_id_roles_id_fk",
+ "tableFrom": "role_permissions",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "role_permissions_permission_id_permissions_id_fk": {
+ "name": "role_permissions_permission_id_permissions_id_fk",
+ "tableFrom": "role_permissions",
+ "tableTo": "permissions",
+ "columnsFrom": [
+ "permission_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.roles": {
+ "name": "roles",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "roles_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domain": {
+ "name": "domain",
+ "type": "user_domain",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "company_id": {
+ "name": "company_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "''"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "roles_company_id_vendors_id_fk": {
+ "name": "roles_company_id_vendors_id_fk",
+ "tableFrom": "roles",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "company_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.security_settings": {
+ "name": "security_settings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "security_settings_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "min_password_length": {
+ "name": "min_password_length",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 8
+ },
+ "require_uppercase": {
+ "name": "require_uppercase",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "require_lowercase": {
+ "name": "require_lowercase",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "require_numbers": {
+ "name": "require_numbers",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "require_symbols": {
+ "name": "require_symbols",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "password_expiry_days": {
+ "name": "password_expiry_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 90
+ },
+ "password_history_count": {
+ "name": "password_history_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 5
+ },
+ "max_failed_attempts": {
+ "name": "max_failed_attempts",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 5
+ },
+ "lockout_duration_minutes": {
+ "name": "lockout_duration_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 30
+ },
+ "require_mfa_for_partners": {
+ "name": "require_mfa_for_partners",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "sms_token_expiry_minutes": {
+ "name": "sms_token_expiry_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 5
+ },
+ "max_sms_attempts_per_day": {
+ "name": "max_sms_attempts_per_day",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 10
+ },
+ "session_timeout_minutes": {
+ "name": "session_timeout_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 480
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.user_roles": {
+ "name": "user_roles",
+ "schema": "",
+ "columns": {
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "role_id": {
+ "name": "role_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "user_roles_user_id_users_id_fk": {
+ "name": "user_roles_user_id_users_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "user_roles_role_id_roles_id_fk": {
+ "name": "user_roles_role_id_roles_id_fk",
+ "tableFrom": "user_roles",
+ "tableTo": "roles",
+ "columnsFrom": [
+ "role_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.users": {
+ "name": "users",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "users_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "deptName": {
+ "name": "deptName",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "company_id": {
+ "name": "company_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tech_company_id": {
+ "name": "tech_company_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "user_domain",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'partners'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "image_url": {
+ "name": "image_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "language": {
+ "name": "language",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'en'"
+ },
+ "phone": {
+ "name": "phone",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mfa_enabled": {
+ "name": "mfa_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "mfa_secret": {
+ "name": "mfa_secret",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_locked": {
+ "name": "is_locked",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "lockout_until": {
+ "name": "lockout_until",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "failed_login_attempts": {
+ "name": "failed_login_attempts",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "last_login_at": {
+ "name": "last_login_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "password_change_required": {
+ "name": "password_change_required",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "deactivated_at": {
+ "name": "deactivated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "deactivation_reason": {
+ "name": "deactivation_reason",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "users_email_idx": {
+ "name": "users_email_idx",
+ "columns": [
+ {
+ "expression": "email",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "users_phone_idx": {
+ "name": "users_phone_idx",
+ "columns": [
+ {
+ "expression": "phone",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "users_company_id_vendors_id_fk": {
+ "name": "users_company_id_vendors_id_fk",
+ "tableFrom": "users",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "company_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "users_tech_company_id_tech_vendors_id_fk": {
+ "name": "users_tech_company_id_tech_vendors_id_fk",
+ "tableFrom": "users",
+ "tableTo": "tech_vendors",
+ "columnsFrom": [
+ "tech_company_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "users_email_unique": {
+ "name": "users_email_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "email"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.form_entries": {
+ "name": "form_entries",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "form_code": {
+ "name": "form_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "data": {
+ "name": "data",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contract_item_id": {
+ "name": "contract_item_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "form_entries_contract_item_id_contract_items_id_fk": {
+ "name": "form_entries_contract_item_id_contract_items_id_fk",
+ "tableFrom": "form_entries",
+ "tableTo": "contract_items",
+ "columnsFrom": [
+ "contract_item_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.form_metas": {
+ "name": "form_metas",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "form_code": {
+ "name": "form_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "form_name": {
+ "name": "form_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "columns": {
+ "name": "columns",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "form_metas_project_id_projects_id_fk": {
+ "name": "form_metas_project_id_projects_id_fk",
+ "tableFrom": "form_metas",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "form_code_project_unique": {
+ "name": "form_code_project_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "project_id",
+ "form_code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.forms": {
+ "name": "forms",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "forms_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "contract_item_id": {
+ "name": "contract_item_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "form_code": {
+ "name": "form_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "form_name": {
+ "name": "form_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "eng": {
+ "name": "eng",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "im": {
+ "name": "im",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "contract_item_form_code_unique": {
+ "name": "contract_item_form_code_unique",
+ "columns": [
+ {
+ "expression": "contract_item_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "form_code",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "forms_contract_item_id_contract_items_id_fk": {
+ "name": "forms_contract_item_id_contract_items_id_fk",
+ "tableFrom": "forms",
+ "tableTo": "contract_items",
+ "columnsFrom": [
+ "contract_item_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tag_class_attributes": {
+ "name": "tag_class_attributes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "tag_class_attributes_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "tag_class_id": {
+ "name": "tag_class_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "att_id": {
+ "name": "att_id",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "def_val": {
+ "name": "def_val",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uom_id": {
+ "name": "uom_id",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "seq": {
+ "name": "seq",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "tag_class_attributes_seq_idx": {
+ "name": "tag_class_attributes_seq_idx",
+ "columns": [
+ {
+ "expression": "seq",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "tag_class_attributes_tag_class_id_tag_classes_id_fk": {
+ "name": "tag_class_attributes_tag_class_id_tag_classes_id_fk",
+ "tableFrom": "tag_class_attributes",
+ "tableTo": "tag_classes",
+ "columnsFrom": [
+ "tag_class_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "uniq_att_id_in_tag_class": {
+ "name": "uniq_att_id_in_tag_class",
+ "nullsNotDistinct": false,
+ "columns": [
+ "tag_class_id",
+ "att_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tag_classes": {
+ "name": "tag_classes",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "tag_classes_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code": {
+ "name": "code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag_type_code": {
+ "name": "tag_type_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "subclasses": {
+ "name": "subclasses",
+ "type": "json",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::json"
+ },
+ "subclass_remark": {
+ "name": "subclass_remark",
+ "type": "json",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'{}'::json"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tag_classes_project_id_projects_id_fk": {
+ "name": "tag_classes_project_id_projects_id_fk",
+ "tableFrom": "tag_classes",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tag_classes_tag_type_code_project_id_tag_types_code_project_id_fk": {
+ "name": "tag_classes_tag_type_code_project_id_tag_types_code_project_id_fk",
+ "tableFrom": "tag_classes",
+ "tableTo": "tag_types",
+ "columnsFrom": [
+ "tag_type_code",
+ "project_id"
+ ],
+ "columnsTo": [
+ "code",
+ "project_id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "uniq_code_in_project": {
+ "name": "uniq_code_in_project",
+ "nullsNotDistinct": false,
+ "columns": [
+ "project_id",
+ "code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tag_subfield_options": {
+ "name": "tag_subfield_options",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attributes_id": {
+ "name": "attributes_id",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code": {
+ "name": "code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "label": {
+ "name": "label",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tag_subfield_options_project_id_projects_id_fk": {
+ "name": "tag_subfield_options_project_id_projects_id_fk",
+ "tableFrom": "tag_subfield_options",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "uniq_attribute_project_code": {
+ "name": "uniq_attribute_project_code",
+ "nullsNotDistinct": false,
+ "columns": [
+ "project_id",
+ "attributes_id",
+ "code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tag_subfields": {
+ "name": "tag_subfields",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag_type_code": {
+ "name": "tag_type_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attributes_id": {
+ "name": "attributes_id",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attributes_description": {
+ "name": "attributes_description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expression": {
+ "name": "expression",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delimiter": {
+ "name": "delimiter",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tag_subfields_project_id_projects_id_fk": {
+ "name": "tag_subfields_project_id_projects_id_fk",
+ "tableFrom": "tag_subfields",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "uniq_tag_type_attribute": {
+ "name": "uniq_tag_type_attribute",
+ "nullsNotDistinct": false,
+ "columns": [
+ "project_id",
+ "tag_type_code",
+ "attributes_id"
+ ]
+ },
+ "uniq_attribute_id_project": {
+ "name": "uniq_attribute_id_project",
+ "nullsNotDistinct": false,
+ "columns": [
+ "attributes_id",
+ "project_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tag_type_class_form_mappings": {
+ "name": "tag_type_class_form_mappings",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag_type_label": {
+ "name": "tag_type_label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "class_label": {
+ "name": "class_label",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "form_code": {
+ "name": "form_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "form_name": {
+ "name": "form_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ep": {
+ "name": "ep",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "uniq_mapping_in_project": {
+ "name": "uniq_mapping_in_project",
+ "nullsNotDistinct": false,
+ "columns": [
+ "project_id",
+ "tag_type_label",
+ "class_label",
+ "form_code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tag_types": {
+ "name": "tag_types",
+ "schema": "",
+ "columns": {
+ "code": {
+ "name": "code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tag_types_project_id_projects_id_fk": {
+ "name": "tag_types_project_id_projects_id_fk",
+ "tableFrom": "tag_types",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {
+ "tag_types_code_project_id_pk": {
+ "name": "tag_types_code_project_id_pk",
+ "columns": [
+ "code",
+ "project_id"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tags": {
+ "name": "tags",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "tags_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "contract_item_id": {
+ "name": "contract_item_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "form_id": {
+ "name": "form_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_no": {
+ "name": "tag_no",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag_type": {
+ "name": "tag_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "class": {
+ "name": "class",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tag_class_id": {
+ "name": "tag_class_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tags_contract_item_id_contract_items_id_fk": {
+ "name": "tags_contract_item_id_contract_items_id_fk",
+ "tableFrom": "tags",
+ "tableTo": "contract_items",
+ "columnsFrom": [
+ "contract_item_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tags_form_id_forms_id_fk": {
+ "name": "tags_form_id_forms_id_fk",
+ "tableFrom": "tags",
+ "tableTo": "forms",
+ "columnsFrom": [
+ "form_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "tags_tag_class_id_tag_classes_id_fk": {
+ "name": "tags_tag_class_id_tag_classes_id_fk",
+ "tableFrom": "tags",
+ "tableTo": "tag_classes",
+ "columnsFrom": [
+ "tag_class_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "contract_item_tag_no_unique": {
+ "name": "contract_item_tag_no_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "contract_item_id",
+ "tag_no"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.template_items": {
+ "name": "template_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "form_mapping_id": {
+ "name": "form_mapping_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tmpl_id": {
+ "name": "tmpl_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tmpl_type": {
+ "name": "tmpl_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "spr_lst_setup": {
+ "name": "spr_lst_setup",
+ "type": "json",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "grd_lst_setup": {
+ "name": "grd_lst_setup",
+ "type": "json",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "spr_itm_lst_setup": {
+ "name": "spr_itm_lst_setup",
+ "type": "json",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "template_items_form_mapping_id_tag_type_class_form_mappings_id_fk": {
+ "name": "template_items_form_mapping_id_tag_type_class_form_mappings_id_fk",
+ "tableFrom": "template_items",
+ "tableTo": "tag_type_class_form_mappings",
+ "columnsFrom": [
+ "form_mapping_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "uniq_tmpl_in_form_mapping": {
+ "name": "uniq_tmpl_in_form_mapping",
+ "nullsNotDistinct": false,
+ "columns": [
+ "form_mapping_id",
+ "tmpl_id"
+ ]
+ },
+ "uniq_name_in_form_mapping": {
+ "name": "uniq_name_in_form_mapping",
+ "nullsNotDistinct": false,
+ "columns": [
+ "form_mapping_id",
+ "name"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_data_report_temps": {
+ "name": "vendor_data_report_temps",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "contract_item_id": {
+ "name": "contract_item_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "form_id": {
+ "name": "form_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_data_report_temps_contract_item_id_contract_items_id_fk": {
+ "name": "vendor_data_report_temps_contract_item_id_contract_items_id_fk",
+ "tableFrom": "vendor_data_report_temps",
+ "tableTo": "contract_items",
+ "columnsFrom": [
+ "contract_item_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vendor_data_report_temps_form_id_forms_id_fk": {
+ "name": "vendor_data_report_temps_form_id_forms_id_fk",
+ "tableFrom": "vendor_data_report_temps",
+ "tableTo": "forms",
+ "columnsFrom": [
+ "form_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.change_logs": {
+ "name": "change_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "contract_id": {
+ "name": "contract_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "entity_type": {
+ "name": "entity_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "entity_id": {
+ "name": "entity_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "changed_fields": {
+ "name": "changed_fields",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "old_values": {
+ "name": "old_values",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "new_values": {
+ "name": "new_values",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_name": {
+ "name": "user_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "is_synced": {
+ "name": "is_synced",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "sync_attempts": {
+ "name": "sync_attempts",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "last_sync_error": {
+ "name": "last_sync_error",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "synced_at": {
+ "name": "synced_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "target_systems": {
+ "name": "target_systems",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'[]'::jsonb"
+ }
+ },
+ "indexes": {
+ "idx_change_logs_contract_synced": {
+ "name": "idx_change_logs_contract_synced",
+ "columns": [
+ {
+ "expression": "contract_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "is_synced",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_change_logs_created_at": {
+ "name": "idx_change_logs_created_at",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_change_logs_entity": {
+ "name": "idx_change_logs_entity",
+ "columns": [
+ {
+ "expression": "entity_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "entity_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_change_logs_sync_attempts": {
+ "name": "idx_change_logs_sync_attempts",
+ "columns": [
+ {
+ "expression": "sync_attempts",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.document_attachments": {
+ "name": "document_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "document_attachments_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "upload_id": {
+ "name": "upload_id",
+ "type": "varchar(36)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_id": {
+ "name": "file_id",
+ "type": "varchar(36)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploaded_by": {
+ "name": "uploaded_by",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dolce_file_path": {
+ "name": "dolce_file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploaded_at": {
+ "name": "uploaded_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "document_attachments_revision_id_revisions_id_fk": {
+ "name": "document_attachments_revision_id_revisions_id_fk",
+ "tableFrom": "document_attachments",
+ "tableTo": "revisions",
+ "columnsFrom": [
+ "revision_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.documents": {
+ "name": "documents",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "documents_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "pic": {
+ "name": "pic",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contract_id": {
+ "name": "contract_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "doc_number": {
+ "name": "doc_number",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_doc_number": {
+ "name": "vendor_doc_number",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ACTIVE'"
+ },
+ "issued_date": {
+ "name": "issued_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "drawing_kind": {
+ "name": "drawing_kind",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "drawing_move_gbn": {
+ "name": "drawing_move_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discipline": {
+ "name": "discipline",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_document_id": {
+ "name": "external_document_id",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_system_type": {
+ "name": "external_system_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_synced_at": {
+ "name": "external_synced_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "c_gbn": {
+ "name": "c_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "d_gbn": {
+ "name": "d_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "degree_gbn": {
+ "name": "degree_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dept_gbn": {
+ "name": "dept_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "j_gbn": {
+ "name": "j_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "s_gbn": {
+ "name": "s_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shi_drawing_no": {
+ "name": "shi_drawing_no",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "manager": {
+ "name": "manager",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "manager_enm": {
+ "name": "manager_enm",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "manager_no": {
+ "name": "manager_no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "register_group": {
+ "name": "register_group",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "register_group_id": {
+ "name": "register_group_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "create_user_no": {
+ "name": "create_user_no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "create_user_id": {
+ "name": "create_user_id",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "create_user_enm": {
+ "name": "create_user_enm",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "unique_contract_doc_status": {
+ "name": "unique_contract_doc_status",
+ "columns": [
+ {
+ "expression": "contract_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "doc_number",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "unique_contract_vendor_doc": {
+ "name": "unique_contract_vendor_doc",
+ "columns": [
+ {
+ "expression": "contract_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "vendor_doc_number",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"documents\".\"vendor_doc_number\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "unique_external_doc": {
+ "name": "unique_external_doc",
+ "columns": [
+ {
+ "expression": "contract_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "external_document_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "external_system_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"documents\".\"external_document_id\" IS NOT NULL",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "drawing_kind_idx": {
+ "name": "drawing_kind_idx",
+ "columns": [
+ {
+ "expression": "drawing_kind",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "documents_contract_id_contracts_id_fk": {
+ "name": "documents_contract_id_contracts_id_fk",
+ "tableFrom": "documents",
+ "tableTo": "contracts",
+ "columnsFrom": [
+ "contract_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.issue_stages": {
+ "name": "issue_stages",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "issue_stages_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "document_id": {
+ "name": "document_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stage_name": {
+ "name": "stage_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "plan_date": {
+ "name": "plan_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "actual_date": {
+ "name": "actual_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "stage_status": {
+ "name": "stage_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PLANNED'"
+ },
+ "stage_order": {
+ "name": "stage_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "priority": {
+ "name": "priority",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'MEDIUM'"
+ },
+ "assignee_id": {
+ "name": "assignee_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "assignee_name": {
+ "name": "assignee_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reminder_days": {
+ "name": "reminder_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 3
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "notes": {
+ "name": "notes",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "unique_document_stage": {
+ "name": "unique_document_stage",
+ "columns": [
+ {
+ "expression": "document_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "stage_name",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "document_stage_order": {
+ "name": "document_stage_order",
+ "columns": [
+ {
+ "expression": "document_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "stage_order",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "issue_stages_document_id_documents_id_fk": {
+ "name": "issue_stages_document_id_documents_id_fk",
+ "tableFrom": "issue_stages",
+ "tableTo": "documents",
+ "columnsFrom": [
+ "document_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.revisions": {
+ "name": "revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "revisions_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "issue_stage_id": {
+ "name": "issue_stage_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "uploader_type": {
+ "name": "uploader_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'vendor'"
+ },
+ "uploader_id": {
+ "name": "uploader_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploader_name": {
+ "name": "uploader_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "usage": {
+ "name": "usage",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "usage_type": {
+ "name": "usage_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_status": {
+ "name": "revision_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'SUBMITTED'"
+ },
+ "submitted_date": {
+ "name": "submitted_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploaded_at": {
+ "name": "uploaded_at",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "review_start_date": {
+ "name": "review_start_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "approved_date": {
+ "name": "approved_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rejected_date": {
+ "name": "rejected_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reviewer_id": {
+ "name": "reviewer_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reviewer_name": {
+ "name": "reviewer_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "review_comments": {
+ "name": "review_comments",
+ "type": "varchar(1000)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "external_upload_id": {
+ "name": "external_upload_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "register_id": {
+ "name": "register_id",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "unique_stage_revision_usage": {
+ "name": "unique_stage_revision_usage",
+ "columns": [
+ {
+ "expression": "issue_stage_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "revision",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "usage",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "COALESCE(\"usage_type\", '')",
+ "asc": true,
+ "isExpression": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sync_batches": {
+ "name": "sync_batches",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "contract_id": {
+ "name": "contract_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_system": {
+ "name": "target_system",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "batch_size": {
+ "name": "batch_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PENDING'"
+ },
+ "started_at": {
+ "name": "started_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "retry_count": {
+ "name": "retry_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "change_log_ids": {
+ "name": "change_log_ids",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "success_count": {
+ "name": "success_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "failure_count": {
+ "name": "failure_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sync_metadata": {
+ "name": "sync_metadata",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "idx_sync_batches_contract_system": {
+ "name": "idx_sync_batches_contract_system",
+ "columns": [
+ {
+ "expression": "contract_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_system",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_sync_batches_status": {
+ "name": "idx_sync_batches_status",
+ "columns": [
+ {
+ "expression": "status",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_sync_batches_created_at": {
+ "name": "idx_sync_batches_created_at",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.sync_configs": {
+ "name": "sync_configs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "contract_id": {
+ "name": "contract_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_system": {
+ "name": "target_system",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "sync_enabled": {
+ "name": "sync_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "sync_interval_minutes": {
+ "name": "sync_interval_minutes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 30
+ },
+ "last_successful_sync": {
+ "name": "last_successful_sync",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "last_sync_attempt": {
+ "name": "last_sync_attempt",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "endpoint_url": {
+ "name": "endpoint_url",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_token": {
+ "name": "auth_token",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "api_version": {
+ "name": "api_version",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'v1'"
+ },
+ "max_batch_size": {
+ "name": "max_batch_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 100
+ },
+ "retry_max_attempts": {
+ "name": "retry_max_attempts",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 3
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "idx_sync_configs_contract_system": {
+ "name": "idx_sync_configs_contract_system",
+ "columns": [
+ {
+ "expression": "contract_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "target_system",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "sync_configs_contract_id_contracts_id_fk": {
+ "name": "sync_configs_contract_id_contracts_id_fk",
+ "tableFrom": "sync_configs",
+ "tableTo": "contracts",
+ "columnsFrom": [
+ "contract_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_attachments": {
+ "name": "vendor_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attachment_type": {
+ "name": "attachment_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'GENERAL'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_attachments_vendor_id_vendors_id_fk": {
+ "name": "vendor_attachments_vendor_id_vendors_id_fk",
+ "tableFrom": "vendor_attachments",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_candidates": {
+ "name": "vendor_candidates",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "company_name": {
+ "name": "company_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contact_email": {
+ "name": "contact_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contact_phone": {
+ "name": "contact_phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_id": {
+ "name": "tax_id",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "address": {
+ "name": "address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country": {
+ "name": "country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'COLLECTED'"
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "items": {
+ "name": "items",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_candidates_vendor_id_vendors_id_fk": {
+ "name": "vendor_candidates_vendor_id_vendors_id_fk",
+ "tableFrom": "vendor_candidates",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_contacts": {
+ "name": "vendor_contacts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contact_name": {
+ "name": "contact_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contact_position": {
+ "name": "contact_position",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contact_department": {
+ "name": "contact_department",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contact_task": {
+ "name": "contact_task",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contact_email": {
+ "name": "contact_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contact_phone": {
+ "name": "contact_phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_primary": {
+ "name": "is_primary",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_contacts_vendor_id_vendors_id_fk": {
+ "name": "vendor_contacts_vendor_id_vendors_id_fk",
+ "tableFrom": "vendor_contacts",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_possible_items": {
+ "name": "vendor_possible_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_possible_items_vendor_id_vendors_id_fk": {
+ "name": "vendor_possible_items_vendor_id_vendors_id_fk",
+ "tableFrom": "vendor_possible_items",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "vendor_possible_items_item_code_items_item_code_fk": {
+ "name": "vendor_possible_items_item_code_items_item_code_fk",
+ "tableFrom": "vendor_possible_items",
+ "tableTo": "items",
+ "columnsFrom": [
+ "item_code"
+ ],
+ "columnsTo": [
+ "item_code"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_possible_materials": {
+ "name": "vendor_possible_materials",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_possible_materials_vendor_id_vendors_id_fk": {
+ "name": "vendor_possible_materials_vendor_id_vendors_id_fk",
+ "tableFrom": "vendor_possible_materials",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "vendor_possible_materials_item_code_materials_item_code_fk": {
+ "name": "vendor_possible_materials_item_code_materials_item_code_fk",
+ "tableFrom": "vendor_possible_materials",
+ "tableTo": "materials",
+ "columnsFrom": [
+ "item_code"
+ ],
+ "columnsTo": [
+ "item_code"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_types": {
+ "name": "vendor_types",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "code": {
+ "name": "code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name_ko": {
+ "name": "name_ko",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name_en": {
+ "name": "name_en",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vendor_types_code_unique": {
+ "name": "vendor_types_code_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendors": {
+ "name": "vendors",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_id": {
+ "name": "tax_id",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "address": {
+ "name": "address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country": {
+ "name": "country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "phone": {
+ "name": "phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "website": {
+ "name": "website",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PENDING_REVIEW'"
+ },
+ "vendor_type_id": {
+ "name": "vendor_type_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_name": {
+ "name": "representative_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_birth": {
+ "name": "representative_birth",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_email": {
+ "name": "representative_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_phone": {
+ "name": "representative_phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_work_expirence": {
+ "name": "representative_work_expirence",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "corporate_registration_number": {
+ "name": "corporate_registration_number",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "items": {
+ "name": "items",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credit_agency": {
+ "name": "credit_agency",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credit_rating": {
+ "name": "credit_rating",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cash_flow_rating": {
+ "name": "cash_flow_rating",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "business_size": {
+ "name": "business_size",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendors_vendor_type_id_vendor_types_id_fk": {
+ "name": "vendors_vendor_type_id_vendor_types_id_fk",
+ "tableFrom": "vendors",
+ "tableTo": "vendor_types",
+ "columnsFrom": [
+ "vendor_type_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tasks": {
+ "name": "tasks",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "varchar(30)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "code": {
+ "name": "code",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(128)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'todo'"
+ },
+ "label": {
+ "name": "label",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'bug'"
+ },
+ "priority": {
+ "name": "priority",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'low'"
+ },
+ "archived": {
+ "name": "archived",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "current_timestamp"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "tasks_code_unique": {
+ "name": "tasks_code_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_candidate_logs": {
+ "name": "vendor_candidate_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_candidate_id": {
+ "name": "vendor_candidate_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "old_status": {
+ "name": "old_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "new_status": {
+ "name": "new_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_candidate_logs_vendor_candidate_id_vendor_candidates_id_fk": {
+ "name": "vendor_candidate_logs_vendor_candidate_id_vendor_candidates_id_fk",
+ "tableFrom": "vendor_candidate_logs",
+ "tableTo": "vendor_candidates",
+ "columnsFrom": [
+ "vendor_candidate_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vendor_candidate_logs_user_id_users_id_fk": {
+ "name": "vendor_candidate_logs_user_id_users_id_fk",
+ "tableFrom": "vendor_candidate_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendors_logs": {
+ "name": "vendors_logs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "old_status": {
+ "name": "old_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "new_status": {
+ "name": "new_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendors_logs_vendor_id_vendors_id_fk": {
+ "name": "vendors_logs_vendor_id_vendors_id_fk",
+ "tableFrom": "vendors_logs",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vendors_logs_user_id_users_id_fk": {
+ "name": "vendors_logs_user_id_users_id_fk",
+ "tableFrom": "vendors_logs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.basic_contract": {
+ "name": "basic_contract",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "basic_contract_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "template_id": {
+ "name": "template_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requested_by": {
+ "name": "requested_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PENDING'"
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "basic_contract_template_id_basic_contract_templates_id_fk": {
+ "name": "basic_contract_template_id_basic_contract_templates_id_fk",
+ "tableFrom": "basic_contract",
+ "tableTo": "basic_contract_templates",
+ "columnsFrom": [
+ "template_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "basic_contract_vendor_id_vendors_id_fk": {
+ "name": "basic_contract_vendor_id_vendors_id_fk",
+ "tableFrom": "basic_contract",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "basic_contract_requested_by_users_id_fk": {
+ "name": "basic_contract_requested_by_users_id_fk",
+ "tableFrom": "basic_contract",
+ "tableTo": "users",
+ "columnsFrom": [
+ "requested_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.basic_contract_templates": {
+ "name": "basic_contract_templates",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "basic_contract_templates_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "template_code": {
+ "name": "template_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "template_name": {
+ "name": "template_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision": {
+ "name": "revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 1
+ },
+ "status": {
+ "name": "status",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ACTIVE'"
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "validity_period": {
+ "name": "validity_period",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "legal_review_required": {
+ "name": "legal_review_required",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "shipbuilding_applicable": {
+ "name": "shipbuilding_applicable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "wind_applicable": {
+ "name": "wind_applicable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "pc_applicable": {
+ "name": "pc_applicable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "nb_applicable": {
+ "name": "nb_applicable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "rc_applicable": {
+ "name": "rc_applicable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "gy_applicable": {
+ "name": "gy_applicable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "sys_applicable": {
+ "name": "sys_applicable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "infra_applicable": {
+ "name": "infra_applicable",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "now()"
+ },
+ "updated_by": {
+ "name": "updated_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "disposed_at": {
+ "name": "disposed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "restored_at": {
+ "name": "restored_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "basic_contract_templates_created_by_users_id_fk": {
+ "name": "basic_contract_templates_created_by_users_id_fk",
+ "tableFrom": "basic_contract_templates",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "basic_contract_templates_updated_by_users_id_fk": {
+ "name": "basic_contract_templates_updated_by_users_id_fk",
+ "tableFrom": "basic_contract_templates",
+ "tableTo": "users",
+ "columnsFrom": [
+ "updated_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "basic_contract_templates_template_code_unique": {
+ "name": "basic_contract_templates_template_code_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "template_code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.incoterms": {
+ "name": "incoterms",
+ "schema": "",
+ "columns": {
+ "code": {
+ "name": "code",
+ "type": "varchar(20)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "incoterms_created_by_users_id_fk": {
+ "name": "incoterms_created_by_users_id_fk",
+ "tableFrom": "incoterms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.payment_terms": {
+ "name": "payment_terms",
+ "schema": "",
+ "columns": {
+ "code": {
+ "name": "code",
+ "type": "varchar(50)",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "payment_terms_created_by_users_id_fk": {
+ "name": "payment_terms_created_by_users_id_fk",
+ "tableFrom": "payment_terms",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.pr_items": {
+ "name": "pr_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "procurement_rfqs_id": {
+ "name": "procurement_rfqs_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_item": {
+ "name": "rfq_item",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pr_item": {
+ "name": "pr_item",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pr_no": {
+ "name": "pr_no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "material_code": {
+ "name": "material_code",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "material_category": {
+ "name": "material_category",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "acc": {
+ "name": "acc",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "material_description": {
+ "name": "material_description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "size": {
+ "name": "size",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_date": {
+ "name": "delivery_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quantity": {
+ "name": "quantity",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "uom": {
+ "name": "uom",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gross_weight": {
+ "name": "gross_weight",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "gw_uom": {
+ "name": "gw_uom",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "spec_no": {
+ "name": "spec_no",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "spec_url": {
+ "name": "spec_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tracking_no": {
+ "name": "tracking_no",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "major_yn": {
+ "name": "major_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "project_def": {
+ "name": "project_def",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_sc": {
+ "name": "project_sc",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_kl": {
+ "name": "project_kl",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_lc": {
+ "name": "project_lc",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_dl": {
+ "name": "project_dl",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "pr_items_procurement_rfqs_id_procurement_rfqs_id_fk": {
+ "name": "pr_items_procurement_rfqs_id_procurement_rfqs_id_fk",
+ "tableFrom": "pr_items",
+ "tableTo": "procurement_rfqs",
+ "columnsFrom": [
+ "procurement_rfqs_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.procurement_attachments": {
+ "name": "procurement_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "attachment_type": {
+ "name": "attachment_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "procurement_rfqs_id": {
+ "name": "procurement_rfqs_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "procurement_rfq_details_id": {
+ "name": "procurement_rfq_details_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "original_file_name": {
+ "name": "original_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "procurement_attachments_procurement_rfqs_id_procurement_rfqs_id_fk": {
+ "name": "procurement_attachments_procurement_rfqs_id_procurement_rfqs_id_fk",
+ "tableFrom": "procurement_attachments",
+ "tableTo": "procurement_rfqs",
+ "columnsFrom": [
+ "procurement_rfqs_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "procurement_attachments_procurement_rfq_details_id_procurement_rfq_details_id_fk": {
+ "name": "procurement_attachments_procurement_rfq_details_id_procurement_rfq_details_id_fk",
+ "tableFrom": "procurement_attachments",
+ "tableTo": "procurement_rfq_details",
+ "columnsFrom": [
+ "procurement_rfq_details_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "procurement_attachments_created_by_users_id_fk": {
+ "name": "procurement_attachments_created_by_users_id_fk",
+ "tableFrom": "procurement_attachments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {
+ "attachment_type_check": {
+ "name": "attachment_type_check",
+ "value": "\"procurement_attachments\".\"procurement_rfqs_id\" IS NOT NULL OR \"procurement_attachments\".\"procurement_rfq_details_id\" IS NOT NULL"
+ }
+ },
+ "isRLSEnabled": false
+ },
+ "public.procurement_quotation_items": {
+ "name": "procurement_quotation_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "quotation_id": {
+ "name": "quotation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pr_item_id": {
+ "name": "pr_item_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "material_code": {
+ "name": "material_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "material_description": {
+ "name": "material_description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quantity": {
+ "name": "quantity",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "uom": {
+ "name": "uom",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "unit_price": {
+ "name": "unit_price",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "total_price": {
+ "name": "total_price",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'USD'"
+ },
+ "vendor_material_code": {
+ "name": "vendor_material_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_material_description": {
+ "name": "vendor_material_description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_date": {
+ "name": "delivery_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "lead_time_in_days": {
+ "name": "lead_time_in_days",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_rate": {
+ "name": "tax_rate",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_amount": {
+ "name": "tax_amount",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discount_rate": {
+ "name": "discount_rate",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discount_amount": {
+ "name": "discount_amount",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_alternative": {
+ "name": "is_alternative",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "is_recommended": {
+ "name": "is_recommended",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "procurement_quotation_items_quotation_id_procurement_vendor_quotations_id_fk": {
+ "name": "procurement_quotation_items_quotation_id_procurement_vendor_quotations_id_fk",
+ "tableFrom": "procurement_quotation_items",
+ "tableTo": "procurement_vendor_quotations",
+ "columnsFrom": [
+ "quotation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "procurement_quotation_items_pr_item_id_pr_items_id_fk": {
+ "name": "procurement_quotation_items_pr_item_id_pr_items_id_fk",
+ "tableFrom": "procurement_quotation_items",
+ "tableTo": "pr_items",
+ "columnsFrom": [
+ "pr_item_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.procurement_rfq_attachments": {
+ "name": "procurement_rfq_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "comment_id": {
+ "name": "comment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quotation_id": {
+ "name": "quotation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_vendor_upload": {
+ "name": "is_vendor_upload",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "uploaded_by": {
+ "name": "uploaded_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploaded_at": {
+ "name": "uploaded_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "procurement_rfq_attachments_rfq_id_procurement_rfqs_id_fk": {
+ "name": "procurement_rfq_attachments_rfq_id_procurement_rfqs_id_fk",
+ "tableFrom": "procurement_rfq_attachments",
+ "tableTo": "procurement_rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "procurement_rfq_attachments_comment_id_procurement_rfq_comments_id_fk": {
+ "name": "procurement_rfq_attachments_comment_id_procurement_rfq_comments_id_fk",
+ "tableFrom": "procurement_rfq_attachments",
+ "tableTo": "procurement_rfq_comments",
+ "columnsFrom": [
+ "comment_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "procurement_rfq_attachments_quotation_id_procurement_vendor_quotations_id_fk": {
+ "name": "procurement_rfq_attachments_quotation_id_procurement_vendor_quotations_id_fk",
+ "tableFrom": "procurement_rfq_attachments",
+ "tableTo": "procurement_vendor_quotations",
+ "columnsFrom": [
+ "quotation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "procurement_rfq_attachments_uploaded_by_users_id_fk": {
+ "name": "procurement_rfq_attachments_uploaded_by_users_id_fk",
+ "tableFrom": "procurement_rfq_attachments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "uploaded_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "procurement_rfq_attachments_vendor_id_vendors_id_fk": {
+ "name": "procurement_rfq_attachments_vendor_id_vendors_id_fk",
+ "tableFrom": "procurement_rfq_attachments",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.procurement_rfq_comments": {
+ "name": "procurement_rfq_comments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_vendor_comment": {
+ "name": "is_vendor_comment",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "is_read": {
+ "name": "is_read",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "parent_comment_id": {
+ "name": "parent_comment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "procurement_rfq_comments_rfq_id_procurement_rfqs_id_fk": {
+ "name": "procurement_rfq_comments_rfq_id_procurement_rfqs_id_fk",
+ "tableFrom": "procurement_rfq_comments",
+ "tableTo": "procurement_rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "procurement_rfq_comments_vendor_id_vendors_id_fk": {
+ "name": "procurement_rfq_comments_vendor_id_vendors_id_fk",
+ "tableFrom": "procurement_rfq_comments",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "procurement_rfq_comments_user_id_users_id_fk": {
+ "name": "procurement_rfq_comments_user_id_users_id_fk",
+ "tableFrom": "procurement_rfq_comments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "procurement_rfq_comments_parent_comment_id_procurement_rfq_comments_id_fk": {
+ "name": "procurement_rfq_comments_parent_comment_id_procurement_rfq_comments_id_fk",
+ "tableFrom": "procurement_rfq_comments",
+ "tableTo": "procurement_rfq_comments",
+ "columnsFrom": [
+ "parent_comment_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.procurement_rfq_details": {
+ "name": "procurement_rfq_details",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "procurement_rfqs_id": {
+ "name": "procurement_rfqs_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendors_id": {
+ "name": "vendors_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'USD'"
+ },
+ "payment_terms_code": {
+ "name": "payment_terms_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "incoterms_code": {
+ "name": "incoterms_code",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "incoterms_detail": {
+ "name": "incoterms_detail",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_date": {
+ "name": "delivery_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tax_code": {
+ "name": "tax_code",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'VV'"
+ },
+ "place_of_shipping": {
+ "name": "place_of_shipping",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "place_of_destination": {
+ "name": "place_of_destination",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cancel_reason": {
+ "name": "cancel_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_by": {
+ "name": "updated_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "material_price_related_yn": {
+ "name": "material_price_related_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "procurement_rfq_details_procurement_rfqs_id_procurement_rfqs_id_fk": {
+ "name": "procurement_rfq_details_procurement_rfqs_id_procurement_rfqs_id_fk",
+ "tableFrom": "procurement_rfq_details",
+ "tableTo": "procurement_rfqs",
+ "columnsFrom": [
+ "procurement_rfqs_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "procurement_rfq_details_vendors_id_vendors_id_fk": {
+ "name": "procurement_rfq_details_vendors_id_vendors_id_fk",
+ "tableFrom": "procurement_rfq_details",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendors_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "procurement_rfq_details_payment_terms_code_payment_terms_code_fk": {
+ "name": "procurement_rfq_details_payment_terms_code_payment_terms_code_fk",
+ "tableFrom": "procurement_rfq_details",
+ "tableTo": "payment_terms",
+ "columnsFrom": [
+ "payment_terms_code"
+ ],
+ "columnsTo": [
+ "code"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "procurement_rfq_details_incoterms_code_incoterms_code_fk": {
+ "name": "procurement_rfq_details_incoterms_code_incoterms_code_fk",
+ "tableFrom": "procurement_rfq_details",
+ "tableTo": "incoterms",
+ "columnsFrom": [
+ "incoterms_code"
+ ],
+ "columnsTo": [
+ "code"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "procurement_rfq_details_updated_by_users_id_fk": {
+ "name": "procurement_rfq_details_updated_by_users_id_fk",
+ "tableFrom": "procurement_rfq_details",
+ "tableTo": "users",
+ "columnsFrom": [
+ "updated_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.procurement_rfqs": {
+ "name": "procurement_rfqs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "series": {
+ "name": "series",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_name": {
+ "name": "item_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rfq_send_date": {
+ "name": "rfq_send_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'RFQ Created'"
+ },
+ "rfq_sealed_yn": {
+ "name": "rfq_sealed_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "pic_code": {
+ "name": "pic_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sent_by": {
+ "name": "sent_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_by": {
+ "name": "updated_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "procurement_rfqs_project_id_projects_id_fk": {
+ "name": "procurement_rfqs_project_id_projects_id_fk",
+ "tableFrom": "procurement_rfqs",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "procurement_rfqs_sent_by_users_id_fk": {
+ "name": "procurement_rfqs_sent_by_users_id_fk",
+ "tableFrom": "procurement_rfqs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "sent_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "procurement_rfqs_created_by_users_id_fk": {
+ "name": "procurement_rfqs_created_by_users_id_fk",
+ "tableFrom": "procurement_rfqs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "procurement_rfqs_updated_by_users_id_fk": {
+ "name": "procurement_rfqs_updated_by_users_id_fk",
+ "tableFrom": "procurement_rfqs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "updated_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "procurement_rfqs_rfq_code_unique": {
+ "name": "procurement_rfqs_rfq_code_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "rfq_code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.procurement_vendor_quotations": {
+ "name": "procurement_vendor_quotations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "quotation_code": {
+ "name": "quotation_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quotation_version": {
+ "name": "quotation_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "total_items_count": {
+ "name": "total_items_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "sub_total": {
+ "name": "sub_total",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'0'"
+ },
+ "tax_total": {
+ "name": "tax_total",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'0'"
+ },
+ "discount_total": {
+ "name": "discount_total",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'0'"
+ },
+ "total_price": {
+ "name": "total_price",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'0'"
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'USD'"
+ },
+ "valid_until": {
+ "name": "valid_until",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "estimated_delivery_date": {
+ "name": "estimated_delivery_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payment_terms_code": {
+ "name": "payment_terms_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "incoterms_code": {
+ "name": "incoterms_code",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "incoterms_detail": {
+ "name": "incoterms_detail",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'Draft'"
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rejection_reason": {
+ "name": "rejection_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "submitted_at": {
+ "name": "submitted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accepted_at": {
+ "name": "accepted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_by": {
+ "name": "updated_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "procurement_vendor_quotations_rfq_id_procurement_rfqs_id_fk": {
+ "name": "procurement_vendor_quotations_rfq_id_procurement_rfqs_id_fk",
+ "tableFrom": "procurement_vendor_quotations",
+ "tableTo": "procurement_rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "procurement_vendor_quotations_vendor_id_vendors_id_fk": {
+ "name": "procurement_vendor_quotations_vendor_id_vendors_id_fk",
+ "tableFrom": "procurement_vendor_quotations",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "procurement_vendor_quotations_payment_terms_code_payment_terms_code_fk": {
+ "name": "procurement_vendor_quotations_payment_terms_code_payment_terms_code_fk",
+ "tableFrom": "procurement_vendor_quotations",
+ "tableTo": "payment_terms",
+ "columnsFrom": [
+ "payment_terms_code"
+ ],
+ "columnsTo": [
+ "code"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "procurement_vendor_quotations_incoterms_code_incoterms_code_fk": {
+ "name": "procurement_vendor_quotations_incoterms_code_incoterms_code_fk",
+ "tableFrom": "procurement_vendor_quotations",
+ "tableTo": "incoterms",
+ "columnsFrom": [
+ "incoterms_code"
+ ],
+ "columnsTo": [
+ "code"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.preset_shares": {
+ "name": "preset_shares",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "preset_id": {
+ "name": "preset_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "shared_with_user_id": {
+ "name": "shared_with_user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "permission": {
+ "name": "permission",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'read'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "preset_shares_preset_id_table_presets_id_fk": {
+ "name": "preset_shares_preset_id_table_presets_id_fk",
+ "tableFrom": "preset_shares",
+ "tableTo": "table_presets",
+ "columnsFrom": [
+ "preset_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.table_presets": {
+ "name": "table_presets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "table_id": {
+ "name": "table_id",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "settings": {
+ "name": "settings",
+ "type": "json",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_default": {
+ "name": "is_default",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "is_shared": {
+ "name": "is_shared",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_sales_attachments": {
+ "name": "tech_sales_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "attachment_type": {
+ "name": "attachment_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "tech_sales_rfq_id": {
+ "name": "tech_sales_rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "original_file_name": {
+ "name": "original_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tech_sales_attachments_tech_sales_rfq_id_tech_sales_rfqs_id_fk": {
+ "name": "tech_sales_attachments_tech_sales_rfq_id_tech_sales_rfqs_id_fk",
+ "tableFrom": "tech_sales_attachments",
+ "tableTo": "tech_sales_rfqs",
+ "columnsFrom": [
+ "tech_sales_rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tech_sales_attachments_created_by_users_id_fk": {
+ "name": "tech_sales_attachments_created_by_users_id_fk",
+ "tableFrom": "tech_sales_attachments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_sales_rfq_comment_attachments": {
+ "name": "tech_sales_rfq_comment_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "comment_id": {
+ "name": "comment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quotation_id": {
+ "name": "quotation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_vendor_upload": {
+ "name": "is_vendor_upload",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "uploaded_by": {
+ "name": "uploaded_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploaded_at": {
+ "name": "uploaded_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tech_sales_rfq_comment_attachments_rfq_id_tech_sales_rfqs_id_fk": {
+ "name": "tech_sales_rfq_comment_attachments_rfq_id_tech_sales_rfqs_id_fk",
+ "tableFrom": "tech_sales_rfq_comment_attachments",
+ "tableTo": "tech_sales_rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfq_comment_attachments_comment_id_tech_sales_rfq_comments_id_fk": {
+ "name": "tech_sales_rfq_comment_attachments_comment_id_tech_sales_rfq_comments_id_fk",
+ "tableFrom": "tech_sales_rfq_comment_attachments",
+ "tableTo": "tech_sales_rfq_comments",
+ "columnsFrom": [
+ "comment_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfq_comment_attachments_quotation_id_tech_sales_vendor_quotations_id_fk": {
+ "name": "tech_sales_rfq_comment_attachments_quotation_id_tech_sales_vendor_quotations_id_fk",
+ "tableFrom": "tech_sales_rfq_comment_attachments",
+ "tableTo": "tech_sales_vendor_quotations",
+ "columnsFrom": [
+ "quotation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfq_comment_attachments_uploaded_by_users_id_fk": {
+ "name": "tech_sales_rfq_comment_attachments_uploaded_by_users_id_fk",
+ "tableFrom": "tech_sales_rfq_comment_attachments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "uploaded_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfq_comment_attachments_vendor_id_tech_vendors_id_fk": {
+ "name": "tech_sales_rfq_comment_attachments_vendor_id_tech_vendors_id_fk",
+ "tableFrom": "tech_sales_rfq_comment_attachments",
+ "tableTo": "tech_vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_sales_rfq_comments": {
+ "name": "tech_sales_rfq_comments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_vendor_comment": {
+ "name": "is_vendor_comment",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "is_read": {
+ "name": "is_read",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "parent_comment_id": {
+ "name": "parent_comment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tech_sales_rfq_comments_rfq_id_tech_sales_rfqs_id_fk": {
+ "name": "tech_sales_rfq_comments_rfq_id_tech_sales_rfqs_id_fk",
+ "tableFrom": "tech_sales_rfq_comments",
+ "tableTo": "tech_sales_rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfq_comments_vendor_id_tech_vendors_id_fk": {
+ "name": "tech_sales_rfq_comments_vendor_id_tech_vendors_id_fk",
+ "tableFrom": "tech_sales_rfq_comments",
+ "tableTo": "tech_vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfq_comments_user_id_users_id_fk": {
+ "name": "tech_sales_rfq_comments_user_id_users_id_fk",
+ "tableFrom": "tech_sales_rfq_comments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfq_comments_parent_comment_id_tech_sales_rfq_comments_id_fk": {
+ "name": "tech_sales_rfq_comments_parent_comment_id_tech_sales_rfq_comments_id_fk",
+ "tableFrom": "tech_sales_rfq_comments",
+ "tableTo": "tech_sales_rfq_comments",
+ "columnsFrom": [
+ "parent_comment_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_sales_rfq_items": {
+ "name": "tech_sales_rfq_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_shipbuilding_id": {
+ "name": "item_shipbuilding_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_offshore_top_id": {
+ "name": "item_offshore_top_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_offshore_hull_id": {
+ "name": "item_offshore_hull_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_type": {
+ "name": "item_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tech_sales_rfq_items_rfq_id_tech_sales_rfqs_id_fk": {
+ "name": "tech_sales_rfq_items_rfq_id_tech_sales_rfqs_id_fk",
+ "tableFrom": "tech_sales_rfq_items",
+ "tableTo": "tech_sales_rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfq_items_item_shipbuilding_id_item_shipbuilding_id_fk": {
+ "name": "tech_sales_rfq_items_item_shipbuilding_id_item_shipbuilding_id_fk",
+ "tableFrom": "tech_sales_rfq_items",
+ "tableTo": "item_shipbuilding",
+ "columnsFrom": [
+ "item_shipbuilding_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfq_items_item_offshore_top_id_item_offshore_top_id_fk": {
+ "name": "tech_sales_rfq_items_item_offshore_top_id_item_offshore_top_id_fk",
+ "tableFrom": "tech_sales_rfq_items",
+ "tableTo": "item_offshore_top",
+ "columnsFrom": [
+ "item_offshore_top_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfq_items_item_offshore_hull_id_item_offshore_hull_id_fk": {
+ "name": "tech_sales_rfq_items_item_offshore_hull_id_item_offshore_hull_id_fk",
+ "tableFrom": "tech_sales_rfq_items",
+ "tableTo": "item_offshore_hull",
+ "columnsFrom": [
+ "item_offshore_hull_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_sales_rfqs": {
+ "name": "tech_sales_rfqs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "bidding_project_id": {
+ "name": "bidding_project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "material_code": {
+ "name": "material_code",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rfq_send_date": {
+ "name": "rfq_send_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'RFQ Created'"
+ },
+ "pic_code": {
+ "name": "pic_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sent_by": {
+ "name": "sent_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_by": {
+ "name": "updated_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "cancel_reason": {
+ "name": "cancel_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_type": {
+ "name": "rfq_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'SHIP'"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tech_sales_rfqs_bidding_project_id_bidding_projects_id_fk": {
+ "name": "tech_sales_rfqs_bidding_project_id_bidding_projects_id_fk",
+ "tableFrom": "tech_sales_rfqs",
+ "tableTo": "bidding_projects",
+ "columnsFrom": [
+ "bidding_project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfqs_sent_by_users_id_fk": {
+ "name": "tech_sales_rfqs_sent_by_users_id_fk",
+ "tableFrom": "tech_sales_rfqs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "sent_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfqs_created_by_users_id_fk": {
+ "name": "tech_sales_rfqs_created_by_users_id_fk",
+ "tableFrom": "tech_sales_rfqs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "tech_sales_rfqs_updated_by_users_id_fk": {
+ "name": "tech_sales_rfqs_updated_by_users_id_fk",
+ "tableFrom": "tech_sales_rfqs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "updated_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "tech_sales_rfqs_rfq_code_unique": {
+ "name": "tech_sales_rfqs_rfq_code_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "rfq_code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_sales_vendor_quotation_attachments": {
+ "name": "tech_sales_vendor_quotation_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "quotation_id": {
+ "name": "quotation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "original_file_name": {
+ "name": "original_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploaded_by": {
+ "name": "uploaded_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_vendor_upload": {
+ "name": "is_vendor_upload",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tech_sales_vendor_quotation_attachments_quotation_id_tech_sales_vendor_quotations_id_fk": {
+ "name": "tech_sales_vendor_quotation_attachments_quotation_id_tech_sales_vendor_quotations_id_fk",
+ "tableFrom": "tech_sales_vendor_quotation_attachments",
+ "tableTo": "tech_sales_vendor_quotations",
+ "columnsFrom": [
+ "quotation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tech_sales_vendor_quotation_attachments_uploaded_by_users_id_fk": {
+ "name": "tech_sales_vendor_quotation_attachments_uploaded_by_users_id_fk",
+ "tableFrom": "tech_sales_vendor_quotation_attachments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "uploaded_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "tech_sales_vendor_quotation_attachments_vendor_id_tech_vendors_id_fk": {
+ "name": "tech_sales_vendor_quotation_attachments_vendor_id_tech_vendors_id_fk",
+ "tableFrom": "tech_sales_vendor_quotation_attachments",
+ "tableTo": "tech_vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_sales_vendor_quotation_revisions": {
+ "name": "tech_sales_vendor_quotation_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "quotation_id": {
+ "name": "quotation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "snapshot": {
+ "name": "snapshot",
+ "type": "json",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "change_reason": {
+ "name": "change_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_note": {
+ "name": "revision_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revised_by": {
+ "name": "revised_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revised_at": {
+ "name": "revised_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "tech_sales_quotation_revisions_quotation_version_idx": {
+ "name": "tech_sales_quotation_revisions_quotation_version_idx",
+ "columns": [
+ {
+ "expression": "quotation_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "version",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "tech_sales_vendor_quotation_revisions_quotation_id_tech_sales_vendor_quotations_id_fk": {
+ "name": "tech_sales_vendor_quotation_revisions_quotation_id_tech_sales_vendor_quotations_id_fk",
+ "tableFrom": "tech_sales_vendor_quotation_revisions",
+ "tableTo": "tech_sales_vendor_quotations",
+ "columnsFrom": [
+ "quotation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_sales_vendor_quotations": {
+ "name": "tech_sales_vendor_quotations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "quotation_code": {
+ "name": "quotation_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quotation_version": {
+ "name": "quotation_version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_price": {
+ "name": "total_price",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "valid_until": {
+ "name": "valid_until",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'Assigned'"
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rejection_reason": {
+ "name": "rejection_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "submitted_at": {
+ "name": "submitted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "accepted_at": {
+ "name": "accepted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_by": {
+ "name": "updated_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tech_sales_vendor_quotations_rfq_id_tech_sales_rfqs_id_fk": {
+ "name": "tech_sales_vendor_quotations_rfq_id_tech_sales_rfqs_id_fk",
+ "tableFrom": "tech_sales_vendor_quotations",
+ "tableTo": "tech_sales_rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "tech_sales_vendor_quotations_vendor_id_tech_vendors_id_fk": {
+ "name": "tech_sales_vendor_quotations_vendor_id_tech_vendors_id_fk",
+ "tableFrom": "tech_sales_vendor_quotations",
+ "tableTo": "tech_vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ocr_rotation_attempts": {
+ "name": "ocr_rotation_attempts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rotation": {
+ "name": "rotation",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "confidence": {
+ "name": "confidence",
+ "type": "numeric(5, 4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tables_found": {
+ "name": "tables_found",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "text_quality": {
+ "name": "text_quality",
+ "type": "numeric(5, 4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "keyword_count": {
+ "name": "keyword_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "score": {
+ "name": "score",
+ "type": "numeric(5, 4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "extracted_rows_count": {
+ "name": "extracted_rows_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ocr_rotation_attempts_session_id_ocr_sessions_id_fk": {
+ "name": "ocr_rotation_attempts_session_id_ocr_sessions_id_fk",
+ "tableFrom": "ocr_rotation_attempts",
+ "tableTo": "ocr_sessions",
+ "columnsFrom": [
+ "session_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ocr_rows": {
+ "name": "ocr_rows",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "table_id": {
+ "name": "table_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "row_index": {
+ "name": "row_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "report_no": {
+ "name": "report_no",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "inspection_date": {
+ "name": "inspection_date",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "no": {
+ "name": "no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "identification_no": {
+ "name": "identification_no",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tag_no": {
+ "name": "tag_no",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "joint_no": {
+ "name": "joint_no",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "joint_type": {
+ "name": "joint_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "welding_date": {
+ "name": "welding_date",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confidence": {
+ "name": "confidence",
+ "type": "numeric(5, 4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_table": {
+ "name": "source_table",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source_row": {
+ "name": "source_row",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "idx_ocr_report_no_unique": {
+ "name": "idx_ocr_report_no_unique",
+ "columns": [
+ {
+ "expression": "report_no",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "no",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "tag_no",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "joint_no",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "joint_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "ocr_rows_table_id_ocr_tables_id_fk": {
+ "name": "ocr_rows_table_id_ocr_tables_id_fk",
+ "tableFrom": "ocr_rows",
+ "tableTo": "ocr_tables",
+ "columnsFrom": [
+ "table_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ocr_rows_session_id_ocr_sessions_id_fk": {
+ "name": "ocr_rows_session_id_ocr_sessions_id_fk",
+ "tableFrom": "ocr_rows",
+ "tableTo": "ocr_sessions",
+ "columnsFrom": [
+ "session_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "ocr_rows_user_id_users_id_fk": {
+ "name": "ocr_rows_user_id_users_id_fk",
+ "tableFrom": "ocr_rows",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ocr_sessions": {
+ "name": "ocr_sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "processing_time": {
+ "name": "processing_time",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "best_rotation": {
+ "name": "best_rotation",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "total_tables": {
+ "name": "total_tables",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "total_rows": {
+ "name": "total_rows",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "image_enhanced": {
+ "name": "image_enhanced",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "pdf_converted": {
+ "name": "pdf_converted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "success": {
+ "name": "success",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "error_message": {
+ "name": "error_message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "warnings": {
+ "name": "warnings",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.ocr_tables": {
+ "name": "ocr_tables",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "table_index": {
+ "name": "table_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "row_count": {
+ "name": "row_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ocr_tables_session_id_ocr_sessions_id_fk": {
+ "name": "ocr_tables_session_id_ocr_sessions_id_fk",
+ "tableFrom": "ocr_tables",
+ "tableTo": "ocr_sessions",
+ "columnsFrom": [
+ "session_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.b_rfq_attachment_revisions": {
+ "name": "b_rfq_attachment_revisions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "attachment_id": {
+ "name": "attachment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision_no": {
+ "name": "revision_no",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "revision_comment": {
+ "name": "revision_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_latest": {
+ "name": "is_latest",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "original_file_name": {
+ "name": "original_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "latest_revision_idx": {
+ "name": "latest_revision_idx",
+ "columns": [
+ {
+ "expression": "attachment_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "is_latest",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "where": "\"b_rfq_attachment_revisions\".\"is_latest\" = $1",
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "attachment_revision_idx": {
+ "name": "attachment_revision_idx",
+ "columns": [
+ {
+ "expression": "attachment_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "revision_no",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "b_rfq_attachment_revisions_attachment_id_b_rfq_attachments_id_fk": {
+ "name": "b_rfq_attachment_revisions_attachment_id_b_rfq_attachments_id_fk",
+ "tableFrom": "b_rfq_attachment_revisions",
+ "tableTo": "b_rfq_attachments",
+ "columnsFrom": [
+ "attachment_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "b_rfq_attachment_revisions_created_by_users_id_fk": {
+ "name": "b_rfq_attachment_revisions_created_by_users_id_fk",
+ "tableFrom": "b_rfq_attachment_revisions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.b_rfqs": {
+ "name": "b_rfqs",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'DRAFT'"
+ },
+ "pic_code": {
+ "name": "pic_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pic_name": {
+ "name": "pic_name",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "eng_pic_name": {
+ "name": "eng_pic_name",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_company": {
+ "name": "project_company",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_flag": {
+ "name": "project_flag",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_site": {
+ "name": "project_site",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_no": {
+ "name": "package_no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_by": {
+ "name": "updated_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "b_rfqs_project_id_projects_id_fk": {
+ "name": "b_rfqs_project_id_projects_id_fk",
+ "tableFrom": "b_rfqs",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "b_rfqs_created_by_users_id_fk": {
+ "name": "b_rfqs_created_by_users_id_fk",
+ "tableFrom": "b_rfqs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "b_rfqs_updated_by_users_id_fk": {
+ "name": "b_rfqs_updated_by_users_id_fk",
+ "tableFrom": "b_rfqs",
+ "tableTo": "users",
+ "columnsFrom": [
+ "updated_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "b_rfqs_rfq_code_unique": {
+ "name": "b_rfqs_rfq_code_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "rfq_code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.b_rfq_attachments": {
+ "name": "b_rfq_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "attachment_type": {
+ "name": "attachment_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "serial_no": {
+ "name": "serial_no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "current_revision": {
+ "name": "current_revision",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'Rev.0'"
+ },
+ "latest_revision_id": {
+ "name": "latest_revision_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "b_rfq_attachments_rfq_id_b_rfqs_id_fk": {
+ "name": "b_rfq_attachments_rfq_id_b_rfqs_id_fk",
+ "tableFrom": "b_rfq_attachments",
+ "tableTo": "b_rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "b_rfq_attachments_created_by_users_id_fk": {
+ "name": "b_rfq_attachments_created_by_users_id_fk",
+ "tableFrom": "b_rfq_attachments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.final_rfq": {
+ "name": "final_rfq",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "final_rfq_status": {
+ "name": "final_rfq_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'DRAFT'"
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "valid_date": {
+ "name": "valid_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "incoterms_code": {
+ "name": "incoterms_code",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gtc": {
+ "name": "gtc",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gtc_valid_date": {
+ "name": "gtc_valid_date",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "classification": {
+ "name": "classification",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sparepart": {
+ "name": "sparepart",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "short_list": {
+ "name": "short_list",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "return_yn": {
+ "name": "return_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "cp_request_yn": {
+ "name": "cp_request_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "prject_gtc_yn": {
+ "name": "prject_gtc_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "return_revision": {
+ "name": "return_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'KRW'"
+ },
+ "payment_terms_code": {
+ "name": "payment_terms_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_code": {
+ "name": "tax_code",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'VV'"
+ },
+ "delivery_date": {
+ "name": "delivery_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "place_of_shipping": {
+ "name": "place_of_shipping",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "place_of_destination": {
+ "name": "place_of_destination",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "firsttime_yn": {
+ "name": "firsttime_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "material_price_related_yn": {
+ "name": "material_price_related_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_remark": {
+ "name": "vendor_remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "final_rfq_rfq_id_b_rfqs_id_fk": {
+ "name": "final_rfq_rfq_id_b_rfqs_id_fk",
+ "tableFrom": "final_rfq",
+ "tableTo": "b_rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "final_rfq_vendor_id_vendors_id_fk": {
+ "name": "final_rfq_vendor_id_vendors_id_fk",
+ "tableFrom": "final_rfq",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "final_rfq_incoterms_code_incoterms_code_fk": {
+ "name": "final_rfq_incoterms_code_incoterms_code_fk",
+ "tableFrom": "final_rfq",
+ "tableTo": "incoterms",
+ "columnsFrom": [
+ "incoterms_code"
+ ],
+ "columnsTo": [
+ "code"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "final_rfq_payment_terms_code_payment_terms_code_fk": {
+ "name": "final_rfq_payment_terms_code_payment_terms_code_fk",
+ "tableFrom": "final_rfq",
+ "tableTo": "payment_terms",
+ "columnsFrom": [
+ "payment_terms_code"
+ ],
+ "columnsTo": [
+ "code"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.initial_rfq": {
+ "name": "initial_rfq",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "initial_rfq_status": {
+ "name": "initial_rfq_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'DRAFT'"
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "valid_date": {
+ "name": "valid_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "incoterms_code": {
+ "name": "incoterms_code",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gtc": {
+ "name": "gtc",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gtc_valid_date": {
+ "name": "gtc_valid_date",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "classification": {
+ "name": "classification",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sparepart": {
+ "name": "sparepart",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "short_list": {
+ "name": "short_list",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "return_yn": {
+ "name": "return_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "cp_request_yn": {
+ "name": "cp_request_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "prject_gtc_yn": {
+ "name": "prject_gtc_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "return_revision": {
+ "name": "return_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "rfq_revision": {
+ "name": "rfq_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "initial_rfq_rfq_id_b_rfqs_id_fk": {
+ "name": "initial_rfq_rfq_id_b_rfqs_id_fk",
+ "tableFrom": "initial_rfq",
+ "tableTo": "b_rfqs",
+ "columnsFrom": [
+ "rfq_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "initial_rfq_vendor_id_vendors_id_fk": {
+ "name": "initial_rfq_vendor_id_vendors_id_fk",
+ "tableFrom": "initial_rfq",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "initial_rfq_incoterms_code_incoterms_code_fk": {
+ "name": "initial_rfq_incoterms_code_incoterms_code_fk",
+ "tableFrom": "initial_rfq",
+ "tableTo": "incoterms",
+ "columnsFrom": [
+ "incoterms_code"
+ ],
+ "columnsTo": [
+ "code"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_attachment_responses": {
+ "name": "vendor_attachment_responses",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "attachment_id": {
+ "name": "attachment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rfq_type": {
+ "name": "rfq_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "rfq_record_id": {
+ "name": "rfq_record_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "response_status": {
+ "name": "response_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'NOT_RESPONDED'"
+ },
+ "current_revision": {
+ "name": "current_revision",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'Rev.0'"
+ },
+ "responded_revision": {
+ "name": "responded_revision",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response_comment": {
+ "name": "response_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_comment": {
+ "name": "vendor_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_request_comment": {
+ "name": "revision_request_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requested_at": {
+ "name": "requested_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "responded_at": {
+ "name": "responded_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_requested_at": {
+ "name": "revision_requested_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_by": {
+ "name": "updated_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "vendor_response_idx": {
+ "name": "vendor_response_idx",
+ "columns": [
+ {
+ "expression": "attachment_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "vendor_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "rfq_type",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "vendor_attachment_responses_attachment_id_b_rfq_attachments_id_fk": {
+ "name": "vendor_attachment_responses_attachment_id_b_rfq_attachments_id_fk",
+ "tableFrom": "vendor_attachment_responses",
+ "tableTo": "b_rfq_attachments",
+ "columnsFrom": [
+ "attachment_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vendor_attachment_responses_vendor_id_vendors_id_fk": {
+ "name": "vendor_attachment_responses_vendor_id_vendors_id_fk",
+ "tableFrom": "vendor_attachment_responses",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vendor_attachment_responses_created_by_users_id_fk": {
+ "name": "vendor_attachment_responses_created_by_users_id_fk",
+ "tableFrom": "vendor_attachment_responses",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "vendor_attachment_responses_updated_by_users_id_fk": {
+ "name": "vendor_attachment_responses_updated_by_users_id_fk",
+ "tableFrom": "vendor_attachment_responses",
+ "tableTo": "users",
+ "columnsFrom": [
+ "updated_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_response_attachments_b": {
+ "name": "vendor_response_attachments_b",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_response_id": {
+ "name": "vendor_response_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "original_file_name": {
+ "name": "original_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploaded_by": {
+ "name": "uploaded_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploaded_at": {
+ "name": "uploaded_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_response_attachments_b_vendor_response_id_vendor_attachment_responses_id_fk": {
+ "name": "vendor_response_attachments_b_vendor_response_id_vendor_attachment_responses_id_fk",
+ "tableFrom": "vendor_response_attachments_b",
+ "tableTo": "vendor_attachment_responses",
+ "columnsFrom": [
+ "vendor_response_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vendor_response_attachments_b_uploaded_by_users_id_fk": {
+ "name": "vendor_response_attachments_b_uploaded_by_users_id_fk",
+ "tableFrom": "vendor_response_attachments_b",
+ "tableTo": "users",
+ "columnsFrom": [
+ "uploaded_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_response_history": {
+ "name": "vendor_response_history",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_response_id": {
+ "name": "vendor_response_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "action": {
+ "name": "action",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "previous_status": {
+ "name": "previous_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "new_status": {
+ "name": "new_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "action_by": {
+ "name": "action_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "action_at": {
+ "name": "action_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_response_history_vendor_response_id_vendor_attachment_responses_id_fk": {
+ "name": "vendor_response_history_vendor_response_id_vendor_attachment_responses_id_fk",
+ "tableFrom": "vendor_response_history",
+ "tableTo": "vendor_attachment_responses",
+ "columnsFrom": [
+ "vendor_response_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vendor_response_history_action_by_users_id_fk": {
+ "name": "vendor_response_history_action_by_users_id_fk",
+ "tableFrom": "vendor_response_history",
+ "tableTo": "users",
+ "columnsFrom": [
+ "action_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_vendor_attachments": {
+ "name": "tech_vendor_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attachment_type": {
+ "name": "attachment_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'GENERAL'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tech_vendor_attachments_vendor_id_tech_vendors_id_fk": {
+ "name": "tech_vendor_attachments_vendor_id_tech_vendors_id_fk",
+ "tableFrom": "tech_vendor_attachments",
+ "tableTo": "tech_vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_vendor_candidates": {
+ "name": "tech_vendor_candidates",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "company_name": {
+ "name": "company_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contact_email": {
+ "name": "contact_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contact_phone": {
+ "name": "contact_phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_id": {
+ "name": "tax_id",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country": {
+ "name": "country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'COLLECTED'"
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tech_vendor_candidates_vendor_id_tech_vendors_id_fk": {
+ "name": "tech_vendor_candidates_vendor_id_tech_vendors_id_fk",
+ "tableFrom": "tech_vendor_candidates",
+ "tableTo": "tech_vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_vendor_contacts": {
+ "name": "tech_vendor_contacts",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contact_name": {
+ "name": "contact_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contact_position": {
+ "name": "contact_position",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contact_email": {
+ "name": "contact_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contact_phone": {
+ "name": "contact_phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country": {
+ "name": "country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_primary": {
+ "name": "is_primary",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tech_vendor_contacts_vendor_id_tech_vendors_id_fk": {
+ "name": "tech_vendor_contacts_vendor_id_tech_vendors_id_fk",
+ "tableFrom": "tech_vendor_contacts",
+ "tableTo": "tech_vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_vendor_possible_items": {
+ "name": "tech_vendor_possible_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_email": {
+ "name": "vendor_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "work_type": {
+ "name": "work_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ship_types": {
+ "name": "ship_types",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_list": {
+ "name": "item_list",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sub_item_list": {
+ "name": "sub_item_list",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "tech_vendor_possible_items_vendor_id_tech_vendors_id_fk": {
+ "name": "tech_vendor_possible_items_vendor_id_tech_vendors_id_fk",
+ "tableFrom": "tech_vendor_possible_items",
+ "tableTo": "tech_vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.tech_vendors": {
+ "name": "tech_vendors",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_id": {
+ "name": "tax_id",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country": {
+ "name": "country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country_eng": {
+ "name": "country_eng",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country_fab": {
+ "name": "country_fab",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_name": {
+ "name": "agent_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_phone": {
+ "name": "agent_phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_email": {
+ "name": "agent_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "address": {
+ "name": "address",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "phone": {
+ "name": "phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "website": {
+ "name": "website",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tech_vendor_type": {
+ "name": "tech_vendor_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ACTIVE'"
+ },
+ "is_quote_comparison": {
+ "name": "is_quote_comparison",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "representative_name": {
+ "name": "representative_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_email": {
+ "name": "representative_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_phone": {
+ "name": "representative_phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_birth": {
+ "name": "representative_birth",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "items": {
+ "name": "items",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.esg_answer_options": {
+ "name": "esg_answer_options",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "esg_evaluation_item_id": {
+ "name": "esg_evaluation_item_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "answer_text": {
+ "name": "answer_text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "score": {
+ "name": "score",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order_index": {
+ "name": "order_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "esg_answer_options_esg_evaluation_item_id_esg_evaluation_items_id_fk": {
+ "name": "esg_answer_options_esg_evaluation_item_id_esg_evaluation_items_id_fk",
+ "tableFrom": "esg_answer_options",
+ "tableTo": "esg_evaluation_items",
+ "columnsFrom": [
+ "esg_evaluation_item_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.esg_evaluation_items": {
+ "name": "esg_evaluation_items",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "esg_evaluation_id": {
+ "name": "esg_evaluation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "evaluation_item": {
+ "name": "evaluation_item",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "evaluation_item_description": {
+ "name": "evaluation_item_description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "order_index": {
+ "name": "order_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "esg_evaluation_items_esg_evaluation_id_esg_evaluations_id_fk": {
+ "name": "esg_evaluation_items_esg_evaluation_id_esg_evaluations_id_fk",
+ "tableFrom": "esg_evaluation_items",
+ "tableTo": "esg_evaluations",
+ "columnsFrom": [
+ "esg_evaluation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.esg_evaluation_responses": {
+ "name": "esg_evaluation_responses",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "submission_id": {
+ "name": "submission_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "esg_evaluation_item_id": {
+ "name": "esg_evaluation_item_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "esg_answer_option_id": {
+ "name": "esg_answer_option_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "selected_score": {
+ "name": "selected_score",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "additional_comments": {
+ "name": "additional_comments",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "esg_evaluation_responses_submission_id_evaluation_submissions_id_fk": {
+ "name": "esg_evaluation_responses_submission_id_evaluation_submissions_id_fk",
+ "tableFrom": "esg_evaluation_responses",
+ "tableTo": "evaluation_submissions",
+ "columnsFrom": [
+ "submission_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "esg_evaluation_responses_esg_evaluation_item_id_esg_evaluation_items_id_fk": {
+ "name": "esg_evaluation_responses_esg_evaluation_item_id_esg_evaluation_items_id_fk",
+ "tableFrom": "esg_evaluation_responses",
+ "tableTo": "esg_evaluation_items",
+ "columnsFrom": [
+ "esg_evaluation_item_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "esg_evaluation_responses_esg_answer_option_id_esg_answer_options_id_fk": {
+ "name": "esg_evaluation_responses_esg_answer_option_id_esg_answer_options_id_fk",
+ "tableFrom": "esg_evaluation_responses",
+ "tableTo": "esg_answer_options",
+ "columnsFrom": [
+ "esg_answer_option_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.esg_evaluations": {
+ "name": "esg_evaluations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "serial_number": {
+ "name": "serial_number",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "category": {
+ "name": "category",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "inspection_item": {
+ "name": "inspection_item",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "esg_evaluations_serial_number_unique": {
+ "name": "esg_evaluations_serial_number_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "serial_number"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.evaluation_submissions": {
+ "name": "evaluation_submissions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "submission_id": {
+ "name": "submission_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "periodic_evaluation_id": {
+ "name": "periodic_evaluation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "company_id": {
+ "name": "company_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "evaluation_year": {
+ "name": "evaluation_year",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "evaluation_round": {
+ "name": "evaluation_round",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "submission_status": {
+ "name": "submission_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'draft'"
+ },
+ "submitted_at": {
+ "name": "submitted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reviewed_at": {
+ "name": "reviewed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reviewed_by": {
+ "name": "reviewed_by",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "review_comments": {
+ "name": "review_comments",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "average_esg_score": {
+ "name": "average_esg_score",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_general_items": {
+ "name": "total_general_items",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "completed_general_items": {
+ "name": "completed_general_items",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "total_esg_items": {
+ "name": "total_esg_items",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "completed_esg_items": {
+ "name": "completed_esg_items",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "evaluation_submissions_periodic_evaluation_id_periodic_evaluations_id_fk": {
+ "name": "evaluation_submissions_periodic_evaluation_id_periodic_evaluations_id_fk",
+ "tableFrom": "evaluation_submissions",
+ "tableTo": "periodic_evaluations",
+ "columnsFrom": [
+ "periodic_evaluation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "evaluation_submissions_company_id_vendors_id_fk": {
+ "name": "evaluation_submissions_company_id_vendors_id_fk",
+ "tableFrom": "evaluation_submissions",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "company_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "evaluation_submissions_submission_id_unique": {
+ "name": "evaluation_submissions_submission_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "submission_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.general_evaluation_responses": {
+ "name": "general_evaluation_responses",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "submission_id": {
+ "name": "submission_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "general_evaluation_id": {
+ "name": "general_evaluation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "response_text": {
+ "name": "response_text",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "has_attachments": {
+ "name": "has_attachments",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "review_comments": {
+ "name": "review_comments",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "general_evaluation_responses_submission_id_evaluation_submissions_id_fk": {
+ "name": "general_evaluation_responses_submission_id_evaluation_submissions_id_fk",
+ "tableFrom": "general_evaluation_responses",
+ "tableTo": "evaluation_submissions",
+ "columnsFrom": [
+ "submission_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "general_evaluation_responses_general_evaluation_id_general_evaluations_id_fk": {
+ "name": "general_evaluation_responses_general_evaluation_id_general_evaluations_id_fk",
+ "tableFrom": "general_evaluation_responses",
+ "tableTo": "general_evaluations",
+ "columnsFrom": [
+ "general_evaluation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.general_evaluations": {
+ "name": "general_evaluations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "serial_number": {
+ "name": "serial_number",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "category": {
+ "name": "category",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "inspection_item": {
+ "name": "inspection_item",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "remarks": {
+ "name": "remarks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "general_evaluations_serial_number_unique": {
+ "name": "general_evaluations_serial_number_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "serial_number"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.vendor_evaluation_attachments": {
+ "name": "vendor_evaluation_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "file_id": {
+ "name": "file_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "submission_id": {
+ "name": "submission_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "general_evaluation_response_id": {
+ "name": "general_evaluation_response_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "original_file_name": {
+ "name": "original_file_name",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stored_file_name": {
+ "name": "stored_file_name",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mime_type": {
+ "name": "mime_type",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploaded_by": {
+ "name": "uploaded_by",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "vendor_evaluation_attachments_submission_id_evaluation_submissions_id_fk": {
+ "name": "vendor_evaluation_attachments_submission_id_evaluation_submissions_id_fk",
+ "tableFrom": "vendor_evaluation_attachments",
+ "tableTo": "evaluation_submissions",
+ "columnsFrom": [
+ "submission_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "vendor_evaluation_attachments_general_evaluation_response_id_general_evaluation_responses_id_fk": {
+ "name": "vendor_evaluation_attachments_general_evaluation_response_id_general_evaluation_responses_id_fk",
+ "tableFrom": "vendor_evaluation_attachments",
+ "tableTo": "general_evaluation_responses",
+ "columnsFrom": [
+ "general_evaluation_response_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "vendor_evaluation_attachments_file_id_unique": {
+ "name": "vendor_evaluation_attachments_file_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "file_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.evaluation_target_reviewers": {
+ "name": "evaluation_target_reviewers",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "evaluation_target_id": {
+ "name": "evaluation_target_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "department_code": {
+ "name": "department_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "department_name_from": {
+ "name": "department_name_from",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reviewer_user_id": {
+ "name": "reviewer_user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "assigned_at": {
+ "name": "assigned_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "assigned_by": {
+ "name": "assigned_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "evaluation_target_reviewers_evaluation_target_id_evaluation_targets_id_fk": {
+ "name": "evaluation_target_reviewers_evaluation_target_id_evaluation_targets_id_fk",
+ "tableFrom": "evaluation_target_reviewers",
+ "tableTo": "evaluation_targets",
+ "columnsFrom": [
+ "evaluation_target_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "evaluation_target_reviewers_reviewer_user_id_users_id_fk": {
+ "name": "evaluation_target_reviewers_reviewer_user_id_users_id_fk",
+ "tableFrom": "evaluation_target_reviewers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "reviewer_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "evaluation_target_reviewers_assigned_by_users_id_fk": {
+ "name": "evaluation_target_reviewers_assigned_by_users_id_fk",
+ "tableFrom": "evaluation_target_reviewers",
+ "tableTo": "users",
+ "columnsFrom": [
+ "assigned_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "unique_target_department": {
+ "name": "unique_target_department",
+ "nullsNotDistinct": false,
+ "columns": [
+ "evaluation_target_id",
+ "department_code"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.evaluation_target_reviews": {
+ "name": "evaluation_target_reviews",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "evaluation_target_id": {
+ "name": "evaluation_target_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reviewer_user_id": {
+ "name": "reviewer_user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "department_code": {
+ "name": "department_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_approved": {
+ "name": "is_approved",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "review_comment": {
+ "name": "review_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reviewed_at": {
+ "name": "reviewed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "evaluation_target_reviews_evaluation_target_id_evaluation_targets_id_fk": {
+ "name": "evaluation_target_reviews_evaluation_target_id_evaluation_targets_id_fk",
+ "tableFrom": "evaluation_target_reviews",
+ "tableTo": "evaluation_targets",
+ "columnsFrom": [
+ "evaluation_target_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "evaluation_target_reviews_reviewer_user_id_users_id_fk": {
+ "name": "evaluation_target_reviews_reviewer_user_id_users_id_fk",
+ "tableFrom": "evaluation_target_reviews",
+ "tableTo": "users",
+ "columnsFrom": [
+ "reviewer_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "unique_target_reviewer": {
+ "name": "unique_target_reviewer",
+ "nullsNotDistinct": false,
+ "columns": [
+ "evaluation_target_id",
+ "reviewer_user_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.evaluation_targets": {
+ "name": "evaluation_targets",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "evaluation_year": {
+ "name": "evaluation_year",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "division": {
+ "name": "division",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domestic_foreign": {
+ "name": "domestic_foreign",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "material_type": {
+ "name": "material_type",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PENDING'"
+ },
+ "admin_comment": {
+ "name": "admin_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "admin_user_id": {
+ "name": "admin_user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "consolidated_comment": {
+ "name": "consolidated_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "consensus_status": {
+ "name": "consensus_status",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirmed_at": {
+ "name": "confirmed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirmed_by": {
+ "name": "confirmed_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ld_claim_count": {
+ "name": "ld_claim_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "ld_claim_amount": {
+ "name": "ld_claim_amount",
+ "type": "numeric(15, 2)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'0'"
+ },
+ "ld_claim_currency": {
+ "name": "ld_claim_currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'KRW'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "evaluation_targets_vendor_id_vendors_id_fk": {
+ "name": "evaluation_targets_vendor_id_vendors_id_fk",
+ "tableFrom": "evaluation_targets",
+ "tableTo": "vendors",
+ "columnsFrom": [
+ "vendor_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "evaluation_targets_admin_user_id_users_id_fk": {
+ "name": "evaluation_targets_admin_user_id_users_id_fk",
+ "tableFrom": "evaluation_targets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "admin_user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ },
+ "evaluation_targets_confirmed_by_users_id_fk": {
+ "name": "evaluation_targets_confirmed_by_users_id_fk",
+ "tableFrom": "evaluation_targets",
+ "tableTo": "users",
+ "columnsFrom": [
+ "confirmed_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.periodic_evaluations": {
+ "name": "periodic_evaluations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "evaluation_target_id": {
+ "name": "evaluation_target_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "evaluation_period": {
+ "name": "evaluation_period",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "documents_submitted": {
+ "name": "documents_submitted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "submission_date": {
+ "name": "submission_date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "submission_deadline": {
+ "name": "submission_deadline",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_score": {
+ "name": "final_score",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_grade": {
+ "name": "final_grade",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_score": {
+ "name": "evaluation_score",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_grade": {
+ "name": "evaluation_grade",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PENDING'"
+ },
+ "review_completed_at": {
+ "name": "review_completed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "finalized_at": {
+ "name": "finalized_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "finalized_by": {
+ "name": "finalized_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_note": {
+ "name": "evaluation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "periodic_evaluations_evaluation_target_id_evaluation_targets_id_fk": {
+ "name": "periodic_evaluations_evaluation_target_id_evaluation_targets_id_fk",
+ "tableFrom": "periodic_evaluations",
+ "tableTo": "evaluation_targets",
+ "columnsFrom": [
+ "evaluation_target_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "periodic_evaluations_finalized_by_users_id_fk": {
+ "name": "periodic_evaluations_finalized_by_users_id_fk",
+ "tableFrom": "periodic_evaluations",
+ "tableTo": "users",
+ "columnsFrom": [
+ "finalized_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "unique_evaluation_target": {
+ "name": "unique_evaluation_target",
+ "nullsNotDistinct": false,
+ "columns": [
+ "evaluation_target_id",
+ "evaluation_period"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.reviewer_evaluation_attachments": {
+ "name": "reviewer_evaluation_attachments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "reviewer_evaluation_detail_id": {
+ "name": "reviewer_evaluation_detail_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "original_file_name": {
+ "name": "original_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stored_file_name": {
+ "name": "stored_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "public_path": {
+ "name": "public_path",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "mime_type": {
+ "name": "mime_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_extension": {
+ "name": "file_extension",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploaded_by": {
+ "name": "uploaded_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "reviewer_evaluation_detail_id_idx": {
+ "name": "reviewer_evaluation_detail_id_idx",
+ "columns": [
+ {
+ "expression": "reviewer_evaluation_detail_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "reviewer_evaluation_attachments_reviewer_evaluation_detail_id_reviewer_evaluation_details_id_fk": {
+ "name": "reviewer_evaluation_attachments_reviewer_evaluation_detail_id_reviewer_evaluation_details_id_fk",
+ "tableFrom": "reviewer_evaluation_attachments",
+ "tableTo": "reviewer_evaluation_details",
+ "columnsFrom": [
+ "reviewer_evaluation_detail_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "reviewer_evaluation_attachments_uploaded_by_users_id_fk": {
+ "name": "reviewer_evaluation_attachments_uploaded_by_users_id_fk",
+ "tableFrom": "reviewer_evaluation_attachments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "uploaded_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.reviewer_evaluation_details": {
+ "name": "reviewer_evaluation_details",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "reviewer_evaluation_id": {
+ "name": "reviewer_evaluation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "reg_eval_criteria_details_id": {
+ "name": "reg_eval_criteria_details_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "score": {
+ "name": "score",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "comment": {
+ "name": "comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "reviewer_evaluation_details_reviewer_evaluation_id_reviewer_evaluations_id_fk": {
+ "name": "reviewer_evaluation_details_reviewer_evaluation_id_reviewer_evaluations_id_fk",
+ "tableFrom": "reviewer_evaluation_details",
+ "tableTo": "reviewer_evaluations",
+ "columnsFrom": [
+ "reviewer_evaluation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "reviewer_evaluation_details_reg_eval_criteria_details_id_reg_eval_criteria_details_id_fk": {
+ "name": "reviewer_evaluation_details_reg_eval_criteria_details_id_reg_eval_criteria_details_id_fk",
+ "tableFrom": "reviewer_evaluation_details",
+ "tableTo": "reg_eval_criteria_details",
+ "columnsFrom": [
+ "reg_eval_criteria_details_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "unique_reviewer_criteria": {
+ "name": "unique_reviewer_criteria",
+ "nullsNotDistinct": false,
+ "columns": [
+ "reviewer_evaluation_id",
+ "reg_eval_criteria_details_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.reviewer_evaluations": {
+ "name": "reviewer_evaluations",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "periodic_evaluation_id": {
+ "name": "periodic_evaluation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "evaluation_target_reviewer_id": {
+ "name": "evaluation_target_reviewer_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_completed": {
+ "name": "is_completed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "submitted_at": {
+ "name": "submitted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reviewer_comment": {
+ "name": "reviewer_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "reviewer_evaluations_periodic_evaluation_id_periodic_evaluations_id_fk": {
+ "name": "reviewer_evaluations_periodic_evaluation_id_periodic_evaluations_id_fk",
+ "tableFrom": "reviewer_evaluations",
+ "tableTo": "periodic_evaluations",
+ "columnsFrom": [
+ "periodic_evaluation_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "reviewer_evaluations_evaluation_target_reviewer_id_evaluation_target_reviewers_id_fk": {
+ "name": "reviewer_evaluations_evaluation_target_reviewer_id_evaluation_target_reviewers_id_fk",
+ "tableFrom": "reviewer_evaluations",
+ "tableTo": "evaluation_target_reviewers",
+ "columnsFrom": [
+ "evaluation_target_reviewer_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "unique_reviewer_evaluation": {
+ "name": "unique_reviewer_evaluation",
+ "nullsNotDistinct": false,
+ "columns": [
+ "periodic_evaluation_id",
+ "evaluation_target_reviewer_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.reg_eval_criteria": {
+ "name": "reg_eval_criteria",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "category": {
+ "name": "category",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'quality'"
+ },
+ "category2": {
+ "name": "category2",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'processScore'"
+ },
+ "item": {
+ "name": "item",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'quality'"
+ },
+ "classification": {
+ "name": "classification",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "range": {
+ "name": "range",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remarks": {
+ "name": "remarks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_by": {
+ "name": "updated_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "variable_score_min ": {
+ "name": "variable_score_min ",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "variable_score_max ": {
+ "name": "variable_score_max ",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "variable_score_unit ": {
+ "name": "variable_score_unit ",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "score_type": {
+ "name": "score_type",
+ "type": "score_type",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'fixed'"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "reg_eval_criteria_created_by_users_id_fk": {
+ "name": "reg_eval_criteria_created_by_users_id_fk",
+ "tableFrom": "reg_eval_criteria",
+ "tableTo": "users",
+ "columnsFrom": [
+ "created_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "reg_eval_criteria_updated_by_users_id_fk": {
+ "name": "reg_eval_criteria_updated_by_users_id_fk",
+ "tableFrom": "reg_eval_criteria",
+ "tableTo": "users",
+ "columnsFrom": [
+ "updated_by"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.reg_eval_criteria_details": {
+ "name": "reg_eval_criteria_details",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "criteria_id": {
+ "name": "criteria_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order_index": {
+ "name": "order_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "score_equip_ship": {
+ "name": "score_equip_ship",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "score_equip_marine": {
+ "name": "score_equip_marine",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "score_bulk_ship": {
+ "name": "score_bulk_ship",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "score_bulk_marine": {
+ "name": "score_bulk_marine",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "reg_eval_criteria_details_criteria_id_reg_eval_criteria_id_fk": {
+ "name": "reg_eval_criteria_details_criteria_id_reg_eval_criteria_id_fk",
+ "tableFrom": "reg_eval_criteria_details",
+ "tableTo": "reg_eval_criteria",
+ "columnsFrom": [
+ "criteria_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.project_gtc_files": {
+ "name": "project_gtc_files",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "original_file_name": {
+ "name": "original_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "mime_type": {
+ "name": "mime_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "project_gtc_files_project_id_projects_id_fk": {
+ "name": "project_gtc_files_project_id_projects_id_fk",
+ "tableFrom": "project_gtc_files",
+ "tableTo": "projects",
+ "columnsFrom": [
+ "project_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.menu_assignments": {
+ "name": "menu_assignments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "menu_assignments_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "menu_path": {
+ "name": "menu_path",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "menu_title": {
+ "name": "menu_title",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "menu_description": {
+ "name": "menu_description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "menu_group": {
+ "name": "menu_group",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "section_title": {
+ "name": "section_title",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "domain": {
+ "name": "domain",
+ "type": "user_domain",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'evcp'"
+ },
+ "manager1_id": {
+ "name": "manager1_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "manager2_id": {
+ "name": "manager2_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {
+ "menu_assignments_path_idx": {
+ "name": "menu_assignments_path_idx",
+ "columns": [
+ {
+ "expression": "menu_path",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": true,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "menu_assignments_manager1_idx": {
+ "name": "menu_assignments_manager1_idx",
+ "columns": [
+ {
+ "expression": "manager1_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "menu_assignments_manager2_idx": {
+ "name": "menu_assignments_manager2_idx",
+ "columns": [
+ {
+ "expression": "manager2_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "menu_assignments_domain_idx": {
+ "name": "menu_assignments_domain_idx",
+ "columns": [
+ {
+ "expression": "domain",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "menu_assignments_manager1_id_users_id_fk": {
+ "name": "menu_assignments_manager1_id_users_id_fk",
+ "tableFrom": "menu_assignments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "manager1_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ },
+ "menu_assignments_manager2_id_users_id_fk": {
+ "name": "menu_assignments_manager2_id_users_id_fk",
+ "tableFrom": "menu_assignments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "manager2_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "menu_assignments_menu_path_unique": {
+ "name": "menu_assignments_menu_path_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "menu_path"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.page_information": {
+ "name": "page_information",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_name": {
+ "name": "page_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "information_content": {
+ "name": "information_content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attachment_file_name": {
+ "name": "attachment_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_file_path": {
+ "name": "attachment_file_path",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_file_size": {
+ "name": "attachment_file_size",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "page_information_page_path_unique": {
+ "name": "page_information_page_path_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "page_path"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.qna": {
+ "name": "qna",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "category": {
+ "name": "category",
+ "type": "qna_category",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "author": {
+ "name": "author",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "is_deleted": {
+ "name": "is_deleted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_qna_author": {
+ "name": "idx_qna_author",
+ "columns": [
+ {
+ "expression": "author",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "qna_author_users_id_fk": {
+ "name": "qna_author_users_id_fk",
+ "tableFrom": "qna",
+ "tableTo": "users",
+ "columnsFrom": [
+ "author"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.qna_answer": {
+ "name": "qna_answer",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "qna_id": {
+ "name": "qna_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "author": {
+ "name": "author",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "is_deleted": {
+ "name": "is_deleted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_answer_qna": {
+ "name": "idx_answer_qna",
+ "columns": [
+ {
+ "expression": "qna_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_answer_author": {
+ "name": "idx_answer_author",
+ "columns": [
+ {
+ "expression": "author",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "qna_answer_qna_id_qna_id_fk": {
+ "name": "qna_answer_qna_id_qna_id_fk",
+ "tableFrom": "qna_answer",
+ "tableTo": "qna",
+ "columnsFrom": [
+ "qna_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "qna_answer_author_users_id_fk": {
+ "name": "qna_answer_author_users_id_fk",
+ "tableFrom": "qna_answer",
+ "tableTo": "users",
+ "columnsFrom": [
+ "author"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.qna_comments": {
+ "name": "qna_comments",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "author": {
+ "name": "author",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "answer_id": {
+ "name": "answer_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_comment_id": {
+ "name": "parent_comment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "is_deleted": {
+ "name": "is_deleted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_comment_answer": {
+ "name": "idx_comment_answer",
+ "columns": [
+ {
+ "expression": "answer_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_comment_parent": {
+ "name": "idx_comment_parent",
+ "columns": [
+ {
+ "expression": "parent_comment_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {
+ "qna_comments_author_users_id_fk": {
+ "name": "qna_comments_author_users_id_fk",
+ "tableFrom": "qna_comments",
+ "tableTo": "users",
+ "columnsFrom": [
+ "author"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "qna_comments_answer_id_qna_answer_id_fk": {
+ "name": "qna_comments_answer_id_qna_answer_id_fk",
+ "tableFrom": "qna_comments",
+ "tableTo": "qna_answer",
+ "columnsFrom": [
+ "answer_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notice": {
+ "name": "notice",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "page_path": {
+ "name": "page_path",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "author_id": {
+ "name": "author_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "notice_author_id_users_id_fk": {
+ "name": "notice_author_id_users_id_fk",
+ "tableFrom": "notice",
+ "tableTo": "users",
+ "columnsFrom": [
+ "author_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.daily_access_stats": {
+ "name": "daily_access_stats",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "date": {
+ "name": "date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "total_visits": {
+ "name": "total_visits",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "unique_users": {
+ "name": "unique_users",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "total_sessions": {
+ "name": "total_sessions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "avg_session_duration": {
+ "name": "avg_session_duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.login_sessions": {
+ "name": "login_sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "login_at": {
+ "name": "login_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "logout_at": {
+ "name": "logout_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "inet",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "session_token": {
+ "name": "session_token",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "nextauth_session_id": {
+ "name": "nextauth_session_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "auth_method": {
+ "name": "auth_method",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_activity_at": {
+ "name": "last_activity_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "session_expired_at": {
+ "name": "session_expired_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "login_sessions_user_id_users_id_fk": {
+ "name": "login_sessions_user_id_users_id_fk",
+ "tableFrom": "login_sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "login_sessions_session_token_unique": {
+ "name": "login_sessions_session_token_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "session_token"
+ ]
+ },
+ "login_sessions_nextauth_session_id_unique": {
+ "name": "login_sessions_nextauth_session_id_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "nextauth_session_id"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.page_visits": {
+ "name": "page_visits",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "session_id": {
+ "name": "session_id",
+ "type": "uuid",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "route": {
+ "name": "route",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "page_title": {
+ "name": "page_title",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "referrer": {
+ "name": "referrer",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ip_address": {
+ "name": "ip_address",
+ "type": "inet",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_agent": {
+ "name": "user_agent",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "visited_at": {
+ "name": "visited_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "duration": {
+ "name": "duration",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "query_params": {
+ "name": "query_params",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "device_type": {
+ "name": "device_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "browser_name": {
+ "name": "browser_name",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "os_name": {
+ "name": "os_name",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "page_visits_user_id_users_id_fk": {
+ "name": "page_visits_user_id_users_id_fk",
+ "tableFrom": "page_visits",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ },
+ "page_visits_session_id_login_sessions_id_fk": {
+ "name": "page_visits_session_id_login_sessions_id_fk",
+ "tableFrom": "page_visits",
+ "tableTo": "login_sessions",
+ "columnsFrom": [
+ "session_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "set null",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.temp_auth_sessions": {
+ "name": "temp_auth_sessions",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "temp_auth_key": {
+ "name": "temp_auth_key",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "auth_method": {
+ "name": "auth_method",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expires_at": {
+ "name": "expires_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_used": {
+ "name": "is_used",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "temp_auth_sessions_user_id_users_id_fk": {
+ "name": "temp_auth_sessions_user_id_users_id_fk",
+ "tableFrom": "temp_auth_sessions",
+ "tableTo": "users",
+ "columnsFrom": [
+ "user_id"
+ ],
+ "columnsTo": [
+ "id"
+ ],
+ "onDelete": "cascade",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "temp_auth_sessions_temp_auth_key_unique": {
+ "name": "temp_auth_sessions_temp_auth_key_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "temp_auth_key"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "public.notifications": {
+ "name": "notifications",
+ "schema": "",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "uuid",
+ "primaryKey": true,
+ "notNull": true,
+ "default": "gen_random_uuid()"
+ },
+ "user_id": {
+ "name": "user_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "message": {
+ "name": "message",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "related_record_id": {
+ "name": "related_record_id",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "related_record_type": {
+ "name": "related_record_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_read": {
+ "name": "is_read",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "read_at": {
+ "name": "read_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {
+ "idx_notifications_user_id": {
+ "name": "idx_notifications_user_id",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_notifications_created_at": {
+ "name": "idx_notifications_created_at",
+ "columns": [
+ {
+ "expression": "created_at",
+ "isExpression": false,
+ "asc": false,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_notifications_is_read": {
+ "name": "idx_notifications_is_read",
+ "columns": [
+ {
+ "expression": "is_read",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ },
+ "idx_notifications_user_read": {
+ "name": "idx_notifications_user_read",
+ "columns": [
+ {
+ "expression": "user_id",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ },
+ {
+ "expression": "is_read",
+ "isExpression": false,
+ "asc": true,
+ "nulls": "last"
+ }
+ ],
+ "isUnique": false,
+ "concurrently": false,
+ "method": "btree",
+ "with": {}
+ }
+ },
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER": {
+ "name": "CUSTOMER_MASTER_BP_HEADER",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "CUSTOMER_MASTER_BP_HEADER_BP_HEADER_unique": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_HEADER_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "BP_HEADER"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_ADDRESS": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ADDRNO": {
+ "name": "ADDRNO",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_ADDRESS_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_ADDRESS",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_EMAIL": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_EMAIL",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_EMAIL_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CONSNUMBER": {
+ "name": "CONSNUMBER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "DATE_FROM": {
+ "name": "DATE_FROM",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SMTP_ADDR": {
+ "name": "SMTP_ADDR",
+ "type": "varchar(241)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_EMAIL_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_EMAIL_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_EMAIL",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_FAX": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_FAX",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_FAX_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CONSNUMBER": {
+ "name": "CONSNUMBER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "COUNTRY": {
+ "name": "COUNTRY",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DATE_FROM": {
+ "name": "DATE_FROM",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "FAX_EXTENS": {
+ "name": "FAX_EXTENS",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FAX_NUMBER": {
+ "name": "FAX_NUMBER",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_FAX_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_FAX_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_FAX",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_POSTAL": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_POSTAL",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_POSTAL_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CITY1": {
+ "name": "CITY1",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CITY2": {
+ "name": "CITY2",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "COUNTRY": {
+ "name": "COUNTRY",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HOUSE_NUM1": {
+ "name": "HOUSE_NUM1",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LANGU": {
+ "name": "LANGU",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NAME1": {
+ "name": "NAME1",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NAME2": {
+ "name": "NAME2",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NAME3": {
+ "name": "NAME3",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NAME4": {
+ "name": "NAME4",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NATION": {
+ "name": "NATION",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "POST_CODE1": {
+ "name": "POST_CODE1",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "POST_CODE2": {
+ "name": "POST_CODE2",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PO_BOX": {
+ "name": "PO_BOX",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REGION": {
+ "name": "REGION",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SORT1": {
+ "name": "SORT1",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SORT2": {
+ "name": "SORT2",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STREET": {
+ "name": "STREET",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TAXJURCODE": {
+ "name": "TAXJURCODE",
+ "type": "varchar(15)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TIME_ZONE": {
+ "name": "TIME_ZONE",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TITLE": {
+ "name": "TITLE",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TRANSPZONE": {
+ "name": "TRANSPZONE",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_POSTAL_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_POSTAL_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_POSTAL",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_TEL": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_TEL",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_TEL_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CONSNUMBER": {
+ "name": "CONSNUMBER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "COUNTRY": {
+ "name": "COUNTRY",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DATE_FROM": {
+ "name": "DATE_FROM",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "R3_USER": {
+ "name": "R3_USER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TEL_EXTENS": {
+ "name": "TEL_EXTENS",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TEL_NUMBER": {
+ "name": "TEL_NUMBER",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_TEL_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_TEL_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_TEL",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_URL": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_URL",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_URL_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CONSNUMBER": {
+ "name": "CONSNUMBER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "DATE_FROM": {
+ "name": "DATE_FROM",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "URI_ADDR": {
+ "name": "URI_ADDR",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_URL_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_URL_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_ADDRESS_AD_URL",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ANRED": {
+ "name": "ANRED",
+ "type": "varchar(15)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AUFSD": {
+ "name": "AUFSD",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FAKSD": {
+ "name": "FAKSD",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GFORM": {
+ "name": "GFORM",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "JMJAH": {
+ "name": "JMJAH",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "JMZAH": {
+ "name": "JMZAH",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "J_1KFREPRE": {
+ "name": "J_1KFREPRE",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "J_1KFTBUS": {
+ "name": "J_1KFTBUS",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "J_1KFTIND": {
+ "name": "J_1KFTIND",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KATR1": {
+ "name": "KATR1",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KDKG1": {
+ "name": "KDKG1",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KTOKD": {
+ "name": "KTOKD",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KUNNR": {
+ "name": "KUNNR",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "LIFNR": {
+ "name": "LIFNR",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LIFSD": {
+ "name": "LIFSD",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LOEVM": {
+ "name": "LOEVM",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NIELS": {
+ "name": "NIELS",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NODEL": {
+ "name": "NODEL",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUGRP": {
+ "name": "PUGRP",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPERR": {
+ "name": "SPERR",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STCD1": {
+ "name": "STCD1",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STCD2": {
+ "name": "STCD2",
+ "type": "varchar(11)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STCD3": {
+ "name": "STCD3",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STCD4": {
+ "name": "STCD4",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STCEG": {
+ "name": "STCEG",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "UMJAH": {
+ "name": "UMJAH",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "UWAER": {
+ "name": "UWAER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VBUND": {
+ "name": "VBUND",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZAPPDT_C": {
+ "name": "ZZAPPDT_C",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZAPPTM_C": {
+ "name": "ZZAPPTM_C",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZAPPUS_C": {
+ "name": "ZZAPPUS_C",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZBA": {
+ "name": "ZZBA",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZBRSCH_C": {
+ "name": "ZZBRSCH_C",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZCRMCD": {
+ "name": "ZZCRMCD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDOKAR_C": {
+ "name": "ZZDOKAR_C",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDOKNR_C": {
+ "name": "ZZDOKNR_C",
+ "type": "varchar(25)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDOKTL_C": {
+ "name": "ZZDOKTL_C",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDOKVR_C": {
+ "name": "ZZDOKVR_C",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDUNS": {
+ "name": "ZZDUNS",
+ "type": "varchar(11)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZFTBU": {
+ "name": "ZZFTBU",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZFTBUNM": {
+ "name": "ZZFTBUNM",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZFTDT": {
+ "name": "ZZFTDT",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZFTDTNM": {
+ "name": "ZZFTDTNM",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZFTGT": {
+ "name": "ZZFTGT",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZFTGTNM": {
+ "name": "ZZFTGTNM",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZINBFLGC": {
+ "name": "ZZINBFLGC",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMDT_C": {
+ "name": "ZZLAMDT_C",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMTM_C": {
+ "name": "ZZLAMTM_C",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMUS_C": {
+ "name": "ZZLAMUS_C",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZORT01_C": {
+ "name": "ZZORT01_C",
+ "type": "varchar(35)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZORT02_C": {
+ "name": "ZZORT02_C",
+ "type": "varchar(35)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREASON": {
+ "name": "ZZREASON",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGDT_C": {
+ "name": "ZZREGDT_C",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGTM_C": {
+ "name": "ZZREGTM_C",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGUS_C": {
+ "name": "ZZREGUS_C",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZSTCDT_C": {
+ "name": "ZZSTCDT_C",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZSTRAS_C": {
+ "name": "ZZSTRAS_C",
+ "type": "varchar(35)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZSUBSEQ_C": {
+ "name": "ZZSUBSEQ_C",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZCOMPANY": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZCOMPANY",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZCOMPANY_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "AKONT": {
+ "name": "AKONT",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BUKRS": {
+ "name": "BUKRS",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "FDGRV": {
+ "name": "FDGRV",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LOEVM": {
+ "name": "LOEVM",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPERR": {
+ "name": "SPERR",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZAHLS": {
+ "name": "ZAHLS",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZTERM": {
+ "name": "ZTERM",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZUAWA": {
+ "name": "ZUAWA",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZWELS": {
+ "name": "ZWELS",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZCOMPANY_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZCOMPANY_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZCOMPANY",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZSALES": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZSALES",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZSALES_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "AUFSD": {
+ "name": "AUFSD",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AWAHR": {
+ "name": "AWAHR",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BZIRK": {
+ "name": "BZIRK",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FAKSD": {
+ "name": "FAKSD",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INCO1": {
+ "name": "INCO1",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INCO2": {
+ "name": "INCO2",
+ "type": "varchar(28)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KALKS": {
+ "name": "KALKS",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KDGRP": {
+ "name": "KDGRP",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KONDA": {
+ "name": "KONDA",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KTGRD": {
+ "name": "KTGRD",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KURST": {
+ "name": "KURST",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KZAZU": {
+ "name": "KZAZU",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LIFSD": {
+ "name": "LIFSD",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LOEVM": {
+ "name": "LOEVM",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LPRIO": {
+ "name": "LPRIO",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PLTYP": {
+ "name": "PLTYP",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPART": {
+ "name": "SPART",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VERSG": {
+ "name": "VERSG",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VKBUR": {
+ "name": "VKBUR",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VKGRP": {
+ "name": "VKGRP",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VKORG": {
+ "name": "VKORG",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VSBED": {
+ "name": "VSBED",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VTWEG": {
+ "name": "VTWEG",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VWERK": {
+ "name": "VWERK",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WAERS": {
+ "name": "WAERS",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZTERM": {
+ "name": "ZTERM",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZSALES_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZSALES_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZSALES",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZSALES_ZCPFN": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZSALES_ZCPFN",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZSALES_ZCPFN_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "DEFPA": {
+ "name": "DEFPA",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KUNN2": {
+ "name": "KUNN2",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PARVW": {
+ "name": "PARVW",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PARZA": {
+ "name": "PARZA",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZSALES_ZCPFN_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZSALES_ZCPFN_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZSALES_ZCPFN",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZTAXIND": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZTAXIND",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZTAXIND_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ALAND": {
+ "name": "ALAND",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "TATYP": {
+ "name": "TATYP",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "TAXKD": {
+ "name": "TAXKD",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZTAXIND_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZTAXIND_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZTAXIND",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZVATREG": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZVATREG",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZVATREG_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "LAND1": {
+ "name": "LAND1",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "STCEG": {
+ "name": "STCEG",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZVATREG_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZVATREG_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_BP_CUSGEN_ZVATREG",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.CUSTOMER_MASTER_BP_HEADER_BP_TAXNUM": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_TAXNUM",
+ "schema": "mdg",
+ "columns": {
+ "BP_HEADER": {
+ "name": "BP_HEADER",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_TAXNUM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "TAXNUM": {
+ "name": "TAXNUM",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TAXTYPE": {
+ "name": "TAXTYPE",
+ "type": "varchar",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "CUSTOMER_MASTER_BP_HEADER_BP_TAXNUM_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk": {
+ "name": "CUSTOMER_MASTER_BP_HEADER_BP_TAXNUM_BP_HEADER_CUSTOMER_MASTER_BP_HEADER_BP_HEADER_fk",
+ "tableFrom": "CUSTOMER_MASTER_BP_HEADER_BP_TAXNUM",
+ "tableTo": "CUSTOMER_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "BP_HEADER"
+ ],
+ "columnsTo": [
+ "BP_HEADER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.DEPARTMENT_CODE_CMCTB_DEPT_MDG": {
+ "name": "DEPARTMENT_CODE_CMCTB_DEPT_MDG",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "BICD": {
+ "name": "BICD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZAREA": {
+ "name": "BIZAREA",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CCCD": {
+ "name": "CCCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "COMPCD": {
+ "name": "COMPCD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CORPCD": {
+ "name": "CORPCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "DEPTCD": {
+ "name": "DEPTCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "DEPTLVL": {
+ "name": "DEPTLVL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEPTPOSNO": {
+ "name": "DEPTPOSNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DHEMPID": {
+ "name": "DHEMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GNCD": {
+ "name": "GNCD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PCCD": {
+ "name": "PCCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PDEPTCD": {
+ "name": "PDEPTCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VALIDFROMDT": {
+ "name": "VALIDFROMDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VALIDTODT": {
+ "name": "VALIDTODT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WERKS": {
+ "name": "WERKS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTCD_unique": {
+ "name": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTCD_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "DEPTCD"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.DEPARTMENT_CODE_CMCTB_DEPT_MDG_COMPNM": {
+ "name": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_COMPNM",
+ "schema": "mdg",
+ "columns": {
+ "DEPTCD": {
+ "name": "DEPTCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_COMPNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "COMPNM": {
+ "name": "COMPNM",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "DEPARTMENT_CODE_CMCTB_DEPT_MDG_COMPNM_DEPTCD_DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTCD_fk": {
+ "name": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_COMPNM_DEPTCD_DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTCD_fk",
+ "tableFrom": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_COMPNM",
+ "tableTo": "DEPARTMENT_CODE_CMCTB_DEPT_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "DEPTCD"
+ ],
+ "columnsTo": [
+ "DEPTCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.DEPARTMENT_CODE_CMCTB_DEPT_MDG_CORPNM": {
+ "name": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_CORPNM",
+ "schema": "mdg",
+ "columns": {
+ "DEPTCD": {
+ "name": "DEPTCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_CORPNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CORPNM": {
+ "name": "CORPNM",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "DEPARTMENT_CODE_CMCTB_DEPT_MDG_CORPNM_DEPTCD_DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTCD_fk": {
+ "name": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_CORPNM_DEPTCD_DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTCD_fk",
+ "tableFrom": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_CORPNM",
+ "tableTo": "DEPARTMENT_CODE_CMCTB_DEPT_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "DEPTCD"
+ ],
+ "columnsTo": [
+ "DEPTCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTNM": {
+ "name": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTNM",
+ "schema": "mdg",
+ "columns": {
+ "DEPTCD": {
+ "name": "DEPTCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "DEPTNM": {
+ "name": "DEPTNM",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTNM_DEPTCD_DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTCD_fk": {
+ "name": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTNM_DEPTCD_DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTCD_fk",
+ "tableFrom": "DEPARTMENT_CODE_CMCTB_DEPT_MDG_DEPTNM",
+ "tableTo": "DEPARTMENT_CODE_CMCTB_DEPT_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "DEPTCD"
+ ],
+ "columnsTo": [
+ "DEPTCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ADDRCNTRY": {
+ "name": "ADDRCNTRY",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AEDAT": {
+ "name": "AEDAT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AENAM": {
+ "name": "AENAM",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AEZET": {
+ "name": "AEZET",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BICD": {
+ "name": "BICD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZAREA": {
+ "name": "BIZAREA",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BSCADDR": {
+ "name": "BSCADDR",
+ "type": "varchar(35)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "COMPCD": {
+ "name": "COMPCD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CORPCD": {
+ "name": "CORPCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "COUNTRYCD": {
+ "name": "COUNTRYCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CSFROMDT": {
+ "name": "CSFROMDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CSTODT": {
+ "name": "CSTODT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CTIROLE": {
+ "name": "CTIROLE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL": {
+ "name": "DEL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEPENDDT": {
+ "name": "DEPENDDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEPTCD": {
+ "name": "DEPTCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DHJOBGRDCD": {
+ "name": "DHJOBGRDCD",
+ "type": "varchar(29)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DHNAME": {
+ "name": "DHNAME",
+ "type": "varchar(70)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DHSINGLID": {
+ "name": "DHSINGLID",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DISPATCH": {
+ "name": "DISPATCH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DPSTARTDT": {
+ "name": "DPSTARTDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DTLADDR": {
+ "name": "DTLADDR",
+ "type": "varchar(35)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DTLADDR2": {
+ "name": "DTLADDR2",
+ "type": "varchar(35)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "EMAIL": {
+ "name": "EMAIL",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "EMPADR": {
+ "name": "EMPADR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "EMPTYPE": {
+ "name": "EMPTYPE",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ENGNAME": {
+ "name": "ENGNAME",
+ "type": "varchar(70)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "EPID": {
+ "name": "EPID",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ERDAT": {
+ "name": "ERDAT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ERNAM": {
+ "name": "ERNAM",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ERZET": {
+ "name": "ERZET",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FORIGNFLG": {
+ "name": "FORIGNFLG",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GJOBCD": {
+ "name": "GJOBCD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GJOBDUTYCD": {
+ "name": "GJOBDUTYCD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GJOBGRDCD": {
+ "name": "GJOBGRDCD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GNCD": {
+ "name": "GNCD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HRMANAGE": {
+ "name": "HRMANAGE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IDNO": {
+ "name": "IDNO",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "JOBCD": {
+ "name": "JOBCD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "JOBCLASS": {
+ "name": "JOBCLASS",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "JOBDUTYCD": {
+ "name": "JOBDUTYCD",
+ "type": "varchar(15)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "JOBGRDCD": {
+ "name": "JOBGRDCD",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KTL_EMP": {
+ "name": "KTL_EMP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LVABSENCE": {
+ "name": "LVABSENCE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MBPHONE": {
+ "name": "MBPHONE",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NAME": {
+ "name": "NAME",
+ "type": "varchar(70)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OKTL_EMPL": {
+ "name": "OKTL_EMPL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORGBICD": {
+ "name": "ORGBICD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORGCOMPCD": {
+ "name": "ORGCOMPCD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORGCORPCD": {
+ "name": "ORGCORPCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORGDEPTCD": {
+ "name": "ORGDEPTCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORGPDEPCD": {
+ "name": "ORGPDEPCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PAYPLC": {
+ "name": "PAYPLC",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PDEPTCD": {
+ "name": "PDEPTCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PSTLCODE": {
+ "name": "PSTLCODE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "RETIRE": {
+ "name": "RETIRE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SEX": {
+ "name": "SEX",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SINGLEID": {
+ "name": "SINGLEID",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SINGLRQ": {
+ "name": "SINGLRQ",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SOCIALID": {
+ "name": "SOCIALID",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SOCIALID_DECR": {
+ "name": "SOCIALID_DECR",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SOJRNEMP": {
+ "name": "SOJRNEMP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TELNUM": {
+ "name": "TELNUM",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TMPJDIV": {
+ "name": "TMPJDIV",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USEDSYS": {
+ "name": "USEDSYS",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VALFROMDT": {
+ "name": "VALFROMDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VALTODT": {
+ "name": "VALTODT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WFREQUIRE": {
+ "name": "WFREQUIRE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WORKPLC": {
+ "name": "WORKPLC",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZPRFLG": {
+ "name": "ZPRFLG",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZBUKRS": {
+ "name": "ZZBUKRS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_unique": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "EMPID"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_BANM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_BANM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_BANM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "GTEXT": {
+ "name": "GTEXT",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_BANM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_BANM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_BANM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_BINM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_BINM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_BINM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "BINM": {
+ "name": "BINM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_BINM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_BINM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_BINM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_COMPNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_COMPNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_COMPNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "COMPNM": {
+ "name": "COMPNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_COMPNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_COMPNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_COMPNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_CORPNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_CORPNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_CORPNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CORPNM": {
+ "name": "CORPNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_CORPNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_CORPNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_CORPNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_COUNTRYNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_COUNTRYNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_COUNTRYNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "COUNTRYNM": {
+ "name": "COUNTRYNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_COUNTRYNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_COUNTRYNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_COUNTRYNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTCODE": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTCODE",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTCODE_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "PCCD": {
+ "name": "PCCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WERKS": {
+ "name": "WERKS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTCODE_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTCODE_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTCODE",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTCODE_PCCDNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTCODE_PCCDNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTCODE_PCCDNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "KTEXT": {
+ "name": "KTEXT",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LTEXT": {
+ "name": "LTEXT",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTCODE_PCCDNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTCODE_PCCDNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTCODE_PCCDNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "DEPTNM": {
+ "name": "DEPTNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DEPTNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_DHJOBGDNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DHJOBGDNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DHJOBGDNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "JOBGRDNM": {
+ "name": "JOBGRDNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DHJOBGDNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DHJOBGDNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_DHJOBGDNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBDUTYNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBDUTYNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBDUTYNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "GJOBDUTYNM": {
+ "name": "GJOBDUTYNM",
+ "type": "varchar(21)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBDUTYNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBDUTYNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBDUTYNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBGRDNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBGRDNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBGRDNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "GJOBGRDNM": {
+ "name": "GJOBGRDNM",
+ "type": "varchar(21)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBGRDNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBGRDNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBGRDNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBGRDTYPE": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBGRDTYPE",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBGRDTYPE_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ISEXECUT": {
+ "name": "ISEXECUT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "JOBGRDTYPE": {
+ "name": "JOBGRDTYPE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBGRDTYPE_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBGRDTYPE_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBGRDTYPE",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "GJOBNM": {
+ "name": "GJOBNM",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GJOBNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_GNNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GNNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GNNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "GNNM": {
+ "name": "GNNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GNNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GNNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_GNNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBDUTYNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBDUTYNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBDUTYNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "JOBDUTYNM": {
+ "name": "JOBDUTYNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBDUTYNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBDUTYNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBDUTYNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBGRDNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBGRDNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBGRDNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ISEXECUT": {
+ "name": "ISEXECUT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "JOBGRDNM": {
+ "name": "JOBGRDNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "JOBGRDTYPE": {
+ "name": "JOBGRDTYPE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBGRDNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBGRDNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBGRDNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "JOBNM": {
+ "name": "JOBNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_JOBNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_KTLNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_KTLNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_KTLNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "LTEXT": {
+ "name": "LTEXT",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_KTLNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_KTLNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_KTLNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_OKTLNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_OKTLNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_OKTLNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "LTEXT": {
+ "name": "LTEXT",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_OKTLNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_OKTLNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_OKTLNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGBICDNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGBICDNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGBICDNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "BINM": {
+ "name": "BINM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGBICDNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGBICDNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGBICDNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGCOMPNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGCOMPNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGCOMPNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "COMPNM": {
+ "name": "COMPNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGCOMPNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGCOMPNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGCOMPNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGCORPNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGCORPNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGCORPNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CORPNM": {
+ "name": "CORPNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGCORPNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGCORPNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGCORPNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGDEPTNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGDEPTNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGDEPTNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "DEPTNM": {
+ "name": "DEPTNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGDEPTNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGDEPTNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGDEPTNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGPDEPNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGPDEPNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGPDEPNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "DEPTNM": {
+ "name": "DEPTNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGPDEPNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGPDEPNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_ORGPDEPNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_MASTER_CMCTB_EMP_MDG_PDEPTNM": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_PDEPTNM",
+ "schema": "mdg",
+ "columns": {
+ "EMPID": {
+ "name": "EMPID",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_PDEPTNM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "DEPTNM": {
+ "name": "DEPTNM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_MASTER_CMCTB_EMP_MDG_PDEPTNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk": {
+ "name": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_PDEPTNM_EMPID_EMPLOYEE_MASTER_CMCTB_EMP_MDG_EMPID_fk",
+ "tableFrom": "EMPLOYEE_MASTER_CMCTB_EMP_MDG_PDEPTNM",
+ "tableTo": "EMPLOYEE_MASTER_CMCTB_EMP_MDG",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "EMPID"
+ ],
+ "columnsTo": [
+ "EMPID"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF": {
+ "name": "EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ADTL_01": {
+ "name": "ADTL_01",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADTL_02": {
+ "name": "ADTL_02",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CORPCD": {
+ "name": "CORPCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "GRPCD": {
+ "name": "GRPCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "MAINCD": {
+ "name": "MAINCD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VALIDFROMDT": {
+ "name": "VALIDFROMDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VALIDTODT": {
+ "name": "VALIDTODT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF_GRPCD_unique": {
+ "name": "EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF_GRPCD_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "GRPCD"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF_NAME": {
+ "name": "EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF_NAME",
+ "schema": "mdg",
+ "columns": {
+ "GRPCD": {
+ "name": "GRPCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF_NAME_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "NAME": {
+ "name": "NAME",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF_NAME_GRPCD_EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF_GRPCD_fk": {
+ "name": "EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF_NAME_GRPCD_EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF_GRPCD_fk",
+ "tableFrom": "EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF_NAME",
+ "tableTo": "EMPLOYEE_REFERENCE_MASTER_CMCTB_EMP_REF_MDG_IF",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "GRPCD"
+ ],
+ "columnsTo": [
+ "GRPCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EQUP_MASTER_MATL": {
+ "name": "EQUP_MASTER_MATL",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EQUP_MASTER_MATL_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "BISMT": {
+ "name": "BISMT",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BRGEW": {
+ "name": "BRGEW",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GEWEI": {
+ "name": "GEWEI",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GROES": {
+ "name": "GROES",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LVORM": {
+ "name": "LVORM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAGRV": {
+ "name": "MAGRV",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MATKL": {
+ "name": "MATKL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "MBRSH": {
+ "name": "MBRSH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEABM": {
+ "name": "MEABM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEINS": {
+ "name": "MEINS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MSTAE": {
+ "name": "MSTAE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MSTDE": {
+ "name": "MSTDE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MTART": {
+ "name": "MTART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NTGEW": {
+ "name": "NTGEW",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRDHA": {
+ "name": "PRDHA",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPART": {
+ "name": "SPART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VHART": {
+ "name": "VHART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VOLEH": {
+ "name": "VOLEH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZAPPDT": {
+ "name": "ZZAPPDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZAPPTM": {
+ "name": "ZZAPPTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZAPPUS": {
+ "name": "ZZAPPUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDESC": {
+ "name": "ZZDESC",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMDT": {
+ "name": "ZZLAMDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMTM": {
+ "name": "ZZLAMTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMUS": {
+ "name": "ZZLAMUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZNAME": {
+ "name": "ZZNAME",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZPRFLG": {
+ "name": "ZZPRFLG",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGDT": {
+ "name": "ZZREGDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGTM": {
+ "name": "ZZREGTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGUS": {
+ "name": "ZZREGUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZSPEC": {
+ "name": "ZZSPEC",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "EQUP_MASTER_MATL_MATNR_unique": {
+ "name": "EQUP_MASTER_MATL_MATNR_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "MATNR"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EQUP_MASTER_MATL_CHARASGN": {
+ "name": "EQUP_MASTER_MATL_CHARASGN",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EQUP_MASTER_MATL_CHARASGN_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ATAW1": {
+ "name": "ATAW1",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATAWE": {
+ "name": "ATAWE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATBEZ": {
+ "name": "ATBEZ",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATFLB": {
+ "name": "ATFLB",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATFLV": {
+ "name": "ATFLV",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATNAM": {
+ "name": "ATNAM",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATWRT": {
+ "name": "ATWRT",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATWTB": {
+ "name": "ATWTB",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLASS": {
+ "name": "CLASS",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KLART": {
+ "name": "KLART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EQUP_MASTER_MATL_CHARASGN_MATNR_EQUP_MASTER_MATL_MATNR_fk": {
+ "name": "EQUP_MASTER_MATL_CHARASGN_MATNR_EQUP_MASTER_MATL_MATNR_fk",
+ "tableFrom": "EQUP_MASTER_MATL_CHARASGN",
+ "tableTo": "EQUP_MASTER_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EQUP_MASTER_MATL_CLASSASGN": {
+ "name": "EQUP_MASTER_MATL_CLASSASGN",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EQUP_MASTER_MATL_CLASSASGN_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CLASS": {
+ "name": "CLASS",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KLART": {
+ "name": "KLART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EQUP_MASTER_MATL_CLASSASGN_MATNR_EQUP_MASTER_MATL_MATNR_fk": {
+ "name": "EQUP_MASTER_MATL_CLASSASGN_MATNR_EQUP_MASTER_MATL_MATNR_fk",
+ "tableFrom": "EQUP_MASTER_MATL_CLASSASGN",
+ "tableTo": "EQUP_MASTER_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EQUP_MASTER_MATL_DESC": {
+ "name": "EQUP_MASTER_MATL_DESC",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EQUP_MASTER_MATL_DESC_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "MAKTX": {
+ "name": "MAKTX",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EQUP_MASTER_MATL_DESC_MATNR_EQUP_MASTER_MATL_MATNR_fk": {
+ "name": "EQUP_MASTER_MATL_DESC_MATNR_EQUP_MASTER_MATL_MATNR_fk",
+ "tableFrom": "EQUP_MASTER_MATL_DESC",
+ "tableTo": "EQUP_MASTER_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EQUP_MASTER_MATL_PLNT": {
+ "name": "EQUP_MASTER_MATL_PLNT",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EQUP_MASTER_MATL_PLNT_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "LVORM": {
+ "name": "LVORM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MMSTA": {
+ "name": "MMSTA",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MMSTD": {
+ "name": "MMSTD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WERKS": {
+ "name": "WERKS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMDT": {
+ "name": "ZZLAMDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMTM": {
+ "name": "ZZLAMTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMUS": {
+ "name": "ZZLAMUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZMTARP": {
+ "name": "ZZMTARP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZPRFLG": {
+ "name": "ZZPRFLG",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGDT": {
+ "name": "ZZREGDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGTM": {
+ "name": "ZZREGTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGUS": {
+ "name": "ZZREGUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EQUP_MASTER_MATL_PLNT_MATNR_EQUP_MASTER_MATL_MATNR_fk": {
+ "name": "EQUP_MASTER_MATL_PLNT_MATNR_EQUP_MASTER_MATL_MATNR_fk",
+ "tableFrom": "EQUP_MASTER_MATL_PLNT",
+ "tableTo": "EQUP_MASTER_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.EQUP_MASTER_MATL_UNIT": {
+ "name": "EQUP_MASTER_MATL_UNIT",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "EQUP_MASTER_MATL_UNIT_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "GEWEI": {
+ "name": "GEWEI",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEABM": {
+ "name": "MEABM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEINH": {
+ "name": "MEINH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "UMREN": {
+ "name": "UMREN",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "UMREZ": {
+ "name": "UMREZ",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VOLEH": {
+ "name": "VOLEH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "EQUP_MASTER_MATL_UNIT_MATNR_EQUP_MASTER_MATL_MATNR_fk": {
+ "name": "EQUP_MASTER_MATL_UNIT_MATNR_EQUP_MASTER_MATL_MATNR_fk",
+ "tableFrom": "EQUP_MASTER_MATL_UNIT",
+ "tableTo": "EQUP_MASTER_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MATERIAL_MASTER_PART_MATL": {
+ "name": "MATERIAL_MASTER_PART_MATL",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MATERIAL_MASTER_PART_MATL_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "BISMT": {
+ "name": "BISMT",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BRGEW": {
+ "name": "BRGEW",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GEWEI": {
+ "name": "GEWEI",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GROES": {
+ "name": "GROES",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LVORM": {
+ "name": "LVORM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAGRV": {
+ "name": "MAGRV",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MATKL": {
+ "name": "MATKL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "MBRSH": {
+ "name": "MBRSH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEABM": {
+ "name": "MEABM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEINS": {
+ "name": "MEINS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MSTAE": {
+ "name": "MSTAE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MSTDE": {
+ "name": "MSTDE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MTART": {
+ "name": "MTART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NTGEW": {
+ "name": "NTGEW",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRDHA": {
+ "name": "PRDHA",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPART": {
+ "name": "SPART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VHART": {
+ "name": "VHART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VOLEH": {
+ "name": "VOLEH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZACT": {
+ "name": "ZZACT",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZAPPDT": {
+ "name": "ZZAPPDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZAPPTM": {
+ "name": "ZZAPPTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZAPPUS": {
+ "name": "ZZAPPUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZCERT": {
+ "name": "ZZCERT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDESC": {
+ "name": "ZZDESC",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZINSP": {
+ "name": "ZZINSP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMDT": {
+ "name": "ZZLAMDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMTM": {
+ "name": "ZZLAMTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMUS": {
+ "name": "ZZLAMUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZMMTYP": {
+ "name": "ZZMMTYP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZMRC": {
+ "name": "ZZMRC",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZNAME": {
+ "name": "ZZNAME",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZPJT": {
+ "name": "ZZPJT",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZPLMID": {
+ "name": "ZZPLMID",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZPRCD_SCV_CTLP": {
+ "name": "ZZPRCD_SCV_CTLP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZPRFLG": {
+ "name": "ZZPRFLG",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGDT": {
+ "name": "ZZREGDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGTM": {
+ "name": "ZZREGTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGUS": {
+ "name": "ZZREGUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREPMAT": {
+ "name": "ZZREPMAT",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREP_DIA": {
+ "name": "ZZREP_DIA",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREP_DIA_UOM": {
+ "name": "ZZREP_DIA_UOM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREP_ITM_MATL": {
+ "name": "ZZREP_ITM_MATL",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZSMID": {
+ "name": "ZZSMID",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZSPEC": {
+ "name": "ZZSPEC",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZSTL": {
+ "name": "ZZSTL",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "MATERIAL_MASTER_PART_MATL_MATNR_unique": {
+ "name": "MATERIAL_MASTER_PART_MATL_MATNR_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "MATNR"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MATERIAL_MASTER_PART_MATL_CHARASGN": {
+ "name": "MATERIAL_MASTER_PART_MATL_CHARASGN",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MATERIAL_MASTER_PART_MATL_CHARASGN_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ATAW1": {
+ "name": "ATAW1",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATAWE": {
+ "name": "ATAWE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATBEZ": {
+ "name": "ATBEZ",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATFLB": {
+ "name": "ATFLB",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATFLV": {
+ "name": "ATFLV",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATNAM": {
+ "name": "ATNAM",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ATWRT": {
+ "name": "ATWRT",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATWTB": {
+ "name": "ATWTB",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLASS": {
+ "name": "CLASS",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "KLART": {
+ "name": "KLART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "MATERIAL_MASTER_PART_MATL_CHARASGN_MATNR_MATERIAL_MASTER_PART_MATL_MATNR_fk": {
+ "name": "MATERIAL_MASTER_PART_MATL_CHARASGN_MATNR_MATERIAL_MASTER_PART_MATL_MATNR_fk",
+ "tableFrom": "MATERIAL_MASTER_PART_MATL_CHARASGN",
+ "tableTo": "MATERIAL_MASTER_PART_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MATERIAL_MASTER_PART_MATL_CLASSASGN": {
+ "name": "MATERIAL_MASTER_PART_MATL_CLASSASGN",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MATERIAL_MASTER_PART_MATL_CLASSASGN_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CLASS": {
+ "name": "CLASS",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "KLART": {
+ "name": "KLART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "MATERIAL_MASTER_PART_MATL_CLASSASGN_MATNR_MATERIAL_MASTER_PART_MATL_MATNR_fk": {
+ "name": "MATERIAL_MASTER_PART_MATL_CLASSASGN_MATNR_MATERIAL_MASTER_PART_MATL_MATNR_fk",
+ "tableFrom": "MATERIAL_MASTER_PART_MATL_CLASSASGN",
+ "tableTo": "MATERIAL_MASTER_PART_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MATERIAL_MASTER_PART_MATL_DESC": {
+ "name": "MATERIAL_MASTER_PART_MATL_DESC",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MATERIAL_MASTER_PART_MATL_DESC_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "MAKTX": {
+ "name": "MAKTX",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "MATERIAL_MASTER_PART_MATL_DESC_MATNR_MATERIAL_MASTER_PART_MATL_MATNR_fk": {
+ "name": "MATERIAL_MASTER_PART_MATL_DESC_MATNR_MATERIAL_MASTER_PART_MATL_MATNR_fk",
+ "tableFrom": "MATERIAL_MASTER_PART_MATL_DESC",
+ "tableTo": "MATERIAL_MASTER_PART_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MATERIAL_MASTER_PART_MATL_PLNT": {
+ "name": "MATERIAL_MASTER_PART_MATL_PLNT",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MATERIAL_MASTER_PART_MATL_PLNT_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "LVORM": {
+ "name": "LVORM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MMSTA": {
+ "name": "MMSTA",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MMSTD": {
+ "name": "MMSTD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WERKS": {
+ "name": "WERKS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZLAMDT": {
+ "name": "ZZLAMDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMTM": {
+ "name": "ZZLAMTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMUS": {
+ "name": "ZZLAMUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZMTARP": {
+ "name": "ZZMTARP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZPRFLG": {
+ "name": "ZZPRFLG",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGDT": {
+ "name": "ZZREGDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGTM": {
+ "name": "ZZREGTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGUS": {
+ "name": "ZZREGUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "MATERIAL_MASTER_PART_MATL_PLNT_MATNR_MATERIAL_MASTER_PART_MATL_MATNR_fk": {
+ "name": "MATERIAL_MASTER_PART_MATL_PLNT_MATNR_MATERIAL_MASTER_PART_MATL_MATNR_fk",
+ "tableFrom": "MATERIAL_MASTER_PART_MATL_PLNT",
+ "tableTo": "MATERIAL_MASTER_PART_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MATERIAL_MASTER_PART_MATL_UNIT": {
+ "name": "MATERIAL_MASTER_PART_MATL_UNIT",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MATERIAL_MASTER_PART_MATL_UNIT_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "BREIT": {
+ "name": "BREIT",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BRGEW": {
+ "name": "BRGEW",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GEWEI": {
+ "name": "GEWEI",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HOEHE": {
+ "name": "HOEHE",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LAENG": {
+ "name": "LAENG",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEABM": {
+ "name": "MEABM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEINH": {
+ "name": "MEINH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "UMREN": {
+ "name": "UMREN",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "UMREZ": {
+ "name": "UMREZ",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VOLEH": {
+ "name": "VOLEH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VOLUM": {
+ "name": "VOLUM",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "MATERIAL_MASTER_PART_MATL_UNIT_MATNR_MATERIAL_MASTER_PART_MATL_MATNR_fk": {
+ "name": "MATERIAL_MASTER_PART_MATL_UNIT_MATNR_MATERIAL_MASTER_PART_MATL_MATNR_fk",
+ "tableFrom": "MATERIAL_MASTER_PART_MATL_UNIT",
+ "tableTo": "MATERIAL_MASTER_PART_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MATERIAL_MASTER_PART_RETURN_CMCTB_MAT_BSE": {
+ "name": "MATERIAL_MASTER_PART_RETURN_CMCTB_MAT_BSE",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MATERIAL_MASTER_PART_RETURN_CMCTB_MAT_BSE_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAT_CD": {
+ "name": "MAT_CD",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "MAT_ID": {
+ "name": "MAT_ID",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "MATERIAL_MASTER_PART_RETURN_CMCTB_MAT_BSE_MAT_CD_unique": {
+ "name": "MATERIAL_MASTER_PART_RETURN_CMCTB_MAT_BSE_MAT_CD_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "MAT_CD"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MODEL_MASTER_MATL": {
+ "name": "MODEL_MASTER_MATL",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MODEL_MASTER_MATL_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "BISMT": {
+ "name": "BISMT",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BRGEW": {
+ "name": "BRGEW",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GEWEI": {
+ "name": "GEWEI",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GROES": {
+ "name": "GROES",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LVORM": {
+ "name": "LVORM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAGRV": {
+ "name": "MAGRV",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MATKL": {
+ "name": "MATKL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "MBRSH": {
+ "name": "MBRSH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEABM": {
+ "name": "MEABM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEINS": {
+ "name": "MEINS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MSTAE": {
+ "name": "MSTAE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MSTDE": {
+ "name": "MSTDE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MTART": {
+ "name": "MTART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NTGEW": {
+ "name": "NTGEW",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRDHA": {
+ "name": "PRDHA",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPART": {
+ "name": "SPART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VHART": {
+ "name": "VHART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VOLEH": {
+ "name": "VOLEH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZAPPDT": {
+ "name": "ZZAPPDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZAPPTM": {
+ "name": "ZZAPPTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZAPPUS": {
+ "name": "ZZAPPUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDESC": {
+ "name": "ZZDESC",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDOKAR": {
+ "name": "ZZDOKAR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDOKNR": {
+ "name": "ZZDOKNR",
+ "type": "varchar(25)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDOKTL": {
+ "name": "ZZDOKTL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDOKVR": {
+ "name": "ZZDOKVR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMDT": {
+ "name": "ZZLAMDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMTM": {
+ "name": "ZZLAMTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMUS": {
+ "name": "ZZLAMUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZMMTYP": {
+ "name": "ZZMMTYP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZNAME": {
+ "name": "ZZNAME",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZPRFLG": {
+ "name": "ZZPRFLG",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGDT": {
+ "name": "ZZREGDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGTM": {
+ "name": "ZZREGTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGUS": {
+ "name": "ZZREGUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZSPEC": {
+ "name": "ZZSPEC",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "MODEL_MASTER_MATL_MATNR_unique": {
+ "name": "MODEL_MASTER_MATL_MATNR_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "MATNR"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MODEL_MASTER_MATL_CHARASGN": {
+ "name": "MODEL_MASTER_MATL_CHARASGN",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MODEL_MASTER_MATL_CHARASGN_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ATAW1": {
+ "name": "ATAW1",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATAWE": {
+ "name": "ATAWE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATBEZ": {
+ "name": "ATBEZ",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATFLB": {
+ "name": "ATFLB",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATFLV": {
+ "name": "ATFLV",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATNAM": {
+ "name": "ATNAM",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATWRT": {
+ "name": "ATWRT",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATWTB": {
+ "name": "ATWTB",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLASS": {
+ "name": "CLASS",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KLART": {
+ "name": "KLART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "MODEL_MASTER_MATL_CHARASGN_MATNR_MODEL_MASTER_MATL_MATNR_fk": {
+ "name": "MODEL_MASTER_MATL_CHARASGN_MATNR_MODEL_MASTER_MATL_MATNR_fk",
+ "tableFrom": "MODEL_MASTER_MATL_CHARASGN",
+ "tableTo": "MODEL_MASTER_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MODEL_MASTER_MATL_CLASSASGN": {
+ "name": "MODEL_MASTER_MATL_CLASSASGN",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MODEL_MASTER_MATL_CLASSASGN_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CLASS": {
+ "name": "CLASS",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KLART": {
+ "name": "KLART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "MODEL_MASTER_MATL_CLASSASGN_MATNR_MODEL_MASTER_MATL_MATNR_fk": {
+ "name": "MODEL_MASTER_MATL_CLASSASGN_MATNR_MODEL_MASTER_MATL_MATNR_fk",
+ "tableFrom": "MODEL_MASTER_MATL_CLASSASGN",
+ "tableTo": "MODEL_MASTER_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MODEL_MASTER_MATL_DESC": {
+ "name": "MODEL_MASTER_MATL_DESC",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MODEL_MASTER_MATL_DESC_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "MAKTX": {
+ "name": "MAKTX",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "MODEL_MASTER_MATL_DESC_MATNR_MODEL_MASTER_MATL_MATNR_fk": {
+ "name": "MODEL_MASTER_MATL_DESC_MATNR_MODEL_MASTER_MATL_MATNR_fk",
+ "tableFrom": "MODEL_MASTER_MATL_DESC",
+ "tableTo": "MODEL_MASTER_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MODEL_MASTER_MATL_PLNT": {
+ "name": "MODEL_MASTER_MATL_PLNT",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MODEL_MASTER_MATL_PLNT_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "LVORM": {
+ "name": "LVORM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MMSTA": {
+ "name": "MMSTA",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MMSTD": {
+ "name": "MMSTD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WERKS": {
+ "name": "WERKS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMDT": {
+ "name": "ZZLAMDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMTM": {
+ "name": "ZZLAMTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAMUS": {
+ "name": "ZZLAMUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZMTARP": {
+ "name": "ZZMTARP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZPRFLG": {
+ "name": "ZZPRFLG",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGDT": {
+ "name": "ZZREGDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGTM": {
+ "name": "ZZREGTM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZREGUS": {
+ "name": "ZZREGUS",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "MODEL_MASTER_MATL_PLNT_MATNR_MODEL_MASTER_MATL_MATNR_fk": {
+ "name": "MODEL_MASTER_MATL_PLNT_MATNR_MODEL_MASTER_MATL_MATNR_fk",
+ "tableFrom": "MODEL_MASTER_MATL_PLNT",
+ "tableTo": "MODEL_MASTER_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.MODEL_MASTER_MATL_UNIT": {
+ "name": "MODEL_MASTER_MATL_UNIT",
+ "schema": "mdg",
+ "columns": {
+ "MATNR": {
+ "name": "MATNR",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "MODEL_MASTER_MATL_UNIT_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "BREIT": {
+ "name": "BREIT",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BRGEW": {
+ "name": "BRGEW",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GEWEI": {
+ "name": "GEWEI",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HOEHE": {
+ "name": "HOEHE",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LAENG": {
+ "name": "LAENG",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEABM": {
+ "name": "MEABM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEINH": {
+ "name": "MEINH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "UMREN": {
+ "name": "UMREN",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "UMREZ": {
+ "name": "UMREZ",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VOLEH": {
+ "name": "VOLEH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VOLUM": {
+ "name": "VOLUM",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "MODEL_MASTER_MATL_UNIT_MATNR_MODEL_MASTER_MATL_MATNR_fk": {
+ "name": "MODEL_MASTER_MATL_UNIT_MATNR_MODEL_MASTER_MATL_MATNR_fk",
+ "tableFrom": "MODEL_MASTER_MATL_UNIT",
+ "tableTo": "MODEL_MASTER_MATL",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "MATNR"
+ ],
+ "columnsTo": [
+ "MATNR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_CCTR": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_CCTR",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_CCTR_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ABTEI": {
+ "name": "ABTEI",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ANRED": {
+ "name": "ANRED",
+ "type": "varchar(15)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BKZER": {
+ "name": "BKZER",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BKZKP": {
+ "name": "BKZKP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BKZKS": {
+ "name": "BKZKS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BKZOB": {
+ "name": "BKZOB",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BUKRS": {
+ "name": "BUKRS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CCTR": {
+ "name": "CCTR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "DATAB": {
+ "name": "DATAB",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DATBI": {
+ "name": "DATBI",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "DATLT": {
+ "name": "DATLT",
+ "type": "varchar(14)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DRNAM": {
+ "name": "DRNAM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FUNC_AREA": {
+ "name": "FUNC_AREA",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GSBER": {
+ "name": "GSBER",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KHINR": {
+ "name": "KHINR",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KOKRS": {
+ "name": "KOKRS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "KOSAR": {
+ "name": "KOSAR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LAND1": {
+ "name": "LAND1",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MGEFL": {
+ "name": "MGEFL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NAME1": {
+ "name": "NAME1",
+ "type": "varchar(70)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NAME2": {
+ "name": "NAME2",
+ "type": "varchar(70)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NAME3": {
+ "name": "NAME3",
+ "type": "varchar(70)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NAME4": {
+ "name": "NAME4",
+ "type": "varchar(70)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORT01": {
+ "name": "ORT01",
+ "type": "varchar(35)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORT02": {
+ "name": "ORT02",
+ "type": "varchar(35)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PFACH": {
+ "name": "PFACH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PKZER": {
+ "name": "PKZER",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PKZKP": {
+ "name": "PKZKP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PKZKS": {
+ "name": "PKZKS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRCTR": {
+ "name": "PRCTR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PSTL2": {
+ "name": "PSTL2",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PSTLZ": {
+ "name": "PSTLZ",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REGIO": {
+ "name": "REGIO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRAS": {
+ "name": "SPRAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STRAS": {
+ "name": "STRAS",
+ "type": "varchar(35)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TELBX": {
+ "name": "TELBX",
+ "type": "varchar(15)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TELF1": {
+ "name": "TELF1",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TELF2": {
+ "name": "TELF2",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TELFX": {
+ "name": "TELFX",
+ "type": "varchar(31)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TELTX": {
+ "name": "TELTX",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TELX1": {
+ "name": "TELX1",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TXJCD": {
+ "name": "TXJCD",
+ "type": "varchar(15)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VERAK": {
+ "name": "VERAK",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VERAK_USE": {
+ "name": "VERAK_USE",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VMETH": {
+ "name": "VMETH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WAERS": {
+ "name": "WAERS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZBRANCH": {
+ "name": "ZZBRANCH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZFCTRI": {
+ "name": "ZZFCTRI",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZSECCODE": {
+ "name": "ZZSECCODE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZSEGMENT": {
+ "name": "ZZSEGMENT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_CCTR_CCTR_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_CCTR_CCTR_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "CCTR"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_CCTR_TEXT": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_CCTR_TEXT",
+ "schema": "mdg",
+ "columns": {
+ "CCTR": {
+ "name": "CCTR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_CCTR_TEXT_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "KTEXT": {
+ "name": "KTEXT",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LTEXT": {
+ "name": "LTEXT",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ORGANIZATION_MASTER_HRHMTB_CCTR_TEXT_CCTR_ORGANIZATION_MASTER_HRHMTB_CCTR_CCTR_fk": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_CCTR_TEXT_CCTR_ORGANIZATION_MASTER_HRHMTB_CCTR_CCTR_fk",
+ "tableFrom": "ORGANIZATION_MASTER_HRHMTB_CCTR_TEXT",
+ "tableTo": "ORGANIZATION_MASTER_HRHMTB_CCTR",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "CCTR"
+ ],
+ "columnsTo": [
+ "CCTR"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_CCTR_TEXT_CCTR_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_CCTR_TEXT_CCTR_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "CCTR"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_PCTR": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_PCTR",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_PCTR_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ABTEI": {
+ "name": "ABTEI",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DATAB": {
+ "name": "DATAB",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DATBI": {
+ "name": "DATBI",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "KHINR": {
+ "name": "KHINR",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "KOKRS": {
+ "name": "KOKRS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "LOCK_IND": {
+ "name": "LOCK_IND",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PCTR": {
+ "name": "PCTR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SEGMENT": {
+ "name": "SEGMENT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TXJCD": {
+ "name": "TXJCD",
+ "type": "varchar(15)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VERAK": {
+ "name": "VERAK",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VERAK_USE": {
+ "name": "VERAK_USE",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_PCTR_PCTR_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_PCTR_PCTR_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "PCTR"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZBUKRS": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZBUKRS",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZBUKRS_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CURR_BUKR": {
+ "name": "CURR_BUKR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZBUKRS": {
+ "name": "ZBUKRS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZBUTXT": {
+ "name": "ZZBUTXT",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZCITY": {
+ "name": "ZZCITY",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZCOUNTRY": {
+ "name": "ZZCOUNTRY",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLANGU": {
+ "name": "ZZLANGU",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZBUKRS_ZBUKRS_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZBUKRS_ZBUKRS_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZBUKRS"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZEKGRP": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZEKGRP",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZEKGRP_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ZEKGRP": {
+ "name": "ZEKGRP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZEKNAM": {
+ "name": "ZZEKNAM",
+ "type": "varchar(36)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZEKTEL": {
+ "name": "ZZEKTEL",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZEMPNUM": {
+ "name": "ZZEMPNUM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZSINGLE": {
+ "name": "ZZSINGLE",
+ "type": "varchar(241)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZTELFX": {
+ "name": "ZZTELFX",
+ "type": "varchar(31)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZTEL_NUM": {
+ "name": "ZZTEL_NUM",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZEKGRP_ZEKGRP_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZEKGRP_ZEKGRP_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZEKGRP"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZEKORG": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZEKORG",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZEKORG_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ZEKORG": {
+ "name": "ZEKORG",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZEKOTX": {
+ "name": "ZZEKOTX",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZEKORG_ZEKORG_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZEKORG_ZEKORG_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZEKORG"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZGSBER": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZGSBER",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZGSBER_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ZGSBER": {
+ "name": "ZGSBER",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZGSBER_ZGSBER_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZGSBER_ZGSBER_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZGSBER"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZGSBER_TEXT": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZGSBER_TEXT",
+ "schema": "mdg",
+ "columns": {
+ "ZGSBER": {
+ "name": "ZGSBER",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZGSBER_TEXT_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "LANGU": {
+ "name": "LANGU",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "TXTMI": {
+ "name": "TXTMI",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "ORGANIZATION_MASTER_HRHMTB_ZGSBER_TEXT_ZGSBER_ORGANIZATION_MASTER_HRHMTB_ZGSBER_ZGSBER_fk": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZGSBER_TEXT_ZGSBER_ORGANIZATION_MASTER_HRHMTB_ZGSBER_ZGSBER_fk",
+ "tableFrom": "ORGANIZATION_MASTER_HRHMTB_ZGSBER_TEXT",
+ "tableTo": "ORGANIZATION_MASTER_HRHMTB_ZGSBER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "ZGSBER"
+ ],
+ "columnsTo": [
+ "ZGSBER"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZGSBER_TEXT_ZGSBER_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZGSBER_TEXT_ZGSBER_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZGSBER"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZLGORT": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZLGORT",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZLGORT_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ZLGORT": {
+ "name": "ZLGORT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZWERKS": {
+ "name": "ZWERKS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLGOBE": {
+ "name": "ZZLGOBE",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZLGORT_ZLGORT_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZLGORT_ZLGORT_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZLGORT"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZSPART": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZSPART",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZSPART_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ZSPART": {
+ "name": "ZSPART",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZSPART_ZSPART_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZSPART_ZSPART_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZSPART"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZVKBUR": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVKBUR",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVKBUR_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CTRY_SOFF": {
+ "name": "CTRY_SOFF",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LANG_SOFF": {
+ "name": "LANG_SOFF",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZVKBUR": {
+ "name": "ZVKBUR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZVKBUR_ZVKBUR_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVKBUR_ZVKBUR_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZVKBUR"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZVKGRP": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVKGRP",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVKGRP_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ZVKGRP": {
+ "name": "ZVKGRP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZVKGRP_ZVKGRP_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVKGRP_ZVKGRP_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZVKGRP"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZVKORG": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVKORG",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVKORG_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ZVKORG": {
+ "name": "ZVKORG",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZBOAVO": {
+ "name": "ZZBOAVO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZKUNNR": {
+ "name": "ZZKUNNR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZVKOKL": {
+ "name": "ZZVKOKL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZWAERS": {
+ "name": "ZZWAERS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZVKORG_ZVKORG_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVKORG_ZVKORG_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZVKORG"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZVSTEL": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVSTEL",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVSTEL_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ALAN_VSTE": {
+ "name": "ALAN_VSTE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AZON_VSTE": {
+ "name": "AZON_VSTE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CTRY_SHPT": {
+ "name": "CTRY_SHPT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LANG_SHPT": {
+ "name": "LANG_SHPT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZVSTEL": {
+ "name": "ZVSTEL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZFABKL": {
+ "name": "ZZFABKL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZLAZBS": {
+ "name": "ZZLAZBS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZRIZBS": {
+ "name": "ZZRIZBS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZVSTEL_ZVSTEL_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVSTEL_ZVSTEL_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZVSTEL"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZVTWEG": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVTWEG",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVTWEG_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ZVTWEG": {
+ "name": "ZVTWEG",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZVTWEG_ZVTWEG_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZVTWEG_ZVTWEG_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZVTWEG"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.ORGANIZATION_MASTER_HRHMTB_ZWERKS": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZWERKS",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZWERKS_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "CTRY_PLNT": {
+ "name": "CTRY_PLNT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LANG_PLNT": {
+ "name": "LANG_PLNT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZWERKS": {
+ "name": "ZWERKS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ZZDELETE": {
+ "name": "ZZDELETE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZFABKL": {
+ "name": "ZZFABKL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZNAME1": {
+ "name": "ZZNAME1",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZZNAME2": {
+ "name": "ZZNAME2",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "ORGANIZATION_MASTER_HRHMTB_ZWERKS_ZWERKS_unique": {
+ "name": "ORGANIZATION_MASTER_HRHMTB_ZWERKS_ZWERKS_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "ZWERKS"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.PROJECT_MASTER_CMCTB_PROJ_MAST": {
+ "name": "PROJECT_MASTER_CMCTB_PROJ_MAST",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "PROJECT_MASTER_CMCTB_PROJ_MAST_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "AS_GRNT_PRD": {
+ "name": "AS_GRNT_PRD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZCLS": {
+ "name": "BIZCLS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZLOC_CD": {
+ "name": "BIZLOC_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZ_DMN": {
+ "name": "BIZ_DMN",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BP_DL_DT": {
+ "name": "BP_DL_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHN_PROJ_TP": {
+ "name": "CHN_PROJ_TP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLS_1": {
+ "name": "CLS_1",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLS_2": {
+ "name": "CLS_2",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNRT_CNTN_YN": {
+ "name": "CNRT_CNTN_YN",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNRT_DL_DT": {
+ "name": "CNRT_DL_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNRT_DT": {
+ "name": "CNRT_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNRT_RESV_YN": {
+ "name": "CNRT_RESV_YN",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CO_CD": {
+ "name": "CO_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CSTM_PO_NO": {
+ "name": "CSTM_PO_NO",
+ "type": "varchar(35)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_YN": {
+ "name": "DEL_YN",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DIGT_PDT_GRP": {
+ "name": "DIGT_PDT_GRP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DIST_PATH": {
+ "name": "DIST_PATH",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_BF_PROJ_NM": {
+ "name": "DL_BF_PROJ_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_CSTM_CD": {
+ "name": "DL_CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DOCK_CD": {
+ "name": "DOCK_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DSN_CHRGR": {
+ "name": "DSN_CHRGR",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FIN_GRNT_FN_DT": {
+ "name": "FIN_GRNT_FN_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GENT_CNT": {
+ "name": "GENT_CNT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GOV": {
+ "name": "GOV",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GRNT_STDT": {
+ "name": "GRNT_STDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IMO_NO": {
+ "name": "IMO_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INQY_NO": {
+ "name": "INQY_NO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INQY_SEQ": {
+ "name": "INQY_SEQ",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IO_GB": {
+ "name": "IO_GB",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MNG_ACOT_DMN": {
+ "name": "MNG_ACOT_DMN",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MN_ENGN_TP_CD": {
+ "name": "MN_ENGN_TP_CD",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MSHIP_NO": {
+ "name": "MSHIP_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NEW_MC_YN": {
+ "name": "NEW_MC_YN",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NTTP": {
+ "name": "NTTP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORDR_GRNT_FN_DT": {
+ "name": "ORDR_GRNT_FN_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORDR_GRNT_PRD": {
+ "name": "ORDR_GRNT_PRD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OWN_1": {
+ "name": "OWN_1",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OWN_AB": {
+ "name": "OWN_AB",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OWN_NM": {
+ "name": "OWN_NM",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PDT_LVL_4": {
+ "name": "PDT_LVL_4",
+ "type": "varchar(14)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PLNT_CD": {
+ "name": "PLNT_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRCTR": {
+ "name": "PRCTR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRGS_STAT": {
+ "name": "PRGS_STAT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_CRTE_REQ_DT": {
+ "name": "PROJ_CRTE_REQ_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_CRTE_REQ_EMPNO": {
+ "name": "PROJ_CRTE_REQ_EMPNO",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_DL_PLN_DT": {
+ "name": "PROJ_DL_PLN_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_DL_RT_DT": {
+ "name": "PROJ_DL_RT_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_DSC": {
+ "name": "PROJ_DSC",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_DTL_TP": {
+ "name": "PROJ_DTL_TP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_ETC_TP": {
+ "name": "PROJ_ETC_TP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_GB": {
+ "name": "PROJ_GB",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_NO": {
+ "name": "PROJ_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PROJ_PRGS_YN": {
+ "name": "PROJ_PRGS_YN",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_PROF": {
+ "name": "PROJ_PROF",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_SCP": {
+ "name": "PROJ_SCP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_WBS_TP": {
+ "name": "PROJ_WBS_TP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRO_PROJ_NO": {
+ "name": "PRO_PROJ_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "QM_CLS": {
+ "name": "QM_CLS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REF_NO": {
+ "name": "REF_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "RLTD_PROJ": {
+ "name": "RLTD_PROJ",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "RL_DL_DT": {
+ "name": "RL_DL_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SALE_GRP": {
+ "name": "SALE_GRP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SALE_ORG_CD": {
+ "name": "SALE_ORG_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SA_DT": {
+ "name": "SA_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SERS_NO": {
+ "name": "SERS_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SERS_YN": {
+ "name": "SERS_YN",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SHTYPE": {
+ "name": "SHTYPE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SHTYPE_CD": {
+ "name": "SHTYPE_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SHTYPE_GRP": {
+ "name": "SHTYPE_GRP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SHTYPE_UOM": {
+ "name": "SHTYPE_UOM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SKND": {
+ "name": "SKND",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRC_SYS_ID": {
+ "name": "SRC_SYS_ID",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STDT": {
+ "name": "STDT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SYS_ACOT_CLSD_DT": {
+ "name": "SYS_ACOT_CLSD_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TOT_CNRT_CNT": {
+ "name": "TOT_CNRT_CNT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TYPE": {
+ "name": "TYPE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WP_PROJ_TP": {
+ "name": "WP_PROJ_TP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "PROJECT_MASTER_CMCTB_PROJ_MAST_PROJ_NO_unique": {
+ "name": "PROJECT_MASTER_CMCTB_PROJ_MAST_PROJ_NO_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "PROJ_NO"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER": {
+ "name": "VENDOR_MASTER_BP_HEADER",
+ "schema": "mdg",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {
+ "VENDOR_MASTER_BP_HEADER_VNDRCD_unique": {
+ "name": "VENDOR_MASTER_BP_HEADER_VNDRCD_unique",
+ "nullsNotDistinct": false,
+ "columns": [
+ "VNDRCD"
+ ]
+ }
+ },
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER_ADDRESS": {
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS",
+ "schema": "mdg",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ADDRNO": {
+ "name": "ADDRNO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "VENDOR_MASTER_BP_HEADER_ADDRESS_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk": {
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk",
+ "tableFrom": "VENDOR_MASTER_BP_HEADER_ADDRESS",
+ "tableTo": "VENDOR_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "VNDRCD"
+ ],
+ "columnsTo": [
+ "VNDRCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER_ADDRESS_AD_EMAIL": {
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_EMAIL",
+ "schema": "mdg",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_EMAIL_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "EMAIL_ADR": {
+ "name": "EMAIL_ADR",
+ "type": "varchar(241)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VLD_ST_DT": {
+ "name": "VLD_ST_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_EMAIL_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk": {
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_EMAIL_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk",
+ "tableFrom": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_EMAIL",
+ "tableTo": "VENDOR_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "VNDRCD"
+ ],
+ "columnsTo": [
+ "VNDRCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER_ADDRESS_AD_FAX": {
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_FAX",
+ "schema": "mdg",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_FAX_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "FAXNO": {
+ "name": "FAXNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FAX_ETS_NO": {
+ "name": "FAX_ETS_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NTN_CD": {
+ "name": "NTN_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VLD_ST_DT": {
+ "name": "VLD_ST_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_FAX_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk": {
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_FAX_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk",
+ "tableFrom": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_FAX",
+ "tableTo": "VENDOR_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "VNDRCD"
+ ],
+ "columnsTo": [
+ "VNDRCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER_ADDRESS_AD_POSTAL": {
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_POSTAL",
+ "schema": "mdg",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_POSTAL_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ADR_1": {
+ "name": "ADR_1",
+ "type": "varchar(190)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR_2": {
+ "name": "ADR_2",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR_TMZ": {
+ "name": "ADR_TMZ",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CITY_ZIP_NO": {
+ "name": "CITY_ZIP_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ETC_ADR_1": {
+ "name": "ETC_ADR_1",
+ "type": "varchar(180)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ETC_ADR_2": {
+ "name": "ETC_ADR_2",
+ "type": "varchar(180)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INTL_ADR_VER_ID": {
+ "name": "INTL_ADR_VER_ID",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LANG_KEY": {
+ "name": "LANG_KEY",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NTN_CD": {
+ "name": "NTN_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "POBX": {
+ "name": "POBX",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "POBX_ZIP_NO": {
+ "name": "POBX_ZIP_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REGN_CD": {
+ "name": "REGN_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TAX_JRDT_ZONE_CD": {
+ "name": "TAX_JRDT_ZONE_CD",
+ "type": "varchar(15)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TRANS_ZONE": {
+ "name": "TRANS_ZONE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TTL": {
+ "name": "TTL",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_1": {
+ "name": "VNDRNM_1",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_2": {
+ "name": "VNDRNM_2",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_3": {
+ "name": "VNDRNM_3",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_4": {
+ "name": "VNDRNM_4",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_ABRV_1": {
+ "name": "VNDRNM_ABRV_1",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_ABRV_2": {
+ "name": "VNDRNM_ABRV_2",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_POSTAL_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk": {
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_POSTAL_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk",
+ "tableFrom": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_POSTAL",
+ "tableTo": "VENDOR_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "VNDRCD"
+ ],
+ "columnsTo": [
+ "VNDRCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER_ADDRESS_AD_TEL": {
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_TEL",
+ "schema": "mdg",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_TEL_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ETX_NO": {
+ "name": "ETX_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HP_ORDR": {
+ "name": "HP_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NTN_CD": {
+ "name": "NTN_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "TELNO": {
+ "name": "TELNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VLD_ST_DT": {
+ "name": "VLD_ST_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_TEL_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk": {
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_TEL_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk",
+ "tableFrom": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_TEL",
+ "tableTo": "VENDOR_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "VNDRCD"
+ ],
+ "columnsTo": [
+ "VNDRCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER_ADDRESS_AD_URL": {
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_URL",
+ "schema": "mdg",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_URL_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "URL": {
+ "name": "URL",
+ "type": "varchar(2000)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VLD_ST_DT": {
+ "name": "VLD_ST_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_URL_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk": {
+ "name": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_URL_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk",
+ "tableFrom": "VENDOR_MASTER_BP_HEADER_ADDRESS_AD_URL",
+ "tableTo": "VENDOR_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "VNDRCD"
+ ],
+ "columnsTo": [
+ "VNDRCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER_BP_TAXNUM": {
+ "name": "VENDOR_MASTER_BP_HEADER_BP_TAXNUM",
+ "schema": "mdg",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_BP_TAXNUM_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "BIZ_PTNR_TX_NO": {
+ "name": "BIZ_PTNR_TX_NO",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TX_NO_CTG": {
+ "name": "TX_NO_CTG",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "VENDOR_MASTER_BP_HEADER_BP_TAXNUM_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk": {
+ "name": "VENDOR_MASTER_BP_HEADER_BP_TAXNUM_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk",
+ "tableFrom": "VENDOR_MASTER_BP_HEADER_BP_TAXNUM",
+ "tableTo": "VENDOR_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "VNDRCD"
+ ],
+ "columnsTo": [
+ "VNDRCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER_BP_VENGEN": {
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN",
+ "schema": "mdg",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ACNT_GRP": {
+ "name": "ACNT_GRP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ACNT_GRP_TP": {
+ "name": "ACNT_GRP_TP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR_1": {
+ "name": "ADR_1",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR_2": {
+ "name": "ADR_2",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AGR_DT": {
+ "name": "AGR_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AGR_R_ID": {
+ "name": "AGR_R_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AGR_TM": {
+ "name": "AGR_TM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZCON": {
+ "name": "BIZCON",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZR_NO": {
+ "name": "BIZR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZTP": {
+ "name": "BIZTP",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZ_UOM_CD": {
+ "name": "BIZ_UOM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZ_UOM_NM": {
+ "name": "BIZ_UOM_NM",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHGR_ID": {
+ "name": "CHGR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_TM": {
+ "name": "CHG_TM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CO_ID": {
+ "name": "CO_ID",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CO_REG_NO": {
+ "name": "CO_REG_NO",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CO_VLM": {
+ "name": "CO_VLM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_HOLD_ORDR": {
+ "name": "DEL_HOLD_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DMST_TOP_CD": {
+ "name": "DMST_TOP_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DMST_TOP_NM": {
+ "name": "DMST_TOP_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DNS_NO": {
+ "name": "DNS_NO",
+ "type": "varchar(11)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DOC_NO": {
+ "name": "DOC_NO",
+ "type": "varchar(25)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DOC_TP": {
+ "name": "DOC_TP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DOC_VER": {
+ "name": "DOC_VER",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FIR_NM": {
+ "name": "FIR_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GBL_TOP_CD": {
+ "name": "GBL_TOP_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GBL_TOP_NM": {
+ "name": "GBL_TOP_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GIRO_VNDR_ORDR": {
+ "name": "GIRO_VNDR_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HOLD_CAUS": {
+ "name": "HOLD_CAUS",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INB_FLAG": {
+ "name": "INB_FLAG",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INTL_LCTN_CHK_NUM": {
+ "name": "INTL_LCTN_CHK_NUM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OVLAP_CAUS_CD": {
+ "name": "OVLAP_CAUS_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PST_HOLD_ORDR": {
+ "name": "PST_HOLD_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PTNT_VNDRCD": {
+ "name": "PTNT_VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PTN_DOC": {
+ "name": "PTN_DOC",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_HOLD_DT": {
+ "name": "PUR_HOLD_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_HOLD_ORDR": {
+ "name": "PUR_HOLD_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "QLT_CHRGR_EMAIL": {
+ "name": "QLT_CHRGR_EMAIL",
+ "type": "varchar(241)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "QLT_CHRGR_NM": {
+ "name": "QLT_CHRGR_NM",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "QLT_CHRGR_TELNO": {
+ "name": "QLT_CHRGR_TELNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REGR_ID": {
+ "name": "REGR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REG_DT": {
+ "name": "REG_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REG_TM": {
+ "name": "REG_TM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_NM": {
+ "name": "REPR_NM",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_RESNO": {
+ "name": "REPR_RESNO",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REP_TEL_NO": {
+ "name": "REP_TEL_NO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SB_WKA_SEQ": {
+ "name": "SB_WKA_SEQ",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCETX_RP_SEX_KEY": {
+ "name": "SRCETX_RP_SEX_KEY",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TTL": {
+ "name": "TTL",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TX_CD_4": {
+ "name": "TX_CD_4",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VAT_REG_NO": {
+ "name": "VAT_REG_NO",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_1": {
+ "name": "VNDRNM_1",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNO": {
+ "name": "VNDRNO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "VENDOR_MASTER_BP_HEADER_BP_VENGEN_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk": {
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk",
+ "tableFrom": "VENDOR_MASTER_BP_HEADER_BP_VENGEN",
+ "tableTo": "VENDOR_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "VNDRCD"
+ ],
+ "columnsTo": [
+ "VNDRCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_COMPNY": {
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_COMPNY",
+ "schema": "mdg",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_COMPNY_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "ACOT_CHRGR_FAXNO": {
+ "name": "ACOT_CHRGR_FAXNO",
+ "type": "varchar(31)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ACOT_CHRGR_TELNO": {
+ "name": "ACOT_CHRGR_TELNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AUTH_GRP": {
+ "name": "AUTH_GRP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BF_VNDRCD": {
+ "name": "BF_VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CO_CD": {
+ "name": "CO_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CSTM_VNDR_CLR_ORDR": {
+ "name": "CSTM_VNDR_CLR_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CTL_ACNT": {
+ "name": "CTL_ACNT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FIN_IR_ACT_DT": {
+ "name": "FIN_IR_ACT_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FIN_IR_CALC_DT": {
+ "name": "FIN_IR_CALC_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IATA_BIC_GB": {
+ "name": "IATA_BIC_GB",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LOGST_VNDR_TP": {
+ "name": "LOGST_VNDR_TP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEMO": {
+ "name": "MEMO",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MIN_ORDR": {
+ "name": "MIN_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MK_CHRGR_EMAIL": {
+ "name": "MK_CHRGR_EMAIL",
+ "type": "varchar(241)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MOFFC_ACNT_NO": {
+ "name": "MOFFC_ACNT_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OVLAP_INVC_ORDR": {
+ "name": "OVLAP_INVC_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PLN_GRP": {
+ "name": "PLN_GRP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PST_HOLD_ORDR": {
+ "name": "PST_HOLD_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REP_TP": {
+ "name": "REP_TP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPLY_COND": {
+ "name": "SPLY_COND",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPLY_HOLD_ORDR": {
+ "name": "SPLY_HOLD_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPLY_MTHD": {
+ "name": "SPLY_MTHD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRT_SPLY_ORDR": {
+ "name": "SPRT_SPLY_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCE_TX_CD": {
+ "name": "SRCE_TX_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCE_TX_NTN_CD": {
+ "name": "SRCE_TX_NTN_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRT_KEY": {
+ "name": "SRT_KEY",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TRD_BANK_SHRT_KEY": {
+ "name": "TRD_BANK_SHRT_KEY",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDR_ACNT_NO": {
+ "name": "VNDR_ACNT_NO",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDR_CHRGR_NM": {
+ "name": "VNDR_CHRGR_NM",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_COMPNY_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk": {
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_COMPNY_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk",
+ "tableFrom": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_COMPNY",
+ "tableTo": "VENDOR_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "VNDRCD"
+ ],
+ "columnsTo": [
+ "VNDRCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_COMPNY_BP_WHTAX": {
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_COMPNY_BP_WHTAX",
+ "schema": "mdg",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_COMPNY_BP_WHTAX_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "DCHAG_CAUS": {
+ "name": "DCHAG_CAUS",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DCHAG_CERT_NO": {
+ "name": "DCHAG_CERT_NO",
+ "type": "varchar(15)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DCHAG_ED_DT": {
+ "name": "DCHAG_ED_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DCHAG_ST_DT": {
+ "name": "DCHAG_ST_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "RECIP_TP": {
+ "name": "RECIP_TP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCE_TX_IDENT_NO": {
+ "name": "SRCE_TX_IDENT_NO",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCE_TX_NO": {
+ "name": "SRCE_TX_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCE_TX_REL_ORDR": {
+ "name": "SRCE_TX_REL_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCE_TX_TP": {
+ "name": "SRCE_TX_TP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_COMPNY_BP_WHTAX_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk": {
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_COMPNY_BP_WHTAX_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk",
+ "tableFrom": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_COMPNY_BP_WHTAX",
+ "tableTo": "VENDOR_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "VNDRCD"
+ ],
+ "columnsTo": [
+ "VNDRCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG": {
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG",
+ "schema": "mdg",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "AT_PUR_ORD_ORDR": {
+ "name": "AT_PUR_ORD_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CALC_SHM_GRP": {
+ "name": "CALC_SHM_GRP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNFM_CTL_KEY": {
+ "name": "CNFM_CTL_KEY",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_COND_1": {
+ "name": "DL_COND_1",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_COND_2": {
+ "name": "DL_COND_2",
+ "type": "varchar(28)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GR_BSE_INVC_VR": {
+ "name": "GR_BSE_INVC_VR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORD_CNFM_REQ_ORDR": {
+ "name": "ORD_CNFM_REQ_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_HOLD_CAUS": {
+ "name": "PUR_HOLD_CAUS",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_HOLD_DT": {
+ "name": "PUR_HOLD_DT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_HOLD_ORDR": {
+ "name": "PUR_HOLD_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_ORD_CUR": {
+ "name": "PUR_ORD_CUR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_ORG_CD": {
+ "name": "PUR_ORG_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SALE_CHRGR_NM": {
+ "name": "SALE_CHRGR_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPLY_COND": {
+ "name": "SPLY_COND",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDR_TELNO": {
+ "name": "VNDR_TELNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk": {
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk",
+ "tableFrom": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG",
+ "tableTo": "VENDOR_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "VNDRCD"
+ ],
+ "columnsTo": [
+ "VNDRCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "mdg.VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG_ZVPFN": {
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG_ZVPFN",
+ "schema": "mdg",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "byDefault",
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG_ZVPFN_id_seq",
+ "schema": "mdg",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "BSE_PTNR_ORDR": {
+ "name": "BSE_PTNR_ORDR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ETC_REF_VNDRCD": {
+ "name": "ETC_REF_VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PLNT_NO": {
+ "name": "PLNT_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PTNR_CNT": {
+ "name": "PTNR_CNT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PTNR_SKL": {
+ "name": "PTNR_SKL",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VNDR_SUB_NO": {
+ "name": "VNDR_SUB_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {
+ "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG_ZVPFN_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk": {
+ "name": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG_ZVPFN_VNDRCD_VENDOR_MASTER_BP_HEADER_VNDRCD_fk",
+ "tableFrom": "VENDOR_MASTER_BP_HEADER_BP_VENGEN_BP_PORG_ZVPFN",
+ "tableTo": "VENDOR_MASTER_BP_HEADER",
+ "schemaTo": "mdg",
+ "columnsFrom": [
+ "VNDRCD"
+ ],
+ "columnsTo": [
+ "VNDRCD"
+ ],
+ "onDelete": "no action",
+ "onUpdate": "no action"
+ }
+ },
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "soap.soap_logs": {
+ "name": "soap_logs",
+ "schema": "soap",
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "direction": {
+ "name": "direction",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "system": {
+ "name": "system",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "interface": {
+ "name": "interface",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "startedAt": {
+ "name": "startedAt",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "endedAt": {
+ "name": "endedAt",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "isSuccess": {
+ "name": "isSuccess",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "requestData": {
+ "name": "requestData",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "responseData": {
+ "name": "responseData",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "errorMessage": {
+ "name": "errorMessage",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_cd": {
+ "name": "cmctb_cd",
+ "schema": "nonsap",
+ "columns": {
+ "CD_CLF": {
+ "name": "CD_CLF",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CD": {
+ "name": "CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CD2": {
+ "name": "CD2",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CD3": {
+ "name": "CD3",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "USR_DF_CHAR_1": {
+ "name": "USR_DF_CHAR_1",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_2": {
+ "name": "USR_DF_CHAR_2",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_3": {
+ "name": "USR_DF_CHAR_3",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_4": {
+ "name": "USR_DF_CHAR_4",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_5": {
+ "name": "USR_DF_CHAR_5",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_6": {
+ "name": "USR_DF_CHAR_6",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_7": {
+ "name": "USR_DF_CHAR_7",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_8": {
+ "name": "USR_DF_CHAR_8",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_9": {
+ "name": "USR_DF_CHAR_9",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_10": {
+ "name": "USR_DF_CHAR_10",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_11": {
+ "name": "USR_DF_CHAR_11",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_12": {
+ "name": "USR_DF_CHAR_12",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_13": {
+ "name": "USR_DF_CHAR_13",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_14": {
+ "name": "USR_DF_CHAR_14",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_15": {
+ "name": "USR_DF_CHAR_15",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_16": {
+ "name": "USR_DF_CHAR_16",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_17": {
+ "name": "USR_DF_CHAR_17",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_18": {
+ "name": "USR_DF_CHAR_18",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_19": {
+ "name": "USR_DF_CHAR_19",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR_20": {
+ "name": "USR_DF_CHAR_20",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHK_1": {
+ "name": "USR_DF_CHK_1",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHK_2": {
+ "name": "USR_DF_CHK_2",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHK_3": {
+ "name": "USR_DF_CHK_3",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHK_4": {
+ "name": "USR_DF_CHK_4",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHK_5": {
+ "name": "USR_DF_CHK_5",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHK_6": {
+ "name": "USR_DF_CHK_6",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHK_7": {
+ "name": "USR_DF_CHK_7",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHK_8": {
+ "name": "USR_DF_CHK_8",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_DT_1": {
+ "name": "USR_DF_DT_1",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_DT_2": {
+ "name": "USR_DF_DT_2",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_DT_3": {
+ "name": "USR_DF_DT_3",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_DT_4": {
+ "name": "USR_DF_DT_4",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_TM_1": {
+ "name": "USR_DF_TM_1",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_TM_2": {
+ "name": "USR_DF_TM_2",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_TM_3": {
+ "name": "USR_DF_TM_3",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_TM_4": {
+ "name": "USR_DF_TM_4",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTER": {
+ "name": "CRTER",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTE_DT": {
+ "name": "CRTE_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTE_TM": {
+ "name": "CRTE_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHGR": {
+ "name": "CHGR",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_TM": {
+ "name": "CHG_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_YN": {
+ "name": "DEL_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_cd_clf": {
+ "name": "cmctb_cd_clf",
+ "schema": "nonsap",
+ "columns": {
+ "CD_CLF": {
+ "name": "CD_CLF",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CRTER": {
+ "name": "CRTER",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTE_DT": {
+ "name": "CRTE_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTE_TM": {
+ "name": "CRTE_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHGR": {
+ "name": "CHGR",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_TM": {
+ "name": "CHG_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_YN": {
+ "name": "DEL_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "XSTAT": {
+ "name": "XSTAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "XMSGS": {
+ "name": "XMSGS",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "XDATS": {
+ "name": "XDATS",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "XTIMS": {
+ "name": "XTIMS",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_cd_clf_nm": {
+ "name": "cmctb_cd_clf_nm",
+ "schema": "nonsap",
+ "columns": {
+ "LANG_KEY": {
+ "name": "LANG_KEY",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CD_CLF": {
+ "name": "CD_CLF",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CD_CLF_NM": {
+ "name": "CD_CLF_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GRP_DSC": {
+ "name": "GRP_DSC",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTER": {
+ "name": "CRTER",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTE_DT": {
+ "name": "CRTE_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTE_TM": {
+ "name": "CRTE_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHGR": {
+ "name": "CHGR",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_TM": {
+ "name": "CHG_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_YN": {
+ "name": "DEL_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_cdnm": {
+ "name": "cmctb_cdnm",
+ "schema": "nonsap",
+ "columns": {
+ "LANG_KEY": {
+ "name": "LANG_KEY",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CD_CLF": {
+ "name": "CD_CLF",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CD": {
+ "name": "CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CD2": {
+ "name": "CD2",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CD3": {
+ "name": "CD3",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CDNM": {
+ "name": "CDNM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GRP_DSC": {
+ "name": "GRP_DSC",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTER": {
+ "name": "CRTER",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTE_DT": {
+ "name": "CRTE_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTE_TM": {
+ "name": "CRTE_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHGR": {
+ "name": "CHGR",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_TM": {
+ "name": "CHG_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_YN": {
+ "name": "DEL_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_customer_addr": {
+ "name": "cmctb_customer_addr",
+ "schema": "nonsap",
+ "columns": {
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ADR_NO": {
+ "name": "ADR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "INTL_ADR_VER_ID": {
+ "name": "INTL_ADR_VER_ID",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "NTN_CD": {
+ "name": "NTN_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CITY_ZIP_NO": {
+ "name": "CITY_ZIP_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "POBX_ZIP_NO": {
+ "name": "POBX_ZIP_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR_1": {
+ "name": "ADR_1",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR_2": {
+ "name": "ADR_2",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REGN_CD": {
+ "name": "REGN_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ETC_ADR_1": {
+ "name": "ETC_ADR_1",
+ "type": "varchar(180)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ETC_ADR_2": {
+ "name": "ETC_ADR_2",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HOUSE_NR1": {
+ "name": "HOUSE_NR1",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "POBX": {
+ "name": "POBX",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LANG_KEY": {
+ "name": "LANG_KEY",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_1": {
+ "name": "VNDRNM_1",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_2": {
+ "name": "VNDRNM_2",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TRANS_ZONE": {
+ "name": "TRANS_ZONE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_customer_cfpn": {
+ "name": "cmctb_customer_cfpn",
+ "schema": "nonsap",
+ "columns": {
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SALE_ORG_CD": {
+ "name": "SALE_ORG_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "DIST_PATH": {
+ "name": "DIST_PATH",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PDT_GRP": {
+ "name": "PDT_GRP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PTNR_SKL": {
+ "name": "PTNR_SKL",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PTNR_CNT": {
+ "name": "PTNR_CNT",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "BSE_PTNR_ORDR": {
+ "name": "BSE_PTNR_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_customer_compny": {
+ "name": "cmctb_customer_compny",
+ "schema": "nonsap",
+ "columns": {
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CO_ID": {
+ "name": "CO_ID",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "AR_ACNT_HDL_GB": {
+ "name": "AR_ACNT_HDL_GB",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRT_KEY": {
+ "name": "SRT_KEY",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AMT_RNE_GB": {
+ "name": "AMT_RNE_GB",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDR_PAY_FRM": {
+ "name": "VNDR_PAY_FRM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BILL_PAY_COND_CD": {
+ "name": "BILL_PAY_COND_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BILL_PAY_BLOC_CD": {
+ "name": "BILL_PAY_BLOC_CD",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PST_HOLD_ORDR": {
+ "name": "PST_HOLD_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_customer_general": {
+ "name": "cmctb_customer_general",
+ "schema": "nonsap",
+ "columns": {
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ADR_NO": {
+ "name": "ADR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ACNT_GRP": {
+ "name": "ACNT_GRP",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OVLAP_CAUS": {
+ "name": "OVLAP_CAUS",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CSTM_TP": {
+ "name": "CSTM_TP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_BLOCK": {
+ "name": "DEL_BLOCK",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PST_HOLD_ORDR": {
+ "name": "PST_HOLD_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CO_ID": {
+ "name": "CO_ID",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TTL": {
+ "name": "TTL",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "COND_GRP_1": {
+ "name": "COND_GRP_1",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CSTM_GRP_NM": {
+ "name": "CSTM_GRP_NM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_NM": {
+ "name": "REPR_NM",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZTP": {
+ "name": "BIZTP",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZCON": {
+ "name": "BIZCON",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TX_NO_2": {
+ "name": "TX_NO_2",
+ "type": "varchar(11)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TX_NO_3": {
+ "name": "TX_NO_3",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TX_NO_4": {
+ "name": "TX_NO_4",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TX_REG_NO": {
+ "name": "TX_REG_NO",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BA_CD": {
+ "name": "BA_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCH_COND_1": {
+ "name": "SRCH_COND_1",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCH_COND_2": {
+ "name": "SRCH_COND_2",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CITY_DISP_NM": {
+ "name": "CITY_DISP_NM",
+ "type": "varchar(105)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRM_CD": {
+ "name": "CRM_CD",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IN_FLAG": {
+ "name": "IN_FLAG",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INDST_CD": {
+ "name": "INDST_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TX_NO_TP": {
+ "name": "TX_NO_TP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LANG_KEY": {
+ "name": "LANG_KEY",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REG_DT": {
+ "name": "REG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REG_DTM": {
+ "name": "REG_DTM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REGR_ID": {
+ "name": "REGR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AGR_DT": {
+ "name": "AGR_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AGR_TM": {
+ "name": "AGR_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AGR_R_ID": {
+ "name": "AGR_R_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_TM": {
+ "name": "CHG_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHGR_ID": {
+ "name": "CHGR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FTGT_CD": {
+ "name": "FTGT_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FTGT_NM": {
+ "name": "FTGT_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FTDT_CD": {
+ "name": "FTDT_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FTDT_NM": {
+ "name": "FTDT_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FTBU_CD": {
+ "name": "FTBU_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FTBU_NM": {
+ "name": "FTBU_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_customer_repremail": {
+ "name": "cmctb_customer_repremail",
+ "schema": "nonsap",
+ "columns": {
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ADR_NO": {
+ "name": "ADR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VLD_ST_DT": {
+ "name": "VLD_ST_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "EMAIL_ADR": {
+ "name": "EMAIL_ADR",
+ "type": "varchar(241)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_customer_reprfax": {
+ "name": "cmctb_customer_reprfax",
+ "schema": "nonsap",
+ "columns": {
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ADR_NO": {
+ "name": "ADR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VLD_ST_DT": {
+ "name": "VLD_ST_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "NTN_CD": {
+ "name": "NTN_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FAXNO": {
+ "name": "FAXNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FAX_ETS_NO": {
+ "name": "FAX_ETS_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_customer_reprtel": {
+ "name": "cmctb_customer_reprtel",
+ "schema": "nonsap",
+ "columns": {
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ADR_NO": {
+ "name": "ADR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VLD_ST_DT": {
+ "name": "VLD_ST_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "NTN_CD": {
+ "name": "NTN_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TELNO": {
+ "name": "TELNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ETX_NO": {
+ "name": "ETX_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HP_ORDR": {
+ "name": "HP_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_customer_reprurl": {
+ "name": "cmctb_customer_reprurl",
+ "schema": "nonsap",
+ "columns": {
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ADR_NO": {
+ "name": "ADR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VLD_ST_DT": {
+ "name": "VLD_ST_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "URL": {
+ "name": "URL",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_customer_sorg": {
+ "name": "cmctb_customer_sorg",
+ "schema": "nonsap",
+ "columns": {
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SALE_ORG_CD": {
+ "name": "SALE_ORG_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "DIST_PATH": {
+ "name": "DIST_PATH",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PDT_GRP": {
+ "name": "PDT_GRP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SALE_REGN": {
+ "name": "SALE_REGN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SALE_OFC": {
+ "name": "SALE_OFC",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SALE_GRP": {
+ "name": "SALE_GRP",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CSTM_GRP": {
+ "name": "CSTM_GRP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PSBL": {
+ "name": "PSBL",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TRD_CUR": {
+ "name": "TRD_CUR",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "EXRAT_TP": {
+ "name": "EXRAT_TP",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRC_PRCS_DSC_CD": {
+ "name": "PRC_PRCS_DSC_CD",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CSTM_STAT_GRP": {
+ "name": "CSTM_STAT_GRP",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SHIPMT_COND": {
+ "name": "SHIPMT_COND",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAX_TRD_QTY": {
+ "name": "MAX_TRD_QTY",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_COND_1": {
+ "name": "DL_COND_1",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_COND_2": {
+ "name": "DL_COND_2",
+ "type": "varchar(84)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPLY_COND": {
+ "name": "SPLY_COND",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ACNT_ASGN_GRP": {
+ "name": "ACNT_ASGN_GRP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_customer_taxcd": {
+ "name": "cmctb_customer_taxcd",
+ "schema": "nonsap",
+ "columns": {
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "DPRT_NTN": {
+ "name": "DPRT_NTN",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "TX_CTG": {
+ "name": "TX_CTG",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CSTM_TX_CLF": {
+ "name": "CSTM_TX_CLF",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_customer_taxnum": {
+ "name": "cmctb_customer_taxnum",
+ "schema": "nonsap",
+ "columns": {
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "TX_NO_CTG": {
+ "name": "TX_NO_CTG",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "BIZ_PTNR_TX_NO": {
+ "name": "BIZ_PTNR_TX_NO",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_mat_bse": {
+ "name": "cmctb_mat_bse",
+ "schema": "nonsap",
+ "columns": {
+ "MAT_NO": {
+ "name": "MAT_NO",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SM_CD": {
+ "name": "SM_CD",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAT_ID": {
+ "name": "MAT_ID",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLAS_CD": {
+ "name": "CLAS_CD",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAT_TP": {
+ "name": "MAT_TP",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAT_GB": {
+ "name": "MAT_GB",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAT_DTL": {
+ "name": "MAT_DTL",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAT_DTL_SPEC": {
+ "name": "MAT_DTL_SPEC",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MATL": {
+ "name": "MATL",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OLD_MAT_NO": {
+ "name": "OLD_MAT_NO",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SBST_MAT_NO": {
+ "name": "SBST_MAT_NO",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "UOM": {
+ "name": "UOM",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PDT_GRP": {
+ "name": "PDT_GRP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MRC": {
+ "name": "MRC",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STOR_MAT_ORDR": {
+ "name": "STOR_MAT_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STYPE": {
+ "name": "STYPE",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLS": {
+ "name": "CLS",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WGT": {
+ "name": "WGT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NET_WGT": {
+ "name": "NET_WGT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WGT_UOM": {
+ "name": "WGT_UOM",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LTH": {
+ "name": "LTH",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LTH_2": {
+ "name": "LTH_2",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WTH": {
+ "name": "WTH",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WTH_2": {
+ "name": "WTH_2",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "THK": {
+ "name": "THK",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STD": {
+ "name": "STD",
+ "type": "varchar(70)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROF_STD": {
+ "name": "PROF_STD",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CBL_OUT_DIA": {
+ "name": "CBL_OUT_DIA",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LTRM_MAT_YN": {
+ "name": "LTRM_MAT_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PNT_AREA": {
+ "name": "PNT_AREA",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PNTIN_AREA": {
+ "name": "PNTIN_AREA",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PNTIN_SPEC": {
+ "name": "PNTIN_SPEC",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PNTOUT_AREA": {
+ "name": "PNTOUT_AREA",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PNTOUT_SPEC_1": {
+ "name": "PNTOUT_SPEC_1",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PNTOUT_SPEC_2": {
+ "name": "PNTOUT_SPEC_2",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PNTOUT_SPEC_3": {
+ "name": "PNTOUT_SPEC_3",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "RT_INSPEC": {
+ "name": "RT_INSPEC",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "UT_INSPEC": {
+ "name": "UT_INSPEC",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MT_INSPEC": {
+ "name": "MT_INSPEC",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PT_INSPEC": {
+ "name": "PT_INSPEC",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MK_DWG_NO": {
+ "name": "MK_DWG_NO",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CUT_DWG_NO": {
+ "name": "CUT_DWG_NO",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PIPE_SPL_NO": {
+ "name": "PIPE_SPL_NO",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PIPE_LINE_NO": {
+ "name": "PIPE_LINE_NO",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PIPE_CLAS": {
+ "name": "PIPE_CLAS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FLUID_KND": {
+ "name": "FLUID_KND",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REP_ITM_MATL": {
+ "name": "REP_ITM_MATL",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REP_DIA": {
+ "name": "REP_DIA",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REP_DIA_UOM": {
+ "name": "REP_DIA_UOM",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REP_SCH": {
+ "name": "REP_SCH",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REP_DIA_LTH": {
+ "name": "REP_DIA_LTH",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DBLN_GB": {
+ "name": "DBLN_GB",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PIPE_GRD": {
+ "name": "PIPE_GRD",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HTRET_YN": {
+ "name": "HTRET_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BA_GALV_SPEC": {
+ "name": "BA_GALV_SPEC",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SSIDE_YN": {
+ "name": "SSIDE_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PNTR_PIPE_YN": {
+ "name": "PNTR_PIPE_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "UBOLT_YN": {
+ "name": "UBOLT_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CTLP_PRCD_PNT": {
+ "name": "CTLP_PRCD_PNT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRCD_SCV_CTLP": {
+ "name": "PRCD_SCV_CTLP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PMI_INSPEC": {
+ "name": "PMI_INSPEC",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WTRPRS": {
+ "name": "WTRPRS",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VLV_FIT_NO": {
+ "name": "VLV_FIT_NO",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TAG_NO": {
+ "name": "TAG_NO",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TAG_SB_NO": {
+ "name": "TAG_SB_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NM_PLATE_TP": {
+ "name": "NM_PLATE_TP",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NM_PLATE_SVC_NM": {
+ "name": "NM_PLATE_SVC_NM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VRCS_MAT_NO": {
+ "name": "VRCS_MAT_NO",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TRSM_FIT_NO": {
+ "name": "TRSM_FIT_NO",
+ "type": "varchar(7)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VLV_OPT_CD_LIST": {
+ "name": "VLV_OPT_CD_LIST",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_REQ_NO": {
+ "name": "PUR_REQ_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ITM_NO": {
+ "name": "ITM_NO",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MDL_NO": {
+ "name": "MDL_NO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BL_NO": {
+ "name": "BL_NO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDR_EQP_NO": {
+ "name": "VNDR_EQP_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BOX_NO": {
+ "name": "BOX_NO",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MMT_NO": {
+ "name": "MMT_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INSTL_LOC": {
+ "name": "INSTL_LOC",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MN_EQP_YN": {
+ "name": "MN_EQP_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FIXED_MAT_YN": {
+ "name": "FIXED_MAT_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRE_YN": {
+ "name": "SPRE_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TOOL_YN": {
+ "name": "TOOL_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CBL_YN": {
+ "name": "CBL_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OWN_INSTL_MAT_YN": {
+ "name": "OWN_INSTL_MAT_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NONINSTL_MAT_YN": {
+ "name": "NONINSTL_MAT_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BLK_NO": {
+ "name": "BLK_NO",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GYEL": {
+ "name": "GYEL",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LNK_PTLST_NO": {
+ "name": "LNK_PTLST_NO",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AREA": {
+ "name": "AREA",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STOR_LOC": {
+ "name": "STOR_LOC",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SGUB_WGT": {
+ "name": "SGUB_WGT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DGUB_WGT": {
+ "name": "DGUB_WGT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_NO": {
+ "name": "PROJ_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DSN_SKL": {
+ "name": "DSN_SKL",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "RMK": {
+ "name": "RMK",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_DT": {
+ "name": "DEL_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAT_STAT": {
+ "name": "MAT_STAT",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_SYS_NO": {
+ "name": "IF_SYS_NO",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GLAND_SPEC_1": {
+ "name": "GLAND_SPEC_1",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GLAND_SPEC_2": {
+ "name": "GLAND_SPEC_2",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GLAND_SPEC_3": {
+ "name": "GLAND_SPEC_3",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MCT_MDLE_STD_1": {
+ "name": "MCT_MDLE_STD_1",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MCT_MDLE_STD_2": {
+ "name": "MCT_MDLE_STD_2",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BEELE_RISE": {
+ "name": "BEELE_RISE",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAX_DRUM_LTH": {
+ "name": "MAX_DRUM_LTH",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AGR_DTM": {
+ "name": "AGR_DTM",
+ "type": "varchar(14)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AGR_R_ID": {
+ "name": "AGR_R_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DISPLN": {
+ "name": "DISPLN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LRG_KWK": {
+ "name": "LRG_KWK",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DTL_KWK": {
+ "name": "DTL_KWK",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SP_INSP_GB": {
+ "name": "SP_INSP_GB",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PNTOUT_SPEC_4": {
+ "name": "PNTOUT_SPEC_4",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OFE_MAT_NO": {
+ "name": "OFE_MAT_NO",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OFE_CAB_YN": {
+ "name": "OFE_CAB_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INSTL_PSB_CNT": {
+ "name": "INSTL_PSB_CNT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CUTL_ML_GB": {
+ "name": "CUTL_ML_GB",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FCM_INSP": {
+ "name": "FCM_INSP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DOC_NO": {
+ "name": "DOC_NO",
+ "type": "varchar(25)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HOLD_CAUS": {
+ "name": "HOLD_CAUS",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HOLD_DT": {
+ "name": "HOLD_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HOLD_LIFT_DT": {
+ "name": "HOLD_LIFT_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAT_KND_GB": {
+ "name": "MAT_KND_GB",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BATCH_MNG_ORDR": {
+ "name": "BATCH_MNG_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FS_INPR_ID": {
+ "name": "FS_INPR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FS_INP_DTM": {
+ "name": "FS_INP_DTM",
+ "type": "varchar(14)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FIN_CHGR_ID": {
+ "name": "FIN_CHGR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FIN_CHG_DTM": {
+ "name": "FIN_CHG_DTM",
+ "type": "varchar(14)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DWG_FILE_NM": {
+ "name": "DWG_FILE_NM",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TAG_NO_CHG_DT": {
+ "name": "TAG_NO_CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SUB_EQP_YN": {
+ "name": "SUB_EQP_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ATT_MAT_YN": {
+ "name": "ATT_MAT_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DSN_REV_NO": {
+ "name": "DSN_REV_NO",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR1": {
+ "name": "USR_DF_CHAR1",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR2": {
+ "name": "USR_DF_CHAR2",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR3": {
+ "name": "USR_DF_CHAR3",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR4": {
+ "name": "USR_DF_CHAR4",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "USR_DF_CHAR5": {
+ "name": "USR_DF_CHAR5",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_mat_clas": {
+ "name": "cmctb_mat_clas",
+ "schema": "nonsap",
+ "columns": {
+ "CLAS_CD": {
+ "name": "CLAS_CD",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CLAS_NM": {
+ "name": "CLAS_NM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLAS_DTL": {
+ "name": "CLAS_DTL",
+ "type": "varchar(180)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRNT_CLAS_CD": {
+ "name": "PRNT_CLAS_CD",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLAS_LVL": {
+ "name": "CLAS_LVL",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "UOM": {
+ "name": "UOM",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STYPE": {
+ "name": "STYPE",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GRD_MATL": {
+ "name": "GRD_MATL",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BSE_UOM": {
+ "name": "BSE_UOM",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_mat_clas_spchar": {
+ "name": "cmctb_mat_clas_spchar",
+ "schema": "nonsap",
+ "columns": {
+ "CLAS_CD": {
+ "name": "CLAS_CD",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SPCHAR_CD": {
+ "name": "SPCHAR_CD",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SPCHAR_SEQ": {
+ "name": "SPCHAR_SEQ",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MNDT_YN": {
+ "name": "MNDT_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "cmctb_mat_clas_spchar_CLAS_CD_SPCHAR_CD_pk": {
+ "name": "cmctb_mat_clas_spchar_CLAS_CD_SPCHAR_CD_pk",
+ "columns": [
+ "CLAS_CD",
+ "SPCHAR_CD"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_mat_dsc": {
+ "name": "cmctb_mat_dsc",
+ "schema": "nonsap",
+ "columns": {
+ "MAT_NO": {
+ "name": "MAT_NO",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "LANG_KEY": {
+ "name": "LANG_KEY",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "MAT_DTL": {
+ "name": "MAT_DTL",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_mat_plnt": {
+ "name": "cmctb_mat_plnt",
+ "schema": "nonsap",
+ "columns": {
+ "MAT_NO": {
+ "name": "MAT_NO",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PLNT": {
+ "name": "PLNT",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "DELV_UOM": {
+ "name": "DELV_UOM",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "EA_BTCH_ND_GB": {
+ "name": "EA_BTCH_ND_GB",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRCR_CLF": {
+ "name": "PRCR_CLF",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_CHRGR_CD": {
+ "name": "PUR_CHRGR_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRCR_CHRGR_CD": {
+ "name": "PRCR_CHRGR_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GOODS_CHRGR_CD": {
+ "name": "GOODS_CHRGR_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_LT": {
+ "name": "PUR_LT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MRP_TP": {
+ "name": "MRP_TP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MAT_STAT": {
+ "name": "MAT_STAT",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BULK_MAT_ORDR": {
+ "name": "BULK_MAT_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRCR_TP": {
+ "name": "PRCR_TP",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SFTY_STCK_QTY": {
+ "name": "SFTY_STCK_QTY",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SER_PROF": {
+ "name": "SER_PROF",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BATCH_MNG_ORDR": {
+ "name": "BATCH_MNG_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SP_PRCR_TP": {
+ "name": "SP_PRCR_TP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_mat_spchar": {
+ "name": "cmctb_mat_spchar",
+ "schema": "nonsap",
+ "columns": {
+ "MAT_NO": {
+ "name": "MAT_NO",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SPCHAR_CD": {
+ "name": "SPCHAR_CD",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SPCHAR_DTL": {
+ "name": "SPCHAR_DTL",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPCHAR_VAL_CD": {
+ "name": "SPCHAR_VAL_CD",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPCHAR_VAL_DTL": {
+ "name": "SPCHAR_VAL_DTL",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPCHAR_VAL_NUM": {
+ "name": "SPCHAR_VAL_NUM",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPCHAR_VAL_UOM": {
+ "name": "SPCHAR_VAL_UOM",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_mat_spchar_mast": {
+ "name": "cmctb_mat_spchar_mast",
+ "schema": "nonsap",
+ "columns": {
+ "SPCHAR_CD": {
+ "name": "SPCHAR_CD",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SPCHAR_DTL": {
+ "name": "SPCHAR_DTL",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPCHAR_TP": {
+ "name": "SPCHAR_TP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPCHAR_VAL_UOM": {
+ "name": "SPCHAR_VAL_UOM",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPCHAR_VAL_YN": {
+ "name": "SPCHAR_VAL_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPCHAR_GRP": {
+ "name": "SPCHAR_GRP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "cmctb_mat_spchar_mast_SPCHAR_CD_pk": {
+ "name": "cmctb_mat_spchar_mast_SPCHAR_CD_pk",
+ "columns": [
+ "SPCHAR_CD"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_mat_spchar_val": {
+ "name": "cmctb_mat_spchar_val",
+ "schema": "nonsap",
+ "columns": {
+ "SPCHAR_CD": {
+ "name": "SPCHAR_CD",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SPCHAR_VAL_CD": {
+ "name": "SPCHAR_VAL_CD",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SPCHAR_VAL_DTL": {
+ "name": "SPCHAR_VAL_DTL",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "cmctb_mat_spchar_val_SPCHAR_CD_SPCHAR_VAL_CD_pk": {
+ "name": "cmctb_mat_spchar_val_SPCHAR_CD_SPCHAR_VAL_CD_pk",
+ "columns": [
+ "SPCHAR_CD",
+ "SPCHAR_VAL_CD"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_mat_uom": {
+ "name": "cmctb_mat_uom",
+ "schema": "nonsap",
+ "columns": {
+ "MAT_NO": {
+ "name": "MAT_NO",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SBST_UOM": {
+ "name": "SBST_UOM",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CNVRT_FCTR_1": {
+ "name": "CNVRT_FCTR_1",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNVRT_FCTR_2": {
+ "name": "CNVRT_FCTR_2",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LTH": {
+ "name": "LTH",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WTH": {
+ "name": "WTH",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HGT": {
+ "name": "HGT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SZ_UOM": {
+ "name": "SZ_UOM",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_proj_bizcls": {
+ "name": "cmctb_proj_bizcls",
+ "schema": "nonsap",
+ "columns": {
+ "PROJ_NO": {
+ "name": "PROJ_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "TYPE": {
+ "name": "TYPE",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "BIZCLS": {
+ "name": "BIZCLS",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "QM_CLS": {
+ "name": "QM_CLS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NEW_MC_YN": {
+ "name": "NEW_MC_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_proj_mast": {
+ "name": "cmctb_proj_mast",
+ "schema": "nonsap",
+ "columns": {
+ "PROJ_NO": {
+ "name": "PROJ_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "MSHIP_NO": {
+ "name": "MSHIP_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SERS_NO": {
+ "name": "SERS_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REF_NO": {
+ "name": "REF_NO",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SKND": {
+ "name": "SKND",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SHTYPE": {
+ "name": "SHTYPE",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SHTYPE_UOM": {
+ "name": "SHTYPE_UOM",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DOCK_CD": {
+ "name": "DOCK_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OWN_1": {
+ "name": "OWN_1",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLS_1": {
+ "name": "CLS_1",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNRT_DT": {
+ "name": "CNRT_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNRT_DL_DT": {
+ "name": "CNRT_DL_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_DSC": {
+ "name": "PROJ_DSC",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_GB": {
+ "name": "PROJ_GB",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OWN_NM": {
+ "name": "OWN_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NEW_SKND2": {
+ "name": "NEW_SKND2",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OWN_AB": {
+ "name": "OWN_AB",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHINA_YN": {
+ "name": "CHINA_YN",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_DTL_TP": {
+ "name": "PROJ_DTL_TP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_PROF": {
+ "name": "PROJ_PROF",
+ "type": "varchar(7)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INQY_NO": {
+ "name": "INQY_NO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INQY_SEQ": {
+ "name": "INQY_SEQ",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NTTP": {
+ "name": "NTTP",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "RLTD_PROJ": {
+ "name": "RLTD_PROJ",
+ "type": "varchar(40)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DIGT_PDT_GRP": {
+ "name": "DIGT_PDT_GRP",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WP_PROJ_TP": {
+ "name": "WP_PROJ_TP",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TOT_CNRT_CNT": {
+ "name": "TOT_CNRT_CNT",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_ETC_TP": {
+ "name": "PROJ_ETC_TP",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRC_SYS_ID": {
+ "name": "SRC_SYS_ID",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRGS_STAT": {
+ "name": "PRGS_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_YN": {
+ "name": "DEL_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_CSTM_CD": {
+ "name": "DL_CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PDT_LVL_4": {
+ "name": "PDT_LVL_4",
+ "type": "varchar(14)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AS_GRNT_PRD": {
+ "name": "AS_GRNT_PRD",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "RL_DL_DT": {
+ "name": "RL_DL_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SA_DT": {
+ "name": "SA_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GOV": {
+ "name": "GOV",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_BF_PROJ_NM": {
+ "name": "DL_BF_PROJ_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IMO_NO": {
+ "name": "IMO_NO",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DIST_PATH": {
+ "name": "DIST_PATH",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SALE_ORG_CD": {
+ "name": "SALE_ORG_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SALE_GRP": {
+ "name": "SALE_GRP",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZLOC_CD": {
+ "name": "BIZLOC_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MNG_ACOT_DMN": {
+ "name": "MNG_ACOT_DMN",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CO_CD": {
+ "name": "CO_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZ_DMN": {
+ "name": "BIZ_DMN",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PLNT_CD": {
+ "name": "PLNT_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRCTR": {
+ "name": "PRCTR",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNRT_CNTN_YN": {
+ "name": "CNRT_CNTN_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNRT_RESV_YN": {
+ "name": "CNRT_RESV_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_PRGS_YN": {
+ "name": "PROJ_PRGS_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SYS_ACOT_CLSD_DT": {
+ "name": "SYS_ACOT_CLSD_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_SCP": {
+ "name": "PROJ_SCP",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LOA": {
+ "name": "LOA",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MN_ENGN_TP_CD": {
+ "name": "MN_ENGN_TP_CD",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPD": {
+ "name": "SPD",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GT": {
+ "name": "GT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BP_DL_DT": {
+ "name": "BP_DL_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SHTYPE_GRP": {
+ "name": "SHTYPE_GRP",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_CRTE_REQ_EMPNO": {
+ "name": "PROJ_CRTE_REQ_EMPNO",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_CRTE_REQ_DT": {
+ "name": "PROJ_CRTE_REQ_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IO_GB": {
+ "name": "IO_GB",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CSTM_PO_NO": {
+ "name": "CSTM_PO_NO",
+ "type": "varchar(35)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GENT_CNT": {
+ "name": "GENT_CNT",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORDR_GRNT_PRD": {
+ "name": "ORDR_GRNT_PRD",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORDR_GRNT_FN_DT": {
+ "name": "ORDR_GRNT_FN_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DSN_CHRGR": {
+ "name": "DSN_CHRGR",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_AF_PROJ_NM": {
+ "name": "DL_AF_PROJ_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_AF_RL_CLNT": {
+ "name": "DL_AF_RL_CLNT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_AF_SHPSRV_SCP": {
+ "name": "DL_AF_SHPSRV_SCP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_AF_NTTP": {
+ "name": "DL_AF_NTTP",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_AF_CLS": {
+ "name": "DL_AF_CLS",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_AF_CALL_SIGN": {
+ "name": "DL_AF_CALL_SIGN",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_AF_TEL_NO": {
+ "name": "DL_AF_TEL_NO",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_AF_FAX_NO": {
+ "name": "DL_AF_FAX_NO",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_AF_EMAIL_ADR": {
+ "name": "DL_AF_EMAIL_ADR",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_WBS_TP": {
+ "name": "PROJ_WBS_TP",
+ "type": "varchar(7)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "XSTAT": {
+ "name": "XSTAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "XMSGS": {
+ "name": "XMSGS",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "XDATS": {
+ "name": "XDATS",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "XTIMS": {
+ "name": "XTIMS",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHN_PROJ_TP": {
+ "name": "CHN_PROJ_TP",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FIN_GRNT_FN_DT": {
+ "name": "FIN_GRNT_FN_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "STDT": {
+ "name": "STDT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SERS_YN": {
+ "name": "SERS_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TYPE": {
+ "name": "TYPE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRO_PROJ_NO": {
+ "name": "PRO_PROJ_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PBSD_PROJ_NO": {
+ "name": "PBSD_PROJ_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PBSD_SHIP_NM": {
+ "name": "PBSD_SHIP_NM",
+ "type": "varchar(150)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZCLS": {
+ "name": "BIZCLS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLS_2": {
+ "name": "CLS_2",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SHTYPE_CD": {
+ "name": "SHTYPE_CD",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_DL_PLN_DT": {
+ "name": "PROJ_DL_PLN_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PROJ_DL_RT_DT": {
+ "name": "PROJ_DL_RT_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TOT_AREA": {
+ "name": "TOT_AREA",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "EXMPT_AREA": {
+ "name": "EXMPT_AREA",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "EXMPT_RAT": {
+ "name": "EXMPT_RAT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "QM_CLS": {
+ "name": "QM_CLS",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNCT_PROJ_NO": {
+ "name": "CNCT_PROJ_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "EQP_DTL_YN": {
+ "name": "EQP_DTL_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "EXP_YN": {
+ "name": "EXP_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ACT_MH_YN": {
+ "name": "ACT_MH_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPEC": {
+ "name": "SPEC",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DSGN_LIFE": {
+ "name": "DSGN_LIFE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NEW_MC_YN": {
+ "name": "NEW_MC_YN",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WK_ENV_WT_VAL_YN": {
+ "name": "WK_ENV_WT_VAL_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GRNT_STDT": {
+ "name": "GRNT_STDT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TMH_ADPT_YN": {
+ "name": "TMH_ADPT_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZV_YN": {
+ "name": "ZV_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SEC_YN": {
+ "name": "SEC_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_proj_wbs": {
+ "name": "cmctb_proj_wbs",
+ "schema": "nonsap",
+ "columns": {
+ "PROJ_NO": {
+ "name": "PROJ_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "WBS_ELMT": {
+ "name": "WBS_ELMT",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "WBS_ELMT_NM": {
+ "name": "WBS_ELMT_NM",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WBS_LVL": {
+ "name": "WBS_LVL",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FLAG": {
+ "name": "FLAG",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WBS_INSD_ELMT": {
+ "name": "WBS_INSD_ELMT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HGRK_WBS_ELMT": {
+ "name": "HGRK_WBS_ELMT",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "XSTAT": {
+ "name": "XSTAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "XMSGS": {
+ "name": "XMSGS",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "XDATS": {
+ "name": "XDATS",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "XTIMS": {
+ "name": "XTIMS",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SYS_STAT": {
+ "name": "SYS_STAT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WBS_ELMT_1": {
+ "name": "WBS_ELMT_1",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WBS_ELMT_2": {
+ "name": "WBS_ELMT_2",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WBS_ELMT_3": {
+ "name": "WBS_ELMT_3",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WBS_ELMT_4": {
+ "name": "WBS_ELMT_4",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WBS_ELMT_5": {
+ "name": "WBS_ELMT_5",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WBS_ELMT_6": {
+ "name": "WBS_ELMT_6",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WBS_ELMT_7": {
+ "name": "WBS_ELMT_7",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WBS_ELMT_8": {
+ "name": "WBS_ELMT_8",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WBS_ELMT_9": {
+ "name": "WBS_ELMT_9",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WBS_ELMT_10": {
+ "name": "WBS_ELMT_10",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_addr": {
+ "name": "cmctb_vendor_addr",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ADR_NO": {
+ "name": "ADR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INTL_ADR_VER_ID": {
+ "name": "INTL_ADR_VER_ID",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CITY_ZIP_NO": {
+ "name": "CITY_ZIP_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "POBX_ZIP_NO": {
+ "name": "POBX_ZIP_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR_1": {
+ "name": "ADR_1",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR_2": {
+ "name": "ADR_2",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REGN_CD": {
+ "name": "REGN_CD",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TTL": {
+ "name": "TTL",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_ABRV_1": {
+ "name": "VNDRNM_ABRV_1",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_ABRV_2": {
+ "name": "VNDRNM_ABRV_2",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_1": {
+ "name": "VNDRNM_1",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_2": {
+ "name": "VNDRNM_2",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LANG_KEY": {
+ "name": "LANG_KEY",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ETC_ADR_1": {
+ "name": "ETC_ADR_1",
+ "type": "varchar(180)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ETC_ADR_2": {
+ "name": "ETC_ADR_2",
+ "type": "varchar(180)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NTN_CD": {
+ "name": "NTN_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "POBX": {
+ "name": "POBX",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TRANS_ZONE": {
+ "name": "TRANS_ZONE",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_3": {
+ "name": "VNDRNM_3",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_4": {
+ "name": "VNDRNM_4",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TAX_JRDT_ZONE_CD": {
+ "name": "TAX_JRDT_ZONE_CD",
+ "type": "varchar(15)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR_TMZ": {
+ "name": "ADR_TMZ",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_compny": {
+ "name": "cmctb_vendor_compny",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CO_CD": {
+ "name": "CO_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CTL_ACNT": {
+ "name": "CTL_ACNT",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRT_KEY": {
+ "name": "SRT_KEY",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PLN_GRP": {
+ "name": "PLN_GRP",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BF_VNDRCD": {
+ "name": "BF_VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPLY_COND": {
+ "name": "SPLY_COND",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OVLAP_INVC_ORDR": {
+ "name": "OVLAP_INVC_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPLY_MTHD": {
+ "name": "SPLY_MTHD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPLY_HOLD_ORDR": {
+ "name": "SPLY_HOLD_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TRD_BANK_SHRT_KEY": {
+ "name": "TRD_BANK_SHRT_KEY",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PST_HOLD_ORDR": {
+ "name": "PST_HOLD_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HOLD_CAUS": {
+ "name": "HOLD_CAUS",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCE_TX_NTN_CD": {
+ "name": "SRCE_TX_NTN_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MIN_ORDR": {
+ "name": "MIN_ORDR",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPRT_SPLY_ORDR": {
+ "name": "SPRT_SPLY_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CSTM_VNDR_CLR_ORDR": {
+ "name": "CSTM_VNDR_CLR_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCE_TX_CD": {
+ "name": "SRCE_TX_CD",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IATA_BIC_GB": {
+ "name": "IATA_BIC_GB",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REP_TP": {
+ "name": "REP_TP",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "LOGST_VNDR_TP": {
+ "name": "LOGST_VNDR_TP",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDR_ACNT_NO": {
+ "name": "VNDR_ACNT_NO",
+ "type": "varchar(12)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDR_CHRGR_NM": {
+ "name": "VNDR_CHRGR_NM",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ACOT_CHRGR_TELNO": {
+ "name": "ACOT_CHRGR_TELNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AUTH_GRP": {
+ "name": "AUTH_GRP",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FIN_IR_CALC_DT": {
+ "name": "FIN_IR_CALC_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FIN_IR_ACT_DT": {
+ "name": "FIN_IR_ACT_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ACOT_CHRGR_FAXNO": {
+ "name": "ACOT_CHRGR_FAXNO",
+ "type": "varchar(31)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MK_CHRGR_EMAIL": {
+ "name": "MK_CHRGR_EMAIL",
+ "type": "varchar(241)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MEMO": {
+ "name": "MEMO",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "MOFFC_ACNT_NO": {
+ "name": "MOFFC_ACNT_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "cmctb_vendor_compny_VNDRCD_CO_CD_pk": {
+ "name": "cmctb_vendor_compny_VNDRCD_CO_CD_pk",
+ "columns": [
+ "VNDRCD",
+ "CO_CD"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_general": {
+ "name": "cmctb_vendor_general",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ACNT_GRP": {
+ "name": "ACNT_GRP",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ACNT_GRP_TP": {
+ "name": "ACNT_GRP_TP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CSTM_CD": {
+ "name": "CSTM_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PST_HOLD_ORDR": {
+ "name": "PST_HOLD_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_HOLD_ORDR": {
+ "name": "PUR_HOLD_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HOLD_CAUS": {
+ "name": "HOLD_CAUS",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CO_ID": {
+ "name": "CO_ID",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_NM": {
+ "name": "REPR_NM",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZTP": {
+ "name": "BIZTP",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZCON": {
+ "name": "BIZCON",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REG_DT": {
+ "name": "REG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REG_DTM": {
+ "name": "REG_DTM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REGR_ID": {
+ "name": "REGR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AGR_DT": {
+ "name": "AGR_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AGR_TM": {
+ "name": "AGR_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AGR_R_ID": {
+ "name": "AGR_R_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_TM": {
+ "name": "CHG_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHGR_ID": {
+ "name": "CHGR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NTN_CD": {
+ "name": "NTN_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REP_TEL_NO": {
+ "name": "REP_TEL_NO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REP_FAX_NO": {
+ "name": "REP_FAX_NO",
+ "type": "varchar(31)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZR_NO": {
+ "name": "BIZR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CO_REG_NO": {
+ "name": "CO_REG_NO",
+ "type": "varchar(18)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TX_CD_4": {
+ "name": "TX_CD_4",
+ "type": "varchar(54)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CO_INST_DT": {
+ "name": "CO_INST_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDR_TP": {
+ "name": "VNDR_TP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GBL_TOP_CD": {
+ "name": "GBL_TOP_CD",
+ "type": "varchar(11)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GBL_TOP_NM": {
+ "name": "GBL_TOP_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DMST_TOP_CD": {
+ "name": "DMST_TOP_CD",
+ "type": "varchar(11)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DMST_TOP_NM": {
+ "name": "DMST_TOP_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZ_UOM_CD": {
+ "name": "BIZ_UOM_CD",
+ "type": "varchar(11)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZ_UOM_NM": {
+ "name": "BIZ_UOM_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DNS_NO": {
+ "name": "DNS_NO",
+ "type": "varchar(11)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TTL": {
+ "name": "TTL",
+ "type": "varchar(45)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VAT_REG_NO": {
+ "name": "VAT_REG_NO",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GIRO_VNDR_ORDR": {
+ "name": "GIRO_VNDR_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_1": {
+ "name": "VNDRNM_1",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_2": {
+ "name": "VNDRNM_2",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_3": {
+ "name": "VNDRNM_3",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_4": {
+ "name": "VNDRNM_4",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_ABRV_1": {
+ "name": "VNDRNM_ABRV_1",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDRNM_ABRV_2": {
+ "name": "VNDRNM_ABRV_2",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PTNT_VNDRCD": {
+ "name": "PTNT_VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR_1": {
+ "name": "ADR_1",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR_2": {
+ "name": "ADR_2",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "QLT_CHRGR_NM": {
+ "name": "QLT_CHRGR_NM",
+ "type": "varchar(60)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "QLT_CHRGR_TELNO": {
+ "name": "QLT_CHRGR_TELNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "QLT_CHRGR_EMAIL": {
+ "name": "QLT_CHRGR_EMAIL",
+ "type": "varchar(241)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SB_WKA_SEQ": {
+ "name": "SB_WKA_SEQ",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OVLAP_CAUS_CD": {
+ "name": "OVLAP_CAUS_CD",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DOC_TP": {
+ "name": "DOC_TP",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DOC_NO": {
+ "name": "DOC_NO",
+ "type": "varchar(25)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PTN_DOC": {
+ "name": "PTN_DOC",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DOC_VER": {
+ "name": "DOC_VER",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INB_FLAG": {
+ "name": "INB_FLAG",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_HOLD_ORDR": {
+ "name": "DEL_HOLD_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_HOLD_DT": {
+ "name": "PUR_HOLD_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "POBX": {
+ "name": "POBX",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INTL_LCTN_CHK_NUM": {
+ "name": "INTL_LCTN_CHK_NUM",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCETX_RP_SEX_KEY": {
+ "name": "SRCETX_RP_SEX_KEY",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDR_CNRT_CHRGR_1": {
+ "name": "VNDR_CNRT_CHRGR_1",
+ "type": "varchar(105)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDR_CNRT_CHRGR_2": {
+ "name": "VNDR_CNRT_CHRGR_2",
+ "type": "varchar(105)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_RESNO": {
+ "name": "REPR_RESNO",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CO_VLM": {
+ "name": "CO_VLM",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_grp": {
+ "name": "cmctb_vendor_grp",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "BIZ_GRP_CD": {
+ "name": "BIZ_GRP_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CRTE_DT": {
+ "name": "CRTE_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTE_TM": {
+ "name": "CRTE_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTER_ID": {
+ "name": "CRTER_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_TM": {
+ "name": "CHG_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHGR_ID": {
+ "name": "CHGR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_inco": {
+ "name": "cmctb_vendor_inco",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VNDRNM": {
+ "name": "VNDRNM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_NM": {
+ "name": "REPR_NM",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PRTNR_GB": {
+ "name": "PRTNR_GB",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INCO_PRTNR_CD": {
+ "name": "INCO_PRTNR_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INCO_PRTNR_WKA_1": {
+ "name": "INCO_PRTNR_WKA_1",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INCO_PRTNR_WKA_2": {
+ "name": "INCO_PRTNR_WKA_2",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INCO_PRTNR_WKA_3": {
+ "name": "INCO_PRTNR_WKA_3",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "JBTYPE_CD": {
+ "name": "JBTYPE_CD",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "JBTYPE_CD_2": {
+ "name": "JBTYPE_CD_2",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INDV_CO_GB": {
+ "name": "INDV_CO_GB",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INCO_FOND_YN": {
+ "name": "INCO_FOND_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DOCK_NO": {
+ "name": "DOCK_NO",
+ "type": "varchar(25)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OCMP_INP_DT": {
+ "name": "OCMP_INP_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INCO_DUSE_DT": {
+ "name": "INCO_DUSE_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INDST_INS_PMRAT": {
+ "name": "INDST_INS_PMRAT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNRT_PFRM_GRAMT": {
+ "name": "CNRT_PFRM_GRAMT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WGE_RAT": {
+ "name": "WGE_RAT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRSPD_DEPTCD_1": {
+ "name": "CRSPD_DEPTCD_1",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRSPD_DEPTCD_2": {
+ "name": "CRSPD_DEPTCD_2",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRSPD_TEAM_BLNG": {
+ "name": "CRSPD_TEAM_BLNG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INCO_PRTNR_ITM_1": {
+ "name": "INCO_PRTNR_ITM_1",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INCO_PRTNR_ITM_2": {
+ "name": "INCO_PRTNR_ITM_2",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OFC_LOC": {
+ "name": "OFC_LOC",
+ "type": "varchar(240)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REP_OCMP_CARR": {
+ "name": "REP_OCMP_CARR",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "INCO_DUSE_CAUS": {
+ "name": "INCO_DUSE_CAUS",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TEL_NO": {
+ "name": "TEL_NO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR1": {
+ "name": "ADR1",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ADR2": {
+ "name": "ADR2",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OLD_VNDRCD": {
+ "name": "OLD_VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TREE_NUM": {
+ "name": "TREE_NUM",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTE_DT": {
+ "name": "CRTE_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTE_TM": {
+ "name": "CRTE_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CRTE_USR_ID": {
+ "name": "CRTE_USR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_DT": {
+ "name": "CHG_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_TM": {
+ "name": "CHG_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHG_USR_ID": {
+ "name": "CHG_USR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "UPR_JBTYPE": {
+ "name": "UPR_JBTYPE",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ZBYBP": {
+ "name": "ZBYBP",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "RMK": {
+ "name": "RMK",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WDL_PLN_YN": {
+ "name": "WDL_PLN_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "WGE_DELY_DVL": {
+ "name": "WGE_DELY_DVL",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ESCROW_YN": {
+ "name": "ESCROW_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_porg": {
+ "name": "cmctb_vendor_porg",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PUR_ORG_CD": {
+ "name": "PUR_ORG_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PUR_ORD_CUR": {
+ "name": "PUR_ORD_CUR",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SPLY_COND": {
+ "name": "SPLY_COND",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_COND_1": {
+ "name": "DL_COND_1",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DL_COND_2": {
+ "name": "DL_COND_2",
+ "type": "varchar(90)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CALC_SHM_GRP": {
+ "name": "CALC_SHM_GRP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "GR_BSE_INVC_VR": {
+ "name": "GR_BSE_INVC_VR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "AT_PUR_ORD_ORDR": {
+ "name": "AT_PUR_ORD_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_HOLD_ORDR": {
+ "name": "PUR_HOLD_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DEL_ORDR": {
+ "name": "DEL_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ORD_CNFM_REQ_ORDR": {
+ "name": "ORD_CNFM_REQ_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SALE_CHRGR_NM": {
+ "name": "SALE_CHRGR_NM",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VNDR_TELNO": {
+ "name": "VNDR_TELNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CNFM_CTL_KEY": {
+ "name": "CNFM_CTL_KEY",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_HOLD_DT": {
+ "name": "PUR_HOLD_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "PUR_HOLD_CAUS": {
+ "name": "PUR_HOLD_CAUS",
+ "type": "varchar(120)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_repremail": {
+ "name": "cmctb_vendor_repremail",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ADR_NO": {
+ "name": "ADR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VLD_ST_DT": {
+ "name": "VLD_ST_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "EMAIL_ADR": {
+ "name": "EMAIL_ADR",
+ "type": "varchar(241)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_reprfax": {
+ "name": "cmctb_vendor_reprfax",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ADR_NO": {
+ "name": "ADR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VLD_ST_DT": {
+ "name": "VLD_ST_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "NTN_CD": {
+ "name": "NTN_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FAXNO": {
+ "name": "FAXNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FAX_ETS_NO": {
+ "name": "FAX_ETS_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_reprtel": {
+ "name": "cmctb_vendor_reprtel",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ADR_NO": {
+ "name": "ADR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VLD_ST_DT": {
+ "name": "VLD_ST_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "NTN_CD": {
+ "name": "NTN_CD",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "TELNO": {
+ "name": "TELNO",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ETX_NO": {
+ "name": "ETX_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "HP_ORDR": {
+ "name": "HP_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_reprurl": {
+ "name": "cmctb_vendor_reprurl",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ADR_NO": {
+ "name": "ADR_NO",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REPR_SER": {
+ "name": "REPR_SER",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VLD_ST_DT": {
+ "name": "VLD_ST_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "URL": {
+ "name": "URL",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_taxnum": {
+ "name": "cmctb_vendor_taxnum",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "TX_NO_CTG": {
+ "name": "TX_NO_CTG",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "BIZ_PTNR_TX_NO": {
+ "name": "BIZ_PTNR_TX_NO",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_vfpn": {
+ "name": "cmctb_vendor_vfpn",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PUR_ORG_CD": {
+ "name": "PUR_ORG_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "VNDR_SUB_NO": {
+ "name": "VNDR_SUB_NO",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PLNT_CD": {
+ "name": "PLNT_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PTNR_SKL": {
+ "name": "PTNR_SKL",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "PTNR_CNT": {
+ "name": "PTNR_CNT",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "ETC_REF_VNDRCD": {
+ "name": "ETC_REF_VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BSE_PTNR_ORDR": {
+ "name": "BSE_PTNR_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.cmctb_vendor_whthx": {
+ "name": "cmctb_vendor_whthx",
+ "schema": "nonsap",
+ "columns": {
+ "VNDRCD": {
+ "name": "VNDRCD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "CO_CD": {
+ "name": "CO_CD",
+ "type": "varchar(4)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SRCE_TX_TP": {
+ "name": "SRCE_TX_TP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "SRCE_TX_REL_ORDR": {
+ "name": "SRCE_TX_REL_ORDR",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "RECIP_TP": {
+ "name": "RECIP_TP",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCE_TX_IDENT_NO": {
+ "name": "SRCE_TX_IDENT_NO",
+ "type": "varchar(16)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SRCE_TX_NO": {
+ "name": "SRCE_TX_NO",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DCHAG_CERT_NO": {
+ "name": "DCHAG_CERT_NO",
+ "type": "varchar(15)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DCHAG_RAT": {
+ "name": "DCHAG_RAT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DCHAG_ST_DT": {
+ "name": "DCHAG_ST_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DCHAG_ED_DT": {
+ "name": "DCHAG_ED_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DCHAG_CAUS": {
+ "name": "DCHAG_CAUS",
+ "type": "varchar(200)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_DT": {
+ "name": "IF_DT",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TM": {
+ "name": "IF_TM",
+ "type": "varchar(6)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_STAT": {
+ "name": "IF_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_MSG": {
+ "name": "IF_MSG",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {},
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ },
+ "nonsap.plftb_estm_proj_mast": {
+ "name": "plftb_estm_proj_mast",
+ "schema": "nonsap",
+ "columns": {
+ "ESTM_PROJ_NO": {
+ "name": "ESTM_PROJ_NO",
+ "type": "varchar(24)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "AGND_NO": {
+ "name": "AGND_NO",
+ "type": "varchar(8)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ESTM_PROJ_NM": {
+ "name": "ESTM_PROJ_NM",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "BIZ_CLS": {
+ "name": "BIZ_CLS",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "REV_NO": {
+ "name": "REV_NO",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ESTM_TYPE": {
+ "name": "ESTM_TYPE",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "OWNER_CD": {
+ "name": "OWNER_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SERS_CNT": {
+ "name": "SERS_CNT",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SKND_CD": {
+ "name": "SKND_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SHTYPE_CD": {
+ "name": "SHTYPE_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SHTYPE_SIZE": {
+ "name": "SHTYPE_SIZE",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "SHTYPE_UOM": {
+ "name": "SHTYPE_UOM",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CHRTR_CD": {
+ "name": "CHRTR_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "NATN_CD": {
+ "name": "NATN_CD",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLS_1": {
+ "name": "CLS_1",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLS_2": {
+ "name": "CLS_2",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "CLS_3": {
+ "name": "CLS_3",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "DATA_CRTE_GB": {
+ "name": "DATA_CRTE_GB",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FS_INPR_ID": {
+ "name": "FS_INPR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FS_INP_DTM": {
+ "name": "FS_INP_DTM",
+ "type": "varchar(14)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FIN_CHGR_ID": {
+ "name": "FIN_CHGR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "FIN_CHG_DTM": {
+ "name": "FIN_CHG_DTM",
+ "type": "varchar(14)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VSL_VAG_1": {
+ "name": "VSL_VAG_1",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VSL_VAG_2": {
+ "name": "VSL_VAG_2",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VSL_VAG_3": {
+ "name": "VSL_VAG_3",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "VSL_VAG_4": {
+ "name": "VSL_VAG_4",
+ "type": "numeric",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ESTM_AOM_APP_ID": {
+ "name": "ESTM_AOM_APP_ID",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ESTM_AOM_STAT": {
+ "name": "ESTM_AOM_STAT",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ESTM_AOM_STAT_CHGR_ID": {
+ "name": "ESTM_AOM_STAT_CHGR_ID",
+ "type": "varchar(13)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ESTM_AOM_STAT_CHG_DTM": {
+ "name": "ESTM_AOM_STAT_CHG_DTM",
+ "type": "varchar(14)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "IF_TRGT_YN": {
+ "name": "IF_TRGT_YN",
+ "type": "varchar(1)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "indexes": {},
+ "foreignKeys": {},
+ "compositePrimaryKeys": {
+ "plftb_estm_proj_mast_ESTM_PROJ_NO_pk": {
+ "name": "plftb_estm_proj_mast_ESTM_PROJ_NO_pk",
+ "columns": [
+ "ESTM_PROJ_NO"
+ ]
+ }
+ },
+ "uniqueConstraints": {},
+ "policies": {},
+ "checkConstraints": {},
+ "isRLSEnabled": false
+ }
+ },
+ "enums": {
+ "public.user_domain": {
+ "name": "user_domain",
+ "schema": "public",
+ "values": [
+ "pending",
+ "evcp",
+ "procurement",
+ "sales",
+ "engineering",
+ "partners"
+ ]
+ },
+ "public.score_type": {
+ "name": "score_type",
+ "schema": "public",
+ "values": [
+ "fixed",
+ "variable"
+ ]
+ },
+ "public.qna_category": {
+ "name": "qna_category",
+ "schema": "public",
+ "values": [
+ "engineering",
+ "procurement",
+ "technical_sales"
+ ]
+ }
+ },
+ "schemas": {
+ "mdg": "mdg",
+ "soap": "soap",
+ "nonsap": "nonsap"
+ },
+ "sequences": {},
+ "roles": {},
+ "policies": {},
+ "views": {
+ "public.contracts_detail_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "contracts_detail_view_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "contract_no": {
+ "name": "contract_no",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contract_name": {
+ "name": "contract_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ACTIVE'"
+ },
+ "start_date": {
+ "name": "start_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "end_date": {
+ "name": "end_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code": {
+ "name": "code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "payment_terms": {
+ "name": "payment_terms",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_terms": {
+ "name": "delivery_terms",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_date": {
+ "name": "delivery_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_location": {
+ "name": "delivery_location",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'KRW'"
+ },
+ "total_amount": {
+ "name": "total_amount",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discount": {
+ "name": "discount",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax": {
+ "name": "tax",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shipping_fee": {
+ "name": "shipping_fee",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_total": {
+ "name": "net_total",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "partial_shipping_allowed": {
+ "name": "partial_shipping_allowed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "partial_payment_allowed": {
+ "name": "partial_payment_allowed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "remarks": {
+ "name": "remarks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "version": {
+ "name": "version",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "definition": "select \"contracts\".\"id\", \"contracts\".\"contract_no\", \"contracts\".\"contract_name\", \"contracts\".\"status\", \"contracts\".\"start_date\", \"contracts\".\"end_date\", \"contracts\".\"project_id\", \"projects\".\"code\", \"projects\".\"name\", \"contracts\".\"vendor_id\", \"vendors\".\"vendor_name\", \"contracts\".\"payment_terms\", \"contracts\".\"delivery_terms\", \"contracts\".\"delivery_date\", \"contracts\".\"delivery_location\", \"contracts\".\"currency\", \"contracts\".\"total_amount\", \"contracts\".\"discount\", \"contracts\".\"tax\", \"contracts\".\"shipping_fee\", \"contracts\".\"net_total\", \"contracts\".\"partial_shipping_allowed\", \"contracts\".\"partial_payment_allowed\", \"contracts\".\"remarks\", \"contracts\".\"version\", \"contracts\".\"created_at\", \"contracts\".\"updated_at\", EXISTS (\n SELECT 1 \n FROM \"contract_envelopes\" \n WHERE \"contract_envelopes\".\"contract_id\" = \"contracts\".\"id\"\n ) as \"has_signature\", COALESCE((\n SELECT json_agg(\n json_build_object(\n 'id', ci.id,\n 'itemId', ci.item_id,\n 'description', ci.description,\n 'quantity', ci.quantity,\n 'unitPrice', ci.unit_price,\n 'taxRate', ci.tax_rate,\n 'taxAmount', ci.tax_amount,\n 'totalLineAmount', ci.total_line_amount,\n 'remark', ci.remark,\n 'createdAt', ci.created_at,\n 'updatedAt', ci.updated_at\n )\n )\n FROM \"contract_items\" AS ci\n WHERE ci.contract_id = \"contracts\".\"id\"\n ), '[]') as \"items\", COALESCE((\n SELECT json_agg(\n json_build_object(\n 'id', ce.id,\n 'envelopeId', ce.envelope_id,\n 'documentId', ce.document_id,\n 'envelopeStatus', ce.envelope_status,\n 'fileName', ce.file_name,\n 'filePath', ce.file_path,\n 'createdAt', ce.created_at,\n 'updatedAt', ce.updated_at,\n 'signers', (\n SELECT json_agg(\n json_build_object(\n 'id', cs.id,\n 'vendorContactId', cs.vendor_contact_id,\n 'signerType', cs.signer_type,\n 'signerEmail', cs.signer_email,\n 'signerName', cs.signer_name,\n 'signerPosition', cs.signer_position,\n 'signerStatus', cs.signer_status,\n 'signedAt', cs.signed_at\n )\n )\n FROM \"contract_signers\" AS cs\n WHERE cs.envelope_id = ce.id\n )\n )\n )\n FROM \"contract_envelopes\" AS ce\n WHERE ce.contract_id = \"contracts\".\"id\"\n ), '[]') as \"envelopes\" from \"contracts\" left join \"projects\" on \"contracts\".\"project_id\" = \"projects\".\"id\" left join \"vendors\" on \"contracts\".\"vendor_id\" = \"vendors\".\"id\"",
+ "name": "contracts_detail_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.poa_detail_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": true,
+ "notNull": true,
+ "identity": {
+ "type": "always",
+ "name": "poa_detail_view_id_seq",
+ "schema": "public",
+ "increment": "1",
+ "startWith": "1",
+ "minValue": "1",
+ "maxValue": "2147483647",
+ "cache": "1",
+ "cycle": false
+ }
+ },
+ "contract_no": {
+ "name": "contract_no",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "change_reason": {
+ "name": "change_reason",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "approval_status": {
+ "name": "approval_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'PENDING'"
+ },
+ "delivery_terms": {
+ "name": "delivery_terms",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_date": {
+ "name": "delivery_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_location": {
+ "name": "delivery_location",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_amount": {
+ "name": "total_amount",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "discount": {
+ "name": "discount",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax": {
+ "name": "tax",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "shipping_fee": {
+ "name": "shipping_fee",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "net_total": {
+ "name": "net_total",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "definition": "select \"poa\".\"id\", \"poa\".\"contract_no\", \"contracts\".\"project_id\", \"contracts\".\"vendor_id\", \"poa\".\"change_reason\", \"poa\".\"approval_status\", \"contracts\".\"contract_name\" as \"original_contract_name\", \"contracts\".\"status\" as \"original_status\", \"contracts\".\"start_date\" as \"original_start_date\", \"contracts\".\"end_date\" as \"original_end_date\", \"poa\".\"delivery_terms\", \"poa\".\"delivery_date\", \"poa\".\"delivery_location\", \"poa\".\"currency\", \"poa\".\"total_amount\", \"poa\".\"discount\", \"poa\".\"tax\", \"poa\".\"shipping_fee\", \"poa\".\"net_total\", \"poa\".\"created_at\", \"poa\".\"updated_at\", EXISTS (\n SELECT 1 \n FROM \"contract_envelopes\" \n WHERE \"contract_envelopes\".\"contract_id\" = \"poa\".\"id\"\n ) as \"has_signature\" from \"poa\" left join \"contracts\" on \"poa\".\"contract_no\" = \"contracts\".\"contract_no\"",
+ "name": "poa_detail_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.project_approved_vendors": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_id": {
+ "name": "tax_id",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "phone": {
+ "name": "phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PENDING_REVIEW'"
+ },
+ "name_ko": {
+ "name": "name_ko",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name_en": {
+ "name": "name_en",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "code": {
+ "name": "code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "type": {
+ "name": "type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ship'"
+ },
+ "submitted_at": {
+ "name": "submitted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "approved_at": {
+ "name": "approved_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "select \"vendors\".\"id\", \"vendors\".\"vendor_name\", \"vendors\".\"vendor_code\", \"vendors\".\"tax_id\", \"vendors\".\"email\", \"vendors\".\"phone\", \"vendors\".\"status\", \"vendor_types\".\"name_ko\", \"vendor_types\".\"name_en\", \"projects\".\"code\", \"projects\".\"name\", \"projects\".\"type\", \"vendor_pq_submissions\".\"submitted_at\", \"vendor_pq_submissions\".\"approved_at\" from \"vendors\" inner join \"vendor_pq_submissions\" on \"vendor_pq_submissions\".\"vendor_id\" = \"vendors\".\"id\" inner join \"projects\" on \"vendor_pq_submissions\".\"project_id\" = \"projects\".\"id\" left join \"vendor_types\" on \"vendors\".\"vendor_type_id\" = \"vendor_types\".\"id\" where \"vendor_pq_submissions\".\"status\" = 'APPROVED'",
+ "name": "project_approved_vendors",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_investigations_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pq_submission_id": {
+ "name": "pq_submission_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requester_id": {
+ "name": "requester_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "qm_manager_id": {
+ "name": "qm_manager_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "investigation_status": {
+ "name": "investigation_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PLANNED'"
+ },
+ "evaluation_type": {
+ "name": "evaluation_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "investigation_address": {
+ "name": "investigation_address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "investigation_method": {
+ "name": "investigation_method",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scheduled_start_at": {
+ "name": "scheduled_start_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "scheduled_end_at": {
+ "name": "scheduled_end_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "forecasted_at": {
+ "name": "forecasted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requested_at": {
+ "name": "requested_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirmed_at": {
+ "name": "confirmed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_score": {
+ "name": "evaluation_score",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_result": {
+ "name": "evaluation_result",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "investigation_notes": {
+ "name": "investigation_notes",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "select \"vendor_investigations\".\"id\", \"vendor_investigations\".\"vendor_id\", \"vendor_investigations\".\"pq_submission_id\", \"vendor_investigations\".\"requester_id\", \"vendor_investigations\".\"qm_manager_id\", \"vendor_investigations\".\"investigation_status\", \"vendor_investigations\".\"evaluation_type\", \"vendor_investigations\".\"investigation_address\", \"vendor_investigations\".\"investigation_method\", \"vendor_investigations\".\"scheduled_start_at\", \"vendor_investigations\".\"scheduled_end_at\", \"vendor_investigations\".\"forecasted_at\", \"vendor_investigations\".\"requested_at\", \"vendor_investigations\".\"confirmed_at\", \"vendor_investigations\".\"completed_at\", \"vendor_investigations\".\"evaluation_score\", \"vendor_investigations\".\"evaluation_result\", \"vendor_investigations\".\"investigation_notes\", \"vendor_investigations\".\"created_at\", \"vendor_investigations\".\"updated_at\", \"vendors\".\"vendor_name\", \"vendors\".\"vendor_code\", requester.name as \"requesterName\", requester.email as \"requesterEmail\", qm_manager.name as \"qmManagerName\", qm_manager.email as \"qmManagerEmail\", (\n CASE \n WHEN EXISTS (\n SELECT 1 FROM vendor_investigation_attachments via \n WHERE via.investigation_id = \"vendor_investigations\".\"id\"\n ) \n THEN true \n ELSE false \n END\n ) as \"hasAttachments\" from \"vendor_investigations\" left join \"vendors\" on \"vendor_investigations\".\"vendor_id\" = \"vendors\".\"id\" left join users AS requester on \"vendor_investigations\".\"requester_id\" = requester.id left join users AS qm_manager on \"vendor_investigations\".\"qm_manager_id\" = qm_manager.id",
+ "name": "vendor_investigations_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.cbe_view": {
+ "columns": {},
+ "definition": "select \"cbe_evaluations\".\"id\" as \"cbe_id\", \"cbe_evaluations\".\"rfq_id\" as \"rfq_id\", \"cbe_evaluations\".\"vendor_id\" as \"vendor_id\", \"cbe_evaluations\".\"total_cost\" as \"total_cost\", \"cbe_evaluations\".\"currency\" as \"currency\", \"cbe_evaluations\".\"payment_terms\" as \"payment_terms\", \"cbe_evaluations\".\"incoterms\" as \"incoterms\", \"cbe_evaluations\".\"result\" as \"result\", \"cbe_evaluations\".\"notes\" as \"notes\", \"cbe_evaluations\".\"evaluated_by\" as \"evaluated_by\", \"cbe_evaluations\".\"evaluated_at\" as \"evaluated_at\", \"rfqs\".\"rfq_code\" as \"rfq_code\", \"rfqs\".\"description\" as \"rfq_description\", \"vendors\".\"vendor_name\" as \"vendor_name\", \"vendors\".\"vendor_code\" as \"vendor_code\", \"projects\".\"id\" as \"project_id\", \"projects\".\"code\" as \"project_code\", \"projects\".\"name\" as \"project_name\", \"users\".\"name\" as \"evaluator_name\", \"users\".\"email\" as \"evaluator_email\" from \"cbe_evaluations\" inner join \"rfqs\" on \"cbe_evaluations\".\"rfq_id\" = \"rfqs\".\"id\" inner join \"vendors\" on \"cbe_evaluations\".\"vendor_id\" = \"vendors\".\"id\" left join \"projects\" on \"rfqs\".\"project_id\" = \"projects\".\"id\" left join \"users\" on \"cbe_evaluations\".\"evaluated_by\" = \"users\".\"id\"",
+ "name": "cbe_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.rfqs_view": {
+ "columns": {},
+ "definition": "select \"rfqs\".\"id\" as \"rfq_id\", \"rfqs\".\"status\" as \"status\", \"rfqs\".\"created_at\" as \"created_at\", \"rfqs\".\"updated_at\" as \"updated_at\", \"rfqs\".\"created_by\" as \"created_by\", \"rfqs\".\"rfq_type\" as \"rfq_type\", \"rfqs\".\"rfq_code\" as \"rfq_code\", \"rfqs\".\"description\" as \"description\", \"rfqs\".\"due_date\" as \"due_date\", \"rfqs\".\"parent_rfq_id\" as \"parent_rfq_id\", \"projects\".\"id\" as \"project_id\", \"projects\".\"code\" as \"project_code\", \"projects\".\"name\" as \"project_name\", \"users\".\"email\" as \"user_email\", \"users\".\"name\" as \"user_name\", (\n SELECT COUNT(*) \n FROM \"rfq_items\" \n WHERE \"rfq_items\".\"rfq_id\" = \"rfqs\".\"id\"\n ) as \"item_count\", (\n SELECT COUNT(*) \n FROM \"rfq_attachments\" \n WHERE \"rfq_attachments\".\"rfq_id\" = \"rfqs\".\"id\"\n ) as \"attachment_count\" from \"rfqs\" left join \"projects\" on \"rfqs\".\"project_id\" = \"projects\".\"id\" left join \"users\" on \"rfqs\".\"created_by\" = \"users\".\"id\"",
+ "name": "rfqs_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_cbe_view": {
+ "columns": {},
+ "definition": "select \"vendors\".\"id\" as \"vendor_id\", \"vendors\".\"vendor_name\" as \"vendor_name\", \"vendors\".\"vendor_code\" as \"vendor_code\", \"vendors\".\"address\" as \"address\", \"vendors\".\"country\" as \"country\", \"vendors\".\"email\" as \"email\", \"vendors\".\"website\" as \"website\", \"vendors\".\"status\" as \"vendor_status\", \"vendor_responses\".\"id\" as \"vendor_response_id\", \"vendor_responses\".\"rfq_id\" as \"rfq_id\", \"vendor_responses\".\"response_status\" as \"rfq_vendor_status\", \"vendor_responses\".\"updated_at\" as \"rfq_vendor_updated\", \"rfqs\".\"rfq_code\" as \"rfq_code\", \"rfqs\".\"rfq_type\" as \"rfq_type\", \"rfqs\".\"description\" as \"description\", \"rfqs\".\"due_date\" as \"due_date\", \"projects\".\"id\" as \"project_id\", \"projects\".\"code\" as \"project_code\", \"projects\".\"name\" as \"project_name\", \"cbe_evaluations\".\"id\" as \"cbe_id\", \"cbe_evaluations\".\"result\" as \"cbe_result\", \"cbe_evaluations\".\"notes\" as \"cbe_note\", \"cbe_evaluations\".\"updated_at\" as \"cbe_updated\", \"cbe_evaluations\".\"total_cost\" as \"total_cost\", \"cbe_evaluations\".\"currency\" as \"currency\", \"cbe_evaluations\".\"payment_terms\" as \"payment_terms\", \"cbe_evaluations\".\"incoterms\" as \"incoterms\", \"cbe_evaluations\".\"delivery_schedule\" as \"delivery_schedule\" from \"vendors\" left join \"vendor_responses\" on \"vendor_responses\".\"vendor_id\" = \"vendors\".\"id\" left join \"rfqs\" on \"vendor_responses\".\"rfq_id\" = \"rfqs\".\"id\" left join \"projects\" on \"rfqs\".\"project_id\" = \"projects\".\"id\" left join \"cbe_evaluations\" on (\"cbe_evaluations\".\"vendor_id\" = \"vendors\".\"id\" and \"cbe_evaluations\".\"rfq_id\" = \"vendor_responses\".\"rfq_id\")",
+ "name": "vendor_cbe_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_response_cbe_view": {
+ "columns": {},
+ "definition": "select \"vendor_responses\".\"id\" as \"response_id\", \"vendor_responses\".\"rfq_id\" as \"rfq_id\", \"vendor_responses\".\"vendor_id\" as \"vendor_id\", \"vendor_responses\".\"response_status\" as \"response_status\", \"vendor_responses\".\"notes\" as \"response_notes\", \"vendor_responses\".\"responded_by\" as \"responded_by\", \"vendor_responses\".\"responded_at\" as \"responded_at\", \"vendor_responses\".\"updated_at\" as \"response_updated_at\", \"rfqs\".\"rfq_code\" as \"rfq_code\", \"rfqs\".\"description\" as \"rfq_description\", \"rfqs\".\"due_date\" as \"rfq_due_date\", \"rfqs\".\"status\" as \"rfq_status\", \"rfqs\".\"rfq_type\" as \"rfq_type\", \"vendors\".\"vendor_name\" as \"vendor_name\", \"vendors\".\"vendor_code\" as \"vendor_code\", \"vendors\".\"status\" as \"vendor_status\", \"projects\".\"id\" as \"project_id\", \"projects\".\"code\" as \"project_code\", \"projects\".\"name\" as \"project_name\", \"vendor_commercial_responses\".\"id\" as \"commercial_response_id\", \"vendor_commercial_responses\".\"response_status\" as \"commercial_response_status\", \"vendor_commercial_responses\".\"total_price\" as \"total_price\", \"vendor_commercial_responses\".\"currency\" as \"currency\", \"vendor_commercial_responses\".\"payment_terms\" as \"payment_terms\", \"vendor_commercial_responses\".\"incoterms\" as \"incoterms\", \"vendor_commercial_responses\".\"delivery_period\" as \"delivery_period\", \"vendor_commercial_responses\".\"warranty_period\" as \"warranty_period\", \"vendor_commercial_responses\".\"validity_period\" as \"validity_period\", \"vendor_commercial_responses\".\"price_breakdown\" as \"price_breakdown\", \"vendor_commercial_responses\".\"commercial_notes\" as \"commercial_notes\", \"vendor_commercial_responses\".\"created_at\" as \"commercial_created_at\", \"vendor_commercial_responses\".\"updated_at\" as \"commercial_updated_at\", (\n SELECT COUNT(*) \n FROM \"vendor_response_attachments\" \n WHERE \"vendor_response_attachments\".\"response_id\" = \"vendor_responses\".\"id\"\n ) as \"attachment_count\", (\n SELECT COUNT(*) \n FROM \"vendor_response_attachments\" \n WHERE \"vendor_response_attachments\".\"commercial_response_id\" = \"vendor_commercial_responses\".\"id\"\n ) as \"commercial_attachment_count\", (\n SELECT COUNT(*) \n FROM \"vendor_response_attachments\" \n WHERE \"vendor_response_attachments\".\"response_id\" = \"vendor_responses\".\"id\"\n AND \"vendor_response_attachments\".\"attachment_type\" = 'TECHNICAL_SPEC'\n ) as \"technical_attachment_count\", (\n SELECT MAX(\"uploaded_at\") \n FROM \"vendor_response_attachments\" \n WHERE \"vendor_response_attachments\".\"response_id\" = \"vendor_responses\".\"id\"\n ) as \"latest_attachment_date\" from \"vendor_responses\" inner join \"rfqs\" on \"vendor_responses\".\"rfq_id\" = \"rfqs\".\"id\" inner join \"vendors\" on \"vendor_responses\".\"vendor_id\" = \"vendors\".\"id\" left join \"projects\" on \"rfqs\".\"project_id\" = \"projects\".\"id\" left join \"vendor_commercial_responses\" on \"vendor_commercial_responses\".\"response_id\" = \"vendor_responses\".\"id\"",
+ "name": "vendor_response_cbe_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_responses_view": {
+ "columns": {},
+ "definition": "select \"vendor_responses\".\"id\" as \"response_id\", \"vendor_responses\".\"rfq_id\" as \"rfq_id\", \"vendor_responses\".\"vendor_id\" as \"vendor_id\", \"rfqs\".\"rfq_code\" as \"rfq_code\", \"rfqs\".\"description\" as \"rfq_description\", \"rfqs\".\"due_date\" as \"rfq_due_date\", \"rfqs\".\"status\" as \"rfq_status\", \"rfqs\".\"rfq_type\" as \"rfq_type\", \"rfqs\".\"created_at\" as \"rfq_created_at\", \"rfqs\".\"updated_at\" as \"rfq_updated_at\", \"rfqs\".\"created_by\" as \"rfq_created_by\", \"projects\".\"id\" as \"project_id\", \"projects\".\"code\" as \"project_code\", \"projects\".\"name\" as \"project_name\", \"vendors\".\"vendor_name\" as \"vendor_name\", \"vendors\".\"vendor_code\" as \"vendor_code\", \"vendor_responses\".\"response_status\" as \"response_status\", \"vendor_responses\".\"responded_at\" as \"responded_at\", CASE WHEN \"vendor_technical_responses\".\"id\" IS NOT NULL THEN TRUE ELSE FALSE END as \"has_technical_response\", \"vendor_technical_responses\".\"id\" as \"technical_response_id\", CASE WHEN \"vendor_commercial_responses\".\"id\" IS NOT NULL THEN TRUE ELSE FALSE END as \"has_commercial_response\", \"vendor_commercial_responses\".\"id\" as \"commercial_response_id\", \"vendor_commercial_responses\".\"total_price\" as \"total_price\", \"vendor_commercial_responses\".\"currency\" as \"currency\", \"rfq_evaluations\".\"id\" as \"tbe_id\", \"rfq_evaluations\".\"result\" as \"tbe_result\", \"cbe_evaluations\".\"id\" as \"cbe_id\", \"cbe_evaluations\".\"result\" as \"cbe_result\", (\n SELECT COUNT(*) \n FROM \"vendor_response_attachments\" \n WHERE \"vendor_response_attachments\".\"response_id\" = \"vendor_responses\".\"id\"\n ) as \"attachment_count\" from \"vendor_responses\" inner join \"rfqs\" on \"vendor_responses\".\"rfq_id\" = \"rfqs\".\"id\" inner join \"vendors\" on \"vendor_responses\".\"vendor_id\" = \"vendors\".\"id\" left join \"projects\" on \"rfqs\".\"project_id\" = \"projects\".\"id\" left join \"vendor_technical_responses\" on \"vendor_technical_responses\".\"response_id\" = \"vendor_responses\".\"id\" left join \"vendor_commercial_responses\" on \"vendor_commercial_responses\".\"response_id\" = \"vendor_responses\".\"id\" left join \"rfq_evaluations\" on (\"rfq_evaluations\".\"rfq_id\" = \"vendor_responses\".\"rfq_id\" and \"rfq_evaluations\".\"vendor_id\" = \"vendor_responses\".\"vendor_id\" and \"rfq_evaluations\".\"eval_type\" = 'TBE') left join \"cbe_evaluations\" on (\"cbe_evaluations\".\"rfq_id\" = \"vendor_responses\".\"rfq_id\" and \"cbe_evaluations\".\"vendor_id\" = \"vendor_responses\".\"vendor_id\")",
+ "name": "vendor_responses_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_rfq_view": {
+ "columns": {},
+ "definition": "select \"vendors\".\"id\" as \"vendor_id\", \"vendors\".\"vendor_name\" as \"vendor_name\", \"vendors\".\"vendor_code\" as \"vendor_code\", \"vendors\".\"address\" as \"address\", \"vendors\".\"country\" as \"country\", \"vendors\".\"email\" as \"email\", \"vendors\".\"website\" as \"website\", \"vendors\".\"status\" as \"vendor_status\", \"vendor_responses\".\"rfq_id\" as \"rfq_id\", \"vendor_responses\".\"response_status\" as \"rfq_vendor_status\", \"vendor_responses\".\"updated_at\" as \"rfq_vendor_updated\", \"rfqs\".\"rfq_code\" as \"rfq_code\", \"rfqs\".\"description\" as \"description\", \"rfqs\".\"due_date\" as \"due_date\", \"projects\".\"id\" as \"project_id\", \"projects\".\"code\" as \"project_code\", \"projects\".\"name\" as \"project_name\" from \"vendors\" left join \"vendor_responses\" on \"vendor_responses\".\"vendor_id\" = \"vendors\".\"id\" left join \"rfqs\" on \"vendor_responses\".\"rfq_id\" = \"rfqs\".\"id\" left join \"projects\" on \"rfqs\".\"project_id\" = \"projects\".\"id\"",
+ "name": "vendor_rfq_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_tbe_view": {
+ "columns": {},
+ "definition": "select \"vendors\".\"id\" as \"vendor_id\", \"vendors\".\"vendor_name\" as \"vendor_name\", \"vendors\".\"vendor_code\" as \"vendor_code\", \"vendors\".\"address\" as \"address\", \"vendors\".\"country\" as \"country\", \"vendors\".\"email\" as \"email\", \"vendors\".\"website\" as \"website\", \"vendors\".\"status\" as \"vendor_status\", \"vendor_responses\".\"id\" as \"vendor_response_id\", \"vendor_responses\".\"rfq_id\" as \"rfq_id\", \"vendor_responses\".\"response_status\" as \"rfq_vendor_status\", \"vendor_responses\".\"updated_at\" as \"rfq_vendor_updated\", \"vendor_technical_responses\".\"id\" as \"technical_response_id\", \"vendor_technical_responses\".\"response_status\" as \"technical_response_status\", \"vendor_technical_responses\".\"summary\" as \"technical_summary\", \"vendor_technical_responses\".\"notes\" as \"technical_notes\", \"vendor_technical_responses\".\"updated_at\" as \"technical_updated\", \"rfqs\".\"rfq_code\" as \"rfq_code\", \"rfqs\".\"rfq_type\" as \"rfq_type\", \"rfqs\".\"status\" as \"rfq_status\", \"rfqs\".\"description\" as \"description\", \"rfqs\".\"due_date\" as \"due_date\", \"projects\".\"id\" as \"project_id\", \"projects\".\"code\" as \"project_code\", \"projects\".\"name\" as \"project_name\", \"rfq_evaluations\".\"id\" as \"tbe_id\", \"rfq_evaluations\".\"result\" as \"tbe_result\", \"rfq_evaluations\".\"notes\" as \"tbe_note\", \"rfq_evaluations\".\"updated_at\" as \"tbe_updated\" from \"vendors\" left join \"vendor_responses\" on \"vendor_responses\".\"vendor_id\" = \"vendors\".\"id\" left join \"rfqs\" on \"vendor_responses\".\"rfq_id\" = \"rfqs\".\"id\" left join \"projects\" on \"rfqs\".\"project_id\" = \"projects\".\"id\" left join \"vendor_technical_responses\" on \"vendor_technical_responses\".\"response_id\" = \"vendor_responses\".\"id\" left join \"rfq_evaluations\" on (\"rfq_evaluations\".\"vendor_id\" = \"vendors\".\"id\" and \"rfq_evaluations\".\"eval_type\" = 'TBE' and \"rfq_evaluations\".\"rfq_id\" = \"vendor_responses\".\"rfq_id\")",
+ "name": "vendor_tbe_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.role_view": {
+ "columns": {},
+ "definition": "select \"roles\".\"id\" as \"id\", \"roles\".\"name\" as \"name\", \"roles\".\"description\" as \"description\", \"roles\".\"domain\" as \"domain\", \"roles\".\"created_at\" as \"created_at\", \"vendors\".\"id\" as \"company_id\", \"vendors\".\"vendor_name\" as \"company_name\", COUNT(\"users\".\"id\") as \"user_count\" from \"roles\" left join \"user_roles\" on \"user_roles\".\"role_id\" = \"roles\".\"id\" left join \"users\" on \"users\".\"id\" = \"user_roles\".\"user_id\" left join \"vendors\" on \"roles\".\"company_id\" = \"vendors\".\"id\" group by \"roles\".\"id\", \"vendors\".\"id\"",
+ "name": "role_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.user_view": {
+ "columns": {},
+ "definition": "select \"users\".\"id\" as \"user_id\", \"users\".\"name\" as \"user_name\", \"users\".\"phone\" as \"user_phone\", \"users\".\"email\" as \"user_email\", \"users\".\"domain\" as \"user_domain\", \"users\".\"image_url\" as \"user_image\", \"vendors\".\"id\" as \"company_id\", \"vendors\".\"vendor_name\" as \"company_name\", \n array_agg(\"roles\".\"name\")\n as \"roles\", \"users\".\"created_at\" as \"created_at\" from \"users\" left join \"vendors\" on \"users\".\"company_id\" = \"vendors\".\"id\" left join \"user_roles\" on \"users\".\"id\" = \"user_roles\".\"user_id\" left join \"roles\" on \"user_roles\".\"role_id\" = \"roles\".\"id\" group by \"users\".\"id\", \"vendors\".\"id\"",
+ "name": "user_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.form_lists_view": {
+ "columns": {},
+ "definition": "select \"tag_type_class_form_mappings\".\"id\" as \"id\", \"tag_type_class_form_mappings\".\"project_id\" as \"project_id\", \"projects\".\"code\" as \"project_code\", \"projects\".\"name\" as \"project_name\", \"tag_type_class_form_mappings\".\"tag_type_label\" as \"tag_type_label\", \"tag_type_class_form_mappings\".\"class_label\" as \"class_label\", \"tag_type_class_form_mappings\".\"form_code\" as \"form_code\", \"tag_type_class_form_mappings\".\"form_name\" as \"form_name\", \"tag_type_class_form_mappings\".\"ep\" as \"ep\", \"tag_type_class_form_mappings\".\"remark\" as \"remark\", \"tag_type_class_form_mappings\".\"created_at\" as \"created_at\", \"tag_type_class_form_mappings\".\"updated_at\" as \"updated_at\" from \"tag_type_class_form_mappings\" inner join \"projects\" on \"tag_type_class_form_mappings\".\"project_id\" = \"projects\".\"id\"",
+ "name": "form_lists_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.view_tag_subfields": {
+ "columns": {
+ "tag_type_code": {
+ "name": "tag_type_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attributes_id": {
+ "name": "attributes_id",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "attributes_description": {
+ "name": "attributes_description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "expression": {
+ "name": "expression",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delimiter": {
+ "name": "delimiter",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sort_order": {
+ "name": "sort_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "code": {
+ "name": "code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "name": {
+ "name": "name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "definition": "select \"tag_subfields\".\"id\" as \"id\", \"tag_subfields\".\"tag_type_code\", \"tag_types\".\"description\", \"tag_subfields\".\"attributes_id\", \"tag_subfields\".\"attributes_description\", \"tag_subfields\".\"expression\", \"tag_subfields\".\"delimiter\", \"tag_subfields\".\"sort_order\", \"tag_subfields\".\"created_at\", \"tag_subfields\".\"updated_at\", \"projects\".\"id\" as \"project_id\", \"projects\".\"code\", \"projects\".\"name\" from \"tag_subfields\" inner join \"tag_types\" on (\"tag_subfields\".\"tag_type_code\" = \"tag_types\".\"code\" and \"tag_subfields\".\"project_id\" = \"tag_types\".\"project_id\") inner join \"projects\" on \"tag_subfields\".\"project_id\" = \"projects\".\"id\"",
+ "name": "view_tag_subfields",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.document_stages_view": {
+ "columns": {
+ "document_id": {
+ "name": "document_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "doc_number": {
+ "name": "doc_number",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "issued_date": {
+ "name": "issued_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contract_id": {
+ "name": "contract_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stage_count": {
+ "name": "stage_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "stage_list": {
+ "name": "stage_list",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "definition": "\n SELECT\n d.id AS document_id,\n d.doc_number,\n d.title,\n d.status,\n d.issued_date,\n d.contract_id,\n (SELECT COUNT(*) FROM issue_stages WHERE document_id = d.id) AS stage_count,\n COALESCE( \n (SELECT json_agg(i.stage_name) FROM issue_stages i WHERE i.document_id = d.id), \n '[]'\n ) AS stage_list,\n d.created_at,\n d.updated_at\n FROM documents d\n",
+ "name": "document_stages_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.enhanced_documents_view": {
+ "columns": {
+ "document_id": {
+ "name": "document_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "doc_number": {
+ "name": "doc_number",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "drawing_kind": {
+ "name": "drawing_kind",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_doc_number": {
+ "name": "vendor_doc_number",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pic": {
+ "name": "pic",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "issued_date": {
+ "name": "issued_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contract_id": {
+ "name": "contract_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_code": {
+ "name": "project_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "c_gbn": {
+ "name": "c_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "d_gbn": {
+ "name": "d_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "degree_gbn": {
+ "name": "degree_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dept_gbn": {
+ "name": "dept_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "j_gbn": {
+ "name": "j_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "s_gbn": {
+ "name": "s_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_stage_id": {
+ "name": "current_stage_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_stage_name": {
+ "name": "current_stage_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_stage_status": {
+ "name": "current_stage_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_stage_order": {
+ "name": "current_stage_order",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_stage_plan_date": {
+ "name": "current_stage_plan_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_stage_actual_date": {
+ "name": "current_stage_actual_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_stage_assignee_name": {
+ "name": "current_stage_assignee_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_stage_priority": {
+ "name": "current_stage_priority",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "days_until_due": {
+ "name": "days_until_due",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_overdue": {
+ "name": "is_overdue",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "days_difference": {
+ "name": "days_difference",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_stages": {
+ "name": "total_stages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "completed_stages": {
+ "name": "completed_stages",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "progress_percentage": {
+ "name": "progress_percentage",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_revision_id": {
+ "name": "latest_revision_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_revision": {
+ "name": "latest_revision",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_revision_status": {
+ "name": "latest_revision_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_revision_uploader_name": {
+ "name": "latest_revision_uploader_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_submitted_date": {
+ "name": "latest_submitted_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "all_stages": {
+ "name": "all_stages",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_count": {
+ "name": "attachment_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "definition": "\n WITH document_stats AS (\n SELECT \n d.id as document_id,\n COUNT(ist.id) as total_stages,\n COUNT(CASE WHEN ist.stage_status IN ('COMPLETED', 'APPROVED') THEN 1 END) as completed_stages,\n CASE \n WHEN COUNT(ist.id) > 0 \n THEN ROUND((COUNT(CASE WHEN ist.stage_status IN ('COMPLETED', 'APPROVED') THEN 1 END) * 100.0) / COUNT(ist.id))\n ELSE 0 \n END as progress_percentage\n FROM documents d\n LEFT JOIN issue_stages ist ON d.id = ist.document_id\n GROUP BY d.id\n ),\n current_stage_info AS (\n SELECT DISTINCT ON (document_id)\n document_id,\n id as current_stage_id,\n stage_name as current_stage_name,\n stage_status as current_stage_status,\n stage_order as current_stage_order,\n plan_date as current_stage_plan_date,\n actual_date as current_stage_actual_date,\n assignee_name as current_stage_assignee_name,\n priority as current_stage_priority,\n CASE \n WHEN actual_date IS NULL AND plan_date IS NOT NULL \n THEN plan_date - CURRENT_DATE\n ELSE NULL \n END as days_until_due,\n CASE \n WHEN actual_date IS NULL AND plan_date < CURRENT_DATE \n THEN true\n WHEN actual_date IS NOT NULL AND actual_date > plan_date \n THEN true\n ELSE false \n END as is_overdue,\n CASE \n WHEN actual_date IS NOT NULL AND plan_date IS NOT NULL \n THEN actual_date - plan_date\n ELSE NULL \n END as days_difference\n FROM issue_stages\n WHERE stage_status NOT IN ('COMPLETED', 'APPROVED')\n ORDER BY document_id, stage_order ASC, priority DESC\n ),\n latest_revision_info AS (\n SELECT DISTINCT ON (ist.document_id)\n ist.document_id,\n r.id as latest_revision_id,\n r.revision as latest_revision,\n r.revision_status as latest_revision_status,\n r.uploader_name as latest_revision_uploader_name,\n r.submitted_date as latest_submitted_date\n FROM revisions r\n JOIN issue_stages ist ON r.issue_stage_id = ist.id\n ORDER BY ist.document_id, r.created_at DESC\n ),\n -- 리비전별 첨부파일 집계\n revision_attachments AS (\n SELECT \n r.id as revision_id,\n COALESCE(\n json_agg(\n json_build_object(\n 'id', da.id,\n 'revisionId', da.revision_id,\n 'fileName', da.file_name,\n 'filePath', da.file_path,\n 'fileSize', da.file_size,\n 'fileType', da.file_type,\n 'createdAt', da.created_at,\n 'updatedAt', da.updated_at\n ) ORDER BY da.created_at\n ) FILTER (WHERE da.id IS NOT NULL),\n '[]'::json\n ) as attachments\n FROM revisions r\n LEFT JOIN document_attachments da ON r.id = da.revision_id\n GROUP BY r.id\n ),\n -- 스테이지별 리비전 집계 (첨부파일 포함)\n stage_revisions AS (\n SELECT \n ist.id as stage_id,\n COALESCE(\n json_agg(\n json_build_object(\n 'id', r.id,\n 'issueStageId', r.issue_stage_id,\n 'revision', r.revision,\n 'uploaderType', r.uploader_type,\n 'uploaderId', r.uploader_id,\n 'uploaderName', r.uploader_name,\n 'comment', r.comment,\n 'usage', r.usage,\n 'revisionStatus', r.revision_status,\n 'submittedDate', r.submitted_date,\n 'uploadedAt', r.uploaded_at,\n 'approvedDate', r.approved_date,\n 'reviewStartDate', r.review_start_date,\n 'rejectedDate', r.rejected_date,\n 'reviewerId', r.reviewer_id,\n 'reviewerName', r.reviewer_name,\n 'reviewComments', r.review_comments,\n 'createdAt', r.created_at,\n 'updatedAt', r.updated_at,\n 'attachments', ra.attachments\n ) ORDER BY r.created_at\n ) FILTER (WHERE r.id IS NOT NULL),\n '[]'::json\n ) as revisions\n FROM issue_stages ist\n LEFT JOIN revisions r ON ist.id = r.issue_stage_id\n LEFT JOIN revision_attachments ra ON r.id = ra.revision_id\n GROUP BY ist.id\n ),\n -- 문서별 스테이지 집계 (리비전 포함)\n stage_aggregation AS (\n SELECT \n ist.document_id,\n json_agg(\n json_build_object(\n 'id', ist.id,\n 'stageName', ist.stage_name,\n 'stageStatus', ist.stage_status,\n 'stageOrder', ist.stage_order,\n 'planDate', ist.plan_date,\n 'actualDate', ist.actual_date,\n 'assigneeName', ist.assignee_name,\n 'priority', ist.priority,\n 'revisions', sr.revisions\n ) ORDER BY ist.stage_order\n ) as all_stages\n FROM issue_stages ist\n LEFT JOIN stage_revisions sr ON ist.id = sr.stage_id\n GROUP BY ist.document_id\n ),\n attachment_counts AS (\n SELECT \n ist.document_id,\n COUNT(da.id) as attachment_count\n FROM issue_stages ist\n LEFT JOIN revisions r ON ist.id = r.issue_stage_id\n LEFT JOIN document_attachments da ON r.id = da.revision_id\n GROUP BY ist.document_id\n )\n \n SELECT \n d.id as document_id,\n d.doc_number,\n d.drawing_kind,\n d.vendor_doc_number, -- ✅ 벤더 문서 번호 추가\n d.title,\n d.pic,\n d.status,\n d.issued_date,\n d.contract_id,\n\n d.c_gbn,\n d.d_gbn,\n d.degree_gbn,\n d.dept_gbn,\n d.s_gbn,\n d.j_gbn,\n\n\n \n -- ✅ 프로젝트 및 벤더 정보 추가\n p.code as project_code,\n v.vendor_name as vendor_name,\n v.vendor_code as vendor_code,\n c.vendor_id as vendor_id,\n \n -- 현재 스테이지 정보\n csi.current_stage_id,\n csi.current_stage_name,\n csi.current_stage_status,\n csi.current_stage_order,\n csi.current_stage_plan_date,\n csi.current_stage_actual_date,\n csi.current_stage_assignee_name,\n csi.current_stage_priority,\n \n -- 계산 필드\n csi.days_until_due,\n csi.is_overdue,\n csi.days_difference,\n \n -- 진행률 정보\n ds.total_stages,\n ds.completed_stages,\n ds.progress_percentage,\n \n -- 최신 리비전 정보\n lri.latest_revision_id,\n lri.latest_revision,\n lri.latest_revision_status,\n lri.latest_revision_uploader_name,\n lri.latest_submitted_date,\n \n -- 전체 스테이지 (리비전 및 첨부파일 포함)\n COALESCE(sa.all_stages, '[]'::json) as all_stages,\n \n -- 기타\n COALESCE(ac.attachment_count, 0) as attachment_count,\n d.created_at,\n d.updated_at\n \n FROM documents d\n -- ✅ contracts, projects, vendors 테이블 JOIN 추가\n LEFT JOIN contracts c ON d.contract_id = c.id\n LEFT JOIN projects p ON c.project_id = p.id\n LEFT JOIN vendors v ON c.vendor_id = v.id\n \n LEFT JOIN document_stats ds ON d.id = ds.document_id\n LEFT JOIN current_stage_info csi ON d.id = csi.document_id\n LEFT JOIN latest_revision_info lri ON d.id = lri.document_id\n LEFT JOIN stage_aggregation sa ON d.id = sa.document_id\n LEFT JOIN attachment_counts ac ON d.id = ac.document_id\n \n ORDER BY d.created_at DESC\n",
+ "name": "enhanced_documents_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.simplified_documents_view": {
+ "columns": {
+ "document_id": {
+ "name": "document_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "doc_number": {
+ "name": "doc_number",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "drawing_kind": {
+ "name": "drawing_kind",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_doc_number": {
+ "name": "vendor_doc_number",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pic": {
+ "name": "pic",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "issued_date": {
+ "name": "issued_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contract_id": {
+ "name": "contract_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "project_code": {
+ "name": "project_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "c_gbn": {
+ "name": "c_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "d_gbn": {
+ "name": "d_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "degree_gbn": {
+ "name": "degree_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "dept_gbn": {
+ "name": "dept_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "j_gbn": {
+ "name": "j_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "s_gbn": {
+ "name": "s_gbn",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "first_stage_id": {
+ "name": "first_stage_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "first_stage_name": {
+ "name": "first_stage_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "first_stage_plan_date": {
+ "name": "first_stage_plan_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "first_stage_actual_date": {
+ "name": "first_stage_actual_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "second_stage_id": {
+ "name": "second_stage_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "second_stage_name": {
+ "name": "second_stage_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "second_stage_plan_date": {
+ "name": "second_stage_plan_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "second_stage_actual_date": {
+ "name": "second_stage_actual_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "all_stages": {
+ "name": "all_stages",
+ "type": "jsonb",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_count": {
+ "name": "attachment_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "definition": "\n WITH \n -- 리비전별 첨부파일 집계\n revision_attachments AS (\n SELECT \n r.id as revision_id,\n COALESCE(\n json_agg(\n json_build_object(\n 'id', da.id,\n 'revisionId', da.revision_id,\n 'fileName', da.file_name,\n 'filePath', da.file_path,\n 'fileSize', da.file_size,\n 'fileType', da.file_type,\n 'createdAt', da.created_at,\n 'updatedAt', da.updated_at\n ) ORDER BY da.created_at\n ) FILTER (WHERE da.id IS NOT NULL),\n '[]'::json\n ) as attachments\n FROM revisions r\n LEFT JOIN document_attachments da ON r.id = da.revision_id\n GROUP BY r.id\n ),\n -- 스테이지별 리비전 집계 (첨부파일 포함)\n stage_revisions AS (\n SELECT \n ist.id as stage_id,\n COALESCE(\n json_agg(\n json_build_object(\n 'id', r.id,\n 'issueStageId', r.issue_stage_id,\n 'revision', r.revision,\n 'uploaderType', r.uploader_type,\n 'uploaderId', r.uploader_id,\n 'uploaderName', r.uploader_name,\n 'comment', r.comment,\n 'usage', r.usage,\n 'usageType', r.usage_type,\n 'revisionStatus', r.revision_status,\n 'submittedDate', r.submitted_date,\n 'uploadedAt', r.uploaded_at,\n 'approvedDate', r.approved_date,\n 'reviewStartDate', r.review_start_date,\n 'rejectedDate', r.rejected_date,\n 'reviewerId', r.reviewer_id,\n 'reviewerName', r.reviewer_name,\n 'reviewComments', r.review_comments,\n 'createdAt', r.created_at,\n 'updatedAt', r.updated_at,\n 'attachments', ra.attachments\n ) ORDER BY r.created_at\n ) FILTER (WHERE r.id IS NOT NULL),\n '[]'::json\n ) as revisions\n FROM issue_stages ist\n LEFT JOIN revisions r ON ist.id = r.issue_stage_id\n LEFT JOIN revision_attachments ra ON r.id = ra.revision_id\n GROUP BY ist.id\n ),\n -- 문서별 스테이지 집계 (리비전 포함)\n stage_aggregation AS (\n SELECT \n ist.document_id,\n json_agg(\n json_build_object(\n 'id', ist.id,\n 'stageName', ist.stage_name,\n 'stageStatus', ist.stage_status,\n 'stageOrder', ist.stage_order,\n 'planDate', ist.plan_date,\n 'actualDate', ist.actual_date,\n 'assigneeName', ist.assignee_name,\n 'priority', ist.priority,\n 'revisions', sr.revisions\n ) ORDER BY ist.stage_order\n ) as all_stages\n FROM issue_stages ist\n LEFT JOIN stage_revisions sr ON ist.id = sr.stage_id\n GROUP BY ist.document_id\n ),\n -- 첫 번째 스테이지 정보 (drawingKind에 따라 다른 조건)\n first_stage_info AS (\n SELECT DISTINCT ON (ist.document_id)\n ist.document_id,\n ist.id as first_stage_id,\n ist.stage_name as first_stage_name,\n ist.plan_date as first_stage_plan_date,\n ist.actual_date as first_stage_actual_date\n FROM issue_stages ist\n JOIN documents d ON ist.document_id = d.id\n WHERE \n (d.drawing_kind = 'B4' AND LOWER(ist.stage_name) LIKE '%pre%') OR\n (d.drawing_kind = 'B3' AND LOWER(ist.stage_name) LIKE '%approval%') OR\n (d.drawing_kind = 'B5' AND LOWER(ist.stage_name) LIKE '%first%')\n ORDER BY ist.document_id, ist.stage_order ASC\n ),\n -- 두 번째 스테이지 정보 (drawingKind에 따라 다른 조건)\n second_stage_info AS (\n SELECT DISTINCT ON (ist.document_id)\n ist.document_id,\n ist.id as second_stage_id,\n ist.stage_name as second_stage_name,\n ist.plan_date as second_stage_plan_date,\n ist.actual_date as second_stage_actual_date\n FROM issue_stages ist\n JOIN documents d ON ist.document_id = d.id\n WHERE \n (d.drawing_kind = 'B4' AND LOWER(ist.stage_name) LIKE '%work%') OR\n (d.drawing_kind = 'B3' AND LOWER(ist.stage_name) LIKE '%work%') OR\n (d.drawing_kind = 'B5' AND LOWER(ist.stage_name) LIKE '%second%')\n ORDER BY ist.document_id, ist.stage_order ASC\n ),\n -- 첨부파일 수 집계\n attachment_counts AS (\n SELECT \n ist.document_id,\n COUNT(da.id) as attachment_count\n FROM issue_stages ist\n LEFT JOIN revisions r ON ist.id = r.issue_stage_id\n LEFT JOIN document_attachments da ON r.id = da.revision_id\n GROUP BY ist.document_id\n )\n \n SELECT \n d.id as document_id,\n d.doc_number,\n d.drawing_kind,\n d.vendor_doc_number,\n d.title,\n d.pic,\n d.status,\n d.issued_date,\n d.contract_id,\n \n -- B4 전용 필드들\n d.c_gbn,\n d.d_gbn,\n d.degree_gbn,\n d.dept_gbn,\n d.s_gbn,\n d.j_gbn,\n \n -- 프로젝트 및 벤더 정보\n p.code as project_code,\n v.vendor_name as vendor_name,\n v.vendor_code as vendor_code,\n \n -- 첫 번째 스테이지 정보\n fsi.first_stage_id,\n fsi.first_stage_name,\n fsi.first_stage_plan_date,\n fsi.first_stage_actual_date,\n \n -- 두 번째 스테이지 정보\n ssi.second_stage_id,\n ssi.second_stage_name,\n ssi.second_stage_plan_date,\n ssi.second_stage_actual_date,\n \n -- 전체 스테이지 (리비전 및 첨부파일 포함)\n COALESCE(sa.all_stages, '[]'::json) as all_stages,\n \n -- 기타\n COALESCE(ac.attachment_count, 0) as attachment_count,\n d.created_at,\n d.updated_at\n \n FROM documents d\n -- contracts, projects, vendors 테이블 JOIN\n LEFT JOIN contracts c ON d.contract_id = c.id\n INNER JOIN projects p ON c.project_id = p.id AND p.type = 'ship'\n LEFT JOIN vendors v ON c.vendor_id = v.id\n \n -- 스테이지 정보 JOIN\n LEFT JOIN first_stage_info fsi ON d.id = fsi.document_id\n LEFT JOIN second_stage_info ssi ON d.id = ssi.document_id\n LEFT JOIN stage_aggregation sa ON d.id = sa.document_id\n LEFT JOIN attachment_counts ac ON d.id = ac.document_id\n \n ORDER BY d.created_at DESC\n",
+ "name": "simplified_documents_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.sync_status_view": {
+ "columns": {
+ "contract_id": {
+ "name": "contract_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "target_system": {
+ "name": "target_system",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "total_changes": {
+ "name": "total_changes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pending_changes": {
+ "name": "pending_changes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "synced_changes": {
+ "name": "synced_changes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "failed_changes": {
+ "name": "failed_changes",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "last_sync_at": {
+ "name": "last_sync_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "next_sync_at": {
+ "name": "next_sync_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sync_enabled": {
+ "name": "sync_enabled",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "\n WITH change_stats AS (\n SELECT \n cl.contract_id,\n sc.target_system,\n COUNT(*) as total_changes,\n COUNT(CASE WHEN cl.is_synced = false AND cl.sync_attempts < sc.retry_max_attempts THEN 1 END) as pending_changes,\n COUNT(CASE WHEN cl.is_synced = true THEN 1 END) as synced_changes,\n COUNT(CASE WHEN cl.sync_attempts >= sc.retry_max_attempts AND cl.is_synced = false THEN 1 END) as failed_changes,\n MAX(cl.synced_at) as last_sync_at\n FROM change_logs cl\n CROSS JOIN sync_configs sc \n WHERE cl.contract_id = sc.contract_id\n AND (cl.target_systems IS NULL OR cl.target_systems @> to_jsonb(sc.target_system))\n GROUP BY cl.contract_id, sc.target_system\n )\n SELECT \n cs.contract_id,\n cs.target_system,\n COALESCE(cs.total_changes, 0) as total_changes,\n COALESCE(cs.pending_changes, 0) as pending_changes,\n COALESCE(cs.synced_changes, 0) as synced_changes,\n COALESCE(cs.failed_changes, 0) as failed_changes,\n cs.last_sync_at,\n CASE \n WHEN sc.sync_enabled = true AND sc.last_successful_sync IS NOT NULL \n THEN sc.last_successful_sync + (sc.sync_interval_minutes || ' minutes')::interval\n ELSE NULL\n END as next_sync_at,\n sc.sync_enabled\n FROM sync_configs sc\n LEFT JOIN change_stats cs ON sc.contract_id = cs.contract_id AND sc.target_system = cs.target_system\n",
+ "name": "sync_status_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_documents_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "doc_number": {
+ "name": "doc_number",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "pic": {
+ "name": "pic",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "issued_date": {
+ "name": "issued_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contract_id": {
+ "name": "contract_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "latest_stage_id": {
+ "name": "latest_stage_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_stage_name": {
+ "name": "latest_stage_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_stage_plan_date": {
+ "name": "latest_stage_plan_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_stage_actual_date": {
+ "name": "latest_stage_actual_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_revision_id": {
+ "name": "latest_revision_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_revision": {
+ "name": "latest_revision",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_revision_uploader_type": {
+ "name": "latest_revision_uploader_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_revision_uploader_name": {
+ "name": "latest_revision_uploader_name",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_count": {
+ "name": "attachment_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "definition": "\n SELECT \n d.id, \n d.doc_number,\n d.title,\n d.pic,\n d.status,\n d.issued_date,\n d.contract_id,\n \n (SELECT id FROM issue_stages WHERE document_id = d.id ORDER BY created_at DESC LIMIT 1) AS latest_stage_id,\n (SELECT stage_name FROM issue_stages WHERE document_id = d.id ORDER BY created_at DESC LIMIT 1) AS latest_stage_name,\n (SELECT plan_date FROM issue_stages WHERE document_id = d.id ORDER BY created_at DESC LIMIT 1) AS latest_stage_plan_date,\n (SELECT actual_date FROM issue_stages WHERE document_id = d.id ORDER BY created_at DESC LIMIT 1) AS latest_stage_actual_date,\n \n (SELECT r.id FROM revisions r JOIN issue_stages i ON r.issue_stage_id = i.id WHERE i.document_id = d.id ORDER BY r.created_at DESC LIMIT 1) AS latest_revision_id,\n (SELECT r.revision FROM revisions r JOIN issue_stages i ON r.issue_stage_id = i.id WHERE i.document_id = d.id ORDER BY r.created_at DESC LIMIT 1) AS latest_revision,\n (SELECT r.uploader_type FROM revisions r JOIN issue_stages i ON r.issue_stage_id = i.id WHERE i.document_id = d.id ORDER BY r.created_at DESC LIMIT 1) AS latest_revision_uploader_type,\n (SELECT r.uploader_name FROM revisions r JOIN issue_stages i ON r.issue_stage_id = i.id WHERE i.document_id = d.id ORDER BY r.created_at DESC LIMIT 1) AS latest_revision_uploader_name,\n \n (SELECT COUNT(*) FROM document_attachments a JOIN revisions r ON a.revision_id = r.id JOIN issue_stages i ON r.issue_stage_id = i.id WHERE i.document_id = d.id) AS attachment_count,\n \n d.created_at,\n d.updated_at\n FROM documents d\n JOIN contracts c ON d.contract_id = c.id\n ",
+ "name": "vendor_documents_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_candidates_with_vendor_info": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "company_name": {
+ "name": "company_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contact_email": {
+ "name": "contact_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contact_phone": {
+ "name": "contact_phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_id": {
+ "name": "tax_id",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "address": {
+ "name": "address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country": {
+ "name": "country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "source": {
+ "name": "source",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'COLLECTED'"
+ },
+ "items": {
+ "name": "items",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "select \"vendor_candidates\".\"id\", \"vendor_candidates\".\"company_name\", \"vendor_candidates\".\"contact_email\", \"vendor_candidates\".\"contact_phone\", \"vendor_candidates\".\"tax_id\", \"vendor_candidates\".\"address\", \"vendor_candidates\".\"country\", \"vendor_candidates\".\"source\", \"vendor_candidates\".\"status\", \"vendor_candidates\".\"items\", \"vendor_candidates\".\"remark\", \"vendor_candidates\".\"created_at\", \"vendor_candidates\".\"updated_at\", \"vendors\".\"vendor_name\", \"vendors\".\"vendor_code\", \"vendors\".\"created_at\" as \"vendor_created_at\", (\n SELECT l2.\"created_at\"\n FROM \"vendor_candidate_logs\" l2\n WHERE l2.\"vendor_candidate_id\" = \"vendor_candidates\".\"id\"\n AND l2.\"action\" = 'status_change'\n ORDER BY l2.\"created_at\" DESC\n LIMIT 1\n ) as \"last_status_change_at\", (\n SELECT u.\"name\"\n FROM \"users\" u\n JOIN \"vendor_candidate_logs\" l3\n ON l3.\"user_id\" = u.\"id\"\n WHERE l3.\"vendor_candidate_id\" = \"vendor_candidates\".\"id\"\n AND l3.\"action\" = 'status_change'\n ORDER BY l3.\"created_at\" DESC\n LIMIT 1\n ) as \"last_status_change_by\", (\n SELECT l4.\"created_at\"\n FROM \"vendor_candidate_logs\" l4\n WHERE l4.\"vendor_candidate_id\" = \"vendor_candidates\".\"id\"\n AND l4.\"action\" = 'invite_sent'\n ORDER BY l4.\"created_at\" DESC\n LIMIT 1\n ) as \"last_invitation_at\", (\n SELECT u2.\"name\"\n FROM \"users\" u2\n JOIN \"vendor_candidate_logs\" l5\n ON l5.\"user_id\" = u2.\"id\"\n WHERE l5.\"vendor_candidate_id\" = \"vendor_candidates\".\"id\"\n AND l5.\"action\" = 'invite_sent'\n ORDER BY l5.\"created_at\" DESC\n LIMIT 1\n ) as \"last_invitation_by\" from \"vendor_candidates\" left join \"vendors\" on \"vendor_candidates\".\"vendor_id\" = \"vendors\".\"id\"",
+ "name": "vendor_candidates_with_vendor_info",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_detail_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_id": {
+ "name": "tax_id",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "address": {
+ "name": "address",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "business_size": {
+ "name": "business_size",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country": {
+ "name": "country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "phone": {
+ "name": "phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "website": {
+ "name": "website",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PENDING_REVIEW'"
+ },
+ "representative_name": {
+ "name": "representative_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_birth": {
+ "name": "representative_birth",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_email": {
+ "name": "representative_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_phone": {
+ "name": "representative_phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "corporate_registration_number": {
+ "name": "corporate_registration_number",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credit_agency": {
+ "name": "credit_agency",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "credit_rating": {
+ "name": "credit_rating",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cash_flow_rating": {
+ "name": "cash_flow_rating",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "definition": "select \"id\", \"vendor_name\", \"vendor_code\", \"tax_id\", \"address\", \"business_size\", \"country\", \"phone\", \"email\", \"website\", \"status\", \"representative_name\", \"representative_birth\", \"representative_email\", \"representative_phone\", \"corporate_registration_number\", \"credit_agency\", \"credit_rating\", \"cash_flow_rating\", \"created_at\", \"updated_at\", \n (SELECT COALESCE(\n json_agg(\n json_build_object(\n 'id', c.id,\n 'contactName', c.contact_name,\n 'contactPosition', c.contact_position,\n 'contactEmail', c.contact_email,\n 'contactPhone', c.contact_phone,\n 'isPrimary', c.is_primary\n )\n ),\n '[]'::json\n )\n FROM vendor_contacts c\n WHERE c.vendor_id = vendors.id)\n as \"contacts\", \n (SELECT COALESCE(\n json_agg(\n json_build_object(\n 'id', a.id,\n 'fileName', a.file_name,\n 'filePath', a.file_path,\n 'attachmentType', a.attachment_type,\n 'createdAt', a.created_at\n )\n ORDER BY a.attachment_type, a.created_at DESC\n ),\n '[]'::json\n )\n FROM vendor_attachments a\n WHERE a.vendor_id = vendors.id)\n as \"attachments\", \n (SELECT COUNT(*)\n FROM vendor_attachments a\n WHERE a.vendor_id = vendors.id)\n as \"attachment_count\", \n (SELECT COUNT(*) \n FROM vendor_contacts c\n WHERE c.vendor_id = vendors.id)\n as \"contact_count\" from \"vendors\"",
+ "name": "vendor_detail_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_items_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_name": {
+ "name": "item_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "definition": "select \"vendor_possible_items\".\"id\", \"vendor_possible_items\".\"vendor_id\", \"items\".\"item_name\", \"items\".\"item_code\", \"items\".\"description\", \"vendor_possible_items\".\"created_at\", \"vendor_possible_items\".\"updated_at\" from \"vendor_possible_items\" left join \"items\" on \"vendor_possible_items\".\"item_code\" = \"items\".\"item_code\"",
+ "name": "vendor_items_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_materials_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_name": {
+ "name": "item_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "unit_of_measure": {
+ "name": "unit_of_measure",
+ "type": "varchar(3)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "steel_type": {
+ "name": "steel_type",
+ "type": "varchar(2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "grade_material": {
+ "name": "grade_material",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "definition": "select \"vendor_possible_materials\".\"id\", \"vendor_possible_materials\".\"vendor_id\", \"materials\".\"item_name\", \"materials\".\"item_code\", \"materials\".\"description\", \"materials\".\"unit_of_measure\", \"materials\".\"steel_type\", \"materials\".\"grade_material\", \"vendor_possible_materials\".\"created_at\", \"vendor_possible_materials\".\"updated_at\" from \"vendor_possible_materials\" left join \"materials\" on \"vendor_possible_materials\".\"item_code\" = \"materials\".\"item_code\"",
+ "name": "vendor_materials_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendors_with_types": {
+ "columns": {},
+ "definition": "select \"vendors\".\"id\" as \"id\", \"vendors\".\"vendor_name\" as \"vendor_name\", \"vendors\".\"vendor_code\" as \"vendor_code\", \"vendors\".\"tax_id\" as \"tax_id\", \"vendors\".\"address\" as \"address\", \"vendors\".\"country\" as \"country\", \"vendors\".\"phone\" as \"phone\", \"vendors\".\"email\" as \"email\", \"vendors\".\"business_size\" as \"business_size\", \"vendors\".\"website\" as \"website\", \"vendors\".\"status\" as \"status\", \"vendors\".\"vendor_type_id\" as \"vendor_type_id\", \"vendors\".\"representative_name\" as \"representative_name\", \"vendors\".\"representative_birth\" as \"representative_birth\", \"vendors\".\"representative_email\" as \"representative_email\", \"vendors\".\"representative_phone\" as \"representative_phone\", \"vendors\".\"corporate_registration_number\" as \"corporate_registration_number\", \"vendors\".\"items\" as \"items\", \"vendors\".\"credit_agency\" as \"credit_agency\", \"vendors\".\"credit_rating\" as \"credit_rating\", \"vendors\".\"cash_flow_rating\" as \"cash_flow_rating\", \"vendors\".\"created_at\" as \"created_at\", \"vendors\".\"updated_at\" as \"updated_at\", \"vendor_types\".\"name_ko\" as \"vendor_type_name\", \"vendor_types\".\"name_en\" as \"vendor_type_name_en\", \"vendor_types\".\"code\" as \"vendor_type_code\", \n CASE\n WHEN \"vendors\".\"status\" = 'ACTIVE' THEN '정규업체'\n WHEN \"vendors\".\"status\" IN ('INACTIVE', 'BLACKLISTED', 'REJECTED') THEN ''\n ELSE '잠재업체'\n END\n as \"vendor_category\" from \"vendors\" left join \"vendor_types\" on \"vendors\".\"vendor_type_id\" = \"vendor_types\".\"id\"",
+ "name": "vendors_with_types",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.basic_contract_view": {
+ "columns": {},
+ "definition": "select \"basic_contract\".\"id\" as \"id\", \"basic_contract\".\"template_id\" as \"template_id\", \"basic_contract\".\"vendor_id\" as \"vendor_id\", \"basic_contract\".\"requested_by\" as \"requested_by\", \"basic_contract\".\"status\" as \"basic_contract_status\", \"basic_contract\".\"created_at\" as \"created_at\", \"basic_contract\".\"updated_at\" as \"updated_at\", \"basic_contract\".\"completed_at\" as \"completed_at\", \"vendors\".\"vendor_code\" as \"vendor_code\", \"vendors\".\"email\" as \"vendor_email\", \"vendors\".\"vendor_name\" as \"vendor_name\", \"users\".\"name\" as \"requested_by_name\", \"basic_contract_templates\".\"template_code\" as \"template_code\", \"basic_contract_templates\".\"template_name\" as \"template_name\", \"basic_contract_templates\".\"revision\" as \"template_revision\", \"basic_contract_templates\".\"status\" as \"template_status\", \"basic_contract_templates\".\"validity_period\" as \"validity_period\", \"basic_contract_templates\".\"legal_review_required\" as \"legal_review_required\", \"basic_contract_templates\".\"shipbuilding_applicable\" as \"shipbuilding_applicable\", \"basic_contract_templates\".\"wind_applicable\" as \"wind_applicable\", \"basic_contract_templates\".\"pc_applicable\" as \"pc_applicable\", \"basic_contract_templates\".\"nb_applicable\" as \"nb_applicable\", \"basic_contract_templates\".\"rc_applicable\" as \"rc_applicable\", \"basic_contract_templates\".\"gy_applicable\" as \"gy_applicable\", \"basic_contract_templates\".\"sys_applicable\" as \"sys_applicable\", \"basic_contract_templates\".\"infra_applicable\" as \"infra_applicable\", \"basic_contract_templates\".\"file_path\" as \"template_file_path\", \"basic_contract_templates\".\"file_name\" as \"template_file_name\", \"basic_contract\".\"file_path\" as \"signed_file_path\", \"basic_contract\".\"file_name\" as \"signed_file_name\", \"basic_contract_templates\".\"created_at\" as \"template_created_at\", \"basic_contract_templates\".\"created_by\" as \"template_created_by\", \"basic_contract_templates\".\"updated_at\" as \"template_updated_at\", \"basic_contract_templates\".\"updated_by\" as \"template_updated_by\", \"basic_contract_templates\".\"disposed_at\" as \"template_disposed_at\", \"basic_contract_templates\".\"restored_at\" as \"template_restored_at\" from \"basic_contract\" left join \"vendors\" on \"basic_contract\".\"vendor_id\" = \"vendors\".\"id\" left join \"users\" on \"basic_contract\".\"requested_by\" = \"users\".\"id\" left join \"basic_contract_templates\" on \"basic_contract\".\"template_id\" = \"basic_contract_templates\".\"id\"",
+ "name": "basic_contract_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.pr_items_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "procurement_rfqs_id": {
+ "name": "procurement_rfqs_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_item": {
+ "name": "rfq_item",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pr_item": {
+ "name": "pr_item",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pr_no": {
+ "name": "pr_no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "material_code": {
+ "name": "material_code",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "material_category": {
+ "name": "material_category",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "acc": {
+ "name": "acc",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "material_description": {
+ "name": "material_description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "size": {
+ "name": "size",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_date": {
+ "name": "delivery_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "quantity": {
+ "name": "quantity",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "uom": {
+ "name": "uom",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gross_weight": {
+ "name": "gross_weight",
+ "type": "numeric(12, 2)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 1
+ },
+ "gw_uom": {
+ "name": "gw_uom",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "spec_no": {
+ "name": "spec_no",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "spec_url": {
+ "name": "spec_url",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tracking_no": {
+ "name": "tracking_no",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "major_yn": {
+ "name": "major_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "project_def": {
+ "name": "project_def",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_sc": {
+ "name": "project_sc",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_kl": {
+ "name": "project_kl",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_lc": {
+ "name": "project_lc",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_dl": {
+ "name": "project_dl",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "item_name": {
+ "name": "item_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "select \"pr_items\".\"id\", \"pr_items\".\"procurement_rfqs_id\", \"pr_items\".\"rfq_item\", \"pr_items\".\"pr_item\", \"pr_items\".\"pr_no\", \"pr_items\".\"material_code\", \"pr_items\".\"material_category\", \"pr_items\".\"acc\", \"pr_items\".\"material_description\", \"pr_items\".\"size\", \"pr_items\".\"delivery_date\", \"pr_items\".\"quantity\", \"pr_items\".\"uom\", \"pr_items\".\"gross_weight\", \"pr_items\".\"gw_uom\", \"pr_items\".\"spec_no\", \"pr_items\".\"spec_url\", \"pr_items\".\"tracking_no\", \"pr_items\".\"major_yn\", \"pr_items\".\"project_def\", \"pr_items\".\"project_sc\", \"pr_items\".\"project_kl\", \"pr_items\".\"project_lc\", \"pr_items\".\"project_dl\", \"pr_items\".\"remark\", \"procurement_rfqs\".\"rfq_code\", \"procurement_rfqs\".\"item_code\", \"procurement_rfqs\".\"item_name\" from \"pr_items\" left join \"procurement_rfqs\" on \"pr_items\".\"procurement_rfqs_id\" = \"procurement_rfqs\".\"id\"",
+ "name": "pr_items_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.procurement_rfq_details_view": {
+ "columns": {},
+ "definition": "select \"rfq_details\".\"id\" as \"detail_id\", \"rfqs\".\"id\" as \"rfq_id\", \"rfqs\".\"rfq_code\" as \"rfq_code\", \"projects\".\"code\" as \"project_code\", \"projects\".\"name\" as \"project_name\", \"rfqs\".\"item_code\" as \"item_code\", \"rfqs\".\"item_name\" as \"item_name\", \"vendors\".\"vendor_name\" as \"vendor_name\", \"vendors\".\"vendor_code\" as \"vendor_code\", \"vendors\".\"id\" as \"vendor_id\", \"vendors\".\"country\" as \"vendor_country\", \"rfq_details\".\"currency\" as \"currency\", \"payment_terms\".\"code\" as \"payment_terms_code\", \"payment_terms\".\"description\" as \"payment_terms_description\", \"incoterms\".\"code\" as \"incoterms_code\", \"incoterms\".\"description\" as \"incoterms_description\", \"rfq_details\".\"incoterms_detail\" as \"incoterms_detail\", \"rfq_details\".\"delivery_date\" as \"delivery_date\", \"rfq_details\".\"tax_code\" as \"tax_code\", \"rfq_details\".\"place_of_shipping\" as \"place_of_shipping\", \"rfq_details\".\"place_of_destination\" as \"place_of_destination\", \"rfq_details\".\"material_price_related_yn\" as \"material_price_related_yn\", \"updated_by_user\".\"name\" as \"updated_by_user_name\", \"rfq_details\".\"updated_at\" as \"updated_at\", (\n SELECT COUNT(*) \n FROM pr_items \n WHERE procurement_rfqs_id = \"rfqs\".\"id\"\n ) as \"pr_items_count\", (\n SELECT COUNT(*) \n FROM pr_items \n WHERE procurement_rfqs_id = \"rfqs\".\"id\" \n AND major_yn = true\n ) as \"major_items_count\", (\n SELECT COUNT(*) \n FROM procurement_rfq_comments \n WHERE rfq_id = \"rfqs\".\"id\" AND vendor_id = \"rfq_details\".\"vendors_id\"\n ) as \"comment_count\", (\n SELECT created_at \n FROM procurement_rfq_comments \n WHERE rfq_id = \"rfqs\".\"id\" AND vendor_id = \"rfq_details\".\"vendors_id\"\n ORDER BY created_at DESC LIMIT 1\n ) as \"last_comment_date\", (\n SELECT created_at \n FROM procurement_rfq_comments \n WHERE rfq_id = \"rfqs\".\"id\" AND vendor_id = \"rfq_details\".\"vendors_id\" AND is_vendor_comment = true\n ORDER BY created_at DESC LIMIT 1\n ) as \"last_vendor_comment_date\", (\n SELECT COUNT(*) \n FROM procurement_rfq_attachments \n WHERE rfq_id = \"rfqs\".\"id\" AND vendor_id = \"rfq_details\".\"vendors_id\"\n ) as \"attachment_count\", (\n SELECT COUNT(*) > 0\n FROM procurement_vendor_quotations\n WHERE rfq_id = \"rfqs\".\"id\" AND vendor_id = \"rfq_details\".\"vendors_id\"\n ) as \"has_quotation\", (\n SELECT status\n FROM procurement_vendor_quotations\n WHERE rfq_id = \"rfqs\".\"id\" AND vendor_id = \"rfq_details\".\"vendors_id\"\n ORDER BY created_at DESC LIMIT 1\n ) as \"quotation_status\", (\n SELECT total_price\n FROM procurement_vendor_quotations\n WHERE rfq_id = \"rfqs\".\"id\" AND vendor_id = \"rfq_details\".\"vendors_id\"\n ORDER BY created_at DESC LIMIT 1\n ) as \"quotation_total_price\", (\n SELECT quotation_version\n FROM procurement_vendor_quotations\n WHERE rfq_id = \"rfqs\".\"id\" AND vendor_id = \"rfq_details\".\"vendors_id\"\n ORDER BY quotation_version DESC LIMIT 1\n ) as \"quotation_version\", (\n SELECT COUNT(DISTINCT quotation_version)\n FROM procurement_vendor_quotations\n WHERE rfq_id = \"rfqs\".\"id\" AND vendor_id = \"rfq_details\".\"vendors_id\"\n ) as \"quotation_version_count\", (\n SELECT created_at\n FROM procurement_vendor_quotations\n WHERE rfq_id = \"rfqs\".\"id\" AND vendor_id = \"rfq_details\".\"vendors_id\"\n ORDER BY quotation_version DESC LIMIT 1\n ) as \"last_quotation_date\" from \"procurement_rfq_details\" \"rfq_details\" left join \"procurement_rfqs\" \"rfqs\" on \"rfq_details\".\"procurement_rfqs_id\" = \"rfqs\".\"id\" left join \"projects\" on \"rfqs\".\"project_id\" = \"projects\".\"id\" left join \"vendors\" on \"rfq_details\".\"vendors_id\" = \"vendors\".\"id\" left join \"payment_terms\" on \"rfq_details\".\"payment_terms_code\" = \"payment_terms\".\"code\" left join \"incoterms\" on \"rfq_details\".\"incoterms_code\" = \"incoterms\".\"code\" left join \"users\" \"updated_by_user\" on \"rfq_details\".\"updated_by\" = \"updated_by_user\".\"id\"",
+ "name": "procurement_rfq_details_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.procurement_rfqs_view": {
+ "columns": {},
+ "definition": "select \"procurement_rfqs\".\"id\" as \"id\", \"procurement_rfqs\".\"rfq_code\" as \"rfq_code\", \"procurement_rfqs\".\"series\" as \"series\", \"procurement_rfqs\".\"rfq_sealed_yn\" as \"rfq_sealed_yn\", \"projects\".\"code\" as \"project_code\", \"projects\".\"name\" as \"project_name\", \"procurement_rfqs\".\"item_code\" as \"item_code\", \"procurement_rfqs\".\"item_name\" as \"item_name\", \"procurement_rfqs\".\"status\" as \"status\", \"procurement_rfqs\".\"pic_code\" as \"pic_code\", \"procurement_rfqs\".\"rfq_send_date\" as \"rfq_send_date\", \"procurement_rfqs\".\"due_date\" as \"due_date\", (\n SELECT MIN(submitted_at)\n FROM procurement_vendor_quotations\n WHERE rfq_id = \"procurement_rfqs\".\"id\"\n AND submitted_at IS NOT NULL\n ) as \"earliest_quotation_submitted_at\", \"created_by_user\".\"name\" as \"created_by_user_name\", \"sent_by_user\".\"name\" as \"sent_by_user_name\", \"procurement_rfqs\".\"updated_at\" as \"updated_at\", \"updated_by_user\".\"name\" as \"updated_by_user_name\", \"procurement_rfqs\".\"remark\" as \"remark\", (\n SELECT material_code \n FROM pr_items \n WHERE procurement_rfqs_id = \"procurement_rfqs\".\"id\"\n AND major_yn = true\n LIMIT 1\n ) as \"major_item_material_code\", (\n SELECT pr_no \n FROM pr_items \n WHERE procurement_rfqs_id = \"procurement_rfqs\".\"id\"\n AND major_yn = true\n LIMIT 1\n ) as \"po_no\", (\n SELECT COUNT(*) \n FROM pr_items \n WHERE procurement_rfqs_id = \"procurement_rfqs\".\"id\"\n ) as \"pr_items_count\" from \"procurement_rfqs\" left join \"projects\" on \"procurement_rfqs\".\"project_id\" = \"projects\".\"id\" left join \"users\" \"created_by_user\" on \"procurement_rfqs\".\"created_by\" = \"created_by_user\".\"id\" left join \"users\" \"updated_by_user\" on \"procurement_rfqs\".\"updated_by\" = \"updated_by_user\".\"id\" left join \"users\" \"sent_by_user\" on \"procurement_rfqs\".\"sent_by\" = \"sent_by_user\".\"id\"",
+ "name": "procurement_rfqs_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.attachment_revision_history": {
+ "columns": {
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_id": {
+ "name": "attachment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_type": {
+ "name": "attachment_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "serial_no": {
+ "name": "serial_no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_revision_id": {
+ "name": "client_revision_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_revision_no": {
+ "name": "client_revision_no",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_file_name": {
+ "name": "client_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_file_path": {
+ "name": "client_file_path",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_file_size": {
+ "name": "client_file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_revision_comment": {
+ "name": "client_revision_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "client_revision_created_at": {
+ "name": "client_revision_created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_latest_client_revision": {
+ "name": "is_latest_client_revision",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_vendor_responses": {
+ "name": "total_vendor_responses",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "responded_vendors": {
+ "name": "responded_vendors",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pending_vendors": {
+ "name": "pending_vendors",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_response_files": {
+ "name": "total_response_files",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "\n SELECT \n br.id as rfq_id,\n br.rfq_code,\n ba.id as attachment_id,\n ba.attachment_type,\n ba.serial_no,\n \n -- 발주처 리비전 정보\n rev.id as client_revision_id,\n rev.revision_no as client_revision_no,\n rev.original_file_name as client_file_name,\n rev.file_size as client_file_size,\n rev.file_path as client_file_path,\n rev.revision_comment as client_revision_comment,\n rev.created_at as client_revision_created_at,\n rev.is_latest as is_latest_client_revision,\n \n -- 벤더 응답 통계\n COALESCE(response_stats.total_responses, 0) as total_vendor_responses,\n COALESCE(response_stats.responded_count, 0) as responded_vendors,\n COALESCE(response_stats.pending_count, 0) as pending_vendors,\n COALESCE(response_stats.total_files, 0) as total_response_files\n \n FROM b_rfqs br\n JOIN b_rfq_attachments ba ON br.id = ba.rfq_id\n JOIN b_rfq_attachment_revisions rev ON ba.id = rev.attachment_id\n LEFT JOIN (\n SELECT \n var.attachment_id,\n COUNT(*) as total_responses,\n COUNT(CASE WHEN var.response_status = 'RESPONDED' THEN 1 END) as responded_count,\n COUNT(CASE WHEN var.response_status = 'NOT_RESPONDED' THEN 1 END) as pending_count,\n COUNT(vra.id) as total_files\n FROM vendor_attachment_responses var\n LEFT JOIN vendor_response_attachments_b vra ON var.id = vra.vendor_response_id\n GROUP BY var.attachment_id\n ) response_stats ON ba.id = response_stats.attachment_id\n \n ORDER BY ba.id, rev.created_at DESC\n",
+ "name": "attachment_revision_history",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.attachments_with_latest_revision": {
+ "columns": {
+ "attachment_id": {
+ "name": "attachment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_type": {
+ "name": "attachment_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "serial_no": {
+ "name": "serial_no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_revision": {
+ "name": "current_revision",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_id": {
+ "name": "revision_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "original_file_name": {
+ "name": "original_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_comment": {
+ "name": "revision_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by": {
+ "name": "created_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_by_name": {
+ "name": "created_by_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "\n SELECT \n a.id as attachment_id,\n a.attachment_type,\n a.serial_no,\n a.rfq_id,\n a.description,\n a.current_revision,\n \n r.id as revision_id,\n r.file_name,\n r.original_file_name,\n r.file_path,\n r.file_size,\n r.file_type,\n r.revision_comment,\n \n a.created_by,\n u.name as created_by_name,\n a.created_at,\n a.updated_at\n FROM b_rfq_attachments a\n LEFT JOIN b_rfq_attachment_revisions r ON a.latest_revision_id = r.id\n LEFT JOIN users u ON a.created_by = u.id\n ",
+ "name": "attachments_with_latest_revision",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.b_rfqs_master": {
+ "columns": {
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pic_code": {
+ "name": "pic_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pic_name": {
+ "name": "pic_name",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "eng_pic_name": {
+ "name": "eng_pic_name",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_no": {
+ "name": "package_no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_id": {
+ "name": "project_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_code": {
+ "name": "project_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_name": {
+ "name": "project_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_type": {
+ "name": "project_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_company": {
+ "name": "project_company",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_flag": {
+ "name": "project_flag",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_site": {
+ "name": "project_site",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_attachments": {
+ "name": "total_attachments",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "\n SELECT \n br.id as rfq_id,\n br.rfq_code,\n br.description,\n br.status,\n br.due_date,\n br.pic_code,\n br.pic_name,\n br.eng_pic_name,\n br.package_no,\n br.package_name,\n br.project_id,\n p.code as project_code,\n p.name as project_name,\n p.type as project_type,\n br.project_company,\n br.project_flag,\n br.project_site,\n COALESCE(att_count.total_attachments, 0) as total_attachments,\n br.created_at,\n br.updated_at\n FROM b_rfqs br\n LEFT JOIN projects p ON br.project_id = p.id\n LEFT JOIN (\n SELECT rfq_id, COUNT(*) as total_attachments\n FROM b_rfq_attachments\n GROUP BY rfq_id\n ) att_count ON br.id = att_count.rfq_id\n",
+ "name": "b_rfqs_master",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.final_rfq_detail": {
+ "columns": {
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_status": {
+ "name": "rfq_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_rfq_id": {
+ "name": "final_rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_rfq_status": {
+ "name": "final_rfq_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_country": {
+ "name": "vendor_country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_business_size": {
+ "name": "vendor_business_size",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "valid_date": {
+ "name": "valid_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "delivery_date": {
+ "name": "delivery_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "incoterms_code": {
+ "name": "incoterms_code",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "incoterms_description": {
+ "name": "incoterms_description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payment_terms_code": {
+ "name": "payment_terms_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "payment_terms_description": {
+ "name": "payment_terms_description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "currency": {
+ "name": "currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_code": {
+ "name": "tax_code",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "place_of_shipping": {
+ "name": "place_of_shipping",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "place_of_destination": {
+ "name": "place_of_destination",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "short_list": {
+ "name": "short_list",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "return_yn": {
+ "name": "return_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cp_request_yn": {
+ "name": "cp_request_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "prject_gtc_yn": {
+ "name": "prject_gtc_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "firsttime_yn": {
+ "name": "firsttime_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "material_price_related_yn": {
+ "name": "material_price_related_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "return_revision": {
+ "name": "return_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gtc": {
+ "name": "gtc",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gtc_valid_date": {
+ "name": "gtc_valid_date",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "classification": {
+ "name": "classification",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sparepart": {
+ "name": "sparepart",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_remark": {
+ "name": "vendor_remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "\n SELECT \n br.id as rfq_id,\n br.rfq_code,\n br.status as rfq_status,\n fr.id as final_rfq_id,\n fr.final_rfq_status,\n fr.vendor_id,\n v.vendor_code,\n v.vendor_name,\n v.country as vendor_country,\n v.business_size as vendor_business_size,\n fr.due_date,\n fr.valid_date,\n fr.delivery_date,\n fr.incoterms_code,\n inc.description as incoterms_description,\n fr.payment_terms_code,\n pt.description as payment_terms_description,\n fr.currency,\n fr.tax_code,\n fr.place_of_shipping,\n fr.place_of_destination,\n fr.short_list,\n fr.return_yn,\n fr.cp_request_yn,\n fr.prject_gtc_yn,\n fr.firsttime_yn,\n fr.material_price_related_yn,\n fr.return_revision,\n fr.gtc,\n fr.gtc_valid_date,\n fr.classification,\n fr.sparepart,\n fr.remark,\n fr.vendor_remark,\n fr.created_at,\n fr.updated_at\n FROM b_rfqs br\n JOIN final_rfq fr ON br.id = fr.rfq_id\n LEFT JOIN vendors v ON fr.vendor_id = v.id\n LEFT JOIN incoterms inc ON fr.incoterms_code = inc.code\n LEFT JOIN payment_terms pt ON fr.payment_terms_code = pt.code\n",
+ "name": "final_rfq_detail",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.initial_rfq_detail": {
+ "columns": {
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_status": {
+ "name": "rfq_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "initial_rfq_id": {
+ "name": "initial_rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "initial_rfq_status": {
+ "name": "initial_rfq_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_category": {
+ "name": "vendor_category",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_country": {
+ "name": "vendor_country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_business_size": {
+ "name": "vendor_business_size",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "valid_date": {
+ "name": "valid_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "incoterms_code": {
+ "name": "incoterms_code",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "incoterms_description": {
+ "name": "incoterms_description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "short_list": {
+ "name": "short_list",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "return_yn": {
+ "name": "return_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "cp_request_yn": {
+ "name": "cp_request_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "prject_gtc_yn": {
+ "name": "prject_gtc_yn",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "return_revision": {
+ "name": "return_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_revision": {
+ "name": "rfq_revision",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gtc": {
+ "name": "gtc",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "gtc_valid_date": {
+ "name": "gtc_valid_date",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "classification": {
+ "name": "classification",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "sparepart": {
+ "name": "sparepart",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "\n SELECT \n br.id as rfq_id,\n br.rfq_code,\n br.status as rfq_status,\n ir.id as initial_rfq_id,\n ir.initial_rfq_status,\n ir.vendor_id,\n v.vendor_code,\n v.vendor_name,\n v.country as vendor_country,\n v.business_size as vendor_business_size,\n v.vendor_category as vendor_category,\n ir.due_date,\n ir.valid_date,\n ir.incoterms_code,\n inc.description as incoterms_description,\n ir.short_list,\n ir.return_yn,\n ir.cp_request_yn,\n ir.prject_gtc_yn,\n ir.return_revision,\n ir.rfq_revision,\n ir.gtc,\n ir.gtc_valid_date,\n ir.classification,\n ir.sparepart,\n ir.created_at,\n ir.updated_at\n FROM b_rfqs br\n JOIN initial_rfq ir ON br.id = ir.rfq_id\n LEFT JOIN vendors_with_types v ON ir.vendor_id = v.id\n LEFT JOIN incoterms inc ON ir.incoterms_code = inc.code\n",
+ "name": "initial_rfq_detail",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.rfq_dashboard": {
+ "columns": {
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_code": {
+ "name": "project_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_name": {
+ "name": "project_name",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_no": {
+ "name": "package_no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "package_name": {
+ "name": "package_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pic_code": {
+ "name": "pic_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pic_name": {
+ "name": "pic_name",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "eng_pic_name": {
+ "name": "eng_pic_name",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_company": {
+ "name": "project_company",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_flag": {
+ "name": "project_flag",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "project_site": {
+ "name": "project_site",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_attachments": {
+ "name": "total_attachments",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "initial_vendor_count": {
+ "name": "initial_vendor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_vendor_count": {
+ "name": "final_vendor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "initial_response_rate": {
+ "name": "initial_response_rate",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_response_rate": {
+ "name": "final_response_rate",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "overall_progress": {
+ "name": "overall_progress",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "days_to_deadline": {
+ "name": "days_to_deadline",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_by_name": {
+ "name": "updated_by_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "updated_by_email": {
+ "name": "updated_by_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "\n -- ② SELECT 절 확장 -------------------------------------------\n SELECT\n br.id AS rfq_id,\n br.rfq_code,\n br.description,\n br.status,\n br.due_date,\n p.code AS project_code,\n p.name AS project_name,\n br.package_no,\n br.package_name,\n br.pic_code,\n br.pic_name,\n br.eng_pic_name,\n br.project_company,\n br.project_flag,\n br.project_site,\n br.remark,\n \n -- 첨부/벤더 요약 -----------------------\n COALESCE(att_count.total_attachments, 0) AS total_attachments,\n COALESCE(init_summary.vendor_count, 0) AS initial_vendor_count,\n COALESCE(final_summary.vendor_count, 0) AS final_vendor_count,\n COALESCE(init_summary.avg_response_rate, 0) AS initial_response_rate,\n COALESCE(final_summary.avg_response_rate, 0) AS final_response_rate,\n \n -- 진행률·마감까지 일수 --------------\n CASE \n WHEN br.status = 'DRAFT' THEN 0\n WHEN br.status = 'Doc. Received' THEN 10\n WHEN br.status = 'PIC Assigned' THEN 20\n WHEN br.status = 'Doc. Confirmed' THEN 30\n WHEN br.status = 'Init. RFQ Sent' THEN 40\n WHEN br.status = 'Init. RFQ Answered' THEN 50\n WHEN br.status = 'TBE started' THEN 60\n WHEN br.status = 'TBE finished' THEN 70\n WHEN br.status = 'Final RFQ Sent' THEN 80\n WHEN br.status = 'Quotation Received' THEN 90\n WHEN br.status = 'Vendor Selected' THEN 100\n ELSE 0\n END AS overall_progress,\n (br.due_date - CURRENT_DATE) AS days_to_deadline,\n \n br.created_at,\n br.updated_at,\n \n -- 💡 추가되는 컬럼 -------------------\n upd.name AS updated_by_name,\n upd.email AS updated_by_email\n FROM b_rfqs br\n LEFT JOIN projects p ON br.project_id = p.id\n \n -- ③ 사용자 정보 조인 --------------------\n LEFT JOIN users upd ON br.updated_by = upd.id\n \n -- (나머지 이미 있던 JOIN 들은 그대로) -----\n LEFT JOIN (\n SELECT rfq_id, COUNT(*) AS total_attachments\n FROM b_rfq_attachments\n GROUP BY rfq_id\n ) att_count ON br.id = att_count.rfq_id\n \n LEFT JOIN (\n SELECT \n rfq_id, \n COUNT(DISTINCT vendor_id) AS vendor_count,\n AVG(response_rate) AS avg_response_rate\n FROM vendor_response_summary\n WHERE rfq_type = 'INITIAL'\n GROUP BY rfq_id\n ) init_summary ON br.id = init_summary.rfq_id\n \n LEFT JOIN (\n SELECT \n rfq_id, \n COUNT(DISTINCT vendor_id) AS vendor_count,\n AVG(response_rate) AS avg_response_rate\n FROM vendor_response_summary\n WHERE rfq_type = 'FINAL'\n GROUP BY rfq_id\n ) final_summary ON br.id = final_summary.rfq_id\n ",
+ "name": "rfq_dashboard",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.rfq_progress_summary": {
+ "columns": {
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_status": {
+ "name": "rfq_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "due_date": {
+ "name": "due_date",
+ "type": "date",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "days_to_deadline": {
+ "name": "days_to_deadline",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_attachments": {
+ "name": "total_attachments",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachments_with_multiple_revisions": {
+ "name": "attachments_with_multiple_revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_client_revisions": {
+ "name": "total_client_revisions",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "initial_vendor_count": {
+ "name": "initial_vendor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "initial_total_responses": {
+ "name": "initial_total_responses",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "initial_responded_count": {
+ "name": "initial_responded_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "initial_up_to_date_count": {
+ "name": "initial_up_to_date_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "initial_version_mismatch_count": {
+ "name": "initial_version_mismatch_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "initial_response_rate": {
+ "name": "initial_response_rate",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "initial_version_match_rate": {
+ "name": "initial_version_match_rate",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_vendor_count": {
+ "name": "final_vendor_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_total_responses": {
+ "name": "final_total_responses",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_responded_count": {
+ "name": "final_responded_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_up_to_date_count": {
+ "name": "final_up_to_date_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_version_mismatch_count": {
+ "name": "final_version_mismatch_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_response_rate": {
+ "name": "final_response_rate",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_version_match_rate": {
+ "name": "final_version_match_rate",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_response_files": {
+ "name": "total_response_files",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "\n SELECT \n br.id as rfq_id,\n br.rfq_code,\n br.status as rfq_status,\n br.due_date,\n (br.due_date - CURRENT_DATE) as days_to_deadline,\n \n -- 첨부파일 통계\n attachment_stats.total_attachments,\n attachment_stats.attachments_with_multiple_revisions,\n attachment_stats.total_client_revisions,\n \n -- Initial RFQ 통계\n COALESCE(initial_stats.vendor_count, 0) as initial_vendor_count,\n COALESCE(initial_stats.total_responses, 0) as initial_total_responses,\n COALESCE(initial_stats.responded_count, 0) as initial_responded_count,\n COALESCE(initial_stats.up_to_date_count, 0) as initial_up_to_date_count,\n COALESCE(initial_stats.version_mismatch_count, 0) as initial_version_mismatch_count,\n COALESCE(initial_stats.response_rate, 0) as initial_response_rate,\n COALESCE(initial_stats.version_match_rate, 0) as initial_version_match_rate,\n \n -- Final RFQ 통계\n COALESCE(final_stats.vendor_count, 0) as final_vendor_count,\n COALESCE(final_stats.total_responses, 0) as final_total_responses,\n COALESCE(final_stats.responded_count, 0) as final_responded_count,\n COALESCE(final_stats.up_to_date_count, 0) as final_up_to_date_count,\n COALESCE(final_stats.version_mismatch_count, 0) as final_version_mismatch_count,\n COALESCE(final_stats.response_rate, 0) as final_response_rate,\n COALESCE(final_stats.version_match_rate, 0) as final_version_match_rate,\n \n COALESCE(file_stats.total_files, 0) as total_response_files\n \n FROM b_rfqs br\n LEFT JOIN (\n SELECT \n ba.rfq_id,\n COUNT(*) as total_attachments,\n COUNT(CASE WHEN rev_count.total_revisions > 1 THEN 1 END) as attachments_with_multiple_revisions,\n SUM(rev_count.total_revisions) as total_client_revisions\n FROM b_rfq_attachments ba\n LEFT JOIN (\n SELECT \n attachment_id,\n COUNT(*) as total_revisions\n FROM b_rfq_attachment_revisions\n GROUP BY attachment_id\n ) rev_count ON ba.id = rev_count.attachment_id\n GROUP BY ba.rfq_id\n ) attachment_stats ON br.id = attachment_stats.rfq_id\n \n LEFT JOIN (\n SELECT \n br.id as rfq_id,\n COUNT(DISTINCT var.vendor_id) as vendor_count,\n COUNT(*) as total_responses,\n COUNT(CASE WHEN var.response_status = 'RESPONDED' THEN 1 END) as responded_count,\n COUNT(CASE WHEN vrd.effective_status = 'UP_TO_DATE' THEN 1 END) as up_to_date_count,\n COUNT(CASE WHEN vrd.effective_status = 'VERSION_MISMATCH' THEN 1 END) as version_mismatch_count,\n ROUND(\n COUNT(CASE WHEN var.response_status = 'RESPONDED' THEN 1 END) * 100.0 / \n NULLIF(COUNT(*), 0), 2\n ) as response_rate,\n ROUND(\n COUNT(CASE WHEN vrd.effective_status = 'UP_TO_DATE' THEN 1 END) * 100.0 / \n NULLIF(COUNT(CASE WHEN var.response_status = 'RESPONDED' THEN 1 END), 0), 2\n ) as version_match_rate\n FROM b_rfqs br\n JOIN vendor_response_detail vrd ON br.id = vrd.rfq_id\n JOIN vendor_attachment_responses var ON vrd.response_id = var.id\n WHERE var.rfq_type = 'INITIAL'\n GROUP BY br.id\n ) initial_stats ON br.id = initial_stats.rfq_id\n \n LEFT JOIN (\n SELECT \n br.id as rfq_id,\n COUNT(DISTINCT var.vendor_id) as vendor_count,\n COUNT(*) as total_responses,\n COUNT(CASE WHEN var.response_status = 'RESPONDED' THEN 1 END) as responded_count,\n COUNT(CASE WHEN vrd.effective_status = 'UP_TO_DATE' THEN 1 END) as up_to_date_count,\n COUNT(CASE WHEN vrd.effective_status = 'VERSION_MISMATCH' THEN 1 END) as version_mismatch_count,\n ROUND(\n COUNT(CASE WHEN var.response_status = 'RESPONDED' THEN 1 END) * 100.0 / \n NULLIF(COUNT(*), 0), 2\n ) as response_rate,\n ROUND(\n COUNT(CASE WHEN vrd.effective_status = 'UP_TO_DATE' THEN 1 END) * 100.0 / \n NULLIF(COUNT(CASE WHEN var.response_status = 'RESPONDED' THEN 1 END), 0), 2\n ) as version_match_rate\n FROM b_rfqs br\n JOIN vendor_response_detail vrd ON br.id = vrd.rfq_id\n JOIN vendor_attachment_responses var ON vrd.response_id = var.id\n WHERE var.rfq_type = 'FINAL'\n GROUP BY br.id\n ) final_stats ON br.id = final_stats.rfq_id\n \n LEFT JOIN (\n SELECT \n br.id as rfq_id,\n COUNT(vra.id) as total_files\n FROM b_rfqs br\n JOIN b_rfq_attachments ba ON br.id = ba.rfq_id\n JOIN vendor_attachment_responses var ON ba.id = var.attachment_id\n LEFT JOIN vendor_response_attachments_b vra ON var.id = vra.vendor_response_id\n GROUP BY br.id\n ) file_stats ON br.id = file_stats.rfq_id\n",
+ "name": "rfq_progress_summary",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_response_attachments_enhanced": {
+ "columns": {
+ "response_attachment_id": {
+ "name": "response_attachment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_response_id": {
+ "name": "vendor_response_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_name": {
+ "name": "file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "original_file_name": {
+ "name": "original_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_path": {
+ "name": "file_path",
+ "type": "varchar(512)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_size": {
+ "name": "file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_type": {
+ "name": "file_type",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "description": {
+ "name": "description",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "uploaded_at": {
+ "name": "uploaded_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_id": {
+ "name": "attachment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_type": {
+ "name": "rfq_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_record_id": {
+ "name": "rfq_record_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response_status": {
+ "name": "response_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_revision": {
+ "name": "current_revision",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "responded_revision": {
+ "name": "responded_revision",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response_comment": {
+ "name": "response_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_comment": {
+ "name": "vendor_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_request_comment": {
+ "name": "revision_request_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requested_at": {
+ "name": "requested_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "responded_at": {
+ "name": "responded_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_requested_at": {
+ "name": "revision_requested_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_type": {
+ "name": "attachment_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "serial_no": {
+ "name": "serial_no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_country": {
+ "name": "vendor_country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_client_revision_id": {
+ "name": "latest_client_revision_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_client_revision_no": {
+ "name": "latest_client_revision_no",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_client_file_name": {
+ "name": "latest_client_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_version_matched": {
+ "name": "is_version_matched",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "version_lag": {
+ "name": "version_lag",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "needs_update": {
+ "name": "needs_update",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "file_sequence": {
+ "name": "file_sequence",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_latest_response_file": {
+ "name": "is_latest_response_file",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "\n SELECT \n vra.id as response_attachment_id,\n vra.vendor_response_id,\n vra.file_name,\n vra.original_file_name,\n vra.file_path,\n vra.file_size,\n vra.file_type,\n vra.description,\n vra.uploaded_at,\n \n -- 응답 기본 정보\n var.attachment_id,\n var.vendor_id,\n var.rfq_type,\n var.rfq_record_id,\n var.response_status,\n var.current_revision,\n var.responded_revision,\n \n -- 코멘트 (새로 추가된 필드 포함)\n var.response_comment,\n var.vendor_comment,\n var.revision_request_comment,\n \n -- 날짜 (새로 추가된 필드 포함)\n var.requested_at,\n var.responded_at,\n var.revision_requested_at,\n \n -- 첨부파일 정보\n ba.attachment_type,\n ba.serial_no,\n ba.rfq_id,\n \n -- 벤더 정보\n v.vendor_code,\n v.vendor_name,\n v.country as vendor_country,\n \n -- 발주처 현재 리비전 정보\n latest_rev.id as latest_client_revision_id,\n latest_rev.revision_no as latest_client_revision_no,\n latest_rev.original_file_name as latest_client_file_name,\n \n -- 리비전 비교\n CASE \n WHEN var.responded_revision = ba.current_revision THEN true \n ELSE false \n END as is_version_matched,\n \n -- 버전 차이 계산 (Rev.0, Rev.1 형태 가정)\n CASE \n WHEN var.responded_revision IS NULL THEN NULL\n WHEN ba.current_revision IS NULL THEN NULL\n ELSE CAST(SUBSTRING(ba.current_revision FROM '[0-9]+') AS INTEGER) - \n CAST(SUBSTRING(var.responded_revision FROM '[0-9]+') AS INTEGER)\n END as version_lag,\n \n CASE \n WHEN var.response_status = 'RESPONDED' \n AND var.responded_revision != ba.current_revision THEN true \n ELSE false \n END as needs_update,\n \n -- 파일 순서\n ROW_NUMBER() OVER (\n PARTITION BY var.id \n ORDER BY vra.uploaded_at DESC\n ) as file_sequence,\n \n -- 최신 응답 파일 여부\n CASE \n WHEN ROW_NUMBER() OVER (\n PARTITION BY var.id \n ORDER BY vra.uploaded_at DESC\n ) = 1 THEN true \n ELSE false \n END as is_latest_response_file\n \n FROM vendor_response_attachments_b vra\n JOIN vendor_attachment_responses var ON vra.vendor_response_id = var.id\n JOIN b_rfq_attachments ba ON var.attachment_id = ba.id\n LEFT JOIN vendors v ON var.vendor_id = v.id\n LEFT JOIN b_rfq_attachment_revisions latest_rev ON ba.latest_revision_id = latest_rev.id\n",
+ "name": "vendor_response_attachments_enhanced",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_response_detail": {
+ "columns": {
+ "response_id": {
+ "name": "response_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_type": {
+ "name": "rfq_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_record_id": {
+ "name": "rfq_record_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_id": {
+ "name": "attachment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_type": {
+ "name": "attachment_type",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "serial_no": {
+ "name": "serial_no",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "attachment_description": {
+ "name": "attachment_description",
+ "type": "varchar(500)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_country": {
+ "name": "vendor_country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response_status": {
+ "name": "response_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "current_revision": {
+ "name": "current_revision",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "responded_revision": {
+ "name": "responded_revision",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response_comment": {
+ "name": "response_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_comment": {
+ "name": "vendor_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_request_comment": {
+ "name": "revision_request_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "requested_at": {
+ "name": "requested_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "responded_at": {
+ "name": "responded_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_requested_at": {
+ "name": "revision_requested_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_client_revision_no": {
+ "name": "latest_client_revision_no",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_client_file_name": {
+ "name": "latest_client_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_client_file_size": {
+ "name": "latest_client_file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_client_revision_comment": {
+ "name": "latest_client_revision_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "is_version_matched": {
+ "name": "is_version_matched",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "version_lag": {
+ "name": "version_lag",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "needs_update": {
+ "name": "needs_update",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "has_multiple_revisions": {
+ "name": "has_multiple_revisions",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_response_files": {
+ "name": "total_response_files",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_response_file_name": {
+ "name": "latest_response_file_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_response_file_size": {
+ "name": "latest_response_file_size",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "latest_response_uploaded_at": {
+ "name": "latest_response_uploaded_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "effective_status": {
+ "name": "effective_status",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "\n SELECT \n var.id as response_id,\n ba.rfq_id,\n br.rfq_code,\n var.rfq_type,\n var.rfq_record_id,\n \n -- 첨부파일 정보\n ba.id as attachment_id,\n ba.attachment_type,\n ba.serial_no,\n ba.description as attachment_description,\n \n -- 벤더 정보\n v.id as vendor_id,\n v.vendor_code,\n v.vendor_name,\n v.country as vendor_country,\n \n -- 응답 상태\n var.response_status,\n var.current_revision,\n var.responded_revision,\n \n -- 코멘트 (새로 추가된 필드 포함)\n var.response_comment,\n var.vendor_comment,\n var.revision_request_comment,\n \n -- 날짜 (새로 추가된 필드 포함)\n var.requested_at,\n var.responded_at,\n var.revision_requested_at,\n \n -- 발주처 최신 리비전\n latest_rev.revision_no as latest_client_revision_no,\n latest_rev.original_file_name as latest_client_file_name,\n latest_rev.file_size as latest_client_file_size,\n latest_rev.revision_comment as latest_client_revision_comment,\n \n -- 리비전 분석\n CASE \n WHEN var.responded_revision = ba.current_revision THEN true \n ELSE false \n END as is_version_matched,\n \n CASE \n WHEN var.responded_revision IS NULL OR ba.current_revision IS NULL THEN NULL\n ELSE CAST(SUBSTRING(ba.current_revision FROM '[0-9]+') AS INTEGER) - \n CAST(SUBSTRING(var.responded_revision FROM '[0-9]+') AS INTEGER)\n END as version_lag,\n \n CASE \n WHEN var.response_status = 'RESPONDED' \n AND var.responded_revision != ba.current_revision THEN true \n ELSE false \n END as needs_update,\n \n CASE \n WHEN revision_count.total_revisions > 1 THEN true \n ELSE false \n END as has_multiple_revisions,\n \n -- 응답 파일 정보\n COALESCE(file_stats.total_files, 0) as total_response_files,\n file_stats.latest_file_name as latest_response_file_name,\n file_stats.latest_file_size as latest_response_file_size,\n file_stats.latest_uploaded_at as latest_response_uploaded_at,\n \n -- 효과적인 상태\n CASE \n WHEN var.response_status = 'NOT_RESPONDED' THEN 'NOT_RESPONDED'\n WHEN var.response_status = 'WAIVED' THEN 'WAIVED'\n WHEN var.response_status = 'REVISION_REQUESTED' THEN 'REVISION_REQUESTED'\n WHEN var.response_status = 'RESPONDED' AND var.responded_revision = ba.current_revision THEN 'UP_TO_DATE'\n WHEN var.response_status = 'RESPONDED' AND var.responded_revision != ba.current_revision THEN 'VERSION_MISMATCH'\n ELSE var.response_status\n END as effective_status\n \n FROM vendor_attachment_responses var\n JOIN b_rfq_attachments ba ON var.attachment_id = ba.id\n JOIN b_rfqs br ON ba.rfq_id = br.id\n LEFT JOIN vendors v ON var.vendor_id = v.id\n LEFT JOIN b_rfq_attachment_revisions latest_rev ON ba.latest_revision_id = latest_rev.id\n LEFT JOIN (\n SELECT \n attachment_id,\n COUNT(*) as total_revisions\n FROM b_rfq_attachment_revisions\n GROUP BY attachment_id\n ) revision_count ON ba.id = revision_count.attachment_id\n LEFT JOIN (\n SELECT \n vendor_response_id,\n COUNT(*) as total_files,\n MAX(original_file_name) as latest_file_name,\n MAX(file_size) as latest_file_size,\n MAX(uploaded_at) as latest_uploaded_at\n FROM vendor_response_attachments_b\n GROUP BY vendor_response_id\n ) file_stats ON var.id = file_stats.vendor_response_id\n",
+ "name": "vendor_response_detail",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.vendor_response_summary": {
+ "columns": {
+ "rfq_id": {
+ "name": "rfq_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_code": {
+ "name": "rfq_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_status": {
+ "name": "rfq_status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_country": {
+ "name": "vendor_country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "vendor_business_size": {
+ "name": "vendor_business_size",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "rfq_type": {
+ "name": "rfq_type",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "total_attachments": {
+ "name": "total_attachments",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "responded_count": {
+ "name": "responded_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "pending_count": {
+ "name": "pending_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "waived_count": {
+ "name": "waived_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "revision_requested_count": {
+ "name": "revision_requested_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "response_rate": {
+ "name": "response_rate",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "completion_rate": {
+ "name": "completion_rate",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "\n SELECT \n br.id as rfq_id,\n br.rfq_code,\n br.status as rfq_status,\n v.id as vendor_id,\n v.vendor_code,\n v.vendor_name,\n v.country as vendor_country,\n v.business_size as vendor_business_size,\n var.rfq_type,\n COUNT(var.id) as total_attachments,\n COUNT(CASE WHEN var.response_status = 'RESPONDED' THEN 1 END) as responded_count,\n COUNT(CASE WHEN var.response_status = 'NOT_RESPONDED' THEN 1 END) as pending_count,\n COUNT(CASE WHEN var.response_status = 'WAIVED' THEN 1 END) as waived_count,\n COUNT(CASE WHEN var.response_status = 'REVISION_REQUESTED' THEN 1 END) as revision_requested_count,\n ROUND(\n (COUNT(CASE WHEN var.response_status = 'RESPONDED' THEN 1 END) * 100.0 / \n NULLIF(COUNT(CASE WHEN var.response_status != 'WAIVED' THEN 1 END), 0)), \n 2\n ) as response_rate,\n ROUND(\n ((COUNT(CASE WHEN var.response_status = 'RESPONDED' THEN 1 END) + \n COUNT(CASE WHEN var.response_status = 'WAIVED' THEN 1 END)) * 100.0 / COUNT(var.id)), \n 2\n ) as completion_rate\n FROM b_rfqs br\n JOIN b_rfq_attachments bra ON br.id = bra.rfq_id\n JOIN vendor_attachment_responses var ON bra.id = var.attachment_id\n JOIN vendors v ON var.vendor_id = v.id\n GROUP BY br.id, br.rfq_code, br.status, v.id, v.vendor_code, v.vendor_name, v.country, v.business_size, var.rfq_type\n",
+ "name": "vendor_response_summary",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.tech_vendor_candidates_with_vendor_info": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "company_name": {
+ "name": "company_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "contact_email": {
+ "name": "contact_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "contact_phone": {
+ "name": "contact_phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_id": {
+ "name": "tax_id",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country": {
+ "name": "country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'COLLECTED'"
+ },
+ "remark": {
+ "name": "remark",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "select \"tech_vendor_candidates\".\"id\", \"tech_vendor_candidates\".\"company_name\", \"tech_vendor_candidates\".\"contact_email\", \"tech_vendor_candidates\".\"contact_phone\", \"tech_vendor_candidates\".\"tax_id\", \"tech_vendor_candidates\".\"country\", \"tech_vendor_candidates\".\"status\", \"tech_vendor_candidates\".\"remark\", \"tech_vendor_candidates\".\"created_at\", \"tech_vendor_candidates\".\"updated_at\", \"tech_vendors\".\"vendor_name\", \"tech_vendors\".\"vendor_code\", \"tech_vendors\".\"created_at\" as \"vendor_created_at\" from \"tech_vendor_candidates\" left join \"tech_vendors\" on \"tech_vendor_candidates\".\"vendor_id\" = \"tech_vendors\".\"id\"",
+ "name": "tech_vendor_candidates_with_vendor_info",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.tech_vendor_detail_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "tax_id": {
+ "name": "tax_id",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "address": {
+ "name": "address",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country": {
+ "name": "country",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country_eng": {
+ "name": "country_eng",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "country_fab": {
+ "name": "country_fab",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_name": {
+ "name": "agent_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_phone": {
+ "name": "agent_phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "agent_email": {
+ "name": "agent_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "phone": {
+ "name": "phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "website": {
+ "name": "website",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'ACTIVE'"
+ },
+ "tech_vendor_type": {
+ "name": "tech_vendor_type",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "representative_name": {
+ "name": "representative_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_email": {
+ "name": "representative_email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_phone": {
+ "name": "representative_phone",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "representative_birth": {
+ "name": "representative_birth",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "definition": "select \"id\", \"vendor_name\", \"vendor_code\", \"tax_id\", \"address\", \"country\", \"country_eng\", \"country_fab\", \"agent_name\", \"agent_phone\", \"agent_email\", \"phone\", \"email\", \"website\", \"status\", \"tech_vendor_type\", \"representative_name\", \"representative_email\", \"representative_phone\", \"representative_birth\", \"created_at\", \"updated_at\", \n (SELECT COALESCE(\n json_agg(\n json_build_object(\n 'id', c.id,\n 'contactName', c.contact_name,\n 'contactPosition', c.contact_position,\n 'contactEmail', c.contact_email,\n 'contactPhone', c.contact_phone,\n 'isPrimary', c.is_primary\n )\n ),\n '[]'::json\n )\n FROM vendor_contacts c\n WHERE c.vendor_id = tech_vendors.id)\n as \"contacts\", \n (SELECT COALESCE(\n json_agg(\n json_build_object(\n 'id', a.id,\n 'fileName', a.file_name,\n 'filePath', a.file_path,\n 'attachmentType', a.attachment_type,\n 'createdAt', a.created_at\n )\n ORDER BY a.attachment_type, a.created_at DESC\n ),\n '[]'::json\n )\n FROM tech_vendor_attachments a\n WHERE a.vendor_id = tech_vendors.id)\n as \"attachments\", \n (SELECT COUNT(*)\n FROM tech_vendor_attachments a\n WHERE a.vendor_id = tech_vendors.id)\n as \"attachment_count\", \n (SELECT COUNT(*) \n FROM vendor_contacts c\n WHERE c.vendor_id = tech_vendors.id)\n as \"contact_count\", \n (SELECT COALESCE(\n json_agg(\n json_build_object(\n 'itemCode', i.item_code\n )\n ),\n '[]'::json\n )\n FROM tech_vendor_possible_items i\n LEFT JOIN items it ON i.item_code = it.item_code\n WHERE i.vendor_id = tech_vendors.id)\n as \"possible_items\", \n (SELECT COUNT(*) \n FROM tech_vendor_possible_items i\n WHERE i.vendor_id = tech_vendors.id)\n as \"item_count\" from \"tech_vendors\"",
+ "name": "tech_vendor_detail_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.tech_vendor_items_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "item_code": {
+ "name": "item_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "definition": "select \"tech_vendor_possible_items\".\"id\", \"tech_vendor_possible_items\".\"vendor_id\", \"items\".\"item_code\", \"tech_vendor_possible_items\".\"created_at\", \"tech_vendor_possible_items\".\"updated_at\" from \"tech_vendor_possible_items\" left join \"items\" on \"tech_vendor_possible_items\".\"item_code\" = \"items\".\"item_code\"",
+ "name": "tech_vendor_items_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.esg_evaluations_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "serial_number": {
+ "name": "serial_number",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "category": {
+ "name": "category",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "inspection_item": {
+ "name": "inspection_item",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "definition": "select \"esg_evaluations\".\"id\", \"esg_evaluations\".\"serial_number\", \"esg_evaluations\".\"category\", \"esg_evaluations\".\"inspection_item\", \"esg_evaluations\".\"is_active\", \"esg_evaluations\".\"created_at\", \"esg_evaluations\".\"updated_at\", count(distinct \"esg_evaluation_items\".\"id\") as \"total_evaluation_items\", count(\"esg_answer_options\".\"id\") as \"total_answer_options\", coalesce(sum(\"esg_answer_options\".\"score\"), 0) as \"max_possible_score\", \n (\n SELECT array_agg(evaluation_item order by order_index) \n FROM esg_evaluation_items \n WHERE esg_evaluation_id = \"esg_evaluations\".\"id\" \n AND is_active = true \n AND evaluation_item is not null\n )\n as \"evaluation_items_list\" from \"esg_evaluations\" left join \"esg_evaluation_items\" on \"esg_evaluations\".\"id\" = \"esg_evaluation_items\".\"esg_evaluation_id\" AND \"esg_evaluation_items\".\"is_active\" = true left join \"esg_answer_options\" on \"esg_evaluation_items\".\"id\" = \"esg_answer_options\".\"esg_evaluation_item_id\" AND \"esg_answer_options\".\"is_active\" = true group by \"esg_evaluations\".\"id\", \"esg_evaluations\".\"serial_number\", \"esg_evaluations\".\"category\", \"esg_evaluations\".\"inspection_item\", \"esg_evaluations\".\"is_active\", \"esg_evaluations\".\"created_at\", \"esg_evaluations\".\"updated_at\"",
+ "name": "esg_evaluations_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.evaluation_targets_with_departments": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "evaluation_year": {
+ "name": "evaluation_year",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "division": {
+ "name": "division",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domestic_foreign": {
+ "name": "domestic_foreign",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "material_type": {
+ "name": "material_type",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PENDING'"
+ },
+ "consensus_status": {
+ "name": "consensus_status",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "admin_comment": {
+ "name": "admin_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "consolidated_comment": {
+ "name": "consolidated_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirmed_at": {
+ "name": "confirmed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirmed_by": {
+ "name": "confirmed_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ld_claim_count": {
+ "name": "ld_claim_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "ld_claim_amount": {
+ "name": "ld_claim_amount",
+ "type": "numeric(15, 2)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'0'"
+ },
+ "ld_claim_currency": {
+ "name": "ld_claim_currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'KRW'"
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ }
+ },
+ "definition": "select \"evaluation_targets\".\"id\", \"evaluation_targets\".\"evaluation_year\", \"evaluation_targets\".\"division\", \"evaluation_targets\".\"vendor_code\", \"evaluation_targets\".\"vendor_name\", \"evaluation_targets\".\"domestic_foreign\", \"evaluation_targets\".\"material_type\", \"evaluation_targets\".\"status\", \"evaluation_targets\".\"consensus_status\", \"evaluation_targets\".\"admin_comment\", \"evaluation_targets\".\"consolidated_comment\", \"evaluation_targets\".\"confirmed_at\", \"evaluation_targets\".\"confirmed_by\", \"evaluation_targets\".\"ld_claim_count\", \"evaluation_targets\".\"ld_claim_amount\", \"evaluation_targets\".\"ld_claim_currency\", \"evaluation_targets\".\"created_at\", \"evaluation_targets\".\"updated_at\", order_reviewer.name as \"order_reviewer_name\", order_reviewer.email as \"order_reviewer_email\", order_etr.department_name_from as \"order_department_name\", order_review.is_approved as \"order_is_approved\", order_review.reviewed_at as \"order_reviewed_at\", procurement_reviewer.name as \"procurement_reviewer_name\", procurement_reviewer.email as \"procurement_reviewer_email\", procurement_etr.department_name_from as \"procurement_department_name\", procurement_review.is_approved as \"procurement_is_approved\", procurement_review.reviewed_at as \"procurement_reviewed_at\", quality_reviewer.name as \"quality_reviewer_name\", quality_reviewer.email as \"quality_reviewer_email\", quality_etr.department_name_from as \"quality_department_name\", quality_review.is_approved as \"quality_is_approved\", quality_review.reviewed_at as \"quality_reviewed_at\", design_reviewer.name as \"design_reviewer_name\", design_reviewer.email as \"design_reviewer_email\", design_etr.department_name_from as \"design_department_name\", design_review.is_approved as \"design_is_approved\", design_review.reviewed_at as \"design_reviewed_at\", cs_reviewer.name as \"cs_reviewer_name\", cs_reviewer.email as \"cs_reviewer_email\", cs_etr.department_name_from as \"cs_department_name\", cs_review.is_approved as \"cs_is_approved\", cs_review.reviewed_at as \"cs_reviewed_at\" from \"evaluation_targets\" left join evaluation_target_reviewers order_etr on \"evaluation_targets\".\"id\" = order_etr.evaluation_target_id AND order_etr.department_code = 'ORDER_EVAL' left join users order_reviewer on order_etr.reviewer_user_id = order_reviewer.id left join evaluation_target_reviews order_review on \"evaluation_targets\".\"id\" = order_review.evaluation_target_id AND order_review.reviewer_user_id = order_reviewer.id left join evaluation_target_reviewers procurement_etr on \"evaluation_targets\".\"id\" = procurement_etr.evaluation_target_id AND procurement_etr.department_code = 'PROCUREMENT_EVAL' left join users procurement_reviewer on procurement_etr.reviewer_user_id = procurement_reviewer.id left join evaluation_target_reviews procurement_review on \"evaluation_targets\".\"id\" = procurement_review.evaluation_target_id AND procurement_review.reviewer_user_id = procurement_reviewer.id left join evaluation_target_reviewers quality_etr on \"evaluation_targets\".\"id\" = quality_etr.evaluation_target_id AND quality_etr.department_code = 'QUALITY_EVAL' left join users quality_reviewer on quality_etr.reviewer_user_id = quality_reviewer.id left join evaluation_target_reviews quality_review on \"evaluation_targets\".\"id\" = quality_review.evaluation_target_id AND quality_review.reviewer_user_id = quality_reviewer.id left join evaluation_target_reviewers design_etr on \"evaluation_targets\".\"id\" = design_etr.evaluation_target_id AND design_etr.department_code = 'DESIGN_EVAL' left join users design_reviewer on design_etr.reviewer_user_id = design_reviewer.id left join evaluation_target_reviews design_review on \"evaluation_targets\".\"id\" = design_review.evaluation_target_id AND design_review.reviewer_user_id = design_reviewer.id left join evaluation_target_reviewers cs_etr on \"evaluation_targets\".\"id\" = cs_etr.evaluation_target_id AND cs_etr.department_code = 'CS_EVAL' left join users cs_reviewer on cs_etr.reviewer_user_id = cs_reviewer.id left join evaluation_target_reviews cs_review on \"evaluation_targets\".\"id\" = cs_review.evaluation_target_id AND cs_review.reviewer_user_id = cs_reviewer.id",
+ "name": "evaluation_targets_with_departments",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.periodic_evaluations_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "evaluation_target_id": {
+ "name": "evaluation_target_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "evaluation_year": {
+ "name": "evaluation_year",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "division": {
+ "name": "division",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domestic_foreign": {
+ "name": "domestic_foreign",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "material_type": {
+ "name": "material_type",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "evaluation_period": {
+ "name": "evaluation_period",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "documents_submitted": {
+ "name": "documents_submitted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "submission_date": {
+ "name": "submission_date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "submission_deadline": {
+ "name": "submission_deadline",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_score": {
+ "name": "final_score",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_grade": {
+ "name": "final_grade",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PENDING'"
+ },
+ "review_completed_at": {
+ "name": "review_completed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "finalized_at": {
+ "name": "finalized_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "finalized_by": {
+ "name": "finalized_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_note": {
+ "name": "evaluation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "admin_comment": {
+ "name": "admin_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "consolidated_comment": {
+ "name": "consolidated_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "consensus_status": {
+ "name": "consensus_status",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirmed_at": {
+ "name": "confirmed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "definition": "select \"periodic_evaluations\".\"id\", \"periodic_evaluations\".\"evaluation_target_id\", \"evaluation_targets\".\"evaluation_year\", \"evaluation_targets\".\"division\", \"evaluation_targets\".\"vendor_id\", \"evaluation_targets\".\"vendor_code\", \"evaluation_targets\".\"vendor_name\", \"evaluation_targets\".\"domestic_foreign\", \"evaluation_targets\".\"material_type\", \"periodic_evaluations\".\"evaluation_period\", \"periodic_evaluations\".\"documents_submitted\", \"periodic_evaluations\".\"submission_date\", \"periodic_evaluations\".\"submission_deadline\", \"periodic_evaluations\".\"final_score\", \"periodic_evaluations\".\"final_grade\", (\n SELECT COALESCE(SUM(CAST(red.score AS DECIMAL(5,2))), 0)\n FROM \"reviewer_evaluation_details\" red\n JOIN \"reg_eval_criteria_details\" recd ON red.reg_eval_criteria_details_id = recd.id\n JOIN \"reg_eval_criteria\" rec ON recd.criteria_id = rec.id\n JOIN \"reviewer_evaluations\" re ON red.reviewer_evaluation_id = re.id\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND rec.category2 = 'processScore'\n AND re.is_completed = true\n ) as \"process_score\", (\n SELECT COALESCE(SUM(CAST(red.score AS DECIMAL(5,2))), 0)\n FROM \"reviewer_evaluation_details\" red\n JOIN \"reg_eval_criteria_details\" recd ON red.reg_eval_criteria_details_id = recd.id\n JOIN \"reg_eval_criteria\" rec ON recd.criteria_id = rec.id\n JOIN \"reviewer_evaluations\" re ON red.reviewer_evaluation_id = re.id\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND rec.category2 = 'priceScore'\n AND re.is_completed = true\n ) as \"price_score\", (\n SELECT COALESCE(SUM(CAST(red.score AS DECIMAL(5,2))), 0)\n FROM \"reviewer_evaluation_details\" red\n JOIN \"reg_eval_criteria_details\" recd ON red.reg_eval_criteria_details_id = recd.id\n JOIN \"reg_eval_criteria\" rec ON recd.criteria_id = rec.id\n JOIN \"reviewer_evaluations\" re ON red.reviewer_evaluation_id = re.id\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND rec.category2 = 'deliveryScore'\n AND re.is_completed = true\n ) as \"delivery_score\", (\n SELECT COALESCE(SUM(CAST(red.score AS DECIMAL(5,2))), 0)\n FROM \"reviewer_evaluation_details\" red\n JOIN \"reg_eval_criteria_details\" recd ON red.reg_eval_criteria_details_id = recd.id\n JOIN \"reg_eval_criteria\" rec ON recd.criteria_id = rec.id\n JOIN \"reviewer_evaluations\" re ON red.reviewer_evaluation_id = re.id\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND rec.category2 = 'selfEvaluationScore'\n AND re.is_completed = true\n ) as \"self_evaluation_score\", (\n SELECT COALESCE(SUM(CAST(red.score AS DECIMAL(5,2))), 0)\n FROM \"reviewer_evaluation_details\" red\n JOIN \"reg_eval_criteria_details\" recd ON red.reg_eval_criteria_details_id = recd.id\n JOIN \"reg_eval_criteria\" rec ON recd.criteria_id = rec.id\n JOIN \"reviewer_evaluations\" re ON red.reviewer_evaluation_id = re.id\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND rec.category2 = 'bonus'\n AND re.is_completed = true\n ) as \"participation_bonus\", (\n SELECT COALESCE(SUM(CAST(red.score AS DECIMAL(5,2))), 0)\n FROM \"reviewer_evaluation_details\" red\n JOIN \"reg_eval_criteria_details\" recd ON red.reg_eval_criteria_details_id = recd.id\n JOIN \"reg_eval_criteria\" rec ON recd.criteria_id = rec.id\n JOIN \"reviewer_evaluations\" re ON red.reviewer_evaluation_id = re.id\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND rec.category2 = 'penalty'\n AND re.is_completed = true\n ) as \"quality_deduction\", \"periodic_evaluations\".\"status\", \"periodic_evaluations\".\"review_completed_at\", \"periodic_evaluations\".\"finalized_at\", \"periodic_evaluations\".\"finalized_by\", \"periodic_evaluations\".\"evaluation_note\", \"periodic_evaluations\".\"created_at\", \"periodic_evaluations\".\"updated_at\", \"evaluation_targets\".\"admin_comment\", \"evaluation_targets\".\"consolidated_comment\", \"evaluation_targets\".\"consensus_status\", \"evaluation_targets\".\"confirmed_at\", (\n SELECT CASE\n WHEN re.id IS NULL THEN 'NOT_ASSIGNED'\n WHEN re.is_completed = true THEN 'COMPLETED'\n WHEN (\n SELECT COALESCE(SUM(CAST(red.score AS DECIMAL(5,2))), 0)\n FROM \"reviewer_evaluation_details\" red\n WHERE red.reviewer_evaluation_id = re.id\n ) > 0 THEN 'IN_PROGRESS'\n ELSE 'NOT_STARTED'\n END\n FROM \"reviewer_evaluations\" re\n JOIN \"evaluation_target_reviewers\" etr ON re.evaluation_target_reviewer_id = etr.id\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND etr.department_code = 'ORDER_EVAL'\n LIMIT 1\n ) as \"order_eval_status\", (\n SELECT CASE\n WHEN re.id IS NULL THEN 'NOT_ASSIGNED'\n WHEN re.is_completed = true THEN 'COMPLETED'\n WHEN (\n SELECT COALESCE(SUM(CAST(red.score AS DECIMAL(5,2))), 0)\n FROM \"reviewer_evaluation_details\" red\n WHERE red.reviewer_evaluation_id = re.id\n ) > 0 THEN 'IN_PROGRESS'\n ELSE 'NOT_STARTED'\n END\n FROM \"reviewer_evaluations\" re\n JOIN \"evaluation_target_reviewers\" etr ON re.evaluation_target_reviewer_id = etr.id\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND etr.department_code = 'PROCUREMENT_EVAL'\n LIMIT 1\n ) as \"procurement_eval_status\", (\n SELECT CASE\n WHEN re.id IS NULL THEN 'NOT_ASSIGNED'\n WHEN re.is_completed = true THEN 'COMPLETED'\n WHEN (\n SELECT COALESCE(SUM(CAST(red.score AS DECIMAL(5,2))), 0)\n FROM \"reviewer_evaluation_details\" red\n WHERE red.reviewer_evaluation_id = re.id\n ) > 0 THEN 'IN_PROGRESS'\n ELSE 'NOT_STARTED'\n END\n FROM \"reviewer_evaluations\" re\n JOIN \"evaluation_target_reviewers\" etr ON re.evaluation_target_reviewer_id = etr.id\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND etr.department_code = 'QUALITY_EVAL'\n LIMIT 1\n ) as \"quality_eval_status\", (\n SELECT CASE\n WHEN re.id IS NULL THEN 'NOT_ASSIGNED'\n WHEN re.is_completed = true THEN 'COMPLETED'\n WHEN (\n SELECT COALESCE(SUM(CAST(red.score AS DECIMAL(5,2))), 0)\n FROM \"reviewer_evaluation_details\" red\n WHERE red.reviewer_evaluation_id = re.id\n ) > 0 THEN 'IN_PROGRESS'\n ELSE 'NOT_STARTED'\n END\n FROM \"reviewer_evaluations\" re\n JOIN \"evaluation_target_reviewers\" etr ON re.evaluation_target_reviewer_id = etr.id\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND etr.department_code = 'DESIGN_EVAL'\n LIMIT 1\n ) as \"design_eval_status\", (\n SELECT CASE\n WHEN re.id IS NULL THEN 'NOT_ASSIGNED'\n WHEN re.is_completed = true THEN 'COMPLETED'\n WHEN (\n SELECT COALESCE(SUM(CAST(red.score AS DECIMAL(5,2))), 0)\n FROM \"reviewer_evaluation_details\" red\n WHERE red.reviewer_evaluation_id = re.id\n ) > 0 THEN 'IN_PROGRESS'\n ELSE 'NOT_STARTED'\n END\n FROM \"reviewer_evaluations\" re\n JOIN \"evaluation_target_reviewers\" etr ON re.evaluation_target_reviewer_id = etr.id\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND etr.department_code = 'CS_EVAL'\n LIMIT 1\n ) as \"cs_eval_status\", (\n SELECT COUNT(*)::int\n FROM \"reviewer_evaluations\" re\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n ) as \"total_reviewers\", (\n SELECT COUNT(*)::int\n FROM \"reviewer_evaluations\" re\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND re.is_completed = true\n ) as \"completed_reviewers\", (\n SELECT COUNT(*)::int\n FROM \"reviewer_evaluations\" re\n WHERE re.periodic_evaluation_id = \"periodic_evaluations\".\"id\"\n AND re.is_completed = false\n ) as \"pending_reviewers\", \"users\".\"name\", \"users\".\"email\" from \"periodic_evaluations\" left join \"evaluation_targets\" on \"periodic_evaluations\".\"evaluation_target_id\" = \"evaluation_targets\".\"id\" left join \"users\" on \"periodic_evaluations\".\"finalized_by\" = \"users\".\"id\" order by \"periodic_evaluations\".\"created_at\"",
+ "name": "periodic_evaluations_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.reviewer_evaluations_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "periodic_evaluation_id": {
+ "name": "periodic_evaluation_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "evaluation_target_reviewer_id": {
+ "name": "evaluation_target_reviewer_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "is_completed": {
+ "name": "is_completed",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "completed_at": {
+ "name": "completed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reviewer_comment": {
+ "name": "reviewer_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "evaluation_period": {
+ "name": "evaluation_period",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "submitted_at": {
+ "name": "submitted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "documents_submitted": {
+ "name": "documents_submitted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": false,
+ "default": false
+ },
+ "submission_date": {
+ "name": "submission_date",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "submission_deadline": {
+ "name": "submission_deadline",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_score": {
+ "name": "final_score",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "final_grade": {
+ "name": "final_grade",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_score": {
+ "name": "evaluation_score",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_grade": {
+ "name": "evaluation_grade",
+ "type": "varchar(5)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "status": {
+ "name": "status",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'PENDING'"
+ },
+ "review_completed_at": {
+ "name": "review_completed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "finalized_at": {
+ "name": "finalized_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "finalized_by": {
+ "name": "finalized_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_note": {
+ "name": "evaluation_note",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "evaluation_year": {
+ "name": "evaluation_year",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "division": {
+ "name": "division",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_id": {
+ "name": "vendor_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_code": {
+ "name": "vendor_code",
+ "type": "varchar(100)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "vendor_name": {
+ "name": "vendor_name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domestic_foreign": {
+ "name": "domestic_foreign",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "material_type": {
+ "name": "material_type",
+ "type": "varchar(30)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "admin_comment": {
+ "name": "admin_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "consolidated_comment": {
+ "name": "consolidated_comment",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirmed_at": {
+ "name": "confirmed_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "confirmed_by": {
+ "name": "confirmed_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "ld_claim_count": {
+ "name": "ld_claim_count",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false,
+ "default": 0
+ },
+ "ld_claim_amount": {
+ "name": "ld_claim_amount",
+ "type": "numeric(15, 2)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'0'"
+ },
+ "ld_claim_currency": {
+ "name": "ld_claim_currency",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'KRW'"
+ },
+ "department_code": {
+ "name": "department_code",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "department_name_from": {
+ "name": "department_name_from",
+ "type": "varchar(50)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "reviewer_user_id": {
+ "name": "reviewer_user_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "assigned_at": {
+ "name": "assigned_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "assigned_by": {
+ "name": "assigned_by",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "definition": "select \"reviewer_evaluations\".\"id\", \"reviewer_evaluations\".\"periodic_evaluation_id\", \"reviewer_evaluations\".\"evaluation_target_reviewer_id\", \"reviewer_evaluations\".\"is_completed\", \"reviewer_evaluations\".\"completed_at\", \"reviewer_evaluations\".\"reviewer_comment\", \"reviewer_evaluations\".\"created_at\", \"reviewer_evaluations\".\"updated_at\", \"periodic_evaluations\".\"evaluation_period\", \"reviewer_evaluations\".\"submitted_at\", \"periodic_evaluations\".\"documents_submitted\", \"periodic_evaluations\".\"submission_date\", \"periodic_evaluations\".\"submission_deadline\", \"periodic_evaluations\".\"final_score\", \"periodic_evaluations\".\"final_grade\", \"periodic_evaluations\".\"evaluation_score\", \"periodic_evaluations\".\"evaluation_grade\", \"periodic_evaluations\".\"status\", \"periodic_evaluations\".\"review_completed_at\", \"periodic_evaluations\".\"finalized_at\", \"periodic_evaluations\".\"finalized_by\", \"periodic_evaluations\".\"evaluation_note\", \"evaluation_targets\".\"evaluation_year\", \"evaluation_targets\".\"division\", \"evaluation_targets\".\"vendor_id\", \"evaluation_targets\".\"vendor_code\", \"evaluation_targets\".\"vendor_name\", \"evaluation_targets\".\"domestic_foreign\", \"evaluation_targets\".\"material_type\", \"evaluation_targets\".\"admin_comment\", \"evaluation_targets\".\"consolidated_comment\", \"evaluation_targets\".\"confirmed_at\", \"evaluation_targets\".\"confirmed_by\", \"evaluation_targets\".\"ld_claim_count\", \"evaluation_targets\".\"ld_claim_amount\", \"evaluation_targets\".\"ld_claim_currency\", \"evaluation_target_reviewers\".\"department_code\", \"evaluation_target_reviewers\".\"department_name_from\", \"evaluation_target_reviewers\".\"reviewer_user_id\", reviewer_user.name as \"reviewer_name\", reviewer_user.email as \"reviewer_email\", \"evaluation_target_reviewers\".\"assigned_at\", \"evaluation_target_reviewers\".\"assigned_by\", assigned_by_user.name as \"assigned_by_user_name\", finalized_by_user.name as \"finalized_by_user_name\", finalized_by_user.email as \"finalized_by_user_email\", \n CASE \n WHEN \"reviewer_evaluations\".\"is_completed\" = true THEN 'COMPLETED'\n ELSE 'NOT_STARTED'\n END\n as \"evaluation_progress\" from \"reviewer_evaluations\" left join \"periodic_evaluations\" on \"reviewer_evaluations\".\"periodic_evaluation_id\" = \"periodic_evaluations\".\"id\" left join \"evaluation_targets\" on \"periodic_evaluations\".\"evaluation_target_id\" = \"evaluation_targets\".\"id\" left join \"evaluation_target_reviewers\" on \"reviewer_evaluations\".\"evaluation_target_reviewer_id\" = \"evaluation_target_reviewers\".\"id\" left join users reviewer_user on \"evaluation_target_reviewers\".\"reviewer_user_id\" = reviewer_user.id left join users assigned_by_user on \"evaluation_target_reviewers\".\"assigned_by\" = assigned_by_user.id left join users finalized_by_user on \"periodic_evaluations\".\"finalized_by\" = finalized_by_user.id order by \"reviewer_evaluations\".\"is_completed\" ASC, \"reviewer_evaluations\".\"updated_at\" DESC",
+ "name": "reviewer_evaluations_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.reg_eval_criteria_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "criteria_id": {
+ "name": "criteria_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "category": {
+ "name": "category",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'quality'"
+ },
+ "category2": {
+ "name": "category2",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'processScore'"
+ },
+ "item": {
+ "name": "item",
+ "type": "varchar(32)",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'quality'"
+ },
+ "classification": {
+ "name": "classification",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "range": {
+ "name": "range",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "detail": {
+ "name": "detail",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "order_index": {
+ "name": "order_index",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true,
+ "default": 0
+ },
+ "score_equip_ship": {
+ "name": "score_equip_ship",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "score_equip_marine": {
+ "name": "score_equip_marine",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "score_bulk_ship": {
+ "name": "score_bulk_ship",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "score_bulk_marine": {
+ "name": "score_bulk_marine",
+ "type": "numeric(5, 2)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "remarks": {
+ "name": "remarks",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "select \"reg_eval_criteria_details\".\"id\", \"reg_eval_criteria_details\".\"criteria_id\", \"reg_eval_criteria\".\"category\", \"reg_eval_criteria\".\"category2\", \"reg_eval_criteria\".\"item\", \"reg_eval_criteria\".\"classification\", \"reg_eval_criteria\".\"range\", \"reg_eval_criteria_details\".\"detail\", \"reg_eval_criteria_details\".\"order_index\", \"reg_eval_criteria_details\".\"score_equip_ship\", \"reg_eval_criteria_details\".\"score_equip_marine\", \"reg_eval_criteria_details\".\"score_bulk_ship\", \"reg_eval_criteria_details\".\"score_bulk_marine\", \"reg_eval_criteria\".\"remarks\" from \"reg_eval_criteria\" left join \"reg_eval_criteria_details\" on \"reg_eval_criteria\".\"id\" = \"reg_eval_criteria_details\".\"criteria_id\" order by \"reg_eval_criteria\".\"id\", \"reg_eval_criteria_details\".\"order_index\"",
+ "name": "reg_eval_criteria_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.project_gtc_view": {
+ "columns": {},
+ "definition": "select \"projects\".\"id\" as \"id\", \"projects\".\"code\" as \"code\", \"projects\".\"name\" as \"name\", \"projects\".\"type\" as \"type\", \"projects\".\"created_at\" as \"project_created_at\", \"projects\".\"updated_at\" as \"project_updated_at\", \"project_gtc_files\".\"id\" as \"gtc_file_id\", \"project_gtc_files\".\"file_name\" as \"fileName\", \"project_gtc_files\".\"file_path\" as \"filePath\", \"project_gtc_files\".\"original_file_name\" as \"originalFileName\", \"project_gtc_files\".\"file_size\" as \"fileSize\", \"project_gtc_files\".\"mime_type\" as \"mimeType\", \"project_gtc_files\".\"created_at\" as \"gtcCreatedAt\", \"project_gtc_files\".\"updated_at\" as \"gtcUpdatedAt\" from \"projects\" left join \"project_gtc_files\" on \"projects\".\"id\" = \"project_gtc_files\".\"project_id\"",
+ "name": "project_gtc_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.qna_answer_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "qna_id": {
+ "name": "qna_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "author": {
+ "name": "author",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ }
+ },
+ "definition": "select \"qna_answer\".\"id\", \"qna_answer\".\"qna_id\", \"qna_answer\".\"content\", \"qna_answer\".\"author\", \"qna_answer\".\"created_at\" as \"created_at\", \"qna_answer\".\"updated_at\" as \"updated_at\", \"qna_answer\".\"is_deleted\" as \"is_deleted\", \"qna_answer\".\"deleted_at\" as \"deleted_at\", \"qna\".\"title\" as \"question_title\", \"qna\".\"category\" as \"question_category\", \"qna\".\"author\" as \"question_author\", \"qna\".\"created_at\" as \"question_created_at\", \"users\".\"name\" as \"author_name\", \"users\".\"email\" as \"author_email\", \"users\".\"domain\" as \"author_domain\", \"users\".\"phone\" as \"author_phone\", \"users\".\"image_url\" as \"author_image_url\", \"users\".\"language\" as \"author_language\", \"vendors\".\"vendor_name\" as \"vendor_name\", \"vendors\".\"vendor_code\" as \"vendor_code\", \"tech_vendors\".\"vendor_name\" as \"tech_vendor_name\", \"tech_vendors\".\"vendor_code\" as \"tech_vendor_code\", COALESCE(\"vendors\".\"vendor_name\", \"tech_vendors\".\"vendor_name\") as \"company_name\", COALESCE(\"vendors\".\"vendor_code\", \"tech_vendors\".\"vendor_code\") as \"company_code\", \n CASE \n WHEN \"vendors\".\"vendor_name\" IS NOT NULL THEN 'vendor'\n WHEN \"tech_vendors\".\"vendor_name\" IS NOT NULL THEN 'techVendor'\n ELSE NULL\n END\n as \"vendor_type\", (\n SELECT COUNT(*)::int\n FROM \"qna_comments\" qc\n WHERE qc.answer_id = \"qna_answer\".\"id\"\n AND qc.is_deleted = false\n ) as \"total_comments\", (\n SELECT COUNT(*)::int\n FROM \"qna_comments\" qc\n WHERE qc.answer_id = \"qna_answer\".\"id\"\n AND qc.is_deleted = false\n ) as \"comment_count\", (\n SELECT COUNT(*)::int\n FROM \"qna_comments\" qc\n WHERE qc.answer_id = \"qna_answer\".\"id\"\n AND qc.parent_comment_id IS NULL\n AND qc.is_deleted = false\n ) as \"parent_comments_count\", (\n SELECT COUNT(*)::int\n FROM \"qna_comments\" qc\n WHERE qc.answer_id = \"qna_answer\".\"id\"\n AND qc.parent_comment_id IS NOT NULL\n AND qc.is_deleted = false\n ) as \"child_comments_count\", (\n SELECT MAX(qc.created_at)\n FROM \"qna_comments\" qc\n WHERE qc.answer_id = \"qna_answer\".\"id\"\n AND qc.is_deleted = false\n ) as \"last_commented_at\", (\n SELECT ROW_NUMBER() OVER (\n PARTITION BY qa2.qna_id \n ORDER BY qa2.created_at ASC\n )\n FROM \"qna_answer\" qa2\n WHERE qa2.id = \"qna_answer\".\"id\"\n AND qa2.is_deleted = false\n ) as \"answer_order\", (\n \"qna_answer\".\"id\" = (\n SELECT qa2.id\n FROM \"qna_answer\" qa2\n WHERE qa2.qna_id = \"qna_answer\".\"qna_id\"\n AND qa2.is_deleted = false\n ORDER BY qa2.created_at ASC\n LIMIT 1\n )\n ) as \"is_first_answer\", (\n \"qna_answer\".\"id\" = (\n SELECT qa2.id\n FROM \"qna_answer\" qa2\n WHERE qa2.qna_id = \"qna_answer\".\"qna_id\"\n AND qa2.is_deleted = false\n ORDER BY qa2.created_at DESC\n LIMIT 1\n )\n ) as \"is_latest_answer\" from \"qna_answer\" left join \"qna\" on \"qna_answer\".\"qna_id\" = \"qna\".\"id\" left join \"users\" on \"qna_answer\".\"author\" = \"users\".\"id\" left join \"vendors\" on \"users\".\"company_id\" = \"vendors\".\"id\" left join \"tech_vendors\" on \"users\".\"tech_company_id\" = \"tech_vendors\".\"id\" where \"qna_answer\".\"is_deleted\" = false order by \"qna_answer\".\"created_at\"",
+ "name": "qna_answer_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.qna_comment_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "author": {
+ "name": "author",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "answer_id": {
+ "name": "answer_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "parent_comment_id": {
+ "name": "parent_comment_id",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "select \"qna_comments\".\"id\", \"qna_comments\".\"content\", \"qna_comments\".\"author\", \"qna_comments\".\"answer_id\", \"qna_comments\".\"parent_comment_id\", \"qna_comments\".\"created_at\" as \"created_at\", \"qna_comments\".\"updated_at\" as \"updated_at\", \"qna_comments\".\"is_deleted\" as \"is_deleted\", \"qna_comments\".\"deleted_at\" as \"deleted_at\", \"qna_answer\".\"content\" as \"answer_content\", \"qna_answer\".\"author\" as \"answer_author\", \"qna_answer\".\"created_at\" as \"answer_created_at\", \"qna_answer\".\"qna_id\" as \"qna_id\", \"qna\".\"title\" as \"question_title\", \"qna\".\"category\" as \"question_category\", \"qna\".\"author\" as \"question_author\", \"users\".\"name\" as \"author_name\", \"users\".\"email\" as \"author_email\", \"users\".\"domain\" as \"author_domain\", \"users\".\"image_url\" as \"author_image_url\", \"vendors\".\"vendor_name\" as \"vendor_name\", \"tech_vendors\".\"vendor_name\" as \"tech_vendor_name\", COALESCE(\"vendors\".\"vendor_name\", \"tech_vendors\".\"vendor_name\") as \"company_name\", \n CASE \n WHEN \"vendors\".\"vendor_name\" IS NOT NULL THEN 'vendor'\n WHEN \"tech_vendors\".\"vendor_name\" IS NOT NULL THEN 'techVendor'\n ELSE NULL\n END\n as \"vendor_type\", \"qna_comments\".\"parent_comment_id\" IS NULL as \"is_parent_comment\", \"qna_comments\".\"parent_comment_id\" IS NOT NULL as \"is_child_comment\", (\n SELECT COUNT(*)::int\n FROM \"qna_comments\" qc2\n WHERE qc2.parent_comment_id = \"qna_comments\".\"id\"\n AND qc2.is_deleted = false\n ) as \"child_comments_count\", (\n SELECT COUNT(*) > 0\n FROM \"qna_comments\" qc2\n WHERE qc2.parent_comment_id = \"qna_comments\".\"id\"\n AND qc2.is_deleted = false\n ) as \"has_child_comments\", \n CASE \n WHEN \"qna_comments\".\"parent_comment_id\" IS NULL THEN 0\n ELSE 1\n END\n as \"comment_depth\", (\n SELECT ROW_NUMBER() OVER (\n PARTITION BY qc2.answer_id, qc2.parent_comment_id\n ORDER BY qc2.created_at ASC\n )\n FROM \"qna_comments\" qc2\n WHERE qc2.id = \"qna_comments\".\"id\"\n AND qc2.is_deleted = false\n ) as \"comment_order\" from \"qna_comments\" left join \"qna_answer\" on \"qna_comments\".\"answer_id\" = \"qna_answer\".\"id\" left join \"qna\" on \"qna_answer\".\"qna_id\" = \"qna\".\"id\" left join \"users\" on \"qna_comments\".\"author\" = \"users\".\"id\" left join \"vendors\" on \"users\".\"company_id\" = \"vendors\".\"id\" left join \"tech_vendors\" on \"users\".\"tech_company_id\" = \"tech_vendors\".\"id\" where \"qna_comments\".\"is_deleted\" = false order by \"qna_comments\".\"created_at\"",
+ "name": "qna_comment_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ },
+ "public.qna_view": {
+ "columns": {
+ "id": {
+ "name": "id",
+ "type": "serial",
+ "primaryKey": true,
+ "notNull": true
+ },
+ "title": {
+ "name": "title",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "content": {
+ "name": "content",
+ "type": "text",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "author": {
+ "name": "author",
+ "type": "integer",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "category": {
+ "name": "category",
+ "type": "qna_category",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "created_at": {
+ "name": "created_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "updated_at": {
+ "name": "updated_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "now()"
+ },
+ "is_deleted": {
+ "name": "is_deleted",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": false
+ },
+ "deleted_at": {
+ "name": "deleted_at",
+ "type": "timestamp",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "name": {
+ "name": "name",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "email": {
+ "name": "email",
+ "type": "varchar(255)",
+ "primaryKey": false,
+ "notNull": true
+ },
+ "domain": {
+ "name": "domain",
+ "type": "user_domain",
+ "typeSchema": "public",
+ "primaryKey": false,
+ "notNull": true,
+ "default": "'partners'"
+ },
+ "phone": {
+ "name": "phone",
+ "type": "varchar(20)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "image_url": {
+ "name": "image_url",
+ "type": "varchar(1024)",
+ "primaryKey": false,
+ "notNull": false
+ },
+ "language": {
+ "name": "language",
+ "type": "varchar(10)",
+ "primaryKey": false,
+ "notNull": false,
+ "default": "'en'"
+ },
+ "is_active": {
+ "name": "is_active",
+ "type": "boolean",
+ "primaryKey": false,
+ "notNull": true,
+ "default": true
+ },
+ "last_login_at": {
+ "name": "last_login_at",
+ "type": "timestamp with time zone",
+ "primaryKey": false,
+ "notNull": false
+ }
+ },
+ "definition": "select \"qna\".\"id\", \"qna\".\"title\", \"qna\".\"content\", \"qna\".\"author\", \"qna\".\"category\", \"qna\".\"created_at\", \"qna\".\"updated_at\", \"qna\".\"is_deleted\", \"qna\".\"deleted_at\", \"users\".\"name\", \"users\".\"email\", \"users\".\"domain\", \"users\".\"phone\", \"users\".\"image_url\", \"users\".\"language\", \"users\".\"is_active\", \"users\".\"last_login_at\", \"vendors\".\"vendor_name\" as \"vendor_name\", \"vendors\".\"vendor_code\" as \"vendor_code\", \"vendors\".\"status\" as \"vendor_status\", \"vendors\".\"country\" as \"vendor_country\", \"vendors\".\"business_size\" as \"vendor_business_size\", \"tech_vendors\".\"vendor_name\" as \"tech_vendor_name\", \"tech_vendors\".\"vendor_code\" as \"tech_vendor_code\", \"tech_vendors\".\"status\" as \"tech_vendor_status\", \"tech_vendors\".\"country\" as \"tech_vendor_country\", \"tech_vendors\".\"tech_vendor_type\" as \"tech_vendor_type\", COALESCE(\"vendors\".\"vendor_name\", \"tech_vendors\".\"vendor_name\") as \"company_name\", COALESCE(\"vendors\".\"vendor_code\", \"tech_vendors\".\"vendor_code\") as \"company_code\", COALESCE(\"vendors\".\"country\", \"tech_vendors\".\"country\") as \"company_country\", \n CASE \n WHEN \"vendors\".\"vendor_name\" IS NOT NULL THEN 'vendor'\n WHEN \"tech_vendors\".\"vendor_name\" IS NOT NULL THEN 'techVendor'\n ELSE NULL\n END\n as \"vendor_type\", (\n SELECT COUNT(*)::int\n FROM \"qna_answer\" qa\n WHERE qa.qna_id = \"qna\".\"id\"\n AND qa.is_deleted = false\n ) as \"total_answers\", (\n SELECT COUNT(*)::int\n FROM \"qna_answer\" qa\n WHERE qa.qna_id = \"qna\".\"id\"\n AND qa.is_deleted = false\n ) as \"answer_count\", (\n SELECT MAX(qa.created_at)\n FROM \"qna_answer\" qa\n WHERE qa.qna_id = \"qna\".\"id\"\n AND qa.is_deleted = false\n ) as \"last_answered_at\", (\n SELECT MIN(qa.created_at)\n FROM \"qna_answer\" qa\n WHERE qa.qna_id = \"qna\".\"id\"\n AND qa.is_deleted = false\n ) as \"first_answered_at\", (\n SELECT COUNT(*)::int\n FROM \"qna_comments\" qc\n INNER JOIN \"qna_answer\" qa ON qc.answer_id = qa.id\n WHERE qa.qna_id = \"qna\".\"id\"\n AND qc.is_deleted = false\n AND qa.is_deleted = false\n ) as \"total_comments\", (\n SELECT GREATEST(\n \"qna\".\"updated_at\",\n COALESCE((\n SELECT MAX(qa.updated_at)\n FROM \"qna_answer\" qa\n WHERE qa.qna_id = \"qna\".\"id\"\n AND qa.is_deleted = false\n ), \"qna\".\"updated_at\"),\n COALESCE((\n SELECT MAX(qc.updated_at)\n FROM \"qna_comments\" qc\n INNER JOIN \"qna_answer\" qa ON qc.answer_id = qa.id\n WHERE qa.qna_id = \"qna\".\"id\"\n AND qc.is_deleted = false\n AND qa.is_deleted = false\n ), \"qna\".\"updated_at\")\n )\n ) as \"last_activity_at\", (\n SELECT COUNT(*) > 0\n FROM \"qna_answer\" qa\n WHERE qa.qna_id = \"qna\".\"id\"\n AND qa.is_deleted = false\n ) as \"has_answers\", (\n SELECT COUNT(*) > 0\n FROM \"qna_answer\" qa\n WHERE qa.qna_id = \"qna\".\"id\"\n AND qa.is_deleted = false\n ) as \"is_answered\", (\n (SELECT COUNT(*) FROM \"qna_answer\" qa WHERE qa.qna_id = \"qna\".\"id\" AND qa.is_deleted = false) >= 3\n OR\n (SELECT COUNT(*) FROM \"qna_comments\" qc \n INNER JOIN \"qna_answer\" qa ON qc.answer_id = qa.id \n WHERE qa.qna_id = \"qna\".\"id\" AND qc.is_deleted = false AND qa.is_deleted = false) >= 5\n ) as \"is_popular\" from \"qna\" left join \"users\" on \"qna\".\"author\" = \"users\".\"id\" left join \"vendors\" on \"users\".\"company_id\" = \"vendors\".\"id\" left join \"tech_vendors\" on \"users\".\"tech_company_id\" = \"tech_vendors\".\"id\" where \"qna\".\"is_deleted\" = false order by \"qna\".\"created_at\"",
+ "name": "qna_view",
+ "schema": "public",
+ "isExisting": false,
+ "materialized": false
+ }
+ },
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ }
+} \ No newline at end of file
diff --git a/db/migrations/meta/_journal.json b/db/migrations/meta/_journal.json
index 94c99647..154f4034 100644
--- a/db/migrations/meta/_journal.json
+++ b/db/migrations/meta/_journal.json
@@ -1492,6 +1492,13 @@
"when": 1752748922465,
"tag": "0212_steep_morg",
"breakpoints": true
+ },
+ {
+ "idx": 213,
+ "version": "7",
+ "when": 1752798561205,
+ "tag": "0213_ordinary_orphan",
+ "breakpoints": true
}
]
} \ No newline at end of file
diff --git a/db/notification.sql b/db/notification.sql
new file mode 100644
index 00000000..1a6ae269
--- /dev/null
+++ b/db/notification.sql
@@ -0,0 +1,57 @@
+-- migrations/001_notification_triggers.sql
+
+-- 1. 알림 생성 시 실시간 NOTIFY 함수
+CREATE OR REPLACE FUNCTION notify_new_notification()
+RETURNS TRIGGER AS $$
+BEGIN
+ -- 새 알림이 생성될 때 NOTIFY 전송
+ PERFORM pg_notify(
+ 'new_notification',
+ json_build_object(
+ 'id', NEW.id,
+ 'user_id', NEW.user_id,
+ 'title', NEW.title,
+ 'message', NEW.message,
+ 'type', NEW.type,
+ 'related_record_id', NEW.related_record_id,
+ 'related_record_type', NEW.related_record_type,
+ 'is_read', NEW.is_read,
+ 'created_at', NEW.created_at
+ )::text
+ );
+
+ RETURN NEW;
+END;
+$$ LANGUAGE plpgsql;
+
+-- 2. 알림 읽음 상태 변경 시 NOTIFY 함수
+CREATE OR REPLACE FUNCTION notify_notification_read()
+RETURNS TRIGGER AS $$
+BEGIN
+ -- 읽음 상태가 변경될 때 NOTIFY 전송
+ IF OLD.is_read != NEW.is_read THEN
+ PERFORM pg_notify(
+ 'notification_read',
+ json_build_object(
+ 'id', NEW.id,
+ 'user_id', NEW.user_id,
+ 'is_read', NEW.is_read,
+ 'read_at', NEW.read_at
+ )::text
+ );
+ END IF;
+
+ RETURN NEW;
+END;
+$$ LANGUAGE plpgsql;
+
+-- 트리거 생성 (알림 테이블에만)
+CREATE OR REPLACE TRIGGER trigger_notify_new_notification
+ AFTER INSERT ON notifications
+ FOR EACH ROW
+ EXECUTE FUNCTION notify_new_notification();
+
+CREATE OR REPLACE TRIGGER trigger_notify_notification_read
+ AFTER UPDATE ON notifications
+ FOR EACH ROW
+ EXECUTE FUNCTION notify_notification_read(); \ No newline at end of file
diff --git a/db/schema/history.ts b/db/schema/history.ts
index 13b00196..ad5ac858 100644
--- a/db/schema/history.ts
+++ b/db/schema/history.ts
@@ -6,7 +6,7 @@ import {
text,
boolean,
integer,
- inet
+ inet, serial
} from 'drizzle-orm/pg-core';
import { relations } from 'drizzle-orm';
import { users } from './users';
@@ -110,4 +110,40 @@ export type PageVisit = typeof pageVisits.$inferSelect;
export type NewPageVisit = typeof pageVisits.$inferInsert;
export type DailyAccessStats = typeof dailyAccessStats.$inferSelect;
-export type NewDailyAccessStats = typeof dailyAccessStats.$inferInsert; \ No newline at end of file
+export type NewDailyAccessStats = typeof dailyAccessStats.$inferInsert;
+
+
+export const fileDownloadLogs = pgTable('file_download_logs', {
+ id: serial('id').primaryKey(),
+ fileId: integer('file_id').notNull(),
+ userId: varchar('user_id', { length: 50 }).notNull(),
+ userEmail: varchar('user_email', { length: 255 }),
+ userName: varchar('user_name', { length: 100 }),
+ userRole: varchar('user_role', { length: 50 }),
+ userIP: inet('user_ip'), // PostgreSQL의 inet 타입 사용 (IPv4/IPv6 지원)
+ userAgent: text('user_agent'),
+ fileName: varchar('file_name', { length: 255 }),
+ filePath: varchar('file_path', { length: 500 }),
+ fileSize: integer('file_size'),
+ downloadedAt: timestamp('downloaded_at', { withTimezone: true }).defaultNow().notNull(),
+ success: boolean('success').notNull(),
+ errorMessage: text('error_message'),
+ sessionId: varchar('session_id', { length: 100 }),
+ requestId: varchar('request_id', { length: 50 }), // 요청 추적용
+ referer: text('referer'),
+ downloadDurationMs: integer('download_duration_ms'), // 다운로드 소요 시간
+ });
+
+ // 사용자별 다운로드 통계 테이블 (선택사항)
+ export const userDownloadStats = pgTable('user_download_stats', {
+ id: serial('id').primaryKey(),
+ userId: varchar('user_id', { length: 50 }).notNull(),
+ date: timestamp('date', { withTimezone: true }).notNull(),
+ totalDownloads: integer('total_downloads').default(0).notNull(),
+ totalBytes: integer('total_bytes').default(0).notNull(),
+ uniqueFiles: integer('unique_files').default(0).notNull(),
+ lastDownloadAt: timestamp('last_download_at', { withTimezone: true }),
+ });
+
+
+ \ No newline at end of file
diff --git a/db/schema/index.ts b/db/schema/index.ts
index 387bba8c..b1d9ee89 100644
--- a/db/schema/index.ts
+++ b/db/schema/index.ts
@@ -27,6 +27,7 @@ export * from './information';
export * from './qna';
export * from './notice';
export * from './history';
+export * from './notification';
// MDG SOAP 수신용
export * from './MDG/mdg'
diff --git a/db/schema/notification.ts b/db/schema/notification.ts
new file mode 100644
index 00000000..8b745ac2
--- /dev/null
+++ b/db/schema/notification.ts
@@ -0,0 +1,65 @@
+// db/schema/notifications.ts
+import {
+ pgTable,
+ uuid,
+ varchar,
+ text,
+ boolean,
+ timestamp,
+ index
+ } from 'drizzle-orm/pg-core';
+ import { users } from './users'; // 기존 users 테이블
+ import { relations } from 'drizzle-orm';
+
+ export const notifications = pgTable('notifications', {
+ id: uuid('id').primaryKey().defaultRandom(),
+ userId: varchar('user_id', { length: 255 }).notNull(),
+ title: varchar('title', { length: 255 }).notNull(),
+ message: text('message').notNull(),
+ type: varchar('type', { length: 50 }).notNull(), // 'assignment', 'update', 'reminder' 등
+ relatedRecordId: varchar('related_record_id', { length: 255 }),
+ relatedRecordType: varchar('related_record_type', { length: 100 }), // 'project', 'task', 'order' 등
+ isRead: boolean('is_read').default(false).notNull(),
+ createdAt: timestamp('created_at').defaultNow().notNull(),
+ readAt: timestamp('read_at'),
+ }, (table) => ({
+ userIdIdx: index('idx_notifications_user_id').on(table.userId),
+ createdAtIdx: index('idx_notifications_created_at').on(table.createdAt.desc()),
+ isReadIdx: index('idx_notifications_is_read').on(table.isRead),
+ userReadIdx: index('idx_notifications_user_read').on(table.userId, table.isRead),
+ }));
+
+ // 관계 정의
+ export const notificationsRelations = relations(notifications, ({ one }) => ({
+ user: one(users, {
+ fields: [notifications.userId],
+ references: [users.id],
+ }),
+ }));
+
+ // 타입 정의
+ export type Notification = typeof notifications.$inferSelect;
+ export type NewNotification = typeof notifications.$inferInsert;
+
+ // 알림 타입 enum
+ export const NotificationType = {
+ ASSIGNMENT: 'assignment',
+ UPDATE: 'update',
+ REMINDER: 'reminder',
+ APPROVAL: 'approval',
+ DEADLINE: 'deadline',
+ STATUS_CHANGE: 'status_change'
+ } as const;
+
+ export type NotificationTypeValue = typeof NotificationType[keyof typeof NotificationType];
+
+ // 관련 레코드 타입 enum
+ export const RelatedRecordType = {
+ PROJECT: 'project',
+ TASK: 'task',
+ ORDER: 'order',
+ DOCUMENT: 'document',
+ USER: 'user'
+ } as const;
+
+ export type RelatedRecordTypeValue = typeof RelatedRecordType[keyof typeof RelatedRecordType]; \ No newline at end of file
diff --git a/lib/file-download-log/service.ts b/lib/file-download-log/service.ts
new file mode 100644
index 00000000..b2350782
--- /dev/null
+++ b/lib/file-download-log/service.ts
@@ -0,0 +1,353 @@
+'use server';
+
+import { revalidatePath } from 'next/cache';
+import { getServerSession } from 'next-auth';
+import { authOptions } from '@/app/api/auth/[...nextauth]/route';
+import { headers } from 'next/headers';
+import db from '@/db/db';
+import { fileDownloadLogs, userDownloadStats, rfqAttachments } from '@/db/schema';
+import { eq, and, gte, sql } from 'drizzle-orm';
+import {
+ createFileDownloadLogSchema,
+ type CreateFileDownloadLogInput,
+ type FileDownloadLog
+} from './validation';
+import { z } from 'zod';
+
+// 요청 정보 타입
+interface RequestInfo {
+ ip?: string;
+ userAgent?: string;
+ referer?: string;
+ sessionId?: string;
+}
+
+// 헤더에서 요청 정보 추출
+async function getRequestInfo(): Promise<RequestInfo> {
+ const headersList = await headers();
+
+ return {
+ ip: headersList.get('x-forwarded-for')?.split(',')[0] ||
+ headersList.get('x-real-ip') ||
+ headersList.get('cf-connecting-ip') || // Cloudflare
+ undefined,
+ userAgent: headersList.get('user-agent') || undefined,
+ referer: headersList.get('referer') || undefined,
+ sessionId: headersList.get('x-session-id') || undefined, // 커스텀 세션 ID
+ };
+ }
+
+// 파일 다운로드 로그 생성 (메인 서버 액션)
+export async function createFileDownloadLog(
+ input: CreateFileDownloadLogInput
+ ): Promise<{ success: boolean; error?: string; logId?: number }> {
+ try {
+ const validatedInput = createFileDownloadLogSchema.parse(input);
+
+ const session = await getServerSession(authOptions);
+ if (!session?.user) {
+ return { success: false, error: 'Unauthorized' };
+ }
+
+ const requestInfo = await getRequestInfo();
+
+ const fileInfo = validatedInput.fileInfo;
+
+
+ // 다운로드 로그 생성
+ const [newLog] = await db
+ .insert(fileDownloadLogs)
+ .values({
+ fileId: validatedInput.fileId,
+ userId: session.user.id,
+ userEmail: session.user.email || undefined,
+ userName: session.user.name || undefined,
+ userIP: requestInfo.ip,
+ userAgent: requestInfo.userAgent,
+ fileName: fileInfo?.fileName,
+ filePath: fileInfo?.filePath,
+ fileSize: fileInfo?.fileSize,
+ success: validatedInput.success,
+ errorMessage: validatedInput.errorMessage,
+ sessionId: requestInfo.sessionId,
+ requestId: validatedInput.requestId,
+ referer: requestInfo.referer,
+ downloadDurationMs: validatedInput.downloadDurationMs,
+ downloadedAt: new Date(),
+ })
+ .returning({ id: fileDownloadLogs.id });
+
+ // 성공한 다운로드인 경우 통계 업데이트
+ if (validatedInput.success && fileInfo?.fileSize) {
+ await updateUserDownloadStats(
+ session.user.id,
+ fileInfo.fileSize,
+ validatedInput.fileId
+ );
+ }
+
+ return { success: true, logId: newLog.id };
+
+ } catch (error) {
+ console.error('파일 다운로드 로그 생성 실패:', error);
+
+ if (error instanceof z.ZodError) {
+ return {
+ success: false,
+ error: `입력값 검증 실패: ${error.errors.map(e => e.message).join(', ')}`
+ };
+ }
+
+ return { success: false, error: '로그 생성 중 오류가 발생했습니다.' };
+ }
+ }
+// 사용자 다운로드 통계 업데이트
+async function updateUserDownloadStats(
+ userId: string,
+ fileSize: number,
+ fileId: number
+): Promise<void> {
+ try {
+ const today = new Date();
+ today.setHours(0, 0, 0, 0);
+
+ // 오늘 날짜의 통계가 있는지 확인
+ const [existingStats] = await db
+ .select()
+ .from(userDownloadStats)
+ .where(
+ and(
+ eq(userDownloadStats.userId, userId),
+ gte(userDownloadStats.date, today)
+ )
+ )
+ .limit(1);
+
+ if (existingStats) {
+ // 기존 통계 업데이트
+ await db
+ .update(userDownloadStats)
+ .set({
+ totalDownloads: sql`${userDownloadStats.totalDownloads} + 1`,
+ totalBytes: sql`${userDownloadStats.totalBytes} + ${fileSize}`,
+ lastDownloadAt: new Date(),
+ // uniqueFiles는 별도 로직으로 계산 (복잡하므로 생략)
+ })
+ .where(eq(userDownloadStats.id, existingStats.id));
+ } else {
+ // 새 통계 생성
+ await db.insert(userDownloadStats).values({
+ userId,
+ date: today,
+ totalDownloads: 1,
+ totalBytes: fileSize,
+ uniqueFiles: 1,
+ lastDownloadAt: new Date(),
+ });
+ }
+ } catch (error) {
+ console.error('다운로드 통계 업데이트 실패:', error);
+ // 통계 실패가 메인 기능에 영향을 주지 않도록 에러를 던지지 않음
+ }
+}
+
+// 사용자 다운로드 이력 조회
+export async function getUserDownloadHistory(
+ page: number = 1,
+ limit: number = 20
+): Promise<{
+ logs: FileDownloadLog[],
+ total: number,
+ hasMore: boolean
+}> {
+ try {
+ const session = await getServerSession(authOptions);
+ if (!session?.user) {
+ throw new Error('Unauthorized');
+ }
+
+ const offset = (page - 1) * limit;
+
+ // 총 개수 조회
+ const [{ count }] = await db
+ .select({ count: sql<number>`count(*)` })
+ .from(fileDownloadLogs)
+ .where(eq(fileDownloadLogs.userId, session.user.id));
+
+ // 로그 조회
+ const logs = await db
+ .select()
+ .from(fileDownloadLogs)
+ .where(eq(fileDownloadLogs.userId, session.user.id))
+ .orderBy(sql`${fileDownloadLogs.downloadedAt} DESC`)
+ .limit(limit)
+ .offset(offset);
+
+ return {
+ logs,
+ total: count,
+ hasMore: offset + logs.length < count,
+ };
+
+ } catch (error) {
+ console.error('다운로드 이력 조회 실패:', error);
+ throw new Error('다운로드 이력을 가져올 수 없습니다.');
+ }
+}
+
+// 사용자 다운로드 통계 조회
+export async function getUserDownloadStats(days: number = 30): Promise<{
+ totalDownloads: number;
+ totalBytes: number;
+ uniqueFiles: number;
+ dailyStats: Array<{
+ date: string;
+ downloads: number;
+ bytes: number;
+ }>;
+}> {
+ try {
+ const session = await getServerSession(authOptions);
+ if (!session?.user) {
+ throw new Error('Unauthorized');
+ }
+
+ const startDate = new Date();
+ startDate.setDate(startDate.getDate() - days);
+
+ // 기간별 통계 조회
+ const dailyStats = await db
+ .select({
+ date: userDownloadStats.date,
+ downloads: userDownloadStats.totalDownloads,
+ bytes: userDownloadStats.totalBytes,
+ })
+ .from(userDownloadStats)
+ .where(
+ and(
+ eq(userDownloadStats.userId, session.user.id),
+ gte(userDownloadStats.date, startDate)
+ )
+ )
+ .orderBy(userDownloadStats.date);
+
+ // 총합 계산
+ const totals = dailyStats.reduce(
+ (acc, stat) => ({
+ totalDownloads: acc.totalDownloads + stat.downloads,
+ totalBytes: acc.totalBytes + stat.bytes,
+ }),
+ { totalDownloads: 0, totalBytes: 0 }
+ );
+
+ // 고유 파일 수 계산 (기간 내)
+ const [{ uniqueFiles }] = await db
+ .select({
+ uniqueFiles: sql<number>`count(distinct ${fileDownloadLogs.fileId})`
+ })
+ .from(fileDownloadLogs)
+ .where(
+ and(
+ eq(fileDownloadLogs.userId, session.user.id),
+ eq(fileDownloadLogs.success, true),
+ gte(fileDownloadLogs.downloadedAt, startDate)
+ )
+ );
+
+ return {
+ ...totals,
+ uniqueFiles: uniqueFiles || 0,
+ dailyStats: dailyStats.map(stat => ({
+ date: stat.date.toISOString().split('T')[0],
+ downloads: stat.downloads,
+ bytes: stat.bytes,
+ })),
+ };
+
+ } catch (error) {
+ console.error('다운로드 통계 조회 실패:', error);
+ throw new Error('다운로드 통계를 가져올 수 없습니다.');
+ }
+}
+
+// 관리자용: 전체 다운로드 로그 조회 (권한 확인 필요)
+export async function getAllDownloadLogs(
+ page: number = 1,
+ limit: number = 50,
+ filters?: {
+ userId?: string;
+ success?: boolean;
+ startDate?: Date;
+ endDate?: Date;
+ }
+): Promise<{
+ logs: FileDownloadLog[],
+ total: number,
+ hasMore: boolean
+}> {
+ try {
+ const session = await getServerSession(authOptions);
+ if (!session?.user || !session.user.roles.includes('admin') ) {
+ throw new Error('관리자 권한이 필요합니다.');
+ }
+
+ const offset = (page - 1) * limit;
+
+ // 필터 조건 구성
+ const conditions = [];
+ if (filters?.userId) {
+ conditions.push(eq(fileDownloadLogs.userId, filters.userId));
+ }
+ if (filters?.success !== undefined) {
+ conditions.push(eq(fileDownloadLogs.success, filters.success));
+ }
+ if (filters?.startDate) {
+ conditions.push(gte(fileDownloadLogs.downloadedAt, filters.startDate));
+ }
+ if (filters?.endDate) {
+ conditions.push(sql`${fileDownloadLogs.downloadedAt} <= ${filters.endDate}`);
+ }
+
+ const whereClause = conditions.length > 0 ? and(...conditions) : undefined;
+
+ // 총 개수 조회
+ const [{ count }] = await db
+ .select({ count: sql<number>`count(*)` })
+ .from(fileDownloadLogs)
+ .where(whereClause);
+
+ // 로그 조회
+ const logs = await db
+ .select()
+ .from(fileDownloadLogs)
+ .where(whereClause)
+ .orderBy(sql`${fileDownloadLogs.downloadedAt} DESC`)
+ .limit(limit)
+ .offset(offset);
+
+ return {
+ logs,
+ total: count,
+ hasMore: offset + logs.length < count,
+ };
+
+ } catch (error) {
+ console.error('전체 다운로드 로그 조회 실패:', error);
+ throw new Error('다운로드 로그를 가져올 수 없습니다.');
+ }
+}
+
+// 편의 함수: 간단한 로그 생성
+export async function logDownloadAttempt(
+ fileId: number,
+ success: boolean,
+ errorMessage?: string,
+ requestId?: string
+): Promise<void> {
+ await createFileDownloadLog({
+ fileId,
+ success,
+ errorMessage,
+ requestId,
+ });
+} \ No newline at end of file
diff --git a/lib/file-download-log/validation.ts b/lib/file-download-log/validation.ts
new file mode 100644
index 00000000..bf888e9c
--- /dev/null
+++ b/lib/file-download-log/validation.ts
@@ -0,0 +1,37 @@
+import { fileDownloadLogs } from "@/db/schema";
+import { createInsertSchema, createSelectSchema } from "drizzle-zod";
+import { z } from 'zod';
+
+// Zod 스키마
+export const fileDownloadLogInsertSchema = createInsertSchema(fileDownloadLogs);
+export const fileDownloadLogSelectSchema = createSelectSchema(fileDownloadLogs);
+
+export type FileDownloadLog = typeof fileDownloadLogs.$inferSelect;
+export type NewFileDownloadLog = typeof fileDownloadLogs.$inferInsert;
+
+// validation.ts에 추가할 타입
+interface FileInfo {
+ fileName?: string;
+ filePath?: string;
+ fileSize?: number;
+ }
+
+ // 수정된 입력 스키마
+export const createFileDownloadLogSchema = z.object({
+ fileId: z.number(),
+ success: z.boolean(),
+ errorMessage: z.string().optional(),
+ requestId: z.string().optional(),
+ downloadDurationMs: z.number().optional(),
+ // 파일 정보를 직접 받을 수 있도록 추가
+ fileInfo: z.object({
+ fileName: z.string().optional(),
+ filePath: z.string().optional(),
+ fileSize: z.number().optional(),
+ }).optional(),
+ // 또는 다른 테이블에서 조회할 수 있도록
+ fileSource: z.enum(['rfqAttachments', 'documents', 'uploads']).optional(),
+ });
+
+
+export type CreateFileDownloadLogInput = z.infer<typeof createFileDownloadLogSchema>;
diff --git a/lib/file-download.ts b/lib/file-download.ts
index 1e8536b5..5e0350a0 100644
--- a/lib/file-download.ts
+++ b/lib/file-download.ts
@@ -1,5 +1,5 @@
// lib/file-download.ts
-// 공용 파일 다운로드 유틸리티
+// 공용 파일 다운로드 유틸리티 (보안 및 로깅 강화)
import { toast } from "sonner";
@@ -14,6 +14,240 @@ export interface FileInfo {
}
/**
+ * 파일 다운로드 옵션
+ */
+export interface FileDownloadOptions {
+ /** 다운로드 액션 타입 */
+ action?: 'download' | 'preview';
+ /** 에러 시 토스트 표시 여부 */
+ showToast?: boolean;
+ /** 성공 시 토스트 표시 여부 */
+ showSuccessToast?: boolean;
+ /** 커스텀 에러 핸들러 */
+ onError?: (error: string) => void;
+ /** 커스텀 성공 핸들러 */
+ onSuccess?: (fileName: string, fileSize?: number) => void;
+ /** 진행률 콜백 (큰 파일용) */
+ onProgress?: (progress: number) => void;
+ /** 로깅 비활성화 */
+ disableLogging?: boolean;
+}
+
+/**
+ * 파일 다운로드 결과
+ */
+export interface FileDownloadResult {
+ success: boolean;
+ error?: string;
+ fileSize?: number;
+ fileInfo?: FileInfo;
+ downloadDuration?: number;
+}
+
+/**
+ * 보안 설정
+ */
+const SECURITY_CONFIG = {
+ // 허용된 파일 확장자
+ ALLOWED_EXTENSIONS: new Set([
+ 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',
+ 'txt', 'csv', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'svg',
+ 'dwg', 'dxf', 'zip', 'rar', '7z', 'webp'
+ ]),
+
+ // 최대 파일 크기 (100MB)
+ MAX_FILE_SIZE: 100 * 1024 * 1024,
+
+ // 허용된 도메인 (선택적)
+ ALLOWED_DOMAINS: [
+ window.location.hostname,
+ 'localhost',
+ '127.0.0.1'
+ ],
+
+ // Rate limiting (클라이언트 사이드)
+ MAX_DOWNLOADS_PER_MINUTE: 10,
+
+ // 타임아웃 설정
+ FETCH_TIMEOUT: 30000, // 30초
+};
+
+/**
+ * Rate limiting 추적
+ */
+class RateLimiter {
+ private downloadAttempts: number[] = [];
+
+ canDownload(): boolean {
+ const now = Date.now();
+ const oneMinuteAgo = now - 60000;
+
+ // 1분 이전 기록 제거
+ this.downloadAttempts = this.downloadAttempts.filter(time => time > oneMinuteAgo);
+
+ if (this.downloadAttempts.length >= SECURITY_CONFIG.MAX_DOWNLOADS_PER_MINUTE) {
+ return false;
+ }
+
+ this.downloadAttempts.push(now);
+ return true;
+ }
+
+ getRemainingDownloads(): number {
+ const now = Date.now();
+ const oneMinuteAgo = now - 60000;
+ this.downloadAttempts = this.downloadAttempts.filter(time => time > oneMinuteAgo);
+
+ return Math.max(0, SECURITY_CONFIG.MAX_DOWNLOADS_PER_MINUTE - this.downloadAttempts.length);
+ }
+}
+
+const rateLimiter = new RateLimiter();
+
+/**
+ * 클라이언트 사이드 로깅 서비스
+ */
+class ClientLogger {
+ private static async logToServer(event: string, data: any) {
+ try {
+ // 로깅이 비활성화된 경우 서버 전송 안함
+ if (data.disableLogging) {
+ console.log(`[CLIENT LOG] ${event}:`, data);
+ return;
+ }
+
+ await fetch('/api/client-logs', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ body: JSON.stringify({
+ event,
+ data: {
+ ...data,
+ timestamp: new Date().toISOString(),
+ userAgent: navigator.userAgent,
+ url: window.location.href,
+ sessionId: this.getSessionId(),
+ },
+ }),
+ }).catch(error => {
+ // 로깅 실패해도 메인 기능에 영향 없도록
+ console.warn('로깅 실패:', error);
+ });
+ } catch (error) {
+ console.warn('로깅 실패:', error);
+ }
+ }
+
+ private static getSessionId(): string {
+ let sessionId = sessionStorage.getItem('client-session-id');
+ if (!sessionId) {
+ sessionId = crypto.randomUUID();
+ sessionStorage.setItem('client-session-id', sessionId);
+ }
+ return sessionId;
+ }
+
+ static logDownloadAttempt(filePath: string, fileName: string, action: string, options?: any) {
+ this.logToServer('download_attempt', {
+ filePath,
+ fileName,
+ action,
+ fileExtension: fileName.split('.').pop()?.toLowerCase(),
+ ...options,
+ });
+ }
+
+ static logDownloadSuccess(filePath: string, fileName: string, fileSize?: number, duration?: number) {
+ this.logToServer('download_success', {
+ filePath,
+ fileName,
+ fileSize,
+ duration,
+ fileExtension: fileName.split('.').pop()?.toLowerCase(),
+ });
+ }
+
+ static logDownloadError(filePath: string, fileName: string, error: string, duration?: number) {
+ this.logToServer('download_error', {
+ filePath,
+ fileName,
+ error,
+ duration,
+ fileExtension: fileName.split('.').pop()?.toLowerCase(),
+ });
+ }
+
+ static logSecurityViolation(type: string, details: any) {
+ this.logToServer('security_violation', {
+ type,
+ ...details,
+ });
+ }
+}
+
+/**
+ * 보안 검증 함수들
+ */
+const SecurityValidator = {
+ validateFileExtension(fileName: string): boolean {
+ const extension = fileName.split('.').pop()?.toLowerCase();
+ return extension ? SECURITY_CONFIG.ALLOWED_EXTENSIONS.has(extension) : false;
+ },
+
+ validateFileName(fileName: string): boolean {
+ // 위험한 문자 체크
+ const dangerousPatterns = [
+ /[<>:"'|?*]/, // 특수문자
+ /[\x00-\x1f]/, // 제어문자
+ /^\./, // 숨김 파일
+ /\.(exe|bat|cmd|scr|vbs|js|jar)$/i, // 실행 파일
+ ];
+
+ return !dangerousPatterns.some(pattern => pattern.test(fileName));
+ },
+
+ validateFilePath(filePath: string): boolean {
+ // 경로 탐색 공격 방지
+ const dangerousPatterns = [
+ /\.\./, // 상위 디렉토리 접근
+ /\/\//, // 이중 슬래시
+ /\\+/, // 백슬래시
+ /[<>:"'|?*]/, // 특수문자
+ ];
+
+ return !dangerousPatterns.some(pattern => pattern.test(filePath));
+ },
+
+ validateUrl(url: string): boolean {
+ try {
+ const urlObj = new URL(url);
+
+ // HTTPS 강제 (개발 환경 제외)
+ if (window.location.protocol === 'https:' && urlObj.protocol !== 'https:') {
+ if (!['localhost', '127.0.0.1'].includes(urlObj.hostname)) {
+ return false;
+ }
+ }
+
+ // 허용된 도메인 검사 (상대 URL은 허용)
+ if (urlObj.hostname && !SECURITY_CONFIG.ALLOWED_DOMAINS.includes(urlObj.hostname)) {
+ return false;
+ }
+
+ return true;
+ } catch {
+ return false;
+ }
+ },
+
+ validateFileSize(size: number): boolean {
+ return size <= SECURITY_CONFIG.MAX_FILE_SIZE;
+ },
+};
+
+/**
* 파일 정보 가져오기
*/
export const getFileInfo = (fileName: string): FileInfo => {
@@ -57,32 +291,24 @@ export const formatFileSize = (bytes: number): string => {
};
/**
- * 파일 다운로드 옵션
+ * 타임아웃이 적용된 fetch
*/
-export interface FileDownloadOptions {
- /** 다운로드 액션 타입 */
- action?: 'download' | 'preview';
- /** 에러 시 토스트 표시 여부 */
- showToast?: boolean;
- /** 성공 시 토스트 표시 여부 */
- showSuccessToast?: boolean;
- /** 커스텀 에러 핸들러 */
- onError?: (error: string) => void;
- /** 커스텀 성공 핸들러 */
- onSuccess?: (fileName: string, fileSize?: number) => void;
- /** 진행률 콜백 (큰 파일용) */
- onProgress?: (progress: number) => void;
-}
-
-/**
- * 파일 다운로드 결과
- */
-export interface FileDownloadResult {
- success: boolean;
- error?: string;
- fileSize?: number;
- fileInfo?: FileInfo;
-}
+const fetchWithTimeout = async (url: string, options: RequestInit = {}): Promise<Response> => {
+ const controller = new AbortController();
+ const timeoutId = setTimeout(() => controller.abort(), SECURITY_CONFIG.FETCH_TIMEOUT);
+
+ try {
+ const response = await fetch(url, {
+ ...options,
+ signal: controller.signal,
+ });
+ clearTimeout(timeoutId);
+ return response;
+ } catch (error) {
+ clearTimeout(timeoutId);
+ throw error;
+ }
+};
/**
* 파일 메타데이터 확인
@@ -95,7 +321,12 @@ export const checkFileMetadata = async (url: string): Promise<{
error?: string;
}> => {
try {
- const response = await fetch(url, {
+ // URL 보안 검증
+ if (!SecurityValidator.validateUrl(url)) {
+ return { exists: false, error: "허용되지 않은 URL입니다" };
+ }
+
+ const response = await fetchWithTimeout(url, {
method: 'HEAD',
headers: { 'Cache-Control': 'no-cache' }
});
@@ -110,6 +341,9 @@ export const checkFileMetadata = async (url: string): Promise<{
case 403:
error = "파일 접근 권한이 없습니다";
break;
+ case 429:
+ error = "요청이 너무 많습니다. 잠시 후 다시 시도해주세요";
+ break;
case 500:
error = "서버 오류가 발생했습니다";
break;
@@ -123,18 +357,26 @@ export const checkFileMetadata = async (url: string): Promise<{
const contentLength = response.headers.get('Content-Length');
const contentType = response.headers.get('Content-Type');
const lastModified = response.headers.get('Last-Modified');
+
+ const size = contentLength ? parseInt(contentLength, 10) : undefined;
+
+ // 파일 크기 검증
+ if (size && !SecurityValidator.validateFileSize(size)) {
+ return {
+ exists: false,
+ error: `파일이 너무 큽니다 (최대 ${formatFileSize(SECURITY_CONFIG.MAX_FILE_SIZE)})`
+ };
+ }
return {
exists: true,
- size: contentLength ? parseInt(contentLength, 10) : undefined,
+ size,
contentType: contentType || undefined,
lastModified: lastModified ? new Date(lastModified) : undefined,
};
} catch (error) {
- return {
- exists: false,
- error: error instanceof Error ? error.message : "네트워크 오류가 발생했습니다"
- };
+ const errorMessage = error instanceof Error ? error.message : "네트워크 오류가 발생했습니다";
+ return { exists: false, error: errorMessage };
}
};
@@ -146,85 +388,199 @@ export const downloadFile = async (
fileName: string,
options: FileDownloadOptions = {}
): Promise<FileDownloadResult> => {
- const { action = 'download', showToast = true, onError, onSuccess } = options;
+ const startTime = Date.now();
+ const { action = 'download', showToast = true, onError, onSuccess, disableLogging = false } = options;
+
+ // 로깅
+ if (!disableLogging) {
+ ClientLogger.logDownloadAttempt(filePath, fileName, action, {
+ userInitiated: true,
+ disableLogging
+ });
+ }
try {
- // ✅ URL에 다운로드 강제 파라미터 추가
+ // Rate limiting 체크
+ if (!rateLimiter.canDownload()) {
+ const error = `다운로드 제한 초과. ${rateLimiter.getRemainingDownloads()}회 남음`;
+ if (showToast) toast.error(error);
+ if (onError) onError(error);
+ if (!disableLogging) {
+ ClientLogger.logSecurityViolation('rate_limit_exceeded', { filePath, fileName });
+ }
+ return { success: false, error };
+ }
+
+ // 보안 검증
+ if (!SecurityValidator.validateFileName(fileName)) {
+ const error = "안전하지 않은 파일명입니다";
+ if (showToast) toast.error(error);
+ if (onError) onError(error);
+ if (!disableLogging) {
+ ClientLogger.logSecurityViolation('invalid_filename', { filePath, fileName });
+ }
+ return { success: false, error };
+ }
+
+ if (!SecurityValidator.validateFilePath(filePath)) {
+ const error = "안전하지 않은 파일 경로입니다";
+ if (showToast) toast.error(error);
+ if (onError) onError(error);
+ if (!disableLogging) {
+ ClientLogger.logSecurityViolation('invalid_filepath', { filePath, fileName });
+ }
+ return { success: false, error };
+ }
+
+ if (!SecurityValidator.validateFileExtension(fileName)) {
+ const error = "허용되지 않은 파일 형식입니다";
+ if (showToast) toast.error(error);
+ if (onError) onError(error);
+ if (!disableLogging) {
+ ClientLogger.logSecurityViolation('invalid_extension', { filePath, fileName });
+ }
+ return { success: false, error };
+ }
+
+ // URL 구성
const baseUrl = filePath.startsWith('http')
? filePath
: `${window.location.origin}${filePath}`;
const url = new URL(baseUrl);
if (action === 'download') {
- url.searchParams.set('download', 'true'); // 🔑 핵심!
+ url.searchParams.set('download', 'true');
}
const fullUrl = url.toString();
+ // URL 보안 검증
+ if (!SecurityValidator.validateUrl(fullUrl)) {
+ const error = "허용되지 않은 URL입니다";
+ if (showToast) toast.error(error);
+ if (onError) onError(error);
+ if (!disableLogging) {
+ ClientLogger.logSecurityViolation('invalid_url', { fullUrl, fileName });
+ }
+ return { success: false, error };
+ }
+
// 파일 정보 확인
const metadata = await checkFileMetadata(fullUrl);
if (!metadata.exists) {
const error = metadata.error || "파일을 찾을 수 없습니다";
if (showToast) toast.error(error);
if (onError) onError(error);
- return { success: false, error };
+ const duration = Date.now() - startTime;
+ if (!disableLogging) {
+ ClientLogger.logDownloadError(filePath, fileName, error, duration);
+ }
+ return { success: false, error, downloadDuration: duration };
}
const fileInfo = getFileInfo(fileName);
- // 미리보기 처리 (download=true 없이)
+ // 미리보기 처리
if (action === 'preview' && fileInfo.canPreview) {
const previewUrl = filePath.startsWith('http')
? filePath
: `${window.location.origin}${filePath}`;
- window.open(previewUrl, '_blank', 'noopener,noreferrer');
- if (showToast) toast.success(`${fileInfo.icon} 파일을 새 탭에서 열었습니다`);
- if (onSuccess) onSuccess(fileName, metadata.size);
- return { success: true, fileSize: metadata.size, fileInfo };
+ // 안전한 새 창 열기
+ const newWindow = window.open('', '_blank', 'noopener,noreferrer');
+ if (newWindow) {
+ newWindow.location.href = previewUrl;
+ if (showToast) toast.success(`${fileInfo.icon} 파일을 새 탭에서 열었습니다`);
+ if (onSuccess) onSuccess(fileName, metadata.size);
+ const duration = Date.now() - startTime;
+ if (!disableLogging) {
+ ClientLogger.logDownloadSuccess(filePath, fileName, metadata.size, duration);
+ }
+ return { success: true, fileSize: metadata.size, fileInfo, downloadDuration: duration };
+ } else {
+ throw new Error("팝업이 차단되었습니다. 팝업 차단을 해제해주세요.");
+ }
}
- // ✅ 안전한 다운로드 방식 (fetch + Blob)
- console.log(`📥 안전한 다운로드: ${fullUrl}`);
+ // 안전한 다운로드
+ console.log(`📥 보안 검증된 다운로드: ${fullUrl}`);
- const response = await fetch(fullUrl);
+ const response = await fetchWithTimeout(fullUrl);
if (!response.ok) {
throw new Error(`다운로드 실패: ${response.status}`);
}
+ // Content-Type 검증
+ const contentType = response.headers.get('Content-Type');
+ if (contentType && fileInfo.mimeType && !contentType.includes(fileInfo.mimeType.split(';')[0])) {
+ console.warn('⚠️ MIME 타입 불일치:', { expected: fileInfo.mimeType, actual: contentType });
+ }
+
// Blob으로 변환
const blob = await response.blob();
- // ✅ 브라우저 호환성을 고려한 다운로드
+ // 최종 파일 크기 검증
+ if (!SecurityValidator.validateFileSize(blob.size)) {
+ const error = `파일이 너무 큽니다 (최대 ${formatFileSize(SECURITY_CONFIG.MAX_FILE_SIZE)})`;
+ if (showToast) toast.error(error);
+ if (onError) onError(error);
+ const duration = Date.now() - startTime;
+ if (!disableLogging) {
+ ClientLogger.logDownloadError(filePath, fileName, error, duration);
+ }
+ return { success: false, error, downloadDuration: duration };
+ }
+
+ // 브라우저 호환성을 고려한 안전한 다운로드
const downloadUrl = URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = downloadUrl;
link.download = fileName;
- link.style.display = 'none'; // 화면에 표시되지 않도록
+ link.style.display = 'none';
+ link.setAttribute('data-download-source', 'secure-download-utility');
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
- // 메모리 정리 (중요!)
+ // 메모리 정리
setTimeout(() => URL.revokeObjectURL(downloadUrl), 100);
// 성공 처리
+ const duration = Date.now() - startTime;
if (showToast) {
- const sizeText = metadata.size ? ` (${formatFileSize(metadata.size)})` : '';
+ const sizeText = blob.size ? ` (${formatFileSize(blob.size)})` : '';
toast.success(`${fileInfo.icon} 파일 다운로드 완료: ${fileName}${sizeText}`);
}
- if (onSuccess) onSuccess(fileName, metadata.size);
+ if (onSuccess) onSuccess(fileName, blob.size);
+ if (!disableLogging) {
+ ClientLogger.logDownloadSuccess(filePath, fileName, blob.size, duration);
+ }
- return { success: true, fileSize: metadata.size, fileInfo };
+ return {
+ success: true,
+ fileSize: blob.size,
+ fileInfo,
+ downloadDuration: duration
+ };
} catch (error) {
+ const duration = Date.now() - startTime;
const errorMessage = error instanceof Error ? error.message : "파일 처리 중 오류가 발생했습니다";
+
console.error("❌ 다운로드 오류:", error);
if (showToast) toast.error(errorMessage);
if (onError) onError(errorMessage);
- return { success: false, error: errorMessage };
+ if (!disableLogging) {
+ ClientLogger.logDownloadError(filePath, fileName, errorMessage, duration);
+ }
+
+ return {
+ success: false,
+ error: errorMessage,
+ downloadDuration: duration
+ };
}
};
@@ -257,4 +613,17 @@ export const smartFileAction = (filePath: string, fileName: string) => {
const action = fileInfo.canPreview ? 'preview' : 'download';
return downloadFile(filePath, fileName, { action });
+};
+
+/**
+ * 보안 정보 조회
+ */
+export const getSecurityInfo = () => {
+ return {
+ allowedExtensions: Array.from(SECURITY_CONFIG.ALLOWED_EXTENSIONS),
+ maxFileSize: SECURITY_CONFIG.MAX_FILE_SIZE,
+ maxFileSizeFormatted: formatFileSize(SECURITY_CONFIG.MAX_FILE_SIZE),
+ remainingDownloads: rateLimiter.getRemainingDownloads(),
+ allowedDomains: SECURITY_CONFIG.ALLOWED_DOMAINS,
+ };
}; \ No newline at end of file
diff --git a/lib/file-stroage.ts b/lib/file-stroage.ts
index ae84f506..beca05ee 100644
--- a/lib/file-stroage.ts
+++ b/lib/file-stroage.ts
@@ -1,8 +1,9 @@
-// lib/file-storage.ts - File과 ArrayBuffer를 위한 분리된 함수들
+// lib/file-storage.ts - 보안이 강화된 파일 저장 유틸리티
import { promises as fs } from "fs";
import path from "path";
import crypto from "crypto";
+import { createHash } from "crypto";
interface FileStorageConfig {
baseDir: string;
@@ -10,6 +11,309 @@ interface FileStorageConfig {
isProduction: boolean;
}
+// 보안 설정
+const SECURITY_CONFIG = {
+ // 허용된 파일 확장자
+ ALLOWED_EXTENSIONS: new Set([
+ 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx',
+ 'txt', 'csv', 'png', 'jpg', 'jpeg', 'gif', 'bmp', 'webp',
+ // SVG 제거 - XSS 위험으로 인해
+ // 'svg',
+ 'dwg', 'dxf', 'zip', 'rar', '7z'
+ ]),
+
+ // 금지된 파일 확장자 (실행 파일 등)
+ FORBIDDEN_EXTENSIONS: new Set([
+ 'exe', 'bat', 'cmd', 'scr', 'vbs', 'js', 'jar', 'com', 'pif',
+ 'msi', 'reg', 'ps1', 'sh', 'php', 'asp', 'jsp', 'py', 'pl',
+ // XSS 방지를 위한 추가 확장자
+ 'html', 'htm', 'xhtml', 'xml', 'xsl', 'xslt'
+ ]),
+
+ // 허용된 MIME 타입
+ ALLOWED_MIME_TYPES: new Set([
+ 'application/pdf',
+ 'application/msword',
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
+ 'application/vnd.ms-excel',
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ 'image/jpeg', 'image/png', 'image/gif', 'image/bmp', 'image/webp',
+ // SVG 제거 - XSS 위험으로 인해
+ // 'image/svg+xml',
+ 'text/plain', 'text/csv',
+ 'application/zip', 'application/x-rar-compressed', 'application/x-7z-compressed'
+ ]),
+
+ // 최대 파일 크기 (100MB)
+ MAX_FILE_SIZE: 100 * 1024 * 1024,
+
+ // 파일명 최대 길이
+ MAX_FILENAME_LENGTH: 255,
+};
+
+// 보안 검증 클래스
+class FileSecurityValidator {
+ // 파일 확장자 검증
+ static validateExtension(fileName: string): { valid: boolean; error?: string } {
+ const extension = path.extname(fileName).toLowerCase().substring(1);
+
+ if (!extension) {
+ return { valid: false, error: "파일 확장자가 없습니다" };
+ }
+
+ if (SECURITY_CONFIG.FORBIDDEN_EXTENSIONS.has(extension)) {
+ return { valid: false, error: `금지된 파일 형식입니다: .${extension}` };
+ }
+
+ if (!SECURITY_CONFIG.ALLOWED_EXTENSIONS.has(extension)) {
+ return { valid: false, error: `허용되지 않은 파일 형식입니다: .${extension}` };
+ }
+
+ return { valid: true };
+ }
+
+ // 파일명 안전성 검증
+ static validateFileName(fileName: string): { valid: boolean; error?: string } {
+ // 길이 체크
+ if (fileName.length > SECURITY_CONFIG.MAX_FILENAME_LENGTH) {
+ return { valid: false, error: "파일명이 너무 깁니다" };
+ }
+
+ // 위험한 문자 체크 (XSS 방지 강화)
+ const dangerousPatterns = [
+ /[<>:"'|?*]/, // HTML 태그 및 특수문자
+ /[\x00-\x1f]/, // 제어문자
+ /^\./, // 숨김 파일
+ /\.\./, // 상위 디렉토리 접근
+ /\/|\\$/, // 경로 구분자
+ /javascript:/i, // JavaScript 프로토콜
+ /data:/i, // Data URI
+ /vbscript:/i, // VBScript 프로토콜
+ /on\w+=/i, // 이벤트 핸들러 (onclick=, onload= 등)
+ /<script/i, // Script 태그
+ /<iframe/i, // Iframe 태그
+ ];
+
+ for (const pattern of dangerousPatterns) {
+ if (pattern.test(fileName)) {
+ return { valid: false, error: "안전하지 않은 파일명입니다" };
+ }
+ }
+
+ // 예약된 Windows 파일명 체크
+ const reservedNames = ['CON', 'PRN', 'AUX', 'NUL', 'COM1', 'COM2', 'COM3', 'COM4', 'COM5', 'COM6', 'COM7', 'COM8', 'COM9', 'LPT1', 'LPT2', 'LPT3', 'LPT4', 'LPT5', 'LPT6', 'LPT7', 'LPT8', 'LPT9'];
+ const nameWithoutExt = path.basename(fileName, path.extname(fileName)).toUpperCase();
+
+ if (reservedNames.includes(nameWithoutExt)) {
+ return { valid: false, error: "예약된 파일명입니다" };
+ }
+
+ return { valid: true };
+ }
+
+ // 파일 크기 검증
+ static validateFileSize(size: number): { valid: boolean; error?: string } {
+ if (size <= 0) {
+ return { valid: false, error: "파일이 비어있습니다" };
+ }
+
+ if (size > SECURITY_CONFIG.MAX_FILE_SIZE) {
+ const maxSizeMB = Math.round(SECURITY_CONFIG.MAX_FILE_SIZE / (1024 * 1024));
+ return { valid: false, error: `파일 크기가 너무 큽니다 (최대 ${maxSizeMB}MB)` };
+ }
+
+ return { valid: true };
+ }
+
+ // MIME 타입 검증
+ static validateMimeType(mimeType: string, fileName: string): { valid: boolean; error?: string } {
+ if (!mimeType) {
+ return { valid: false, error: "MIME 타입을 확인할 수 없습니다" };
+ }
+
+ // 기본 MIME 타입 체크
+ const baseMimeType = mimeType.split(';')[0].toLowerCase();
+
+ if (!SECURITY_CONFIG.ALLOWED_MIME_TYPES.has(baseMimeType)) {
+ return { valid: false, error: `허용되지 않은 파일 형식입니다: ${baseMimeType}` };
+ }
+
+ // 확장자와 MIME 타입 일치성 체크
+ const extension = path.extname(fileName).toLowerCase().substring(1);
+ const expectedMimeTypes = this.getExpectedMimeTypes(extension);
+
+ if (expectedMimeTypes.length > 0 && !expectedMimeTypes.includes(baseMimeType)) {
+ console.warn(`⚠️ MIME 타입 불일치: ${fileName} (확장자: ${extension}, MIME: ${baseMimeType})`);
+ // 경고만 하고 허용 (일부 브라우저에서 MIME 타입이 다를 수 있음)
+ }
+
+ return { valid: true };
+ }
+
+ // 확장자별 예상되는 MIME 타입들
+ private static getExpectedMimeTypes(extension: string): string[] {
+ const mimeMap: Record<string, string[]> = {
+ 'pdf': ['application/pdf'],
+ 'doc': ['application/msword'],
+ 'docx': ['application/vnd.openxmlformats-officedocument.wordprocessingml.document'],
+ 'xls': ['application/vnd.ms-excel'],
+ 'xlsx': ['application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],
+ 'jpg': ['image/jpeg'],
+ 'jpeg': ['image/jpeg'],
+ 'png': ['image/png'],
+ 'gif': ['image/gif'],
+ 'bmp': ['image/bmp'],
+ 'svg': ['image/svg+xml'],
+ 'webp': ['image/webp'],
+ 'txt': ['text/plain'],
+ 'csv': ['text/csv', 'application/csv'],
+ 'zip': ['application/zip'],
+ 'rar': ['application/x-rar-compressed'],
+ '7z': ['application/x-7z-compressed'],
+ };
+
+ return mimeMap[extension] || [];
+ }
+
+ // 디렉터리 기본 안전성 검증 (경로 탐색 공격 방지)
+ static validateDirectory(directory: string): { valid: boolean; error?: string } {
+ // 경로 정규화
+ const normalizedDir = path.normalize(directory).replace(/^\/+/, '');
+
+ // 경로 탐색 공격 방지
+ if (normalizedDir.includes('..') || normalizedDir.includes('//')) {
+ return { valid: false, error: "안전하지 않은 디렉터리 경로입니다" };
+ }
+
+ // 절대 경로 방지
+ if (path.isAbsolute(directory)) {
+ return { valid: false, error: "절대 경로는 사용할 수 없습니다" };
+ }
+
+ return { valid: true };
+ }
+
+ // 파일 내용 기본 검증 (매직 넘버 체크 + XSS 패턴 검사)
+ static async validateFileContent(buffer: Buffer, fileName: string): Promise<{ valid: boolean; error?: string }> {
+ try {
+ const extension = path.extname(fileName).toLowerCase().substring(1);
+
+ // 파일 시그니처 (매직 넘버) 검증
+ const fileSignatures: Record<string, Buffer[]> = {
+ 'pdf': [Buffer.from([0x25, 0x50, 0x44, 0x46])], // %PDF
+ 'jpg': [Buffer.from([0xFF, 0xD8, 0xFF])],
+ 'jpeg': [Buffer.from([0xFF, 0xD8, 0xFF])],
+ 'png': [Buffer.from([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])],
+ 'gif': [Buffer.from([0x47, 0x49, 0x46, 0x38])], // GIF8
+ 'zip': [Buffer.from([0x50, 0x4B, 0x03, 0x04]), Buffer.from([0x50, 0x4B, 0x05, 0x06])],
+ };
+
+ const expectedSignatures = fileSignatures[extension];
+ if (expectedSignatures) {
+ const hasValidSignature = expectedSignatures.some(signature =>
+ buffer.subarray(0, signature.length).equals(signature)
+ );
+
+ if (!hasValidSignature) {
+ return { valid: false, error: `파일 내용이 확장자와 일치하지 않습니다: ${extension}` };
+ }
+ }
+
+ // 실행 파일 패턴 검색
+ const executablePatterns = [
+ Buffer.from([0x4D, 0x5A]), // MZ (Windows executable)
+ Buffer.from([0x7F, 0x45, 0x4C, 0x46]), // ELF (Linux executable)
+ ];
+
+ for (const pattern of executablePatterns) {
+ if (buffer.subarray(0, pattern.length).equals(pattern)) {
+ return { valid: false, error: "실행 파일은 업로드할 수 없습니다" };
+ }
+ }
+
+ // XSS 패턴 검사 (텍스트 기반 파일용)
+ const textBasedExtensions = ['txt', 'csv', 'xml', 'svg', 'html', 'htm'];
+ if (textBasedExtensions.includes(extension)) {
+ const content = buffer.toString('utf8', 0, Math.min(buffer.length, 8192)); // 첫 8KB만 검사
+
+ const xssPatterns = [
+ /<script[\s\S]*?>/i, // <script> 태그
+ /<iframe[\s\S]*?>/i, // <iframe> 태그
+ /on\w+\s*=\s*["'][^"']*["']/i, // 이벤트 핸들러 (onclick="...")
+ /javascript\s*:/i, // javascript: 프로토콜
+ /vbscript\s*:/i, // vbscript: 프로토콜
+ /data\s*:\s*text\/html/i, // data:text/html
+ /<meta[\s\S]*?http-equiv[\s\S]*?>/i, // meta refresh
+ /<object[\s\S]*?>/i, // object 태그
+ /<embed[\s\S]*?>/i, // embed 태그
+ /<form[\s\S]*?action[\s\S]*?>/i, // form 태그
+ ];
+
+ for (const pattern of xssPatterns) {
+ if (pattern.test(content)) {
+ return { valid: false, error: "파일에 잠재적으로 위험한 스크립트가 포함되어 있습니다" };
+ }
+ }
+ }
+
+ return { valid: true };
+ } catch (error) {
+ console.error("파일 내용 검증 오류:", error);
+ return { valid: false, error: "파일 내용을 검증할 수 없습니다" };
+ }
+ }
+}
+
+// 파일 업로드 로깅 클래스
+class FileUploadLogger {
+ static logUploadAttempt(fileName: string, size: number, directory: string, userId?: string) {
+ console.log(`📤 파일 업로드 시도:`, {
+ fileName,
+ size: this.formatFileSize(size),
+ directory,
+ userId,
+ timestamp: new Date().toISOString(),
+ });
+ }
+
+ static logUploadSuccess(fileName: string, hashedFileName: string, size: number, directory: string, userId?: string) {
+ console.log(`✅ 파일 업로드 성공:`, {
+ originalName: fileName,
+ savedName: hashedFileName,
+ size: this.formatFileSize(size),
+ directory,
+ userId,
+ timestamp: new Date().toISOString(),
+ });
+ }
+
+ static logUploadError(fileName: string, error: string, userId?: string) {
+ console.error(`❌ 파일 업로드 실패:`, {
+ fileName,
+ error,
+ userId,
+ timestamp: new Date().toISOString(),
+ });
+ }
+
+ static logSecurityViolation(fileName: string, violation: string, userId?: string) {
+ console.warn(`🚨 파일 업로드 보안 위반:`, {
+ fileName,
+ violation,
+ userId,
+ timestamp: new Date().toISOString(),
+ });
+ }
+
+ private static formatFileSize(bytes: number): string {
+ if (bytes === 0) return '0 Bytes';
+ const k = 1024;
+ const sizes = ['Bytes', 'KB', 'MB', 'GB'];
+ const i = Math.floor(Math.log(bytes) / Math.log(k));
+ return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i];
+ }
+}
+
// 파일명 해시 생성 유틸리티
export function generateHashedFileName(originalName: string): string {
const fileExtension = path.extname(originalName);
@@ -24,19 +328,43 @@ export function generateHashedFileName(originalName: string): string {
return `${timestamp}-${randomHash}${fileExtension}`;
}
-// ✅ File 저장용 인터페이스
+// HTML safe한 파일명 생성 (XSS 방지)
+export function sanitizeFileNameForDisplay(fileName: string): string {
+ return fileName
+ .replace(/&/g, '&amp;') // & → &amp;
+ .replace(/</g, '&lt;') // < → &lt;
+ .replace(/>/g, '&gt;') // > → &gt;
+ .replace(/"/g, '&quot;') // " → &quot;
+ .replace(/'/g, '&#39;') // ' → &#39;
+ .replace(/\//g, '&#47;') // / → &#47;
+ .replace(/\\/g, '&#92;'); // \ → &#92;
+}
+
+// 파일명에서 위험한 문자 제거 (저장용)
+export function sanitizeFileNameForStorage(fileName: string): string {
+ return fileName
+ .replace(/[<>:"'|?*\\\/]/g, '_') // 위험한 문자를 언더스코어로
+ .replace(/[\x00-\x1f]/g, '') // 제어문자 제거
+ .replace(/\s+/g, '_') // 공백을 언더스코어로
+ .replace(/_{2,}/g, '_') // 연속된 언더스코어를 하나로
+ .replace(/^_+|_+$/g, '') // 앞뒤 언더스코어 제거
+ .substring(0, 200); // 길이 제한
+}
+
+// 보안 강화된 파일 저장 옵션들
interface SaveFileOptions {
file: File;
directory: string;
originalName?: string;
+ userId?: string;
}
-// ✅ Buffer/ArrayBuffer 저장용 인터페이스
interface SaveBufferOptions {
buffer: Buffer | ArrayBuffer;
fileName: string;
directory: string;
originalName?: string;
+ userId?: string;
}
interface SaveFileResult {
@@ -44,10 +372,19 @@ interface SaveFileResult {
filePath?: string;
publicPath?: string;
fileName?: string;
+ originalName?: string;
+ fileSize?: number;
error?: string;
+ securityChecks?: {
+ extensionCheck: boolean;
+ fileNameCheck: boolean;
+ sizeCheck: boolean;
+ mimeTypeCheck: boolean;
+ contentCheck: boolean;
+ };
}
-const nasPath = process.env.NAS_PATH || "/evcp_nas"
+const nasPath = process.env.NAS_PATH || "/evcp_nas";
// 환경별 설정
function getStorageConfig(): FileStorageConfig {
@@ -68,22 +405,87 @@ function getStorageConfig(): FileStorageConfig {
}
}
-// ✅ 1. File 객체 저장 함수 (기존 방식)
+// 보안이 강화된 File 객체 저장 함수
export async function saveFile({
file,
directory,
- originalName
+ originalName,
+ userId,
}: SaveFileOptions): Promise<SaveFileResult> {
+ const finalFileName = originalName || file.name;
+
+ // 초기 로깅
+ FileUploadLogger.logUploadAttempt(finalFileName, file.size, directory, userId);
+
try {
const config = getStorageConfig();
- const finalFileName = originalName || file.name;
- const hashedFileName = generateHashedFileName(finalFileName);
+ const securityChecks = {
+ extensionCheck: false,
+ fileNameCheck: false,
+ sizeCheck: false,
+ mimeTypeCheck: false,
+ contentCheck: false,
+ };
+
+ // 1. 디렉터리 기본 안전성 검증
+ const dirValidation = FileSecurityValidator.validateDirectory(directory);
+ if (!dirValidation.valid) {
+ FileUploadLogger.logSecurityViolation(finalFileName, `Directory: ${dirValidation.error}`, userId);
+ return { success: false, error: dirValidation.error, securityChecks };
+ }
+
+ // 2. 파일 확장자 검증
+ const extValidation = FileSecurityValidator.validateExtension(finalFileName);
+ if (!extValidation.valid) {
+ FileUploadLogger.logSecurityViolation(finalFileName, `Extension: ${extValidation.error}`, userId);
+ return { success: false, error: extValidation.error, securityChecks };
+ }
+ securityChecks.extensionCheck = true;
+
+ // 3. 파일명 안전성 검증
+ const nameValidation = FileSecurityValidator.validateFileName(finalFileName);
+ if (!nameValidation.valid) {
+ FileUploadLogger.logSecurityViolation(finalFileName, `FileName: ${nameValidation.error}`, userId);
+ return { success: false, error: nameValidation.error, securityChecks };
+ }
+ securityChecks.fileNameCheck = true;
+
+ // 4. 파일 크기 검증
+ const sizeValidation = FileSecurityValidator.validateFileSize(file.size);
+ if (!sizeValidation.valid) {
+ FileUploadLogger.logSecurityViolation(finalFileName, `Size: ${sizeValidation.error}`, userId);
+ return { success: false, error: sizeValidation.error, securityChecks };
+ }
+ securityChecks.sizeCheck = true;
+
+ // 5. MIME 타입 검증
+ const mimeValidation = FileSecurityValidator.validateMimeType(file.type, finalFileName);
+ if (!mimeValidation.valid) {
+ FileUploadLogger.logSecurityViolation(finalFileName, `MIME: ${mimeValidation.error}`, userId);
+ return { success: false, error: mimeValidation.error, securityChecks };
+ }
+ securityChecks.mimeTypeCheck = true;
+
+ // 6. 파일 내용 추출 및 검증
+ const arrayBuffer = await file.arrayBuffer();
+ const dataBuffer = Buffer.from(arrayBuffer);
+
+ const contentValidation = await FileSecurityValidator.validateFileContent(dataBuffer, finalFileName);
+ if (!contentValidation.valid) {
+ FileUploadLogger.logSecurityViolation(finalFileName, `Content: ${contentValidation.error}`, userId);
+ return { success: false, error: contentValidation.error, securityChecks };
+ }
+ securityChecks.contentCheck = true;
+
+ // 7. 안전한 파일명 전처리
+ const safeOriginalName = sanitizeFileNameForStorage(finalFileName);
+ const hashedFileName = generateHashedFileName(safeOriginalName);
- // 저장 경로 설정
+ // 8. 저장 경로 설정
const saveDir = path.join(config.baseDir, directory);
const filePath = path.join(saveDir, hashedFileName);
- // 웹 접근 경로
+ // 9. 웹 접근 경로
let publicPath: string;
if (config.isProduction) {
publicPath = `${config.publicUrl}/${directory}/${hashedFileName}`;
@@ -91,54 +493,110 @@ export async function saveFile({
publicPath = `/${directory}/${hashedFileName}`;
}
- console.log(`📄 File 객체 저장: ${finalFileName}`);
+ console.log(`📄 보안 검증 완료 - File 객체 저장: ${finalFileName}`);
console.log(`📁 저장 위치: ${filePath}`);
console.log(`🌐 웹 접근 경로: ${publicPath}`);
- // 디렉토리 생성
+ // 10. 디렉토리 생성
await fs.mkdir(saveDir, { recursive: true });
- // File 객체에서 데이터 추출
- const arrayBuffer = await file.arrayBuffer();
- const dataBuffer = Buffer.from(arrayBuffer);
-
- // 파일 저장
+ // 11. 파일 저장
await fs.writeFile(filePath, dataBuffer);
- console.log(`✅ File 저장 완료: ${hashedFileName} (${dataBuffer.length} bytes)`);
+ // 12. 성공 로깅
+ FileUploadLogger.logUploadSuccess(finalFileName, hashedFileName, file.size, directory, userId);
return {
success: true,
filePath,
publicPath,
fileName: hashedFileName,
+ originalName: finalFileName,
+ fileSize: file.size,
+ securityChecks,
};
} catch (error) {
- console.error("File 저장 실패:", error);
+ const errorMessage = error instanceof Error ? error.message : "File 저장 중 오류가 발생했습니다.";
+ FileUploadLogger.logUploadError(finalFileName, errorMessage, userId);
return {
success: false,
- error: error instanceof Error ? error.message : "File 저장 중 오류가 발생했습니다.",
+ error: errorMessage,
};
}
}
-// ✅ 2. Buffer/ArrayBuffer 저장 함수 (DRM 복호화용)
+// 보안이 강화된 Buffer 저장 함수
export async function saveBuffer({
buffer,
fileName,
directory,
- originalName
+ originalName,
+ userId,
}: SaveBufferOptions): Promise<SaveFileResult> {
+ const finalFileName = originalName || fileName;
+ const dataBuffer = buffer instanceof ArrayBuffer ? Buffer.from(buffer) : buffer;
+
+ // 초기 로깅
+ FileUploadLogger.logUploadAttempt(finalFileName, dataBuffer.length, directory, userId);
+
try {
const config = getStorageConfig();
- const finalFileName = originalName || fileName;
- const hashedFileName = generateHashedFileName(finalFileName);
+ const securityChecks = {
+ extensionCheck: false,
+ fileNameCheck: false,
+ sizeCheck: false,
+ mimeTypeCheck: true, // Buffer는 MIME 타입 검증 스킵
+ contentCheck: false,
+ };
+
+ // 1. 디렉터리 기본 안전성 검증
+ const dirValidation = FileSecurityValidator.validateDirectory(directory);
+ if (!dirValidation.valid) {
+ FileUploadLogger.logSecurityViolation(finalFileName, `Directory: ${dirValidation.error}`, userId);
+ return { success: false, error: dirValidation.error, securityChecks };
+ }
+
+ // 2. 파일 확장자 검증
+ const extValidation = FileSecurityValidator.validateExtension(finalFileName);
+ if (!extValidation.valid) {
+ FileUploadLogger.logSecurityViolation(finalFileName, `Extension: ${extValidation.error}`, userId);
+ return { success: false, error: extValidation.error, securityChecks };
+ }
+ securityChecks.extensionCheck = true;
+
+ // 3. 파일명 안전성 검증
+ const nameValidation = FileSecurityValidator.validateFileName(finalFileName);
+ if (!nameValidation.valid) {
+ FileUploadLogger.logSecurityViolation(finalFileName, `FileName: ${nameValidation.error}`, userId);
+ return { success: false, error: nameValidation.error, securityChecks };
+ }
+ securityChecks.fileNameCheck = true;
+
+ // 4. 파일 크기 검증
+ const sizeValidation = FileSecurityValidator.validateFileSize(dataBuffer.length);
+ if (!sizeValidation.valid) {
+ FileUploadLogger.logSecurityViolation(finalFileName, `Size: ${sizeValidation.error}`, userId);
+ return { success: false, error: sizeValidation.error, securityChecks };
+ }
+ securityChecks.sizeCheck = true;
+
+ // 5. 파일 내용 검증
+ const contentValidation = await FileSecurityValidator.validateFileContent(dataBuffer, finalFileName);
+ if (!contentValidation.valid) {
+ FileUploadLogger.logSecurityViolation(finalFileName, `Content: ${contentValidation.error}`, userId);
+ return { success: false, error: contentValidation.error, securityChecks };
+ }
+ securityChecks.contentCheck = true;
- // 저장 경로 설정
+ // 6. 안전한 파일명 전처리
+ const safeOriginalName = sanitizeFileNameForStorage(finalFileName);
+ const hashedFileName = generateHashedFileName(safeOriginalName);
+
+ // 7. 저장 경로 설정
const saveDir = path.join(config.baseDir, directory);
const filePath = path.join(saveDir, hashedFileName);
- // 웹 접근 경로
+ // 8. 웹 접근 경로
let publicPath: string;
if (config.isProduction) {
publicPath = `${config.publicUrl}/${directory}/${hashedFileName}`;
@@ -146,37 +604,39 @@ export async function saveBuffer({
publicPath = `/${directory}/${hashedFileName}`;
}
- console.log(`🔓 Buffer/ArrayBuffer 저장: ${finalFileName}`);
+ console.log(`🔓 보안 검증 완료 - Buffer 저장: ${finalFileName}`);
console.log(`📁 저장 위치: ${filePath}`);
console.log(`🌐 웹 접근 경로: ${publicPath}`);
- // 디렉토리 생성
+ // 9. 디렉토리 생성
await fs.mkdir(saveDir, { recursive: true });
- // Buffer 준비
- const dataBuffer = buffer instanceof ArrayBuffer ? Buffer.from(buffer) : buffer;
-
- // 파일 저장
+ // 10. 파일 저장
await fs.writeFile(filePath, dataBuffer);
- console.log(`✅ Buffer 저장 완료: ${hashedFileName} (${dataBuffer.length} bytes)`);
+ // 11. 성공 로깅
+ FileUploadLogger.logUploadSuccess(finalFileName, hashedFileName, dataBuffer.length, directory, userId);
return {
success: true,
filePath,
publicPath,
fileName: hashedFileName,
+ originalName: finalFileName,
+ fileSize: dataBuffer.length,
+ securityChecks,
};
} catch (error) {
- console.error("Buffer 저장 실패:", error);
+ const errorMessage = error instanceof Error ? error.message : "Buffer 저장 중 오류가 발생했습니다.";
+ FileUploadLogger.logUploadError(finalFileName, errorMessage, userId);
return {
success: false,
- error: error instanceof Error ? error.message : "Buffer 저장 중 오류가 발생했습니다.",
+ error: errorMessage,
};
}
}
-// ✅ 업데이트 함수들
+// 업데이트 함수들 (보안 검증 포함)
export async function updateFile(
options: SaveFileOptions,
oldFilePath?: string
@@ -190,11 +650,9 @@ export async function updateFile(
return result;
} catch (error) {
- console.error("File 업데이트 실패:", error);
- return {
- success: false,
- error: error instanceof Error ? error.message : "File 업데이트 중 오류가 발생했습니다.",
- };
+ const errorMessage = error instanceof Error ? error.message : "File 업데이트 중 오류가 발생했습니다.";
+ FileUploadLogger.logUploadError(options.originalName || options.file.name, errorMessage, options.userId);
+ return { success: false, error: errorMessage };
}
}
@@ -211,15 +669,13 @@ export async function updateBuffer(
return result;
} catch (error) {
- console.error("Buffer 업데이트 실패:", error);
- return {
- success: false,
- error: error instanceof Error ? error.message : "Buffer 업데이트 중 오류가 발생했습니다.",
- };
+ const errorMessage = error instanceof Error ? error.message : "Buffer 업데이트 중 오류가 발생했습니다.";
+ FileUploadLogger.logUploadError(options.originalName || options.fileName, errorMessage, options.userId);
+ return { success: false, error: errorMessage };
}
}
-// 파일 삭제 함수
+// 안전한 파일 삭제 함수
export async function deleteFile(publicPath: string): Promise<boolean> {
try {
const config = getStorageConfig();
@@ -232,6 +688,13 @@ export async function deleteFile(publicPath: string): Promise<boolean> {
absolutePath = path.join(process.cwd(), 'public', publicPath);
}
+ // 경로 안전성 검증
+ const normalizedPath = path.normalize(absolutePath);
+ if (normalizedPath.includes('..')) {
+ console.error("🚨 위험한 파일 삭제 시도:", absolutePath);
+ return false;
+ }
+
console.log(`🗑️ 파일 삭제: ${absolutePath}`);
await fs.access(absolutePath);
@@ -243,17 +706,18 @@ export async function deleteFile(publicPath: string): Promise<boolean> {
}
}
-// ✅ 편의 함수들 (하위 호환성)
+// 편의 함수들 (하위 호환성)
export const save = {
file: saveFile,
buffer: saveBuffer,
};
-// ✅ DRM 워크플로우 통합 함수
+// DRM 워크플로우 통합 함수 (보안 강화)
export async function saveDRMFile(
originalFile: File,
decryptFunction: (file: File) => Promise<ArrayBuffer>,
- directory: string
+ directory: string,
+ userId?: string
): Promise<SaveFileResult> {
try {
console.log(`🔐 DRM 파일 처리 시작: ${originalFile.name}`);
@@ -261,11 +725,12 @@ export async function saveDRMFile(
// 1. DRM 복호화
const decryptedData = await decryptFunction(originalFile);
- // 2. 복호화된 데이터 저장
+ // 2. 보안 검증과 함께 복호화된 데이터 저장
const result = await saveBuffer({
buffer: decryptedData,
fileName: originalFile.name,
- directory
+ directory,
+ userId,
});
if (result.success) {
@@ -274,10 +739,21 @@ export async function saveDRMFile(
return result;
} catch (error) {
+ const errorMessage = error instanceof Error ? error.message : "DRM 파일 처리 중 오류가 발생했습니다.";
console.error(`❌ DRM 파일 처리 실패: ${originalFile.name}`, error);
- return {
- success: false,
- error: error instanceof Error ? error.message : "DRM 파일 처리 중 오류가 발생했습니다.",
- };
+ FileUploadLogger.logUploadError(originalFile.name, errorMessage, userId);
+ return { success: false, error: errorMessage };
}
+}
+
+// 보안 설정 조회 함수
+export function getSecurityConfig() {
+ return {
+ allowedExtensions: Array.from(SECURITY_CONFIG.ALLOWED_EXTENSIONS),
+ forbiddenExtensions: Array.from(SECURITY_CONFIG.FORBIDDEN_EXTENSIONS),
+ allowedMimeTypes: Array.from(SECURITY_CONFIG.ALLOWED_MIME_TYPES),
+ maxFileSize: SECURITY_CONFIG.MAX_FILE_SIZE,
+ maxFileSizeFormatted: FileUploadLogger['formatFileSize'](SECURITY_CONFIG.MAX_FILE_SIZE),
+ maxFilenameLength: SECURITY_CONFIG.MAX_FILENAME_LENGTH,
+ };
} \ No newline at end of file
diff --git a/lib/network/get-client-ip.ts b/lib/network/get-client-ip.ts
new file mode 100644
index 00000000..566700e9
--- /dev/null
+++ b/lib/network/get-client-ip.ts
@@ -0,0 +1,116 @@
+import { NextRequest } from 'next/server';
+
+export interface GetClientIpOptions {
+ /**
+ * Which index to take from a comma-separated forwarded-for list.
+ * 0 = leftmost (original client; default).
+ * -1 = rightmost (closest hop).
+ */
+ forwardedIndex?: number;
+
+ /**
+ * Custom header priority override. Default uses common reverse-proxy headers.
+ */
+ headerPriority?: readonly string[];
+
+ /**
+ * Value to return when nothing found.
+ * Default: 'unknown'
+ */
+ fallback?: string;
+}
+
+const DEFAULT_HEADER_PRIORITY = [
+ 'x-forwarded-for',
+ 'x-real-ip',
+ 'cf-connecting-ip',
+ 'vercel-forwarded-for',
+] as const;
+
+export function getClientIp(
+ req: NextRequest,
+ opts: GetClientIpOptions = {}
+): string {
+ const {
+ forwardedIndex = 0,
+ headerPriority = DEFAULT_HEADER_PRIORITY,
+ fallback = 'unknown',
+ } = opts;
+
+ for (const h of headerPriority) {
+ const raw = req.headers.get(h);
+ if (!raw) continue;
+
+ // headers like x-forwarded-for can be CSV
+ const parts = raw.split(',').map(p => p.trim()).filter(Boolean);
+ if (parts.length === 0) continue;
+
+ const idx =
+ forwardedIndex >= 0
+ ? forwardedIndex
+ : parts.length + forwardedIndex; // support -1 end indexing
+
+ const sel = parts[idx] ?? parts[0]; // safe fallback to 0
+ const norm = normalizeIp(sel);
+ if (norm) return norm;
+ }
+
+ return fallback;
+}
+
+/**
+ * Normalize IPv4/IPv6/port-suffixed forms to a canonical-ish string.
+ */
+export function normalizeIp(raw: string | null | undefined): string {
+ if (!raw) return '';
+
+ let ip = raw.trim();
+
+ // Strip brackets: [2001:db8::1]
+ if (ip.startsWith('[') && ip.endsWith(']')) {
+ ip = ip.slice(1, -1);
+ }
+
+ // IPv4:port (because some proxies send ip:port)
+ // Heuristic: if '.' present (IPv4-ish) and ':' present, drop port after last colon.
+ if (ip.includes('.') && ip.includes(':')) {
+ ip = ip.slice(0, ip.lastIndexOf(':'));
+ }
+
+ // IPv4-mapped IPv6 ::ffff:203.0.113.5
+ if (ip.startsWith('::ffff:')) {
+ ip = ip.substring(7);
+ }
+
+ return ip;
+}
+
+
+export interface RequestInfo {
+ ip: string;
+ userAgent: string;
+ referer?: string;
+ requestId: string;
+ method: string;
+ url: string;
+ }
+
+ export function getRequestInfo(req: NextRequest, ipOpts?: GetClientIpOptions): RequestInfo {
+ const ip = getClientIp(req, ipOpts);
+ const userAgent = req.headers.get('user-agent')?.trim() || 'unknown';
+
+ const refererRaw = req.headers.get('referer')?.trim();
+ const referer = refererRaw && refererRaw.length > 0 ? refererRaw : undefined;
+
+ const { href, pathname } = req.nextUrl;
+
+ return {
+ ip,
+ userAgent,
+ referer,
+ requestId: (globalThis.crypto?.randomUUID?.() ?? crypto.randomUUID()),
+ method: req.method,
+ url: href || pathname,
+ };
+ }
+ \ No newline at end of file
diff --git a/lib/notification/NotificationContext.tsx b/lib/notification/NotificationContext.tsx
new file mode 100644
index 00000000..b1779264
--- /dev/null
+++ b/lib/notification/NotificationContext.tsx
@@ -0,0 +1,219 @@
+// lib/notification/NotificationContext.tsx
+"use client";
+
+import React, { createContext, useContext, useEffect, useState } from 'react';
+import { useSession } from 'next-auth/react';
+import { toast } from 'sonner'; // 또는 react-hot-toast
+
+interface Notification {
+ id: string;
+ title: string;
+ message: string;
+ type: string;
+ relatedRecordId?: string;
+ relatedRecordType?: string;
+ isRead: boolean;
+ createdAt: string;
+}
+
+interface NotificationContextType {
+ notifications: Notification[];
+ unreadCount: number;
+ markAsRead: (id: string) => Promise<void>;
+ markAllAsRead: () => Promise<void>;
+ refreshNotifications: () => Promise<void>;
+}
+
+const NotificationContext = createContext<NotificationContextType | null>(null);
+
+export function NotificationProvider({ children }: { children: React.ReactNode }) {
+ const { data: session } = useSession();
+ const [notifications, setNotifications] = useState<Notification[]>([]);
+ const [unreadCount, setUnreadCount] = useState(0);
+
+ // 알림 목록 가져오기
+ const refreshNotifications = async () => {
+ if (!session?.user) return;
+
+ try {
+ const response = await fetch('/api/notifications');
+ const data = await response.json();
+ setNotifications(data.notifications);
+ setUnreadCount(data.unreadCount);
+ } catch (error) {
+ console.error('Failed to fetch notifications:', error);
+ }
+ };
+
+ // 읽음 처리
+ const markAsRead = async (id: string) => {
+ try {
+ await fetch(`/api/notifications/${id}/read`, { method: 'PATCH' });
+ setNotifications(prev =>
+ prev.map(n => n.id === id ? { ...n, isRead: true } : n)
+ );
+ setUnreadCount(prev => prev - 1);
+ } catch (error) {
+ console.error('Failed to mark notification as read:', error);
+ }
+ };
+
+ // 모든 알림 읽음 처리
+ const markAllAsRead = async () => {
+ try {
+ await fetch('/api/notifications/read-all', { method: 'PATCH' });
+ setNotifications(prev => prev.map(n => ({ ...n, isRead: true })));
+ setUnreadCount(0);
+ } catch (error) {
+ console.error('Failed to mark all notifications as read:', error);
+ }
+ };
+
+ // SSE 연결로 실시간 알림 수신
+ useEffect(() => {
+ if (!session?.user) return;
+
+ // 초기 알림 로드
+ refreshNotifications();
+
+ // SSE 연결
+ const eventSource = new EventSource('/api/notifications/stream');
+
+ eventSource.onmessage = (event) => {
+ try {
+ const data = JSON.parse(event.data);
+
+ if (data.type === 'heartbeat' || data.type === 'connected') {
+ return; // 하트비트 및 연결 확인 메시지는 무시
+ }
+
+ if (data.type === 'new_notification') {
+ const newNotification = data.data;
+
+ // 새 알림을 기존 목록에 추가
+ setNotifications(prev => [newNotification, ...prev]);
+ setUnreadCount(prev => prev + 1);
+
+ // Toast 알림 표시
+ toast(newNotification.title, {
+ description: newNotification.message,
+ action: {
+ label: "보기",
+ onClick: () => {
+ handleNotificationClick(newNotification);
+ },
+ },
+ });
+ } else if (data.type === 'notification_read') {
+ const readData = data.data;
+
+ // 읽음 상태 업데이트
+ setNotifications(prev =>
+ prev.map(n => n.id === readData.id ? { ...n, isRead: true, readAt: readData.read_at } : n)
+ );
+
+ if (!readData.is_read) {
+ setUnreadCount(prev => Math.max(0, prev - 1));
+ }
+ }
+ } catch (error) {
+ console.error('Failed to parse SSE data:', error);
+ }
+ };
+
+ eventSource.onopen = () => {
+ console.log('SSE connection established');
+ };
+
+ eventSource.onerror = (error) => {
+ console.error('SSE error:', error);
+ // 자동 재연결은 EventSource가 처리
+ };
+
+ return () => {
+ eventSource.close();
+ };
+ }, [session?.user]);
+
+ const handleNotificationClick = (notification: Notification) => {
+ // 알림 클릭 시 관련 페이지로 이동
+ if (notification.relatedRecordId && notification.relatedRecordType) {
+ const url = getNotificationUrl(notification.relatedRecordType, notification.relatedRecordId);
+ window.location.href = url;
+ }
+ markAsRead(notification.id);
+ };
+
+ const getNotificationUrl = (type: string, id: string | null) => {
+ const pathParts = window.location.pathname.split('/');
+ const lng = pathParts[1];
+ const domain = pathParts[2];
+
+ // 도메인별 기본 URL 설정
+ const baseUrls = {
+ 'partners': `/${lng}/partners`,
+ 'procurement': `/${lng}/procurement`,
+ 'sales': `/${lng}/sales`,
+ 'engineering': `/${lng}/engineering`,
+ 'evcp': `/${lng}/evcp`
+ };
+
+ const baseUrl = baseUrls[domain as keyof typeof baseUrls] || `/${lng}/evcp`;
+
+ if (!id) {
+ // ID가 없는 경우 (시스템 공지, 일반 알림 등)
+ switch (type) {
+ case 'evaluation':
+ case 'evaluation_request':
+ return domain === 'partners' ? `${baseUrl}/evaluation` : `${baseUrl}/evaluations`;
+ case 'announcement':
+ case 'system':
+ return `${baseUrl}/announcements`;
+ default:
+ return baseUrl;
+ }
+ }
+
+ // ID가 있는 경우
+ switch (type) {
+ case 'project':
+ return `${baseUrl}/projects/${id}`;
+ case 'task':
+ return `${baseUrl}/tasks/${id}`;
+ case 'order':
+ return `${baseUrl}/orders/${id}`;
+ case 'evaluation_submission':
+ return domain === 'partners'
+ ? `${baseUrl}/evaluation/${id}`
+ : `${baseUrl}/evaluations/submissions/${id}`;
+ case 'document':
+ return `${baseUrl}/documents/${id}`;
+ case 'approval':
+ return `${baseUrl}/approvals/${id}`;
+ default:
+ return baseUrl;
+ }
+ };
+
+ return (
+ <NotificationContext.Provider
+ value={{
+ notifications,
+ unreadCount,
+ markAsRead,
+ markAllAsRead,
+ refreshNotifications
+ }}
+ >
+ {children}
+ </NotificationContext.Provider>
+ );
+}
+
+export function useNotifications() {
+ const context = useContext(NotificationContext);
+ if (!context) {
+ throw new Error('useNotifications must be used within NotificationProvider');
+ }
+ return context;
+} \ No newline at end of file
diff --git a/lib/notification/service.ts b/lib/notification/service.ts
new file mode 100644
index 00000000..f0018113
--- /dev/null
+++ b/lib/notification/service.ts
@@ -0,0 +1,342 @@
+// lib/notification/service.ts
+import db from '@/db/db';
+import { notifications, type NewNotification, type Notification } from '@/db/schema';
+import { eq, and, desc, count, gt } from 'drizzle-orm';
+
+// 알림 생성
+export async function createNotification(data: Omit<NewNotification, 'id' | 'createdAt'>) {
+ const [notification] = await db
+ .insert(notifications)
+ .values({
+ ...data,
+ createdAt: new Date(),
+ })
+ .returning();
+
+ return notification;
+}
+
+// 여러 알림 한번에 생성 (벌크 생성)
+export async function createNotifications(data: Omit<NewNotification, 'id' | 'createdAt'>[]) {
+ if (data.length === 0) return [];
+
+ const notificationsData = data.map(item => ({
+ ...item,
+ createdAt: new Date(),
+ }));
+
+ const createdNotifications = await db
+ .insert(notifications)
+ .values(notificationsData)
+ .returning();
+
+ return createdNotifications;
+}
+
+// 사용자의 알림 목록 조회 (페이지네이션 포함)
+export async function getUserNotifications(
+ userId: string,
+ options: {
+ limit?: number;
+ offset?: number;
+ unreadOnly?: boolean;
+ } = {}
+) {
+ const { limit = 20, offset = 0, unreadOnly = false } = options;
+
+ const whereConditions = [eq(notifications.userId, userId)];
+
+ if (unreadOnly) {
+ whereConditions.push(eq(notifications.isRead, false));
+ }
+
+ const userNotifications = await db
+ .select()
+ .from(notifications)
+ .where(and(...whereConditions))
+ .orderBy(desc(notifications.createdAt))
+ .limit(limit)
+ .offset(offset);
+
+ return userNotifications;
+}
+
+// 읽지 않은 알림 개수 조회
+export async function getUnreadNotificationCount(userId: string) {
+ const [result] = await db
+ .select({ count: count() })
+ .from(notifications)
+ .where(
+ and(
+ eq(notifications.userId, userId),
+ eq(notifications.isRead, false)
+ )
+ );
+
+ return result.count;
+}
+
+// 알림 읽음 처리
+export async function markNotificationAsRead(notificationId: string, userId: string) {
+ const [updatedNotification] = await db
+ .update(notifications)
+ .set({
+ isRead: true,
+ readAt: new Date()
+ })
+ .where(
+ and(
+ eq(notifications.id, notificationId),
+ eq(notifications.userId, userId)
+ )
+ )
+ .returning();
+
+ return updatedNotification;
+}
+
+// 모든 알림 읽음 처리
+export async function markAllNotificationsAsRead(userId: string) {
+ const updatedNotifications = await db
+ .update(notifications)
+ .set({
+ isRead: true,
+ readAt: new Date()
+ })
+ .where(
+ and(
+ eq(notifications.userId, userId),
+ eq(notifications.isRead, false)
+ )
+ )
+ .returning();
+
+ return updatedNotifications;
+}
+
+// 특정 알림 삭제
+export async function deleteNotification(notificationId: string, userId: string) {
+ const [deletedNotification] = await db
+ .delete(notifications)
+ .where(
+ and(
+ eq(notifications.id, notificationId),
+ eq(notifications.userId, userId)
+ )
+ )
+ .returning();
+
+ return deletedNotification;
+}
+
+// 최근 알림 조회 (실시간 업데이트용)
+export async function getLatestNotifications(userId: string, since?: Date) {
+ const whereConditions = [eq(notifications.userId, userId)];
+
+ if (since) {
+ whereConditions.push(gt(notifications.createdAt, since));
+ }
+
+ const latestNotifications = await db
+ .select()
+ .from(notifications)
+ .where(and(...whereConditions))
+ .orderBy(desc(notifications.createdAt))
+ .limit(10);
+
+ return latestNotifications;
+}
+
+// =========================
+// 알림 템플릿 및 헬퍼 함수들
+// =========================
+
+export const NotificationTemplates = {
+ // 프로젝트 관련
+ projectAssigned: (projectName: string, projectId: string): Omit<NewNotification, 'userId' | 'id' | 'createdAt'> => ({
+ title: '새 프로젝트가 할당되었습니다',
+ message: `"${projectName}" 프로젝트가 회원님에게 할당되었습니다.`,
+ type: 'assignment',
+ relatedRecordId: projectId,
+ relatedRecordType: 'project',
+ isRead: false,
+ }),
+
+ // 작업 관련
+ taskAssigned: (taskName: string, taskId: string): Omit<NewNotification, 'userId' | 'id' | 'createdAt'> => ({
+ title: '새 작업이 할당되었습니다',
+ message: `"${taskName}" 작업이 회원님에게 할당되었습니다.`,
+ type: 'assignment',
+ relatedRecordId: taskId,
+ relatedRecordType: 'task',
+ isRead: false,
+ }),
+
+ // 주문 관련
+ orderStatusChanged: (orderNumber: string, status: string, orderId: string): Omit<NewNotification, 'userId' | 'id' | 'createdAt'> => ({
+ title: '주문 상태가 변경되었습니다',
+ message: `주문 ${orderNumber}의 상태가 "${status}"로 변경되었습니다.`,
+ type: 'status_change',
+ relatedRecordId: orderId,
+ relatedRecordType: 'order',
+ isRead: false,
+ }),
+
+ // 평가 관련
+ evaluationDocumentRequested: (evaluationYear: number, evaluationRound: string, dueDate?: string): Omit<NewNotification, 'userId' | 'id' | 'createdAt'> => ({
+ title: '협력업체 평가 자료 제출 요청',
+ message: `${evaluationYear}년 ${evaluationRound} 협력업체 평가 자료 제출이 요청되었습니다.${dueDate ? ` 마감일: ${dueDate}` : ''}`,
+ type: 'evaluation_request',
+ relatedRecordId: null,
+ relatedRecordType: 'evaluation',
+ isRead: false,
+ }),
+
+ evaluationRequestCompleted: (vendorCount: number, evaluationYear: number, evaluationRound: string): Omit<NewNotification, 'userId' | 'id' | 'createdAt'> => ({
+ title: '평가 자료 요청이 완료되었습니다',
+ message: `${vendorCount}개 협력업체에게 ${evaluationYear}년 ${evaluationRound} 평가 자료 요청이 완료되었습니다.`,
+ type: 'evaluation_admin',
+ relatedRecordId: null,
+ relatedRecordType: 'evaluation',
+ isRead: false,
+ }),
+
+ evaluationSubmitted: (vendorName: string, evaluationYear: number, evaluationRound: string, submissionId: string): Omit<NewNotification, 'userId' | 'id' | 'createdAt'> => ({
+ title: '협력업체 평가가 제출되었습니다',
+ message: `${vendorName}에서 ${evaluationYear}년 ${evaluationRound} 평가를 제출했습니다.`,
+ type: 'evaluation_submission',
+ relatedRecordId: submissionId,
+ relatedRecordType: 'evaluation_submission',
+ isRead: false,
+ }),
+
+ // 승인 관련
+ approvalRequired: (documentName: string, documentId: string): Omit<NewNotification, 'userId' | 'id' | 'createdAt'> => ({
+ title: '승인이 필요합니다',
+ message: `"${documentName}" 문서의 승인이 필요합니다.`,
+ type: 'approval',
+ relatedRecordId: documentId,
+ relatedRecordType: 'document',
+ isRead: false,
+ }),
+
+ // 마감일 관련
+ deadlineReminder: (taskName: string, daysLeft: number, taskId: string): Omit<NewNotification, 'userId' | 'id' | 'createdAt'> => ({
+ title: '마감일 알림',
+ message: `"${taskName}" 작업의 마감일이 ${daysLeft}일 남았습니다.`,
+ type: 'deadline',
+ relatedRecordId: taskId,
+ relatedRecordType: 'task',
+ isRead: false,
+ }),
+
+ // 시스템 공지
+ systemAnnouncement: (title: string, message: string): Omit<NewNotification, 'userId' | 'id' | 'createdAt'> => ({
+ title,
+ message,
+ type: 'announcement',
+ relatedRecordId: null,
+ relatedRecordType: 'system',
+ isRead: false,
+ }),
+};
+
+// =========================
+// 비즈니스 로직별 편의 함수들
+// =========================
+
+// 프로젝트 할당 알림
+export async function notifyProjectAssignment(userId: string, projectName: string, projectId: string) {
+ return await createNotification({
+ userId,
+ ...NotificationTemplates.projectAssigned(projectName, projectId),
+ });
+}
+
+// 작업 할당 알림
+export async function notifyTaskAssignment(userId: string, taskName: string, taskId: string) {
+ return await createNotification({
+ userId,
+ ...NotificationTemplates.taskAssigned(taskName, taskId),
+ });
+}
+
+// 주문 상태 변경 알림
+export async function notifyOrderStatusChange(userId: string, orderNumber: string, status: string, orderId: string) {
+ return await createNotification({
+ userId,
+ ...NotificationTemplates.orderStatusChanged(orderNumber, status, orderId),
+ });
+}
+
+// 평가 자료 요청 알림 (벤더에게)
+export async function notifyEvaluationDocumentRequest(
+ userIds: string[],
+ evaluationYear: number,
+ evaluationRound: string,
+ dueDate?: string
+) {
+ const template = NotificationTemplates.evaluationDocumentRequested(evaluationYear, evaluationRound, dueDate);
+
+ const notificationsData = userIds.map(userId => ({
+ userId,
+ ...template,
+ }));
+
+ return await createNotifications(notificationsData);
+}
+
+// 평가 요청 완료 알림 (관리자에게)
+export async function notifyEvaluationRequestCompleted(
+ adminUserIds: string[],
+ vendorCount: number,
+ evaluationYear: number,
+ evaluationRound: string
+) {
+ const template = NotificationTemplates.evaluationRequestCompleted(vendorCount, evaluationYear, evaluationRound);
+
+ const notificationsData = adminUserIds.map(userId => ({
+ userId,
+ ...template,
+ }));
+
+ return await createNotifications(notificationsData);
+}
+
+// 평가 제출 알림 (평가 담당자에게)
+export async function notifyEvaluationSubmission(
+ evaluatorUserIds: string[],
+ vendorName: string,
+ evaluationYear: number,
+ evaluationRound: string,
+ submissionId: string
+) {
+ const template = NotificationTemplates.evaluationSubmitted(vendorName, evaluationYear, evaluationRound, submissionId);
+
+ const notificationsData = evaluatorUserIds.map(userId => ({
+ userId,
+ ...template,
+ }));
+
+ return await createNotifications(notificationsData);
+}
+
+// 승인 요청 알림
+export async function notifyApprovalRequired(userId: string, documentName: string, documentId: string) {
+ return await createNotification({
+ userId,
+ ...NotificationTemplates.approvalRequired(documentName, documentId),
+ });
+}
+
+// 시스템 공지 (전체 사용자)
+export async function broadcastSystemAnnouncement(userIds: string[], title: string, message: string) {
+ const template = NotificationTemplates.systemAnnouncement(title, message);
+
+ const notificationsData = userIds.map(userId => ({
+ userId,
+ ...template,
+ }));
+
+ return await createNotifications(notificationsData);
+} \ No newline at end of file
diff --git a/lib/rate-limit.ts b/lib/rate-limit.ts
new file mode 100644
index 00000000..db90dcff
--- /dev/null
+++ b/lib/rate-limit.ts
@@ -0,0 +1,63 @@
+// lib/rate-limit.ts
+import { NextRequest } from 'next/server';
+import { getClientIp } from './network/get-client-ip';
+
+interface RateLimitResult {
+ success: boolean;
+ remaining?: number;
+}
+
+// 메모리 기반 간단한 rate limiter (프로덕션에서는 Redis 사용 권장)
+const requestCounts = new Map<string, { count: number; resetTime: number }>();
+
+
+
+export default async function rateLimit(
+ request: NextRequest,
+ maxRequests: number = 100,
+ windowMs: number = 60 * 60 * 1000 // 1시간
+): Promise<RateLimitResult> {
+ // 클라이언트 IP 가져오기
+ const clientIP = getClientIp(request);
+
+
+ const now = Date.now();
+ const key = `rate_limit:${clientIP}`;
+
+ // 기존 요청 정보 가져오기
+ let requestInfo = requestCounts.get(key);
+
+ // 윈도우가 리셋된 경우 또는 첫 요청인 경우
+ if (!requestInfo || now > requestInfo.resetTime) {
+ requestInfo = {
+ count: 1,
+ resetTime: now + windowMs
+ };
+ requestCounts.set(key, requestInfo);
+ return { success: true, remaining: maxRequests - 1 };
+ }
+
+ // 요청 한도 초과 확인
+ if (requestInfo.count >= maxRequests) {
+ return { success: false, remaining: 0 };
+ }
+
+ // 요청 카운트 증가
+ requestInfo.count++;
+ requestCounts.set(key, requestInfo);
+
+ return {
+ success: true,
+ remaining: maxRequests - requestInfo.count
+ };
+}
+
+// 주기적으로 만료된 항목 정리 (메모리 누수 방지)
+setInterval(() => {
+ const now = Date.now();
+ for (const [key, value] of requestCounts.entries()) {
+ if (now > value.resetTime) {
+ requestCounts.delete(key);
+ }
+ }
+}, 60 * 60 * 1000); // 1시간마다 정리 \ No newline at end of file
diff --git a/lib/realtime/NotificationManager.ts b/lib/realtime/NotificationManager.ts
new file mode 100644
index 00000000..88eed387
--- /dev/null
+++ b/lib/realtime/NotificationManager.ts
@@ -0,0 +1,223 @@
+// lib/realtime/NotificationManager.ts
+import { Client } from 'pg';
+import { EventEmitter } from 'events';
+
+interface NotificationPayload {
+ id: string;
+ user_id: string;
+ title: string;
+ message: string;
+ type: string;
+ related_record_id?: string;
+ related_record_type?: string;
+ is_read: boolean;
+ created_at: string;
+}
+
+interface NotificationReadPayload {
+ id: string;
+ user_id: string;
+ is_read: boolean;
+ read_at?: string;
+}
+
+class NotificationManager extends EventEmitter {
+ private client: Client | null = null;
+ private isConnected = false;
+ private reconnectAttempts = 0;
+ private maxReconnectAttempts = 5;
+ private reconnectDelay = 1000;
+ private reconnectTimeout: NodeJS.Timeout | null = null;
+
+ constructor() {
+ super();
+ this.setMaxListeners(100); // SSE 연결이 많을 수 있으므로 제한 증가
+ this.connect();
+ }
+
+ private async connect() {
+ try {
+ // 기존 연결이 있으면 정리
+ if (this.client) {
+ try {
+ await this.client.end();
+ } catch (error) {
+ console.warn('Error closing existing connection:', error);
+ }
+ }
+
+ this.client = new Client({
+ connectionString: process.env.DATABASE_URL,
+ application_name: 'notification_listener',
+ // 연결 유지 설정
+ keepAlive: true,
+ keepAliveInitialDelayMillis: 10000,
+ });
+
+ await this.client.connect();
+
+ // LISTEN 채널 구독
+ await this.client.query('LISTEN new_notification');
+ await this.client.query('LISTEN notification_read');
+
+ console.log('NotificationManager: PostgreSQL LISTEN connected');
+
+ // 알림 수신 처리
+ this.client.on('notification', (msg) => {
+ try {
+ if (msg.channel === 'new_notification') {
+ const payload: NotificationPayload = JSON.parse(msg.payload || '{}');
+ console.log('New notification received:', payload.id, 'for user:', payload.user_id);
+ this.emit('newNotification', payload);
+ } else if (msg.channel === 'notification_read') {
+ const payload: NotificationReadPayload = JSON.parse(msg.payload || '{}');
+ console.log('Notification read:', payload.id, 'by user:', payload.user_id);
+ this.emit('notificationRead', payload);
+ }
+ } catch (error) {
+ console.error('Error parsing notification payload:', error);
+ }
+ });
+
+ // 연결 오류 처리
+ this.client.on('error', (error) => {
+ console.error('PostgreSQL LISTEN error:', error);
+ this.isConnected = false;
+ this.scheduleReconnect();
+ });
+
+ // 연결 종료 처리
+ this.client.on('end', () => {
+ console.log('PostgreSQL LISTEN connection ended');
+ this.isConnected = false;
+ this.scheduleReconnect();
+ });
+
+ this.isConnected = true;
+ this.reconnectAttempts = 0;
+
+ // 연결 성공 이벤트 발송
+ this.emit('connected');
+
+ } catch (error) {
+ console.error('Failed to connect NotificationManager:', error);
+ this.isConnected = false;
+ this.scheduleReconnect();
+ }
+ }
+
+ private scheduleReconnect() {
+ // 이미 재연결이 예약되어 있으면 무시
+ if (this.reconnectTimeout) {
+ return;
+ }
+
+ if (this.reconnectAttempts >= this.maxReconnectAttempts) {
+ console.error('Max reconnection attempts reached for NotificationManager');
+ this.emit('maxReconnectAttemptsReached');
+ return;
+ }
+
+ this.reconnectAttempts++;
+ const delay = this.reconnectDelay * Math.pow(2, this.reconnectAttempts - 1);
+
+ console.log(`Scheduling NotificationManager reconnection in ${delay}ms (attempt ${this.reconnectAttempts})`);
+
+ this.reconnectTimeout = setTimeout(() => {
+ this.reconnectTimeout = null;
+ this.connect();
+ }, delay);
+ }
+
+ public async disconnect() {
+ if (this.reconnectTimeout) {
+ clearTimeout(this.reconnectTimeout);
+ this.reconnectTimeout = null;
+ }
+
+ if (this.client) {
+ try {
+ await this.client.end();
+ } catch (error) {
+ console.warn('Error disconnecting NotificationManager:', error);
+ }
+ this.client = null;
+ }
+
+ this.isConnected = false;
+ this.emit('disconnected');
+ }
+
+ public getConnectionStatus(): boolean {
+ return this.isConnected && this.client !== null;
+ }
+
+ public getReconnectAttempts(): number {
+ return this.reconnectAttempts;
+ }
+
+ // 강제 재연결 (관리자 API용)
+ public async forceReconnect() {
+ console.log('Forcing NotificationManager reconnection...');
+ this.reconnectAttempts = 0;
+ if (this.reconnectTimeout) {
+ clearTimeout(this.reconnectTimeout);
+ this.reconnectTimeout = null;
+ }
+ await this.disconnect();
+ await this.connect();
+ }
+
+ // 연결 상태 체크 (헬스체크용)
+ public async healthCheck(): Promise<{ status: string; details: any }> {
+ try {
+ if (!this.client || !this.isConnected) {
+ return {
+ status: 'unhealthy',
+ details: {
+ connected: false,
+ reconnectAttempts: this.reconnectAttempts,
+ maxReconnectAttempts: this.maxReconnectAttempts
+ }
+ };
+ }
+
+ // 간단한 쿼리로 연결 상태 확인
+ await this.client.query('SELECT 1');
+
+ return {
+ status: 'healthy',
+ details: {
+ connected: true,
+ reconnectAttempts: this.reconnectAttempts,
+ uptime: process.uptime()
+ }
+ };
+ } catch (error) {
+ return {
+ status: 'unhealthy',
+ details: {
+ connected: false,
+ error: error instanceof Error ? error.message : 'Unknown error',
+ reconnectAttempts: this.reconnectAttempts
+ }
+ };
+ }
+ }
+}
+
+// 싱글톤 인스턴스
+const notificationManager = new NotificationManager();
+
+// 프로세스 종료 시 정리
+process.on('SIGINT', async () => {
+ console.log('Shutting down NotificationManager...');
+ await notificationManager.disconnect();
+});
+
+process.on('SIGTERM', async () => {
+ console.log('Shutting down NotificationManager...');
+ await notificationManager.disconnect();
+});
+
+export default notificationManager; \ No newline at end of file
diff --git a/lib/realtime/RealtimeNotificationService.ts b/lib/realtime/RealtimeNotificationService.ts
new file mode 100644
index 00000000..4bc728ee
--- /dev/null
+++ b/lib/realtime/RealtimeNotificationService.ts
@@ -0,0 +1,362 @@
+// lib/realtime/RealtimeNotificationService.ts
+import notificationManager from './NotificationManager';
+
+interface ConnectedClient {
+ userId: string;
+ controller: ReadableStreamDefaultController;
+ lastHeartbeat: number;
+ connectionId: string;
+ userAgent?: string;
+ ipAddress?: string;
+}
+
+class RealtimeNotificationService {
+ private connectedClients = new Map<string, ConnectedClient[]>();
+ private heartbeatInterval: NodeJS.Timeout | null = null;
+ private clientTimeout = 5 * 60 * 1000; // 5분
+ private heartbeatFrequency = 30 * 1000; // 30초
+
+ constructor() {
+ this.setupEventListeners();
+ this.startHeartbeat();
+ this.startConnectionCleanup();
+ }
+
+ private setupEventListeners() {
+ // PostgreSQL NOTIFY 이벤트 수신 시 클라이언트들에게 브로드캐스트
+ notificationManager.on('newNotification', (payload: any) => {
+ console.log('Broadcasting new notification to user:', payload.user_id);
+ this.broadcastToUser(payload.user_id, {
+ type: 'new_notification',
+ data: payload
+ });
+ });
+
+ notificationManager.on('notificationRead', (payload: any) => {
+ console.log('Broadcasting notification read to user:', payload.user_id);
+ this.broadcastToUser(payload.user_id, {
+ type: 'notification_read',
+ data: payload
+ });
+ });
+
+ // NotificationManager 연결 상태 변화 시 클라이언트들에게 알림
+ notificationManager.on('connected', () => {
+ this.broadcastToAllUsers({
+ type: 'system_status',
+ data: { status: 'connected', message: 'Real-time notifications are now active' }
+ });
+ });
+
+ notificationManager.on('disconnected', () => {
+ this.broadcastToAllUsers({
+ type: 'system_status',
+ data: { status: 'disconnected', message: 'Real-time notifications temporarily unavailable' }
+ });
+ });
+ }
+
+ // 클라이언트 연결 등록
+ public addClient(
+ userId: string,
+ controller: ReadableStreamDefaultController,
+ metadata?: { userAgent?: string; ipAddress?: string }
+ ): string {
+ const connectionId = `${userId}_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
+
+ if (!this.connectedClients.has(userId)) {
+ this.connectedClients.set(userId, []);
+ }
+
+ const clients = this.connectedClients.get(userId)!;
+
+ // 동일 사용자의 최대 연결 수 제한
+ const maxConnectionsPerUser = parseInt(process.env.MAX_CONNECTIONS_PER_USER || '5');
+ if (clients.length >= maxConnectionsPerUser) {
+ console.warn(`Max connections (${maxConnectionsPerUser}) reached for user ${userId}`);
+ // 가장 오래된 연결 제거
+ const oldestClient = clients.shift();
+ if (oldestClient) {
+ try {
+ oldestClient.controller.close();
+ } catch (error) {
+ console.warn('Error closing oldest connection:', error);
+ }
+ }
+ }
+
+ clients.push({
+ userId,
+ controller,
+ lastHeartbeat: Date.now(),
+ connectionId,
+ userAgent: metadata?.userAgent,
+ ipAddress: metadata?.ipAddress
+ });
+
+ console.log(`Client ${connectionId} connected for user ${userId} (total: ${clients.length})`);
+
+ // 연결 확인 메시지 전송
+ this.sendToClient(controller, {
+ type: 'connected',
+ data: {
+ connectionId,
+ serverTime: new Date().toISOString(),
+ dbStatus: notificationManager.getConnectionStatus()
+ }
+ });
+
+ return connectionId;
+ }
+
+ // 클라이언트 연결 해제
+ public removeClient(userId: string, controller: ReadableStreamDefaultController): void {
+ const clients = this.connectedClients.get(userId);
+ if (!clients) return;
+
+ const filteredClients = clients.filter(client => {
+ if (client.controller === controller) {
+ console.log(`Client ${client.connectionId} disconnected for user ${userId}`);
+ return false;
+ }
+ return true;
+ });
+
+ if (filteredClients.length === 0) {
+ this.connectedClients.delete(userId);
+ console.log(`All clients disconnected for user ${userId}`);
+ } else {
+ this.connectedClients.set(userId, filteredClients);
+ }
+ }
+
+ // 특정 사용자에게 메시지 브로드캐스트
+ private broadcastToUser(userId: string, message: any): void {
+ const clients = this.connectedClients.get(userId);
+ if (!clients || clients.length === 0) {
+ console.log(`No connected clients for user ${userId}`);
+ return;
+ }
+
+ const activeClients: ConnectedClient[] = [];
+ let sentCount = 0;
+
+ for (const client of clients) {
+ if (this.sendToClient(client.controller, message)) {
+ client.lastHeartbeat = Date.now();
+ activeClients.push(client);
+ sentCount++;
+ }
+ }
+
+ // 활성 클라이언트만 유지
+ if (activeClients.length === 0) {
+ this.connectedClients.delete(userId);
+ } else {
+ this.connectedClients.set(userId, activeClients);
+ }
+
+ console.log(`Message sent to ${sentCount}/${clients.length} clients for user ${userId}`);
+ }
+
+ // 모든 사용자에게 브로드캐스트 (시스템 메시지용)
+ private broadcastToAllUsers(message: any): void {
+ let totalSent = 0;
+ let totalClients = 0;
+
+ for (const [userId, clients] of this.connectedClients.entries()) {
+ totalClients += clients.length;
+ const activeClients: ConnectedClient[] = [];
+
+ for (const client of clients) {
+ if (this.sendToClient(client.controller, message)) {
+ client.lastHeartbeat = Date.now();
+ activeClients.push(client);
+ totalSent++;
+ }
+ }
+
+ if (activeClients.length === 0) {
+ this.connectedClients.delete(userId);
+ } else {
+ this.connectedClients.set(userId, activeClients);
+ }
+ }
+
+ console.log(`System message sent to ${totalSent}/${totalClients} clients`);
+ }
+
+ // 개별 클라이언트에게 메시지 전송
+ private sendToClient(controller: ReadableStreamDefaultController, message: any): boolean {
+ try {
+ const encoder = new TextEncoder();
+ const data = `data: ${JSON.stringify(message)}\n\n`;
+ controller.enqueue(encoder.encode(data));
+ return true;
+ } catch (error) {
+ console.warn('Failed to send message to client:', error);
+ return false;
+ }
+ }
+
+ // 하트비트 전송 (연결 유지)
+ private startHeartbeat(): void {
+ this.heartbeatInterval = setInterval(() => {
+ const heartbeatMessage = {
+ type: 'heartbeat',
+ data: {
+ timestamp: new Date().toISOString(),
+ serverStatus: 'healthy',
+ dbStatus: notificationManager.getConnectionStatus()
+ }
+ };
+
+ this.broadcastToAllUsers(heartbeatMessage);
+ }, this.heartbeatFrequency);
+
+ console.log(`Heartbeat started with ${this.heartbeatFrequency}ms interval`);
+ }
+
+ // 비활성 연결 정리
+ private startConnectionCleanup(): void {
+ setInterval(() => {
+ const now = Date.now();
+ let cleanedConnections = 0;
+
+ for (const [userId, clients] of this.connectedClients.entries()) {
+ const activeClients = clients.filter(client => {
+ const isActive = (now - client.lastHeartbeat) < this.clientTimeout;
+ if (!isActive) {
+ try {
+ client.controller.close();
+ } catch (error) {
+ // 이미 닫힌 연결일 수 있음
+ }
+ cleanedConnections++;
+ }
+ return isActive;
+ });
+
+ if (activeClients.length === 0) {
+ this.connectedClients.delete(userId);
+ } else {
+ this.connectedClients.set(userId, activeClients);
+ }
+ }
+
+ if (cleanedConnections > 0) {
+ console.log(`Cleaned up ${cleanedConnections} inactive connections`);
+ }
+ }, 60000); // 1분마다 정리
+ }
+
+ // 연결된 클라이언트 수 조회
+ public getConnectedClientCount(): number {
+ let count = 0;
+ for (const clients of this.connectedClients.values()) {
+ count += clients.length;
+ }
+ return count;
+ }
+
+ // 특정 사용자의 연결된 클라이언트 수 조회
+ public getUserClientCount(userId: string): number {
+ return this.connectedClients.get(userId)?.length || 0;
+ }
+
+ // 연결된 사용자 수 조회
+ public getConnectedUserCount(): number {
+ return this.connectedClients.size;
+ }
+
+ // 상세 연결 정보 조회 (관리자용)
+ public getDetailedConnectionInfo() {
+ const info = {
+ totalClients: this.getConnectedClientCount(),
+ totalUsers: this.getConnectedUserCount(),
+ dbConnectionStatus: notificationManager.getConnectionStatus(),
+ connections: {} as any
+ };
+
+ for (const [userId, clients] of this.connectedClients.entries()) {
+ info.connections[userId] = clients.map(client => ({
+ connectionId: client.connectionId,
+ lastHeartbeat: new Date(client.lastHeartbeat).toISOString(),
+ userAgent: client.userAgent,
+ ipAddress: client.ipAddress,
+ connectedFor: Date.now() - client.lastHeartbeat
+ }));
+ }
+
+ return info;
+ }
+
+ // 특정 사용자의 모든 연결 해제 (관리자용)
+ public disconnectUser(userId: string): number {
+ const clients = this.connectedClients.get(userId);
+ if (!clients) return 0;
+
+ const count = clients.length;
+
+ for (const client of clients) {
+ try {
+ this.sendToClient(client.controller, {
+ type: 'force_disconnect',
+ data: { reason: 'Administrative action' }
+ });
+ client.controller.close();
+ } catch (error) {
+ console.warn(`Error disconnecting client ${client.connectionId}:`, error);
+ }
+ }
+
+ this.connectedClients.delete(userId);
+ console.log(`Forcibly disconnected ${count} clients for user ${userId}`);
+
+ return count;
+ }
+
+ // 서비스 종료
+ public shutdown(): void {
+ console.log('Shutting down RealtimeNotificationService...');
+
+ if (this.heartbeatInterval) {
+ clearInterval(this.heartbeatInterval);
+ this.heartbeatInterval = null;
+ }
+
+ // 모든 연결에게 종료 메시지 전송 후 연결 해제
+ const shutdownMessage = {
+ type: 'server_shutdown',
+ data: { message: 'Server is shutting down. Please reconnect in a moment.' }
+ };
+
+ for (const clients of this.connectedClients.values()) {
+ for (const client of clients) {
+ try {
+ this.sendToClient(client.controller, shutdownMessage);
+ client.controller.close();
+ } catch (error) {
+ // 이미 종료된 연결 무시
+ }
+ }
+ }
+
+ this.connectedClients.clear();
+ console.log('RealtimeNotificationService shutdown complete');
+ }
+}
+
+// 싱글톤 인스턴스
+const realtimeNotificationService = new RealtimeNotificationService();
+
+// 프로세스 종료 시 정리
+process.on('SIGINT', () => {
+ realtimeNotificationService.shutdown();
+});
+
+process.on('SIGTERM', () => {
+ realtimeNotificationService.shutdown();
+});
+
+export default realtimeNotificationService; \ No newline at end of file
diff --git a/lib/sedp/get-form-tags.ts b/lib/sedp/get-form-tags.ts
index f307d54a..d37b1890 100644
--- a/lib/sedp/get-form-tags.ts
+++ b/lib/sedp/get-form-tags.ts
@@ -13,7 +13,7 @@ import {
} from "@/db/schema";
import { eq, and, like, inArray } from "drizzle-orm";
import { getSEDPToken } from "./sedp-token";
-import { getFormMappingsByTagType } from "../tags/form-mapping-service";
+import { getFormMappingsByTagTypebyProeject } from "../tags/form-mapping-service";
interface Attribute {
@@ -153,17 +153,15 @@ export async function importTagsFromSEDP(
}
// 태그 타입에 따른 폼 정보 가져오기
- const allFormMappings = await getFormMappingsByTagType(
- tagTypeDescription,
+ const allFormMappings = await getFormMappingsByTagTypebyProeject(
projectId,
- tagClassLabel
);
// ep가 "IMEP"인 것만 필터링
- const formMappings = allFormMappings?.filter(mapping => mapping.ep === "IMEP") || [];
+ // const formMappings = allFormMappings?.filter(mapping => mapping.ep === "IMEP") || [];
// 현재 formCode와 일치하는 매핑 찾기
- const targetFormMapping = formMappings.find(mapping => mapping.formCode === formCode);
+ const targetFormMapping = allFormMappings.find(mapping => mapping.formCode === formCode);
if (targetFormMapping) {
console.log(`[IMPORT TAGS] Found IMEP form mapping for ${formCode}, creating form...`);
@@ -246,17 +244,15 @@ export async function importTagsFromSEDP(
}
// form mapping 정보 가져오기
- const allFormMappings = await getFormMappingsByTagType(
- tagTypeDescription,
+ const allFormMappings = await getFormMappingsByTagTypebyProeject(
projectId,
- tagClassLabel
);
// ep가 "IMEP"인 것만 필터링
- const formMappings = allFormMappings?.filter(mapping => mapping.ep === "IMEP") || [];
+ // const formMappings = allFormMappings?.filter(mapping => mapping.ep === "IMEP") || [];
// 현재 formCode와 일치하는 매핑 찾기
- const targetFormMapping = formMappings.find(mapping => mapping.formCode === formCode);
+ const targetFormMapping = allFormMappings.find(mapping => mapping.formCode === formCode);
if (targetFormMapping) {
targetImValue = targetFormMapping.ep === "IMEP";
diff --git a/lib/tags/form-mapping-service.ts b/lib/tags/form-mapping-service.ts
index 3e86e9d9..6de0e244 100644
--- a/lib/tags/form-mapping-service.ts
+++ b/lib/tags/form-mapping-service.ts
@@ -70,4 +70,32 @@ export async function getFormMappingsByTagType(
// 3) 아무것도 없으면 빈 배열
console.log(`No mappings found at all for tagType="${tagType}"`);
return [];
+}
+
+
+export async function getFormMappingsByTagTypebyProeject(
+
+ projectId: number,
+): Promise<FormMapping[]> {
+
+ const specificRows = await db
+ .select({
+ formCode: tagTypeClassFormMappings.formCode,
+ formName: tagTypeClassFormMappings.formName,
+ ep: tagTypeClassFormMappings.ep,
+ remark: tagTypeClassFormMappings.remark
+ })
+ .from(tagTypeClassFormMappings)
+ .where(and(
+ eq(tagTypeClassFormMappings.projectId, projectId),
+ ))
+
+ if (specificRows.length > 0) {
+ console.log("Found specific mapping rows:", specificRows.length);
+ return specificRows;
+ }
+
+
+
+ return [];
} \ No newline at end of file
diff --git a/middleware.ts b/middleware.ts
index 559cd038..00f2eeb0 100644
--- a/middleware.ts
+++ b/middleware.ts
@@ -48,7 +48,8 @@ function isPublicPath(path: string, lng: string) {
// 3. publicPaths 배열의 경로들과 매칭
if (publicPaths.some(publicPath => {
- return path === `/${lng}${publicPath}` || path.startsWith(`/${lng}${publicPath}/`);
+ // return path === `/${lng}${publicPath}` || path.startsWith(`/${lng}${publicPath}/`);
+ return path === `/${lng}${publicPath}`;
})) {
return true;
}