Skip to content

feat(mobile): weekly worktime insights (Phase 4B) - #14

Draft
dohyeon16 wants to merge 1 commit into
feature/mobile-attendance-auditfrom
feature/mobile-worktime-insights
Draft

feat(mobile): weekly worktime insights (Phase 4B)#14
dohyeon16 wants to merge 1 commit into
feature/mobile-attendance-auditfrom
feature/mobile-worktime-insights

Conversation

@dohyeon16

Copy link
Copy Markdown
Owner

Phase 4B — 근무시간 사전 안내 (Draft)

정보성 안내이며 법적 판정이 아닙니다. 이번 주 근무시간을 미리 인지하도록 돕는 파생 안내로, backend/schema/신규 business data 없이 ScheduledShift + AttendanceRecord + 근무지 정책에서 계산합니다.

주간 시간 계산 정책 (순수 함수 · 테스트)

  • 주 = 월~일(payCalc weekKeyOf와 동일 관례).
  • 예정/실제 중복 방지: 날짜+근무지 기준으로 그 날 실제 기록이 있으면 실제만, 없으면 예정만 집계 → 같은 근무 이중 집계 없음.
  • 완료 기록=실근무(휴게 차감), 진행 중=출근현재(clamp), 예정=시작종료(종료 없으면 0).
  • expected = actual + planned, 근무지별 계산(주휴/40h는 사업장 단위).

안내 문구 (정보성 · 임계 기반)

  • ≥15h → "주휴수당 요건 확인" (소정근로시간·개근 등 조건에 따라 달라짐 명시).
  • ≥38h 근접 / >40h 초과 가능 → "40시간 근접/초과 가능" (실제 적용은 사업장·근로조건에 따라).
  • 금지 표현 없음(발생 확정/위반/미지급). 모든 표면에 "간이 안내" 디스클레이머.

알림 조건

  • 인앱 안내를 notificationsFeed에 병합. id에 주(월요일) 포함(worktime-*-<monday>) + 기존 read 상태 → 매 실행마다 중복 생성 안 함, 지난 주 미생성(항상 이번 주만 계산). 급여일 리마인더는 기존 것 그대로(재구현 안 함).
  • UI: 홈 "이번 주 근무" compact 카드(실제/예정/예상 + 상태 배지), semantic theme·다크모드.

테스트

  • 신규 +20 (임계 0/14h59/15h/39h/40h/40h+, 예정만/실제만/실제+예정, 이중집계 방지, 자정 넘김, 진행중, 근무지 분리, 월/연 경계, 지난주 미생성, 안내 id·read).
  • 전체 158/158, tsc --noEmit 0, web + ios/android export OK, git diff --check clean, secret scan clean.
  • expo doctor 경고 2건은 기존 이슈(패키지 미변경).

무변경 / 상태

  • backend/schema/API/Production 변경 없음 → Preview smoke 불필요, 기존 sync 회귀 테스트 green.
  • 실기기 검증(실제 알림 발화·UI 클릭) 대기.

브랜치 전략

후속 (Phase 4C)

  • Vision/Gemini 서버 프록시(클라이언트 키 노출 감사 선행) → 급여명세서 OCR → 예상↔명세서↔실입금 3-way 비교.

🤖 Generated with Claude Code

https://claude.ai/code/session_01QEVyEfK1DDkhyEnpTUq3jo

Informational (not a legal determination) heads-up on this week's worktime,
derived from ScheduledShift + AttendanceRecord + workplace policy. No backend,
schema, or new business data — pure derived state.

Weekly calculation (pure, tested)
- Week is Mon–Sun (same convention as payCalc weekKeyOf).
- Per date+workplace, actual attendance overrides planned shift → no double count
  of a shift that already has an actual record.
- Completed record = worked minutes (break deducted); in-progress = clock-in→now
  (clamped); planned shift = start→end (skipped if no end time).
- expected = actual + planned. Computed per workplace (allowance/40h are per site).

Insights (threshold-based, information only)
- >=15h → "주휴수당 요건 확인" (notes 소정근로/개근 등 조건에 따라 달라짐).
- >=38h near / >40h exceed → "40시간 근접/초과 가능" (실제 적용은 사업장·근로조건에 따라).
- No "발생 확정/위반/미지급" wording; every surface carries a 간이 안내 disclaimer.

Surfaces
- Home "이번 주 근무" compact card (실제/예정/예상 + status badges), semantic theme.
- In-app notices merged into notificationsFeed with stable per-week ids
  (worktime-*-<monday>) + existing read-state → no duplicate on each launch,
  never generated for past weeks. Payday reminder untouched (already exists).

Tests: +20 (thresholds, planned/actual, double-count guard, overnight, in-progress,
per-workplace, month/year boundary, past-week suppression, notice id/read-state).
Full suite 158/158, tsc 0, web + ios/android export OK. No backend/Production change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEVyEfK1DDkhyEnpTUq3jo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant