handly

Tables (33)

action_request

  • action_request_id — uuid — Primary key — NOT NULL
  • request_type — varchar(20) — NOT NULL
  • handover_work_id — uuid — Foreign key → handover_work.handover_work_id
  • risk_analysis_id — uuid — Foreign key → ai_risk_analysis.risk_analysis_id
  • requester_employee_id — uuid — Foreign key → employee.employee_id — NOT NULL
  • assignee_employee_id — uuid — Foreign key → employee.employee_id — NOT NULL
  • reason — text — NOT NULL
  • status — varchar(20) — NOT NULL
  • due_at — timestamptz
  • requested_at — timestamptz — NOT NULL
  • resolved_at — timestamptz
  • resolution_note — text

ai_conversation

  • conversation_id — uuid — Primary key — NOT NULL
  • employee_id — uuid — Foreign key → employee.employee_id — NOT NULL
  • title — varchar(200) — NOT NULL
  • status — varchar(20) — NOT NULL
  • created_at — timestamptz — NOT NULL
  • last_message_at — timestamptz

ai_job

  • ai_job_id — uuid — Primary key — NOT NULL
  • job_type — varchar(30) — NOT NULL
  • target_type — varchar(50) — NOT NULL
  • target_id — uuid — NOT NULL
  • status — varchar(20) — NOT NULL
  • requested_by — uuid — Foreign key → employee.employee_id
  • model_name — varchar(100)
  • model_version — varchar(100)
  • prompt_version — varchar(100)
  • retry_count — integer — NOT NULL
  • retryable_yn — boolean — NOT NULL
  • error_code — varchar(100)
  • error_message — text
  • requested_at — timestamptz — NOT NULL
  • started_at — timestamptz
  • completed_at — timestamptz

ai_message

  • message_id — uuid — Primary key — NOT NULL
  • conversation_id — uuid — Foreign key → ai_conversation.conversation_id — NOT NULL
  • sender_type — varchar(20) — NOT NULL
  • content — text — NOT NULL
  • created_at — timestamptz — NOT NULL
  • model_name — varchar(100)
  • retrieval_scope_hash — varchar(128)
  • safety_status — varchar(30) — NOT NULL

ai_message_source

  • message_source_id — uuid — Primary key — NOT NULL
  • message_id — uuid — Foreign key → ai_message.message_id — NOT NULL
  • chunk_id — uuid — Foreign key → knowledge_chunk.chunk_id — NOT NULL
  • work_id — uuid — Foreign key → work.work_id
  • handover_id — uuid — Foreign key → handover.handover_id
  • citation_order — integer — NOT NULL
  • relevance_score — numeric(7,6)
  • source_title — varchar(200) — NOT NULL

ai_recommendation

  • recommendation_id — uuid — Primary key — NOT NULL
  • ai_job_id — uuid — Foreign key → ai_job.ai_job_id — NOT NULL
  • handover_work_id — uuid — Foreign key → handover_work.handover_work_id — NOT NULL
  • classification — varchar(20) — NOT NULL
  • title — varchar(200) — NOT NULL
  • recommended_content — text — NOT NULL
  • reason — text — NOT NULL
  • confidence_score — numeric(5,4)
  • review_status — varchar(20) — NOT NULL
  • reviewed_by — uuid — Foreign key → employee.employee_id
  • reviewed_at — timestamptz
  • adoption_status — varchar(20) — NOT NULL
  • version_no — integer — NOT NULL

ai_risk_analysis

  • risk_analysis_id — uuid — Primary key — NOT NULL
  • ai_job_id — uuid — Foreign key → ai_job.ai_job_id — NOT NULL
  • handover_work_id — uuid — Foreign key → handover_work.handover_work_id — NOT NULL
  • risk_type — varchar(30) — NOT NULL
  • risk_score — numeric(5,2) — NOT NULL
  • severity — varchar(10) — NOT NULL
  • reason_json — jsonb — NOT NULL
  • candidate_yn — boolean — NOT NULL
  • analyzed_at — timestamptz — NOT NULL
  • superseded_yn — boolean — NOT NULL

