feat: 활동증명서용 회장 서명 등록/변경 + 회장 임기 관리#17
Open
youngunghan wants to merge 1 commit into
Open
Conversation
This was referenced Jul 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
신규 API — 회장 서명 등록/변경 + 회장 임기 관리
PUT /certificates/signature/me (require_president, multipart/form-data, field file)
GET /certificates/signature/me (require_president)
POST /certificates/president-terms (require_admin)
GET /certificates/president-terms/current (require_admin)
허용 포맷 PNG/JPEG/JPG/WEBP/GIF, content-type + 매직바이트 이중 검사, 최대 5MB
업로드된 서명은 렌더링 시 서버에서 빨강 + 투명 배경 PNG로 정규화(밝은 배경은 투명, 어두운 획만 지정색으로 채움) — 원본 포맷과 무관하게 항상 image/png data URI로 임베드
회장 1인당 서명 1개, 교체 시 기존 서명 파일 삭제
회장 임명 시 기존에 열려 있는 임기를 같은 트랜잭션에서 자동 종료, 동시 임명 요청은 DB 유니크 제약으로 하나만 성공
require_president는 현직 임기만 통과
검증 메시지:· 이미지 형식/매직바이트 불일치 → "이미지 파일(PNG, JPG, WEBP, GIF)이 맞는지 확인해주세요." · 5MB 초과 → "파일 용량이 너무 큽니다. (최대 5MB)" · 회장이 아닌 사용자의 접근 → "회장만 수행할 수 있는 기능입니다." · 동시 임명 충돌 → "다른 회장 임명 요청과 충돌했습니다. 다시 시도해주세요." · 새 임기 시작일이 현직 임기 시작일보다 빠름 → "새 임기 시작일은 현직 회장의 임기 시작일보다 빠를 수 없습니다." · 시작일이 미래 → "임기 시작일은 오늘보다 미래일 수 없습니다 (임명은 즉시 발효됩니다)." · 서명 동시 등록 충돌 → "다른 서명 등록 요청과 충돌했습니다. 다시 시도해주세요."
※ 이 PR 범위: 회장 임기(president_terms) + 서명 저장/조회(certificate_signatures)까지입니다. 업로드된 서명을 실제 증명서 PDF에 빨강 잉크로 렌더링하는 부분은 렌더링 PR에서 이어집니다. 오브젝트 스토리지는 OCI를 직접 사용합니다.
DB 마이그레이션:
d1e2f3a4b5c6(president_terms, certificate_signatures 2테이블). 열린 임기 최대 1개는 생성 컬럼 + UNIQUE로 DB에서 강제.