codepolicy addition

This commit is contained in:
2025-12-30 23:46:08 +09:00
parent 526e17d5c8
commit 4ce1e3f813
3 changed files with 671 additions and 13 deletions

560
codepolicy/index.php Normal file
View File

@@ -0,0 +1,560 @@
<?php
/**
* SAM System - Code Development Policy Guide
* Final Update: 2025-12-19
*/
?>
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SAM Code Development Policy</title>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&family=Fira+Code:wght@400;500&display=swap" rel="stylesheet">
<!-- Icons -->
<script src="https://unpkg.com/lucide@latest"></script>
<style>
:root {
--bg: #030712;
--glass: rgba(17, 24, 39, 0.7);
--glass-border: rgba(255, 255, 255, 0.1);
--primary: #3b82f6;
--primary-glow: rgba(59, 130, 246, 0.5);
--secondary: #10b981;
--accent: #8b5cf6;
--danger: #ef4444;
--text-main: #f3f4f6;
--text-muted: #9ca3af;
--code-bg: #111827;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: var(--bg);
color: var(--text-main);
font-family: 'Inter', sans-serif;
line-height: 1.6;
overflow-x: hidden;
background-image:
radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 40%);
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem;
}
/* Hero Section */
.hero {
padding: 4rem 0 2rem;
text-align: center;
}
.hero h1 {
font-family: 'Outfit', sans-serif;
font-size: 3.5rem;
background: linear-gradient(135deg, #fff 0%, #3b82f6 50%, #8b5cf6 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
margin-bottom: 1rem;
letter-spacing: -0.02em;
}
.hero p {
color: var(--text-muted);
font-size: 1.1rem;
max-width: 600px;
margin: 0 auto;
}
.update-badge {
display: inline-block;
padding: 0.5rem 1rem;
background: rgba(59, 130, 246, 0.1);
border: 1px solid rgba(59, 130, 246, 0.2);
border-radius: 20px;
color: var(--primary);
font-size: 0.85rem;
margin-bottom: 2rem;
}
/* Section Layout */
.section {
margin-bottom: 4rem;
opacity: 0;
transform: translateY(20px);
transition: all 0.6s ease-out;
}
.section.visible {
opacity: 1;
transform: translateY(0);
}
.section-header {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 2rem;
}
.section-header i {
color: var(--primary);
}
.section-header h2 {
font-family: 'Outfit', sans-serif;
font-size: 2rem;
color: #fff;
}
/* Glass Cards */
.glass-card {
background: var(--glass);
backdrop-filter: blur(12px);
border: 1px solid var(--glass-border);
border-radius: 24px;
padding: 2.5rem;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
position: relative;
overflow: hidden;
height: 100%;
}
.glass-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 2px;
background: linear-gradient(90deg, transparent, var(--primary), transparent);
opacity: 0.3;
}
/* Content Styles */
h3 {
font-family: 'Outfit', sans-serif;
font-size: 1.4rem;
margin-bottom: 1.5rem;
color: #fff;
display: flex;
align-items: center;
gap: 0.5rem;
}
.grid-2 {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
gap: 2rem;
}
.rule-box {
border-radius: 16px;
padding: 1.5rem;
margin-bottom: 1.5rem;
}
.rule-box.prohibited {
background: rgba(239, 68, 68, 0.05);
border: 1px solid rgba(239, 68, 68, 0.2);
}
.rule-box.prohibited h4 {
color: var(--danger);
margin-bottom: 0.75rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
.rule-box.mandatory {
background: rgba(16, 185, 129, 0.05);
border: 1px solid rgba(16, 185, 129, 0.2);
}
.rule-box.mandatory h4 {
color: var(--secondary);
margin-bottom: 0.75rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
/* Table Styles */
.table-container {
width: 100%;
overflow-x: auto;
margin-top: 1rem;
}
table {
width: 100%;
border-collapse: collapse;
font-size: 0.95rem;
}
th {
text-align: left;
padding: 1rem;
background: rgba(255, 255, 255, 0.03);
color: var(--text-muted);
font-weight: 600;
border-bottom: 2px solid var(--glass-border);
}
td {
padding: 1rem;
border-bottom: 1px solid var(--glass-border);
}
tr:last-child td {
border-bottom: none;
}
/* Code Block */
pre {
background: var(--code-bg);
padding: 1.5rem;
border-radius: 12px;
font-family: 'Fira Code', monospace;
font-size: 0.9rem;
color: #d1d5db;
overflow-x: auto;
margin: 1rem 0;
border: 1px solid rgba(255, 255, 255, 0.05);
}
code {
color: #818cf8;
}
/* Flow Diagrams */
.flow-diagram {
display: flex;
flex-direction: column;
align-items: center;
gap: 0.5rem;
margin: 2rem 0;
}
.flow-box {
padding: 1rem 2rem;
background: rgba(255, 255, 255, 0.05);
border: 1px solid var(--glass-border);
border-radius: 12px;
width: 100%;
max-width: 500px;
text-align: center;
}
.flow-arrow {
font-size: 1.5rem;
color: var(--primary);
}
/* List Styles */
ul, ol {
padding-left: 1.5rem;
margin-bottom: 1.5rem;
}
li {
margin-bottom: 0.5rem;
}
/* Tags */
.tag {
display: inline-block;
padding: 0.2rem 0.6rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 700;
text-transform: uppercase;
margin-right: 0.5rem;
}
.tag-red { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.tag-green { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.tag-blue { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
/* Animation class */
@keyframes fadeInUp {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
.animate-up {
animation: fadeInUp 0.8s ease forwards;
}
footer {
padding: 4rem 2rem;
text-align: center;
color: var(--text-muted);
border-top: 1px solid var(--glass-border);
}
/* Responsive */
@media (max-width: 768px) {
.hero h1 { font-size: 2.5rem; }
.grid-2 { grid-template-columns: 1fr; }
.container { padding: 1rem; }
}
</style>
</head>
<body>
<div class="container">
<!-- Hero Section -->
<header class="hero scale-in">
<span class="update-badge">Last Updated: 2025-12-19</span>
<h1>SAM Code Development Policy</h1>
<p>SAM 시스템의 견적, 수주, 생산, 출하, 품질 등 모든 MES 기능 개발에 적용되는 핵심 가이드라인 및 공통 정책입니다.</p>
</header>
<!-- Section 1: Overview -->
<section class="section">
<div class="section-header">
<i data-lucide="info"></i>
<h2>📋 개요</h2>
</div>
<div class="glass-card">
<p>이 문서는 SAM 시스템의 모든 기능 개발에 공통으로 적용되는 정책을 정의합니다. 각 기능별 개발 문서(MASTER_PLAN.md)는 반드시 이 공통 정책 문서를 참조하며, 정책 준수 여부가 품질 검증의 최우선 순위입니다.</p>
</div>
</section>
<!-- Section 2: Core Rules -->
<section class="section">
<div class="section-header">
<i data-lucide="alert-octagon"></i>
<h2>🚨 필수 준수 규칙</h2>
</div>
<div class="grid-2">
<!-- Table Policy -->
<div class="glass-card">
<h3><i data-lucide="database"></i> 1. 테이블 정책</h3>
<div class="rule-box prohibited">
<h4>❌ 절대 금지</h4>
<ul>
<li>새로운 테이블을 임의로 생성 (price_new, order_items_v2 등)</li>
<li>기존 테이블 구조를 사용자 승인 없이 변경</li>
<li>mng 프로젝트에서 마이그레이션 실행</li>
</ul>
</div>
<div class="rule-box mandatory">
<h4>✅ 필수 사항</h4>
<ul>
<li>기존 테이블을 최우선으로 분석하여 활용</li>
<li>테이블 추가가 필요한 경우 반드시 사용자 승인 획득</li>
<li>DB 마이그레이션은 오직 <strong>api</strong> 프로젝트에서만 실행</li>
</ul>
</div>
</div>
<!-- Tech Stack -->
<div class="glass-card">
<h3><i data-lucide="layers"></i> 2. 프로젝트 스택</h3>
<div class="table-container">
<table>
<thead>
<tr>
<th>프로젝트</th>
<th>기술 스택</th>
<th>주의사항</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>mng</strong></td>
<td>Laravel 12 + Plain Blade + Tailwind + Filament</td>
<td><span class="tag tag-red">❌ Alpine.js 금지</span></td>
</tr>
<tr>
<td><strong>api</strong></td>
<td>Laravel 12 REST API + Swagger</td>
<td><span class="tag tag-green">Multi-tenant 필수</span></td>
</tr>
<tr>
<td><strong>5130</strong></td>
<td>PHP + jQuery + Legacy JS</td>
<td>분석 및 참조용</td>
</tr>
<tr>
<td><strong>react</strong></td>
<td>Next.js 15</td>
<td>프론트엔드 전담</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Code Convention -->
<div class="glass-card" style="margin-top: 2rem;">
<h3><i data-lucide="code-2"></i> 3. 코드 컨벤션 (추측 금지 원칙)</h3>
<p style="margin-bottom: 1.5rem;"><span class="tag tag-red">🔴 핵심: 모든 코드 요소는 실제 확인 후 사용</span></p>
<div class="grid-2">
<div class="rule-box prohibited">
<h4>❌ 절대 금지 - 추측/할루시네이션</h4>
<ul style="font-size: 0.9rem;">
<li>컬럼명 추측 (tenant.name → 실제는 tenant.company_name)</li>
<li>관계명 추측 (user.roles → 실제는 user.userRoles)</li>
<li>경로 및 메서드명 추측 (getName() → getCompanyName() 확인 필요)</li>
<li>테이블명 확인 (users → sam_users 여부 확인)</li>
</ul>
</div>
<div class="rule-box mandatory">
<h4>✅ 필수 사항 - 확인 프로세스</h4>
<ul style="font-size: 0.9rem;">
<li>모델 파일(app/Models/*.php)에서 컬럼/관계 직접 확인</li>
<li>마이그레이션 파일에서 원본 데이터 구조 대조</li>
<li>기존 컨트롤러/서비스의 실제 구현 패턴 확인</li>
<li>불확실한 경우 주저하지 말고 사용자에게 질문</li>
</ul>
</div>
</div>
</div>
</section>
<!-- Section 3: DB Policy -->
<section class="section">
<div class="section-header">
<i data-lucide="table"></i>
<h2>🗄️ DB 테이블 상세 정책</h2>
</div>
<div class="glass-card">
<h3>테이블 설계 정책 (Hybrid EAV)</h3>
<div class="grid-2" style="margin-top: 2rem;">
<div class="rule-box" style="background: rgba(59, 130, 246, 0.05); border: 1px solid rgba(59, 130, 246, 0.2);">
<h4 style="color: var(--primary);"><span class="tag tag-red">🔴</span> 필수 컬럼 (일반 컬럼 생성)</h4>
<ul style="font-size: 0.9rem;">
<li>조인에 사용되는 필드 (FK: tenant_id, product_id 등)</li>
<li>인덱싱이 필요한 검색/정렬 필드 (status, created_at)</li>
<li>고빈도 쿼리 WHERE 조건 필드</li>
<li>유니크 제약이 필요한 고유 필드 (code, slug)</li>
</ul>
</div>
<div class="rule-box" style="background: rgba(139, 92, 246, 0.05); border: 1px solid rgba(139, 92, 246, 0.2);">
<h4 style="color: var(--accent);"><span class="tag tag-green">🟢</span> 가변 컬럼 (options JSON 통합)</h4>
<ul style="font-size: 0.9rem;">
<li>순수 비즈니스 로직용 데이터</li>
<li>설정값, 부가 옵션 정보</li>
<li>향후 확장 가능성이 높은 데이터</li>
<li>조인이나 검색 필터로 사용되지 않는 필드</li>
</ul>
</div>
</div>
<div style="margin-top: 2rem;">
<h4>⚠️ Enum 지양 정책</h4>
<pre>
// ❌ 지양: DB Enum (변경 시 마이그레이션 복잡)
$table->enum('status',['pending','approved','rejected']);
// ✅ 권장: string + 코드 테이블 (common_codes)
$table->string('status', 20)->default('pending');
// ✅ 허용: boolean (명확한 2가지 상태)
$table->boolean('is_active')->default(true);
</pre>
</div>
</div>
</section>
<!-- Section 4: Workflow -->
<section class="section">
<div class="section-header">
<i data-lucide="refresh-cw"></i>
<h2>🔄 Phase 진행 및 커밋 정책</h2>
</div>
<div class="grid-2">
<div class="glass-card">
<h3>Phase 워크플로우</h3>
<div class="flow-diagram">
<div class="flow-box"><strong>Step 1: 5130 리서치</strong><br>원본 데이터 구조 분석</div>
<div class="flow-arrow">↓</div>
<div class="flow-box"><strong>Step 2: SAM 매핑</strong><br>기존 확인 및 신규 설계</div>
<div class="flow-arrow">↓</div>
<div class="flow-box"><strong>Step 3: 필수/가변 분류</strong><br>JSON 통합 필드 식별</div>
<div class="flow-arrow">↓</div>
<div class="flow-box"><strong>Step 4: 사용자 승인</strong><br>설계 확정 후 구현 시작</div>
</div>
</div>
<div class="glass-card">
<h3>세션 및 커밋 원칙</h3>
<ul style="margin-top: 1rem;">
<li><strong>롤백 포인트</strong>: 각 Phase 완료 시 Git 태그 생성 필수</li>
<li><strong>세션 중단 대응</strong>: PROGRESS.md를 통해 컨텍스트 실시간 복구</li>
<li><strong>커밋 메시지</strong>: 반드시 <strong>한글</strong>로 작성하며 단계별 커밋</li>
<li><strong>푸시 정책</strong>: 커밋 후 푸시 여부는 묻지 않으며 사용자 수동 진행</li>
</ul>
</div>
</div>
</section>
<!-- Section 5: Changlog -->
<section class="section">
<div class="section-header">
<i data-lucide="history"></i>
<h2>📝 변경 이력</h2>
</div>
<div class="glass-card">
<div class="table-container">
<table>
<thead>
<tr>
<th>날짜</th>
<th>변경 내용</th>
<th>작성자</th>
</tr>
</thead>
<tbody>
<tr>
<td>2025-12-19</td>
<td>초기 공통 정책 문서 작성 (MES 통합 가이드)</td>
<td>Claude</td>
</tr>
</tbody>
</table>
</div>
</div>
</section>
</div>
<footer>
<p>&copy; 2025 SAM MES Development Group. All Rights Reserved.</p>
<p style="margin-top: 10px; font-size: 0.8rem; opacity: 0.5;">이 문서는 SAM 시스템의 공식 개발 정책을 따릅니다.</p>
</footer>
<script>
// Initialize Lucide Icons
lucide.createIcons();
// Intersection Observer for Scroll Animations
const observerOptions = {
threshold: 0.1
};
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
}
});
}, observerOptions);
document.querySelectorAll('.section').forEach(section => {
observer.observe(section);
});
</script>
</body>
</html>

View File

@@ -349,11 +349,84 @@
</div>
</section>
<!-- Section 2: Commission Ratios -->
<!-- Section 2: Product & Pricing -->
<section class="section">
<div class="section-header">
<span class="section-tag">02. Commission Ratios</span>
<h2>수당 지급 비율</h2>
<span class="section-tag">02. Product & Pricing</span>
<h2>02. 주요 상품 및 가격 안내</h2>
<p>기본 기획된 SAM의 핵심 모듈 및 패키지 라인업입니다.</p>
</div>
<div class="glass-card animate-up">
<h3 style="margin-bottom: 1.5rem; color: var(--secondary);">개별 모듈 (Modules)</h3>
<div class="table-container">
<table>
<thead>
<tr>
<th>상품명</th>
<th>주요 기능 설명</th>
<th style="text-align: right;">가입비 (VAT 별도)</th>
<th style="text-align: right;">구독료 (월)</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>QR코드 관리</strong></td>
<td>설비/장비에 QR 부착하여 실시간 점검 및 이력 관리</td>
<td style="text-align: right;">1,020만원</td>
<td style="text-align: right;">5만원</td>
</tr>
<tr>
<td><strong>사진/출하 관리</strong></td>
<td>현장 상황 사진 기록 및 출하 시점 품질 증빙 자동화</td>
<td style="text-align: right;">1,920만원</td>
<td style="text-align: right;">10만원</td>
</tr>
<tr>
<td><strong>검사/토큰 적용</strong></td>
<td>공정별 검사 데이터 기록 및 전자 세금계산서 연동</td>
<td style="text-align: right;">1,020만원</td>
<td style="text-align: right;">5만원</td>
</tr>
<tr>
<td><strong>이카운트 연동</strong></td>
<td>ERP(이카운트) 데이터 동기화 및 거래처 원장 관리</td>
<td style="text-align: right;">1,920만원</td>
<td style="text-align: right;">10만원</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="glass-card animate-up" style="margin-top: 2rem;">
<h3 style="margin-bottom: 1.5rem; color: var(--secondary);">통합 패키지 (Packages)</h3>
<div class="policy-grid">
<div class="glass-card" style="padding: 1.5rem; border: 1px solid rgba(0, 242, 254, 0.2);">
<h4>공사관리 패키지</h4>
<p style="margin: 0.5rem 0; font-size: 0.9rem;">건설 및 공사 현장 관리에 최적화된 올인원 솔루션</p>
<div style="margin-top: 1rem; font-weight: 700;">
가입비: <span class="ratio">4,000만원</span><br>
구독료: <span style="color: var(--text-muted);">20만원/월</span>
</div>
</div>
<div class="glass-card" style="padding: 1.5rem; border: 1px solid rgba(123, 97, 255, 0.2);">
<h4>공정/정부지원사업</h4>
<p style="margin: 0.5rem 0; font-size: 0.9rem;">정부 사업 규격에 맞춘 공정 관리 및 투명한 이력 추적</p>
<div style="margin-top: 1rem; font-weight: 700;">
가입비: <span class="ratio">8,000만원</span><br>
구독료: <span style="color: var(--text-muted);">40만원/월</span>
</div>
</div>
</div>
</div>
</section>
<!-- Section 3: Commission Ratios -->
<section class="section">
<div class="section-header">
<span class="section-tag">03. Commission Ratios</span>
<h2>03. 수당 지급 비율</h2>
</div>
<div class="glass-card animate-up">
<div class="table-container">
@@ -396,8 +469,8 @@
<!-- Section 3: Hierarchy Visualization -->
<section class="section">
<div class="section-header">
<span class="section-tag">03. Hierarchy Details</span>
<h2>계층 구조 및 수당 시뮬레이션</h2>
<span class="section-tag">04. Hierarchy Details</span>
<h2>04. 계층 구조 및 수당 시뮬레이션</h2>
</div>
<div class="glass-card animate-up">
<p>영업 관리자의 수익은 자신의 활동뿐만 아니라 조직의 활성화에 따라 극대화됩니다.</p>
@@ -443,8 +516,8 @@
<!-- Section 4: Sales Success Workflow -->
<section class="section">
<div class="section-header">
<span class="section-tag">04. Sales Success Workflow</span>
<h2>6단계 성공 프로세스</h2>
<span class="section-tag">05. Sales Success Workflow</span>
<h2>05. 6단계 성공 프로세스</h2>
<p>단순한 판매를 넘어, 고객의 성공을 설계하는 표준 영업 프로세스입니다.</p>
</div>
<div class="workflow-grid">
@@ -484,8 +557,8 @@
<!-- Section 5: Schedule & Margin -->
<section class="section">
<div class="section-header">
<span class="section-tag">05. Schedule & Margin</span>
<h2>지급 일정 및 운영 정책</h2>
<span class="section-tag">06. Schedule & Margin</span>
<h2>06. 지급 일정 및 운영 정책</h2>
</div>
<div class="policy-grid">
<div class="glass-card animate-up">

View File

@@ -19,7 +19,32 @@
---
## 2. 수당 지급 비율
## 2. 주요 상품 및 가격 체계
### 2.1 개별 모듈 (Modules)
고객의 필요에 따라 특정 기능을 선택하여 도입할 수 있는 단위 상품입니다.
| 상품명 | 주요 기능 | 가입비 (Join Fee) | 구독료 (Monthly) |
| :--- | :--- | :---: | :---: |
| **QR코드 관리** | 설비관리 및 장비 점검 | 1,020만원 | 5만원 |
| **사진/출하 관리** | 현장 사진 및 출하 증빙 관리 | 1,920만원 | 10만원 |
| **검사/토큰 적용** | 공정 검사 및 전자계산서 연동 | 1,020만원 | 5만원 |
| **이카운트 연동** | ERP(이카운트) 및 거래처 대장 | 1,920만원 | 10만원 |
| **ISO/인정서류** | 인증 서류 관리 및 토큰 적용 | 1,020만원 | 5만원 |
| **재고 관리** | 적정 재고 표기 및 입출고 관리 | 1,920만원 | 10만원 |
| **제조/발주 관리** | 제작 지시 및 외주 발주 관리 | 1,920만원 | 10만원 |
### 2.2 패키지 상품 (Packages)
연관된 모듈을 통합하여 합리적인 가격으로 제공하는 솔루션 묶음입니다.
| 패키지명 | 구성 및 특징 | 가입비 (Join Fee) | 구독료 (Monthly) |
| :--- | :--- | :---: | :---: |
| **공사관리 패키지** | 건설 및 공사 현장 특화 모듈 통합 | 4,000만원 | 20만원 |
| **공정/정부지원사업** | 스마트공장 및 지원사업 최적화 솔루션 | 8,000만원 | 40만원 |
---
## 3. 수당 지급 비율
| 구분 | 지급 비율 | 설명 |
|------|-----------|------|
@@ -29,7 +54,7 @@
---
## 3. 계층 구조 및 역할
## 4. 계층 구조 및 역할
### 3.1 역할 상세
@@ -47,7 +72,7 @@
---
## 4. 수당 지급 프로세스
## 5. 수당 지급 프로세스
1. **계약 체결**: 고객사와 서비스 이용 계약 완료
2. **가입비 납부**: 고객사가 가입비 전액을 본사에 납부
@@ -56,7 +81,7 @@
---
## 5. 회사 마진 및 운영 정책
## 6. 회사 마진 및 운영 정책
### 5.1 마진 계산
- 회사 마진 = 가입비 - (판매자 수당 + 관리자 수당 + 메뉴제작 협업수당)