audit_log

  • audit_log_id — uuid — Primary key — NOT NULL
  • occurred_at — timestamptz — NOT NULL
  • actor_employee_id — uuid — Foreign key → employee.employee_id
  • actor_role — varchar(20)
  • actor_mode — varchar(20)
  • action_type — varchar(50) — NOT NULL
  • target_type — varchar(50) — NOT NULL
  • target_id — uuid — NOT NULL
  • work_id — uuid — Foreign key → work.work_id
  • handover_id — uuid — Foreign key → handover.handover_id
  • before_json — jsonb
  • after_json — jsonb
  • result — varchar(20) — NOT NULL
  • request_id — varchar(100)
  • trace_id — varchar(100)
  • ip_hash — varchar(128)
  • user_agent — text

daily_work_schedule

  • daily_schedule_id — uuid — Primary key — NOT NULL
  • work_id — uuid — Foreign key → work.work_id — NOT NULL
  • assignee_employee_id — uuid — Foreign key → employee.employee_id — NOT NULL
  • schedule_date — date — NOT NULL
  • start_time — time
  • end_time — time
  • recurrence_rule — varchar(500)
  • status — varchar(20) — NOT NULL
  • completion_note — text
  • version_no — integer — NOT NULL
  • updated_at — timestamptz — NOT NULL

department

  • department_id — uuid — Primary key — NOT NULL
  • hris_department_id — varchar(50) — NOT NULL
  • parent_department_id — uuid — Foreign key → department.department_id
  • department_code — varchar(30) — NOT NULL
  • department_name — varchar(100) — NOT NULL
  • department_type — varchar(30) — NOT NULL
  • active_yn — boolean — NOT NULL
  • valid_from — date
  • valid_to — date
  • created_at — timestamptz — NOT NULL
  • updated_at — timestamptz — NOT NULL

employee

  • employee_id — uuid — Primary key — NOT NULL
  • hris_employee_id — varchar(50) — NOT NULL
  • sso_subject — varchar(255) — NOT NULL
  • employee_no — varchar(30) — NOT NULL
  • employee_name — varchar(100) — NOT NULL
  • email — varchar(255)
  • extension_no — varchar(20)
  • employment_status — varchar(30) — NOT NULL
  • last_hris_synced_at — timestamptz
  • created_at — timestamptz — NOT NULL
  • updated_at — timestamptz — NOT NULL

employee_assignment

  • assignment_id — uuid — Primary key — NOT NULL
  • employee_id — uuid — Foreign key → employee.employee_id — NOT NULL
  • department_id — uuid — Foreign key → department.department_id — NOT NULL
  • position_id — uuid — Foreign key → position.position_id
  • assignment_type — varchar(20) — NOT NULL
  • start_date — date — NOT NULL
  • end_date — date
  • change_reason — varchar(500)
  • current_yn — boolean — NOT NULL

employee_role

  • employee_role_id — uuid — Primary key — NOT NULL
  • employee_id — uuid — Foreign key → employee.employee_id — NOT NULL
  • role_code — varchar(30) — Foreign key → system_role.role_code — NOT NULL
  • scope_department_id — uuid — Foreign key → department.department_id
  • valid_from — date — NOT NULL
  • valid_to — date

file_asset

  • file_asset_id — uuid — Primary key — NOT NULL
  • storage_provider — varchar(30) — NOT NULL
  • bucket_name — varchar(100) — NOT NULL
  • object_key — varchar(1024) — NOT NULL
  • original_name — varchar(255) — NOT NULL
  • mime_type — varchar(150) — NOT NULL
  • size_bytes — bigint — NOT NULL
  • sha256_hash — varchar(64) — NOT NULL
  • version_no — integer — NOT NULL
  • classification — varchar(30) — NOT NULL
  • created_by — uuid — Foreign key → employee.employee_id — NOT NULL
  • created_at — timestamptz — NOT NULL

