care

Tables (34)

ActiveSession

  • id — INT — Primary key — NOT NULL
  • sessionId — VARCHAR(255) — NOT NULL
  • userId — INT — Foreign key → User.id
  • currentPath — VARCHAR(500) — NOT NULL
  • device — VARCHAR(20)
  • startedAt — DATETIME — NOT NULL
  • lastSeenAt — DATETIME — NOT NULL
  • pageViews — INT — NOT NULL

AdminLog

  • id — INT — Primary key — NOT NULL
  • adminId — INT — Foreign key → User.id — NOT NULL
  • action — VARCHAR(100) — NOT NULL
  • targetTable — VARCHAR(100) — NOT NULL
  • targetId — INT
  • before — JSON
  • after — JSON
  • reason — TEXT
  • expiresAt — DATETIME
  • createdAt — DATETIME — NOT NULL

Agent

  • id — INT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • encryptedPhone — VARCHAR(255) — NOT NULL
  • phoneHash — VARCHAR(255)
  • email — VARCHAR(255)
  • gender — ENUM('male', 'female') — NOT NULL
  • encryptedBirthdate — VARCHAR(255) — NOT NULL
  • job — VARCHAR(100) — NOT NULL
  • careerYears — INT
  • specialties — JSON — 자격증 보유 여부
  • expectations — TEXT
  • price — INT — NOT NULL
  • description — TEXT
  • status — VARCHAR(50) — NOT NULL
  • regionSido — ENUM('seoul', 'busan', 'daegu', 'incheon', 'gwangju', 'daejeon', 'ulsan', 'sejong', 'gyeonggi', 'gangwon', 'chungbuk', 'chungnam', 'jeonbuk', 'jeonnam', 'gyeongbuk', 'gyeongnam', 'jeju')
  • regionSigungu — VARCHAR(100)
  • addressDetail — VARCHAR(255)
  • hasLicense — BOOLEAN — 매칭 점수 0-100
  • workType — ENUM('main_job', 'side_job')
  • level — VARCHAR(50)
  • applicantType — ENUM('member', 'non_member')
  • desiredIncome — VARCHAR(100)
  • fullTimeInterest — BOOLEAN
  • contactAvailability — JSON
  • isInsuranceAgent — BOOLEAN
  • insuranceCareerYears — INT
  • insuranceKnowledge — VARCHAR(50)
  • motivation — TEXT
  • coreStrengths — JSON
  • matchingScore — FLOAT — Silver/Gold/Platinum
  • matchingGrade — VARCHAR(20) — GA가 후보자에게 남기는 메모
  • motivationScore — FLOAT
  • potentialScore — FLOAT
  • aptitudeScore — FLOAT
  • scoreOverriddenAt — DATETIME
  • partnersUserId — VARCHAR(255)
  • portfolioData — JSON
  • portfolioSyncedAt — DATETIME
  • thirdPartyConsent — BOOLEAN — NOT NULL
  • deletedBy — VARCHAR(100)
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL
  • =후보자 — (설계사 전환 희망자

AgentASLog

  • id — INT — Primary key — NOT NULL
  • asRequestId — INT — Foreign key → AgentASRequest.id — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • status — ENUM('requested','processing','completed','rejected') — NOT NULL
  • adminId — INT
  • note — TEXT
  • createdAt — DATETIME — NOT NULL

AgentASRequest

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • agentId — INT — Foreign key → Agent.id — NOT NULL
  • onboardingId — INT — Foreign key → Onboarding.id — NOT NULL
  • reason — ENUM('communication_fail','mismatch','poor_quality','other') — NOT NULL
  • description — TEXT
  • status — ENUM('requested','processing','completed','rejected') — NOT NULL
  • evidenceFiles — JSON
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

AgentPurchase

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • agentId — INT — Foreign key → Agent.id — NOT NULL
  • price — INT — NOT NULL
  • creditsUsed — INT — NOT NULL
  • paymentStatus — ENUM('success','failed','canceled') — NOT NULL
  • approvalStatus — ENUM('auto_approved','pending_approval','approved','rejected') — NOT NULL
  • approvedAt — DATETIME
  • approvedBy — INT
  • approvalReason — VARCHAR(500)
  • adminMemo — TEXT
  • exclusiveUntil — DATETIME
  • createdAt — DATETIME — NOT NULL

AlimtalkLog

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • templateCode — VARCHAR(100) — NOT NULL
  • status — VARCHAR(50) — NOT NULL
  • errorMessage — TEXT
  • sentAt — DATETIME
  • createdAt — DATETIME — NOT NULL

AnalyticsEvent

  • id — INT — Primary key — NOT NULL
  • sessionId — VARCHAR(255) — NOT NULL
  • userId — INT — Foreign key → User.id
  • eventType — VARCHAR(50) — NOT NULL
  • pageName — VARCHAR(100)
  • referrer — VARCHAR(500)
  • duration — INT
  • device — VARCHAR(20)
  • createdAt — DATETIME — NOT NULL

ChatMessage

  • id — INT — Primary key — NOT NULL
  • roomId — INT — Foreign key → ChatRoom.id — NOT NULL
  • senderId — INT — Foreign key → User.id — NOT NULL
  • senderRole — ENUM('admin','ga','agent') — NOT NULL
  • content — TEXT — NOT NULL
  • isRead — BOOLEAN — NOT NULL
  • createdAt — DATETIME — NOT NULL

ChatRoom

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • status — ENUM('active','closed') — NOT NULL
  • slackNotifyEnabled — BOOLEAN — NOT NULL
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL
  • closedAt — DATETIME

CreditPlan

  • id — INT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • price — INT — NOT NULL — 정기결제 SID
  • priceVat — INT — NOT NULL — 1.0 호환용
  • discountPrice — INT
  • discountPriceVat — INT
  • discountStartAt — DATETIME
  • discountEndAt — DATETIME
  • credits — INT — NOT NULL
  • status — VARCHAR(50) — NOT NULL
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

CreditTransaction

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • type — VARCHAR(50) — NOT NULL
  • amount — INT — NOT NULL
  • balanceAfter — INT — NOT NULL
  • relatedPurchaseId — INT — Foreign key → AgentPurchase.id
  • adminName — VARCHAR(100)
  • createdAt — DATETIME — NOT NULL

EmailVerification

  • id — INT — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • code — VARCHAR(10) — NOT NULL
  • sendCount — INT — NOT NULL
  • lastSentAt — DATETIME — NOT NULL
  • verified — BOOLEAN — NOT NULL
  • verificationToken — VARCHAR(255)
  • expiresAt — DATETIME — NOT NULL
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

GAMatchingPreference

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • matchingWeightType — VARCHAR(50)
  • preferredActivityTimes — JSON
  • establishedYear — INT
  • designerCount — INT
  • mainProducts — JSON
  • targetCustomers — VARCHAR(255)
  • educationProgram — TEXT
  • supportBenefits — TEXT
  • gaIntroduction — TEXT
  • gaStrengths — TEXT
  • preferredWorkType — VARCHAR(20)
  • requireCareer — BOOLEAN
  • preferredGender — VARCHAR(10)
  • preferredAgeMin — INT
  • preferredAgeMax — INT
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

GANotificationPreference

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • enableNewAgentAlert — BOOLEAN — NOT NULL
  • notifyAllRegions — BOOLEAN — NOT NULL
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

GANotificationRegion

  • id — INT — Primary key — NOT NULL
  • preferenceId — INT — Foreign key → GANotificationPreference.id — NOT NULL
  • regionSido — VARCHAR(50) — NOT NULL
  • regionSigungu — VARCHAR(100)
  • createdAt — DATETIME — NOT NULL

Inquiry

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • type — ENUM('technical','billing','service','complaint','other') — NOT NULL
  • priority — INT — NOT NULL
  • title — VARCHAR(255) — NOT NULL
  • content — TEXT — NOT NULL
  • status — ENUM('new','assigned','checking','answered') — NOT NULL
  • adminResponse — TEXT
  • adminId — INT
  • adminName — VARCHAR(100)
  • adminMemo — TEXT
  • respondedAt — DATETIME
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

Meeting

  • id — INT — Primary key — NOT NULL
  • onboardingId — INT — Foreign key → Onboarding.id — NOT NULL
  • scheduledDate — DATETIME — NOT NULL
  • location — VARCHAR(255)
  • result — ENUM('success','failed')
  • memo — TEXT
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

NewAgentNotificationQueue

  • id — INT — Primary key — NOT NULL
  • agentId — INT — Foreign key → Agent.id — NOT NULL
  • regionSido — VARCHAR(50) — NOT NULL
  • regionSigungu — VARCHAR(100)
  • status — VARCHAR(50) — NOT NULL
  • processedAt — DATETIME
  • createdAt — DATETIME — NOT NULL

Notice

  • id — INT — Primary key — NOT NULL
  • title — VARCHAR(255) — NOT NULL
  • content — TEXT — NOT NULL
  • isPublished — BOOLEAN — NOT NULL
  • isPinned — BOOLEAN — NOT NULL
  • viewCount — INT — NOT NULL
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

NoticeViewLog

  • id — INT — Primary key — NOT NULL
  • noticeId — INT — Foreign key → Notice.id — NOT NULL
  • ipAddress — VARCHAR(50) — NOT NULL
  • expiresAt — DATETIME — NOT NULL
  • createdAt — DATETIME — NOT NULL

Notification

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • type — ENUM('as_request','as_delayed','ga_signup','ga_delayed','purchase_request','payment_request') — NOT NULL
  • title — VARCHAR(255) — NOT NULL
  • message — TEXT — NOT NULL
  • data — JSON
  • isRead — BOOLEAN — NOT NULL
  • createdAt — DATETIME — NOT NULL

Onboarding

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • agentId — INT — Foreign key → Agent.id — NOT NULL
  • purchaseId — INT — Foreign key → AgentPurchase.id — NOT NULL
  • status — ENUM('pending', 'contacting', 'completed', 'failed', 'contact_failed', 'meeting_scheduled', 'meeting_completed', 'meeting_failed') — NOT NULL
  • memo — TEXT
  • gaMemo — TEXT — 첫 구매 월간 가격 (VAT 포함)
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL
  • =온보딩 — (컨택→대면 프로세스

OnboardingLog

  • id — INT — Primary key — NOT NULL
  • onboardingId — INT — Foreign key → Onboarding.id — NOT NULL
  • oldStatus — VARCHAR(50)
  • newStatus — VARCHAR(50) — NOT NULL
  • changedBy — VARCHAR(100) — NOT NULL
  • note — TEXT
  • createdAt — DATETIME — NOT NULL

PackagePlan

  • id — INT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • agentCount — INT — NOT NULL
  • price — INT — NOT NULL — page_view, page_exit, click, form_submit
  • discountPrice — INT
  • discountRate — INT
  • status — VARCHAR(50) — NOT NULL
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

PackageRequest

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • packageName — VARCHAR(200) — NOT NULL
  • agentCount — INT — NOT NULL
  • amount — INT — NOT NULL
  • status — VARCHAR(50) — NOT NULL
  • rejectionReason — TEXT
  • processedBy — INT
  • processedAt — DATETIME
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

PartnerApplication

  • id — INT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • encryptedPhone — VARCHAR(255) — NOT NULL
  • phoneHash — VARCHAR(255) — NOT NULL
  • email — VARCHAR(255)
  • gender — ENUM('male', 'female') — NOT NULL
  • encryptedBirthdate — VARCHAR(255) — NOT NULL
  • job — VARCHAR(100)
  • fullAddress — VARCHAR(500) — NOT NULL
  • careerYears — INT
  • specialties — JSON
  • expectations — TEXT
  • howDidYouKnow — VARCHAR(255)
  • consentPersonalInfo — BOOLEAN — NOT NULL
  • consentMarketing — BOOLEAN — NOT NULL
  • status — ENUM('pending', 'approved', 'rejected') — NOT NULL
  • rejectionReason — TEXT
  • processedBy — INT — Foreign key → User.id
  • processedAt — DATETIME
  • createdAgentId — INT — Foreign key → Agent.id
  • applicantType — ENUM('member', 'non_member')
  • applicantUserId — INT — Foreign key → User.id
  • hasLicense — BOOLEAN
  • workType — ENUM('main_job', 'side_job')
  • level — VARCHAR(50)
  • partnersUserId — VARCHAR(255)
  • desiredIncome — VARCHAR(100)
  • fullTimeInterest — BOOLEAN
  • contactAvailability — JSON
  • isInsuranceAgent — BOOLEAN
  • insuranceCareerYears — INT
  • insuranceKnowledge — VARCHAR(50)
  • motivation — TEXT
  • coreStrengths — JSON
  • matchingScore — FLOAT
  • matchingGrade — VARCHAR(20)
  • motivationScore — FLOAT
  • potentialScore — FLOAT
  • aptitudeScore — FLOAT
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

Payment

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • type — ENUM('credit', 'subscription', 'subscription_renewal') — NOT NULL
  • status — ENUM('ready', 'approved', 'failed', 'canceled') — NOT NULL
  • tid — VARCHAR(255) — NOT NULL
  • partnerUserId — VARCHAR(255) — NOT NULL
  • itemName — VARCHAR(255) — NOT NULL
  • quantity — INT — NOT NULL
  • totalAmount — INT — NOT NULL
  • taxFreeAmount — INT — NOT NULL
  • creditAmount — INT
  • subscriptionType — ENUM('monthly', 'yearly')
  • approvedAt — DATETIME
  • kakaoResponse — JSON
  • errorCode — VARCHAR(50)
  • errorMessage — TEXT
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

PaymentRequest

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • type — ENUM('credit','subscription') — NOT NULL
  • creditAmount — INT
  • subscriptionType — ENUM('monthly','yearly')
  • amount — INT — NOT NULL
  • status — ENUM('pending','approved','rejected') — NOT NULL
  • rejectionReason — TEXT
  • processedBy — INT
  • processedAt — DATETIME
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

PhoneVerification

  • id — INT — Primary key — NOT NULL
  • phoneHash — VARCHAR(255) — NOT NULL
  • encryptedPhone — VARCHAR(255) — NOT NULL
  • code — VARCHAR(10) — NOT NULL
  • sendCount — INT — NOT NULL
  • lastSentAt — DATETIME — NOT NULL
  • verified — BOOLEAN — NOT NULL
  • verificationToken — VARCHAR(255)
  • expiresAt — DATETIME — NOT NULL
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

SubscriptionPlan

  • id — INT — Primary key — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • priceMonthlyFirst — INT — NOT NULL — 재구매 월간 가격 (VAT 포함)
  • priceMonthlyFirstVat — INT — NOT NULL — 첫 구매 할인율 %
  • priceMonthly — INT — NOT NULL — 연간 가격 (VAT 미포함)
  • priceMonthlyVat — INT — NOT NULL — 연간 가격 (VAT 포함)
  • discountRate — INT — VAT 미포함
  • priceYearly — INT — NOT NULL — VAT 포함
  • priceYearlyVat — INT — NOT NULL — VAT 포함 정가
  • featuresJson — JSON
  • status — VARCHAR(50) — NOT NULL
  • =구독 — 플랜

UsageLog

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • actionType — ENUM('search','view_agent','purchase','onboarding_update','as_request') — NOT NULL
  • meta — JSON
  • createdAt — DATETIME — NOT NULL

User

  • id — INT — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • encryptedPassword — VARCHAR(255) — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • encryptedPhone — VARCHAR(255) — NOT NULL
  • phoneHash — VARCHAR(255)
  • companyName — VARCHAR(200) — NOT NULL
  • position — VARCHAR(100) — NOT NULL
  • role — ENUM('admin', 'ga', 'agent') — NOT NULL
  • status — ENUM('active', 'inactive', 'suspended') — NOT NULL
  • encryptedBirthdate — VARCHAR(255) — NOT NULL
  • regionSido — ENUM('seoul', 'busan', 'daegu', 'incheon', 'gwangju', 'daejeon', 'ulsan', 'sejong', 'gyeonggi', 'gangwon', 'chungbuk', 'chungnam', 'jeonbuk', 'jeonnam', 'gyeongbuk', 'gyeongnam', 'jeju')
  • regionSigungu — VARCHAR(100)
  • addressDetail — VARCHAR(255)
  • creditBalance — INT — NOT NULL
  • totalSpent — FLOAT — NOT NULL
  • approved — BOOLEAN — NOT NULL
  • approvedAt — DATETIME
  • approvedBy — INT
  • marketingConsent — BOOLEAN — NOT NULL
  • serviceTermsAgreed — BOOLEAN — NOT NULL
  • subscriptionPlanId — INT — Foreign key → SubscriptionPlan.id
  • subscriptionStatus — ENUM('none', 'active', 'expired', 'canceled') — NOT NULL
  • subscriptionExpireAt — DATETIME
  • subscriptionSid — VARCHAR(255) — 카카오페이 정기결제 SID
  • trialEndsAt — DATETIME
  • socialProvider — VARCHAR(50) — naver, kakao 등
  • socialId — VARCHAR(255)
  • lastLoginAt — DATETIME
  • deletedBy — VARCHAR(100)
  • deletedAt — DATETIME
  • deleteReason — VARCHAR(500)
  • deleteScheduledAt — DATETIME
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL

UserSubscription

  • id — INT — Primary key — NOT NULL
  • userId — INT — Foreign key → User.id — NOT NULL
  • planId — INT — Foreign key → SubscriptionPlan.id — NOT NULL
  • startAt — DATETIME — NOT NULL
  • endAt — DATETIME — NOT NULL
  • status — ENUM('none','active','expired','canceled') — NOT NULL
  • autoRenew — BOOLEAN — NOT NULL
  • renewalPrice — INT
  • cancelReason — VARCHAR(100)
  • cancelDetail — TEXT
  • canceledAt — DATETIME
  • createdAt — DATETIME — NOT NULL
  • updatedAt — DATETIME — NOT NULL