Skip to content

feat(jobs): 작업 공고(선착순 배정·마감 알림·캘린더) + fix(estimates): 발신 계정 표시 - #51

Merged
brekarta-stack merged 7 commits into
mainfrom
brekarta-stack/견적서-자동화
Nov 13, 2026

Hidden character warning

The head ref may contain hidden characters: "brekarta-stack/\uacac\uc801\uc11c-\uc790\ub3d9\ud654"
Merged

brekarta-stack merged 7 commits into
mainfrom
brekarta-stack/견적서-자동화

Conversation

@brekarta-stack

@brekarta-stack brekarta-stack commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

이 PR에는 두 가지가 들어 있습니다.

1. 작업 공고 — 선착순 배정, 마감 알림, 캘린더, 이메일 로그인 링크

설계: docs/job-board-plan.md

  • /admin/jobs: 문의마다 견적가(비공개)·작업비·마감일·전달 메모를 적어 공고, 관리자(오세기)로 가져가기, 회수
  • /artist/jobs: 공고 목록·상세·가져가기. 고객 신원·견적가는 조회 단계부터 제외. 가져간 공고는 다른 작업자에게 404
  • 가져가기 = status='open' 조건부 UPDATE 한 번 → 수락 완료 배정 생성, 구글 캘린더에 마감일 종일 일정
  • 마감 알림 메일 50·25·10% — /api/cron/job-alerts (맥 launchd 15분 + Vercel 하루 1회)
  • 네이버 메일 작업자용 이메일 로그인 링크 (해시 저장, 15분, 1회용, 버튼 확인)

배포 후 사람이 할 일

  1. Supabase SQL Editor 에서 supabase/migrations/20261113_job_board.sql 실행
  2. GCP Agents-CES 에서 Google Calendar API 사용 설정
  3. 견적서 화면에서 구글을 ask@papercraft.kr 로 다시 연결(캘린더 체크)

검증: npm test 437 통과, tsc·빌드 통과, 별도 검증 에이전트 2회(중요 2건 수정 후 재검증 통과). 실제 DB·메일·캘린더 경로는 운영 env 없이 미실행.

2. (기존) 견적서 발신 계정 표시

견적서 메일은 이미 PE Studio <ask@papercraft.kr> 로 나가고 있었다(#47). 상세 화면의 기록 칸에는 버튼을 누른 관리자 계정만 보여 발신 계정으로 오해됐다.

  • 발신 주소를 estimateFromAddress() 한 곳에서 정한다(ESTIMATE_FROM_EMAIL 로만 변경)
  • 발송 폼·발송 완료 칸·발송 기록에 "보낸 계정"을 표시하고, 관리자 계정은 "처리:" 로 구분
  • 발송 이벤트 detail 에 from 저장

npm test 378/378, tsc·eslint·build 통과.

🤖 Generated with Claude Code

…ly from the acting admin

The send already went out from PE Studio <ask@papercraft.kr>, but the
event log only showed the admin who clicked (brekarta@gmail.com), which
read as the sender. Resolve the sender in one helper, show it on the send
form, the sent card and the sent event, and label the actor as 처리.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
actioncraft-web Ready Ready Preview Nov 13, 2026 2:38am UTC

Request Review

brekarta-stack and others added 4 commits November 13, 2026 10:26
… calendar

Inquiries become job postings: the admin enters a client quote, a worker fee
and a deadline per inquiry on /admin/jobs, and workers see open postings on
the portal (/artist/jobs) without customer identity or the client quote. The
first worker to claim wins through a single conditional update; the claim
creates an accepted assignment, hides the posting from everyone else and
records an all-day deadline event on the connected Google Calendar.

Deadline mails go out when 50%, 25% and 10% of the claim-to-deadline window
remain, checked by /api/cron/job-alerts (Mac launchd every 15 minutes, daily
Vercel cron as a fallback). Workers without Google accounts sign in with a
one-time email link (hashed, 15 minutes, button-confirmed).

Requires migration 20261113_job_board.sql, the Calendar API enabled in GCP
and reconnecting Google as ask@papercraft.kr. See docs/job-board-plan.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… orphan race, expired postings

- Reuse the worker's existing (quote, artist) assignment row on claim instead
  of inserting, so a released job can be claimed again by the same worker
  (unique index assignments_quote_artist_unique); map 23505 to a user message.
- Refuse the claim when another assignment became active after posting.
- Link the assignment to the posting before the calendar call and only while
  the posting is still claimed by the same worker; cancel the new assignment
  if it was released meanwhile.
- Hide and refuse postings whose deadline has passed (KST).
- Reject blocked accounts inside the email-link authorize step; the relative
  deny URL from the signIn callback made the client throw and hang. The verify
  button also catches signIn errors.
- Login link requests always return the same result (no account probing via
  error messages); constant-time CRON_SECRET comparison.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nment on claim

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brekarta-stack brekarta-stack changed the title fix(estimates): show sending account ask@papercraft.kr in estimate UI feat(jobs): 작업 공고(선착순 배정·마감 알림·캘린더) + fix(estimates): 발신 계정 표시 Nov 13, 2026
…inclusive fee

Claimed assignments now use fee_tax_mode 'vat' (fee + 10%). Input and storage
stay supply-based; the worker list, job detail, new-posting mail, calendar
event and admin board lead with the VAT-inclusive amount and show the
supply/VAT split next to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the portal

Work detail shows 작업비 (부가세 포함) first for vat-mode assignments and the
amount still to receive including VAT; dashboard and settlement totals add
VAT for tax-invoice work (withholding/none stay pre-tax).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@brekarta-stack
brekarta-stack merged commit 87e43a1 into main Nov 13, 2026
2 of 3 checks passed

This branch was successfully deployed

1 active deployment
Preview — 897ace83 Deployed Nov 13, 2026 by vercel[bot]
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