handover

  • handover_id — uuid — Primary key — NOT NULL
  • handover_no — varchar(40) — NOT NULL
  • title — varchar(200) — NOT NULL
  • trigger_type — varchar(30) — NOT NULL
  • hr_event_id — uuid — Foreign key → hr_event.hr_event_id
  • schedule_target_id — uuid — Foreign key → personnel_schedule_target.schedule_target_id
  • source_department_id — uuid — Foreign key → department.department_id
  • target_department_id — uuid — Foreign key → department.department_id
  • status — varchar(20) — NOT NULL
  • supplement_requested_yn — boolean — NOT NULL
  • start_date — date — NOT NULL
  • due_date — date — NOT NULL
  • completed_at — timestamptz
  • progress_rate — numeric(5,2) — NOT NULL
  • risk_score — numeric(5,2)
  • version_no — integer — NOT NULL
  • created_at — timestamptz — NOT NULL
  • updated_at — timestamptz — NOT NULL

handover_participant

  • participant_id — uuid — Primary key — NOT NULL
  • handover_id — uuid — Foreign key → handover.handover_id — NOT NULL
  • employee_id — uuid — Foreign key → employee.employee_id — NOT NULL
  • participant_role — varchar(20) — NOT NULL
  • assigned_department_id — uuid — Foreign key → department.department_id
  • assigned_position_id — uuid — Foreign key → position.position_id
  • start_at — timestamptz — NOT NULL
  • end_at — timestamptz
  • assigned_by — uuid — Foreign key → employee.employee_id — NOT NULL
  • active_yn — boolean — NOT NULL

handover_record

  • handover_record_id — uuid — Primary key — NOT NULL
  • handover_work_id — uuid — Foreign key → handover_work.handover_work_id — NOT NULL
  • record_type — varchar(30) — NOT NULL
  • title — varchar(200) — NOT NULL
  • content — text — NOT NULL
  • recorded_by — uuid — Foreign key → employee.employee_id — NOT NULL
  • recorded_at — timestamptz — NOT NULL
  • sequence_no — integer — NOT NULL
  • source_recommendation_id — uuid — Foreign key → ai_recommendation.recommendation_id
  • version_no — integer — NOT NULL

handover_status_history

  • status_history_id — uuid — Primary key — NOT NULL
  • handover_id — uuid — Foreign key → handover.handover_id — NOT NULL
  • from_status — varchar(20)
  • to_status — varchar(20) — NOT NULL
  • supplement_requested_yn — boolean — NOT NULL
  • reason — text
  • changed_by — uuid — Foreign key → employee.employee_id — NOT NULL
  • changed_at — timestamptz — NOT NULL
  • handover_version — integer — NOT NULL

handover_work

  • handover_work_id — uuid — Primary key — NOT NULL
  • handover_id — uuid — Foreign key → handover.handover_id — NOT NULL
  • work_id — uuid — Foreign key → work.work_id — NOT NULL
  • transfer_scope — varchar(20) — NOT NULL
  • status — varchar(20) — NOT NULL
  • progress_rate — numeric(5,2) — NOT NULL
  • due_date — date — NOT NULL
  • final_confirmed_at — timestamptz
  • ownership_transferred_at — timestamptz
  • version_no — integer — NOT NULL

hr_event

  • hr_event_id — uuid — Primary key — NOT NULL
  • external_event_id — varchar(100) — NOT NULL
  • event_version — integer — NOT NULL
  • event_type — varchar(30) — NOT NULL
  • employee_id — uuid — Foreign key → employee.employee_id — NOT NULL
  • before_department_id — uuid — Foreign key → department.department_id
  • after_department_id — uuid — Foreign key → department.department_id
  • before_position_id — uuid — Foreign key → position.position_id
  • after_position_id — uuid — Foreign key → position.position_id
  • effective_date — date — NOT NULL
  • process_status — varchar(20) — NOT NULL
  • payload_json — jsonb — NOT NULL
  • received_at — timestamptz — NOT NULL
  • last_processed_at — timestamptz
  • last_error_code — varchar(100)
  • last_error_message — text

