Commit Graph

19 Commits

Author SHA1 Message Date
king 6ebf705e27 feat(performance): new marketplace order, 쿠팡(윙) rename, manual-only 쿠팡(로켓)·애터미아자몰
- Column order: 카페24 · 네이버 · 쿠팡(윙) · 쿠팡(로켓) · 오늘의집 · G마켓 · 카카오 ·
  GS샵 · 11번가 · 롯데ON · 토스 · 애터미아자몰 (registry + migration 003 sort_order)
- Existing coupang (WING API) renamed to 쿠팡(윙)
- New manual-only marketplaces coupang_rocket / atomy (adapters/manual.py,
  manual_only flag): skipped by sync_all, no credentials / connection test in
  settings, status "수동 입력", manual input always on (API refuses turning it off)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 02:35:18 +09:00
king 3882836fd5 feat(project): meeting rows added from the task cell stay in the same item cell (migration 027), in-place redraw with animation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 20:28:24 +09:00
king 454b3cc700 feat(performance): per-shop manual sales input, column order, bold centered table headers (migration 002)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 17:26:57 +09:00
king e130bbe577 feat(project): meeting task table - pick an existing task to add a subtask; title opens task panel
- New "작업" column (migration 026 parent_task_id): empty = new task in the section,
  chosen task = register as its subtask (candidates = open main tasks of that section)
- Server validates the task belongs to the project, clears it when the project changes,
  and rejects apply if the chosen task was deleted/moved
- Removed the in-table subtask rows (hover button, Tab/Shift+Tab, right-click) from UI/API
- Registered row title opens the task editor on the right (iframe ?embed=1, waits for the
  task window to save before switching/closing, like the inbox panel)
