feat: 생년월일 필드 추가 + 카카오 스코프 확장 + 채널 연동 문서

- signup.html: 수집 목적 안내 카드, 생년월일(선택) 필드, 필수/선택 배지
- app.py: /api/signup에 birthday 처리, get_or_create_user birthday 파라미터
- mileage_schema.sql: users 테이블 birthday 컬럼 추가
- dbsetup.py: 기존 DB 마이그레이션 (ALTER TABLE ADD birthday)
- kakao_client.py: scope에 phone_number,birthday,birthyear 추가
- privacy.html: 항목별 수집 목적 테이블, 필수/선택 구분, 9항 신설
- kakao-phone-request.md: 전화번호+생일 스코프 신청 사유 문서
- kakao-channel-integration.md: 채널 API 분석 및 알림톡 로드맵
- kakao-chanell-rest-api.md: 카카오 채널 REST API 원문 참고 문서

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
thug0bin
2026-02-25 10:12:41 +09:00
parent 2b3d8649ba
commit f969756caa
9 changed files with 984 additions and 36 deletions

View File

@@ -78,18 +78,47 @@
}
.input-group {
margin-bottom: 20px;
margin-bottom: 24px;
}
.input-group label {
display: block;
display: flex;
align-items: center;
gap: 6px;
font-size: 14px;
font-weight: 600;
color: #495057;
margin-bottom: 8px;
margin-bottom: 6px;
letter-spacing: -0.2px;
}
.label-badge {
font-size: 11px;
font-weight: 600;
padding: 2px 6px;
border-radius: 4px;
letter-spacing: -0.2px;
}
.badge-required {
background: #fff0f0;
color: #e03131;
}
.badge-optional {
background: #f0f4ff;
color: #6366f1;
}
.input-purpose {
font-size: 12px;
color: #868e96;
margin-bottom: 8px;
line-height: 1.5;
letter-spacing: -0.2px;
padding-left: 2px;
}
.input-group input {
width: 100%;
padding: 16px;
@@ -129,6 +158,94 @@
flex: 1;
}
.birthday-wrapper {
display: flex;
gap: 8px;
}
.birthday-wrapper select {
flex: 1;
padding: 16px 12px;
border: 1.5px solid #e9ecef;
border-radius: 12px;
font-size: 15px;
font-family: inherit;
color: #212529;
background: #fff;
-webkit-appearance: none;
appearance: none;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23868e96' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
background-repeat: no-repeat;
background-position: right 12px center;
}
.birthday-wrapper select:focus {
outline: none;
border-color: #6366f1;
}
.birthday-wrapper select.placeholder {
color: #adb5bd;
}
/* 수집 항목 안내 카드 */
.info-card {
background: #f8f9fa;
border-radius: 14px;
padding: 20px;
margin-bottom: 24px;
}
.info-card-title {
font-size: 13px;
font-weight: 700;
color: #495057;
margin-bottom: 12px;
letter-spacing: -0.2px;
}
.info-item {
display: flex;
align-items: flex-start;
gap: 10px;
margin-bottom: 10px;
}
.info-item:last-child { margin-bottom: 0; }
.info-item-icon {
width: 32px;
height: 32px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
font-size: 15px;
flex-shrink: 0;
}
.info-item-icon.blue { background: rgba(99, 102, 241, 0.1); }
.info-item-icon.green { background: rgba(16, 185, 129, 0.1); }
.info-item-icon.pink { background: rgba(244, 63, 94, 0.1); }
.info-item-text {
flex: 1;
}
.info-item-label {
font-size: 13px;
font-weight: 600;
color: #495057;
letter-spacing: -0.2px;
}
.info-item-desc {
font-size: 12px;
color: #868e96;
line-height: 1.5;
letter-spacing: -0.2px;
}
.privacy-consent {
margin: 24px 0;
}
@@ -346,17 +463,51 @@
<div class="form-title">회원가입</div>
<div class="form-desc">
청춘약국 마일리지 서비스에 가입하세요.<br>
영수증 QR 스캔으로 포인트를 적립할 수 있습니다.
영수증 QR 스캔으로 구매금액의 3%를 적립할 수 있습니다.
</div>
<!-- 수집 항목 안내 카드 -->
<div class="info-card">
<div class="info-card-title">수집 항목 및 이용 목적</div>
<div class="info-item">
<div class="info-item-icon blue">📱</div>
<div class="info-item-text">
<div class="info-item-label">전화번호 (필수)</div>
<div class="info-item-desc">마일리지 적립 계정의 고유 식별자로 사용됩니다. 포인트 조회 및 사용 시 본인 확인에 필요합니다.</div>
</div>
</div>
<div class="info-item">
<div class="info-item-icon green">👤</div>
<div class="info-item-text">
<div class="info-item-label">이름 (필수)</div>
<div class="info-item-desc">동명이인 구분 및 약국 방문 시 본인 확인에 사용됩니다.</div>
</div>
</div>
<div class="info-item">
<div class="info-item-icon pink">🎂</div>
<div class="info-item-text">
<div class="info-item-label">생년월일 (선택)</div>
<div class="info-item-desc">생일 기념 포인트 2배 적립 이벤트 및 연령대별 맞춤 건강 정보 제공에 활용됩니다.</div>
</div>
</div>
</div>
<form id="formSignup" onsubmit="return false;">
<div class="input-group">
<label for="name">이름</label>
<label for="name">
이름
<span class="label-badge badge-required">필수</span>
</label>
<div class="input-purpose">약국 방문 시 본인 확인 및 동명이인 구분에 사용됩니다.</div>
<input type="text" id="name" placeholder="이름을 입력하세요" autocomplete="name" required>
</div>
<div class="input-group">
<label for="phone">전화번호</label>
<label for="phone">
전화번호
<span class="label-badge badge-required">필수</span>
</label>
<div class="input-purpose">마일리지 적립·조회의 고유 식별자로 사용됩니다.</div>
<div class="phone-wrapper">
<span class="phone-prefix">010 -</span>
<input type="tel" id="phone"
@@ -368,12 +519,31 @@
</div>
</div>
<div class="input-group">
<label>
생년월일
<span class="label-badge badge-optional">선택</span>
</label>
<div class="input-purpose">생일 기념 포인트 2배 적립 및 연령대별 맞춤 건강 정보 제공에 활용됩니다.</div>
<div class="birthday-wrapper">
<select id="birthYear" class="placeholder">
<option value="">년도</option>
</select>
<select id="birthMonth" class="placeholder">
<option value=""></option>
</select>
<select id="birthDay" class="placeholder">
<option value=""></option>
</select>
</div>
</div>
<div class="privacy-consent">
<label class="checkbox-container">
<input type="checkbox" id="privacyConsent" required>
<span class="consent-text">
<a href="/privacy" target="_blank">개인정보 수집·이용</a>에 동의합니다.
<br><span style="font-size:12px; color:#868e96;">전화번호, 이름을 마일리지 적립·조회 목적으로 수집합니다.</span>
<br><span style="font-size:12px; color:#868e96;">전화번호, 이름(필수), 생년월일(선택)을 마일리지 적립·조회 및 맞춤 서비스 목적으로 수집합니다.</span>
</span>
</label>
</div>
@@ -418,6 +588,41 @@
<script>
if('serviceWorker' in navigator){navigator.serviceWorker.register('/sw.js').catch(()=>{});}
// 생년월일 셀렉트 초기화
(function() {
var yearSel = document.getElementById('birthYear');
var monthSel = document.getElementById('birthMonth');
var daySel = document.getElementById('birthDay');
var currentYear = new Date().getFullYear();
for (var y = currentYear; y >= 1920; y--) {
var opt = document.createElement('option');
opt.value = y;
opt.textContent = y + '년';
yearSel.appendChild(opt);
}
for (var m = 1; m <= 12; m++) {
var opt = document.createElement('option');
opt.value = m < 10 ? '0' + m : '' + m;
opt.textContent = m + '월';
monthSel.appendChild(opt);
}
for (var d = 1; d <= 31; d++) {
var opt = document.createElement('option');
opt.value = d < 10 ? '0' + d : '' + d;
opt.textContent = d + '일';
daySel.appendChild(opt);
}
// 선택 시 placeholder 클래스 제거
[yearSel, monthSel, daySel].forEach(function(sel) {
sel.addEventListener('change', function() {
if (this.value) this.classList.remove('placeholder');
else this.classList.add('placeholder');
});
});
})();
const phoneInput = document.getElementById('phone');
const form = document.getElementById('formSignup');
const alertMsg = document.getElementById('alertMsg');
@@ -437,6 +642,15 @@
const phone = '010' + raw;
const consent = document.getElementById('privacyConsent').checked;
// 생년월일 (선택)
const birthYear = document.getElementById('birthYear').value;
const birthMonth = document.getElementById('birthMonth').value;
const birthDay = document.getElementById('birthDay').value;
let birthday = null;
if (birthYear && birthMonth && birthDay) {
birthday = birthYear + '-' + birthMonth + '-' + birthDay;
}
if (!name) return showAlert('이름을 입력해주세요.');
if (raw.length < 7) return showAlert('올바른 전화번호를 입력해주세요.');
if (!consent) return showAlert('개인정보 수집·이용에 동의해주세요.');
@@ -446,10 +660,13 @@
btn.textContent = '가입 중...';
try {
const body = { name, phone };
if (birthday) body.birthday = birthday;
const res = await fetch('/api/signup', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ name, phone })
body: JSON.stringify(body)
});
const data = await res.json();