hr_event_process_log

  • process_log_id — uuid — Primary key — NOT NULL
  • hr_event_id — uuid — Foreign key → hr_event.hr_event_id — NOT NULL
  • attempt_no — integer — NOT NULL
  • status — varchar(20) — NOT NULL
  • processed_count — integer — NOT NULL
  • failed_count — integer — NOT NULL
  • error_detail_json — jsonb
  • started_at — timestamptz — NOT NULL
  • completed_at — timestamptz

knowledge_chunk

  • chunk_id — uuid — Primary key — NOT NULL
  • knowledge_document_id — uuid — Foreign key → knowledge_document.knowledge_document_id — NOT NULL
  • chunk_no — integer — NOT NULL
  • chunk_text — text — NOT NULL
  • embedding — vector(1536) — NOT NULL
  • metadata_json — jsonb — NOT NULL
  • token_count — integer — NOT NULL

knowledge_document

  • knowledge_document_id — uuid — Primary key — NOT NULL
  • handover_id — uuid — Foreign key → handover.handover_id — NOT NULL
  • file_asset_id — uuid — Foreign key → file_asset.file_asset_id
  • document_version — integer — NOT NULL
  • access_scope_json — jsonb — NOT NULL
  • masking_status — varchar(30) — NOT NULL
  • knowledge_status — varchar(30) — NOT NULL
  • content_hash — varchar(64) — NOT NULL
  • registered_at — timestamptz — NOT NULL

notification

  • notification_id — uuid — Primary key — NOT NULL
  • recipient_employee_id — uuid — Foreign key → employee.employee_id — NOT NULL
  • notification_type — varchar(30) — NOT NULL
  • event_key — varchar(200) — NOT NULL
  • title — varchar(200) — NOT NULL
  • message — text — NOT NULL
  • work_id — uuid — Foreign key → work.work_id
  • handover_id — uuid — Foreign key → handover.handover_id
  • handover_work_id — uuid — Foreign key → handover_work.handover_work_id
  • read_yn — boolean — NOT NULL
  • read_at — timestamptz
  • created_at — timestamptz — NOT NULL

ownership_history

  • ownership_history_id — uuid — Primary key — NOT NULL
  • work_id — uuid — Foreign key → work.work_id — NOT NULL
  • owner_employee_id — uuid — Foreign key → employee.employee_id
  • owner_position_id — uuid — Foreign key → position.position_id
  • ownership_type — varchar(20) — NOT NULL
  • department_id_at_time — uuid — Foreign key → department.department_id — NOT NULL
  • position_id_at_time — uuid — Foreign key → position.position_id
  • current_department_id_snapshot — uuid — Foreign key → department.department_id
  • extension_no_snapshot — varchar(20)
  • start_at — timestamptz — NOT NULL
  • end_at — timestamptz
  • change_reason_code — varchar(30) — NOT NULL
  • change_reason_detail — text
  • handover_work_id — uuid — Foreign key → handover_work.handover_work_id
  • recorded_by — uuid — Foreign key → employee.employee_id — NOT NULL
  • recorded_at — timestamptz — NOT NULL
  • correction_of_history_id — uuid — Foreign key → ownership_history.ownership_history_id

personnel_schedule

  • personnel_schedule_id — uuid — Primary key — NOT NULL
  • schedule_name — varchar(200) — NOT NULL
  • event_type — varchar(30) — NOT NULL
  • effective_date — date — NOT NULL
  • handover_start_date — date — NOT NULL
  • handover_due_date — date — NOT NULL
  • status — varchar(20) — NOT NULL
  • created_by — uuid — Foreign key → employee.employee_id — NOT NULL
  • version_no — integer — NOT NULL