- Help + docs (DEPLOYMENT 026); tests (real PostgreSQL, jsdom)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:35:18 +09:00
king b7c0f28ad2 fix(project): meeting task table shared per week on the server (others' rows were invisible)
- Cause: the table lived only in each browser's localStorage
- project_db migration 025 goal_meeting_tasks (week_start, parent_id for subtask rows, task_id)
- API list/add/update/delete + apply; apply locks the row and creates the task once via the
  same helper as the task window (_create_task_for: membership, assignee check, notifications)
- Non-members see other people's rows with project/section/task hidden; only member projects
  can be picked; completed meeting is read-only (409)
- Client saves per field, refreshes every 30s / on focus, uploads rows left in this browser once
- Docs (DEPLOYMENT 025, PROJECT_MODULE, help, CLAUDE.md); tests (real PostgreSQL incl. 4
  concurrent applies -> one task, jsdom)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 16:06:23 +09:00
king 2aa6b6efae feat(notice): urgent notices centered on every ERP screen until acknowledged
- Super admin only: /notice/ page (title, body with images, show time KST, all or picked people,
  preview, edit with optional re-show, cancel/undo, per-person acknowledgement status)
- Shown on every ERP page (erp_base, main, admin) dead center; [확인] only (no Esc/backdrop close),
  queue in order, ack failure keeps the dialog, closes when acked/cancelled elsewhere
- project_db migration 024 (urgent_notices, targets, acks, images as bytea); shares ProjectStore.pool
- Body sanitized like task descriptions, images restricted to /notice/images/{id}, type sniffed
- Entry points: ERP sidebar foot and Project options dialog (super admin)
- Docs (NOTICE_MODULE, DEPLOYMENT 024, overview, CLAUDE.md); tests (DB-less, real PostgreSQL, jsdom)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 14:07:10 +09:00
king 06af036f86 feat(project): PC tray notifier for mentions and assignments
Windows tray app (desktop/notifier, C# .NET Framework 4.8 WinForms,
single exe, no installer/admin) that shows the same big alert popup as
the web even when the browser is in the background: layered topmost
window that does not steal focus, blinking border, open/close actions,
sound, autostart toggle, DPAPI-encrypted token.

Server side (project_db migration 023):
- notifier_links / notifier_tokens (SHA-256 hashes only)
- device link flow: link/start -> browser approve at /project/notifier
  -> link/poll issues token once
- Bearer API for alerts/read/logout reusing _alerts_payload; token
  re-checks current user record and project permission each call
- /project/notifier page (approve, connected PCs, revoke, download)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 10:21:58 +09:00
king 5278d568de feat(project): weekly meetings editable by anyone, admin completes to lock
Meeting write APIs now accept any project user; deleting a meeting and the
new POST /api/goals/meetings/{week}/complete (complete/reopen) stay admin
only. A completed meeting (migration 022: completed_at, completed_by)
rejects edits with 409; last-week result fields follow the next meeting's
lock instead. The page shows a complete button / locked badge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 17:37:23 +09:00
king c9d5e6e017 feat(project): meeting board button opens a blank Google Slides deck
A "회의록 보드" button next to attendees opens the week's Google Slides
deck in its own window. The deck is found (Drive appProperties) or
created in the shared drive MEETING_BOARD_FOLDER_ID as one BLANK slide,
named like "10월 2주차 (10/5~10/11)". Needs a token with Drive and
Slides scopes; the authorize script now requests them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 12:04:09 +09:00
king 9528f735b8 feat(project): allow text in meeting target/result cells; fix result note save
- Target and result cells accept text such as "20개". Values that parse
  as amounts still go to the integer columns; anything else goes to the
  new target_text/result_text columns (migration 021).
- Fix: PUT /api/goals/meeting-items/{id} dropped result_note, so the
  last-week result text was never saved.
- Update meeting nav test to the month-bounded week numbering.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 11:40:30 +09:00
king cd3577b299 feat(project): month-bounded meeting weeks, weekly sales targets, sticky header
- Weeks stay inside the month: week 1 starts on the 1st (through the next
  Sunday if the 1st is a weekend); a trailing Mon/Tue joins the last week.
  "Last week" is the previous period.
- Prev-week review columns: 전주 업무 | 결과(text, new result_note) |
  전주 목표 | 결과(amount).
- Header now shows month target, cumulative weekly target, month-to-date
  sales and gap (amount + %), with decisions/notes beside it; the area
  stays fixed while scrolling.
- Goals board: the monthly sales target is entered per week; the sum
  becomes the month target.
- Migration 020: result_note, goal_week_targets, drop Monday-only check,
  move absorbed Monday meetings to the new week start.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 11:24:41 +09:00
king b576dd1a38 feat(asset): add photos, monitor links and deletion
Apply asset_db_002_photos_monitors.sql before rebuilding web.

Restrict soft deletion to the super admin; retain reports and audit.
2026-10-06 02:29:19 +09:00
king bd0c47e6fc feat(asset): add inventory and HWiNFO reports
Requires asset_db initialized with scripts/sql/asset_db_init.sql and ASSET_DB_URL configured before enabling storage.
2026-10-06 02:09:10 +09:00
king 090e508bf3 feat(project): add meeting cell editing
Apply project_db migration 019 to enable vertical cell merges. Other cell editing remains available before migration.
2026-10-03 15:11:41 +09:00
king aa669553db feat(performance): 실적(쇼핑몰 통합 매출) 모듈 1단계 — 대시보드·설정·보안·어댑터 구조
- 네 영역 분리: ① 수집(adapters/ 쇼핑몰 10곳 + sync.py) ② 보안(security/ + credentials.py)
  ③ 계산·저장(calc.py + db.py) ④ 화면(dashboard.py, router.py, templates, performance.css/js)
- 대시보드: 기간(오늘/이번주/이번달/올해/직접선택, 이전·다음), 쇼핑몰 필터, KPI 5개(진행 중 기간은
  직전 기간 같은 경과일 대비), 일자×쇼핑몰 표(주간합계, 총매출/수수료/차감매출 전환), 일별 추이·
  쇼핑몰 비중(SVG), 월 누적(비중)·연간 누적, 금액 클릭 → 주문 상세
- 설정(관리자): 사용/매출 집계, 수수료율 이력(적용 시작일), 쇼핑몰별 API 인증정보 입력·연결 테스트·
  연결 상태, 마스터 키 상태·재암호화, 테스트(모의) 데이터 생성/삭제
- 인증정보: 설정 화면 입력 → AES-256-GCM(키 버전, AAD=쇼핑몰+항목) 암호화 저장, secret 원문은
  화면으로 다시 보내지 않음, 오류·로그·raw 는 비밀값 가린 뒤 저장. 마스터 키는 APP_ENCRYPTION_KEY(.env)
- 매출 기준일: 결제=결제일, 취소·반품=발생일. 금액 원 단위 정수, 수수료 반올림은 calc.commission 한 곳
- 동기화: 같은 쇼핑몰 동시 실행 차단(running 부분 유니크), 쇼핑몰별 실패 격리, 중복 방지 UNIQUE+UPSERT
- 카페24 어댑터는 기존 app/integrations/cafe24 OAuth 토큰 재사용, 나머지는 입력칸만(수집은 다음 단계)
- performance_db 초기화 스크립트, 권한키 performance(설정은 is_admin), 문서·.env.example

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 16:07:46 +09:00
king 269e779129 feat(vacation): 휴가 관리 모듈 — 월간 달력 bar/연차·반차 신청/승인 워크플로/공휴일·연차 설정
- vacation_db 전용 저장소(VacationDBStore), VACATION_DB_URL 미설정 시 '설정 필요' 안내
- 월간 달력: 구글식 휴가 bar(주 단위 lane 배정), 일/공휴일 빨강·토요일 파랑
- 신청 폼: 종류/기간/시작·종료 구분(종일/오전/오후)/사유 + 예상 일수 미리보기
- 일수 계산은 서버(compute_days)에서 주말+공휴일(is_red) 제외 재계산
- 워크플로: 작성중/반려→제출→승인|반려, 취소 soft delete, 본인만 수정(작성중/반려)
- 권한: vacation(접근)/vacation_approver(승인), admin 통과. 설정은 admin 전용
- 공휴일(vacation_holidays) DB 기반 provider + settings CRUD, 연차잔여(vacation_balances)
- 엑셀 내보내기(openpyxl), scripts/sql/vacation_db_init.sql(멱등, 2026 공휴일 seed)
- main.py 등록, 메뉴 ready 전환, docs/.env.example/CLAUDE.md 갱신

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 08:20:20 +09:00
king 9e707be5ac feat(cupang): 쿠팡 밀크런 모듈 추가 (출고 달력/박스계산/입고센터)
- app/modules/cupang: router/db/store/itemcode + 템플릿 5종
- cupang_db 전용(JSON 폴백 없음). CUPANG_DB_URL 미설정 시 안내 페이지
- 월간 달력 + 출고 묶음(헤더+라인), 박스 입수량 자동계산(서버 재계산)
- 입고센터 관리(사용중 soft delete), 박스규칙 upsert, 엑셀 내보내기
- 상품 검색은 itemcode_db 읽기 전용(미설정 시 수동 입력)
- MODULE_KEYS/메뉴/아이콘/라벨 동기화, scripts/sql/cupang_db_init.sql(멱등)
- app/data/ gitignore 추가(PII)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-29 20:47:32 +09:00
king 550867ba0c feat(expense+admin): 결재 워크플로 + 첨부 + 집계 + 엑셀 + 사용자 직접 등록
[admin]
- POST /api/users 사용자 직접 등록 (이메일만으로). UserStore.create_user 추가
- admin.html: 등록 폼 + 삭제 버튼 + 한글 라벨 + 신규 권한 표시
- 신규 권한 키: expense_approver, vacation_approver (APPROVER_KEYS)
- is_approver(user_rec, kind) 헬퍼

[expense 워크플로]
- 상태 전이: 작성중 → 제출 → 승인/반려 → 정산완료
- API: /api/items/{id}/{submit,revert,approve,reject,settle}
- 권한: submit/revert=owner, approve/reject/settle=expense_approver 또는 admin
- expense_items 컬럼: approver_email, decided_at, reject_reason
- 작성중/반려 상태에서만 수정/삭제/첨부 가능

[expense 첨부]
- 영수증/기타 (kind: receipt|other). 최대 20MB, 확장자 화이트리스트
- 저장: DATA_DIR/uploads/expense/{item_id}/{att_id}_{filename}
- expense_attachments 테이블 (CASCADE on item delete)
- API: 업로드/목록/다운로드/삭제

[expense 집계]
- /expense/reports: 연도별 월×카테고리 피벗 표

[expense 엑셀]
- GET /expense/api/export.xlsx?from&to&scope=mine|all
- scope=all 은 승인자/관리자만

[DDL]
- expense_db_init.sql: 신규 컬럼/테이블 포함 (멱등)
- expense_db_002_workflow_attachments.sql: 운영 DB 마이그레이션용

[deps]
- openpyxl>=3.1, python-multipart>=0.0.20

[docs]
- DATABASES.md: 워크플로 다이어그램, attachments 테이블, 마이그레이션
- PROJECT_OVERVIEW.md: 권한 키 표
- DEPLOYMENT.md: DATA_DIR/uploads 안내
2026-05-29 02:52:44 +09:00
king 9c58b022e2 feat(expense): 개인경비 모듈 + ERP 좌측메뉴 셸 + expense_db 연결
- ERP 셸: 좌측 사이드바 + 상단 헤더 + 콘텐츠 영역(erp_base.html)
- 분기: 슈퍼관리자 → 업무모듈 카드, 일반사용자 → ERP 메인(erp_home.html)
- 신규 라우트: /modules (슈퍼관리자 모듈 카드 재진입)
- 개인경비 모듈: app/modules/expense/ (라우터/저장소/템플릿)
  - JSON 저장소(ExpenseStore) + PostgreSQL 저장소(ExpenseDBStore)
  - 팩토리: EXPENSE_DB_URL 있으면 DB, 없으면 JSON 폴백
- DB: scripts/sql/expense_db_init.sql (멱등 DDL, postgres-db 컨테이너)
  - expense_db, 역할 expense_app, 테이블 expense_items, 인덱스/트리거
- 마이그레이션: scripts/migrate_expense_json_to_db.py (멱등, --dry-run)
- 의존성: psycopg[binary,pool]>=3.2
- 환경변수: EXPENSE_DB_URL 추가
- 문서: CLAUDE.md 작업 기준 + docs/{PROJECT_OVERVIEW,SERVER_ARCHITECTURE,DATABASES,DEPLOYMENT}.md
  - main-app 배포 경로 /opt/www/main 고정 명시
  - 위험 명령(DROP/TRUNCATE/rm -rf/volume 삭제) 사용자 승인 정책
2026-05-29 02:21:03 +09:00