personnel_schedule_target

  • schedule_target_id — uuid — Primary key — NOT NULL
  • personnel_schedule_id — uuid — Foreign key → personnel_schedule.personnel_schedule_id — NOT NULL
  • employee_id — uuid — Foreign key → employee.employee_id — NOT NULL
  • from_department_id — uuid — Foreign key → department.department_id
  • to_department_id — uuid — Foreign key → department.department_id
  • readiness_status — varchar(30) — NOT NULL
  • receiver_employee_id — uuid — Foreign key → employee.employee_id
  • handover_id — uuid — Foreign key → handover.handover_id
  • updated_by — uuid — Foreign key → employee.employee_id — NOT NULL
  • updated_at — timestamptz — NOT NULL

position

  • position_id — uuid — Primary key — NOT NULL
  • hris_position_id — varchar(50) — NOT NULL
  • position_code — varchar(30) — NOT NULL
  • position_name — varchar(100) — NOT NULL
  • position_level — smallint
  • manager_yn — boolean — NOT NULL
  • active_yn — boolean — NOT NULL

supplement_request

  • supplement_request_id — uuid — Primary key — NOT NULL
  • handover_work_id — uuid — Foreign key → handover_work.handover_work_id — NOT NULL
  • requester_employee_id — uuid — Foreign key → employee.employee_id — NOT NULL
  • assignee_employee_id — uuid — Foreign key → employee.employee_id — NOT NULL
  • request_type — varchar(20) — NOT NULL
  • reason — text — NOT NULL
  • status — varchar(20) — NOT NULL
  • requested_at — timestamptz — NOT NULL
  • resolved_at — timestamptz
  • resolution_note — text

system_role

  • role_code — varchar(30) — Primary key — NOT NULL
  • role_name — varchar(100) — NOT NULL

work

  • work_id — uuid — Primary key — NOT NULL
  • work_code — varchar(40) — NOT NULL
  • work_name — varchar(200) — NOT NULL
  • description — text
  • owning_department_id — uuid — Foreign key → department.department_id — NOT NULL
  • work_type — varchar(30) — NOT NULL
  • work_nature — varchar(20) — NOT NULL
  • criticality — varchar(10) — NOT NULL
  • status — varchar(20) — NOT NULL
  • position_based_yn — boolean — NOT NULL
  • version_no — integer — NOT NULL
  • created_by — uuid — Foreign key → employee.employee_id — NOT NULL
  • updated_by — uuid — Foreign key → employee.employee_id — NOT NULL
  • created_at — timestamptz — NOT NULL
  • updated_at — timestamptz — NOT NULL

work_document

  • work_document_id — uuid — Primary key — NOT NULL
  • work_id — uuid — Foreign key → work.work_id — NOT NULL
  • file_asset_id — uuid — Foreign key → file_asset.file_asset_id — NOT NULL
  • document_type — varchar(30) — NOT NULL
  • title — varchar(200) — NOT NULL
  • access_level — varchar(30) — NOT NULL
  • active_yn — boolean — NOT NULL
  • created_at — timestamptz — NOT NULL

work_ownership

  • work_ownership_id — uuid — Primary key — NOT NULL
  • work_id — uuid — Foreign key → work.work_id — NOT NULL
  • owner_employee_id — uuid — Foreign key → employee.employee_id
  • owner_position_id — uuid — Foreign key → position.position_id
  • ownership_type — varchar(20) — NOT NULL
  • start_at — timestamptz — NOT NULL
  • expected_end_at — timestamptz
  • source_handover_work_id — uuid — Foreign key → handover_work.handover_work_id
  • active_yn — boolean — NOT NULL
  • version_no — integer — NOT NULL