from enum import Enum


class CreditRecordType(str, Enum):
    RECHARGE = "recharge"
    CONSUME = "consume"
    REFUND = "refund"


class CreditRecordOwnerType(str, Enum):
    GENERATION_RECORD = "generation_record"
    CHAT_GENERATION_TASK = "chat_generation_task"
    MODULE_GENERATION_PROJECT = "module_generation_project"
    MODULE_GENERATION_STEP = "module_generation_step"
    SHOT_REPLICATE_TASK_SET = "shot_replicate_task_set"
    SHOT_REPLICATE_SEGMENT = "shot_replicate_segment"
    PAYMENT_ORDER = "payment_order"
    ADMIN_ADJUST = "admin_adjust"
    UNKNOWN = "unknown"


class CreditRecordChargeKind(str, Enum):
    MEDIA = "media"
    TEXT_PROMPT = "text_prompt"
    FILE_PARSE = "file_parse"
    VISION_INPUT = "vision_input"
    MODULE_CREATE = "module_create"
    VIDEO_ANALYSIS = "video_analysis"
    VIDEO_SPLIT = "video_split"
    RECHARGE = "recharge"
    REFUND = "refund"
    ADMIN_ADJUST = "admin_adjust"
    UNKNOWN = "unknown"


class CreditRecordSubject(str, Enum):
    MEDIA = "media"
    TEXT = "text"
    MODULE = "module"
    ANALYSIS = "analysis"
    SPLIT = "split"
    RECHARGE = "recharge"
    REFUND = "refund"
    ADMIN_ADJUST = "admin_adjust"
    UNKNOWN = "unknown"


class CreditRecordMediaType(str, Enum):
    IMAGE = "image"
    VIDEO = "video"


class CreditRecordAction(str, Enum):
    CHARGE = "charge"
    REFUND = "refund"


class CreditRecordSourceModule(str, Enum):
    AI_CREATION = "ai_creation"
    GENERATION_RECORD = "generation_record"
    HOT_OPENING_REPLICATE = "hot_opening_replicate"
    SHOT_REPLICATE = "shot_replicate"
    PAYMENT = "payment"
    ADMIN = "admin"
    UNKNOWN = "unknown"


class CreditRecordSourceStepCode(str, Enum):
    MATERIAL_INPUT = "material_input"
    IMAGE_PROMPT_OPTIMIZE = "image_prompt_optimize"
    IMAGE_GENERATE = "image_generate"
    VIDEO_PROMPT_OPTIMIZE = "video_prompt_optimize"
    VIDEO_GENERATE = "video_generate"
    VIDEO_ANALYSIS = "video_analysis"
    UNKNOWN = "unknown"


class CreditRecordBillingScene(str, Enum):
    AI_CREATION_IMAGE_GENERATE = "ai_creation_image_generate"
    AI_CREATION_VIDEO_GENERATE = "ai_creation_video_generate"

    GENERATION_RECORD_TEXT_PROMPT_OPTIMIZE = "generation_record_text_prompt_optimize"
    GENERATION_RECORD_IMAGE_GENERATE = "generation_record_image_generate"
    GENERATION_RECORD_VIDEO_GENERATE = "generation_record_video_generate"
    GENERATION_RECORD_FILE_PARSE = "generation_record_file_parse"
    GENERATION_RECORD_VISION_INPUT = "generation_record_vision_input"

    HOT_OPENING_PROJECT_CREATE = "hot_opening_project_create"
    HOT_OPENING_IMAGE_PROMPT_OPTIMIZE = "hot_opening_image_prompt_optimize"
    HOT_OPENING_IMAGE_GENERATE = "hot_opening_image_generate"
    HOT_OPENING_VIDEO_PROMPT_OPTIMIZE = "hot_opening_video_prompt_optimize"
    HOT_OPENING_VIDEO_GENERATE = "hot_opening_video_generate"

    SHOT_VIDEO_ANALYSIS = "shot_video_analysis"
    SHOT_ORIGINAL_VIDEO_ANALYSIS = "shot_original_video_analysis"
    SHOT_SEGMENT_VIDEO_ANALYSIS = "shot_segment_video_analysis"
    SHOT_VIDEO_SPLIT = "shot_video_split"
    SHOT_SEGMENT_REPLICATE_CREATE = "shot_segment_replicate_create"
    SHOT_IMAGE_PROMPT_OPTIMIZE = "shot_image_prompt_optimize"
    SHOT_IMAGE_GENERATE = "shot_image_generate"
    SHOT_VIDEO_PROMPT_OPTIMIZE = "shot_video_prompt_optimize"
    SHOT_VIDEO_GENERATE = "shot_video_generate"

    RECHARGE = "recharge"
    ADMIN_ADJUST = "admin_adjust"
    REFUND = "refund"
    UNKNOWN = "unknown"


CREDIT_RECORD_TYPE_LABELS = {
    CreditRecordType.RECHARGE.value: "充值",
    CreditRecordType.CONSUME.value: "消费",
    CreditRecordType.REFUND.value: "回退",
}

CREDIT_RECORD_SUBJECT_LABELS = {
    CreditRecordSubject.MEDIA.value: "图片/视频生成积分",
    CreditRecordSubject.TEXT.value: "提词优化积分",
    CreditRecordSubject.MODULE.value: "模块功能积分",
    CreditRecordSubject.ANALYSIS.value: "分析积分",
    CreditRecordSubject.SPLIT.value: "切片积分",
    CreditRecordSubject.RECHARGE.value: "充值积分",
    CreditRecordSubject.REFUND.value: "回退积分",
    CreditRecordSubject.ADMIN_ADJUST.value: "管理员调整",
    CreditRecordSubject.UNKNOWN.value: "历史未知",
}

CREDIT_RECORD_CHARGE_KIND_LABELS = {
    CreditRecordChargeKind.MEDIA.value: "媒体生成",
    CreditRecordChargeKind.TEXT_PROMPT.value: "提词优化",
    CreditRecordChargeKind.FILE_PARSE.value: "文件解析",
    CreditRecordChargeKind.VISION_INPUT.value: "图片理解",
    CreditRecordChargeKind.MODULE_CREATE.value: "创建模块项目",
    CreditRecordChargeKind.VIDEO_ANALYSIS.value: "视频分析",
    CreditRecordChargeKind.VIDEO_SPLIT.value: "视频切片",
    CreditRecordChargeKind.RECHARGE.value: "充值",
    CreditRecordChargeKind.REFUND.value: "回退",
    CreditRecordChargeKind.ADMIN_ADJUST.value: "管理员调整",
    CreditRecordChargeKind.UNKNOWN.value: "历史未知",
}

CREDIT_RECORD_MEDIA_TYPE_LABELS = {
    CreditRecordMediaType.IMAGE.value: "图片",
    CreditRecordMediaType.VIDEO.value: "视频",
}

CREDIT_RECORD_SOURCE_MODULE_LABELS = {
    CreditRecordSourceModule.AI_CREATION.value: "AI创作",
    CreditRecordSourceModule.GENERATION_RECORD.value: "项目记录",
    CreditRecordSourceModule.HOT_OPENING_REPLICATE.value: "爆款开头复刻",
    CreditRecordSourceModule.SHOT_REPLICATE.value: "拆镜复刻",
    CreditRecordSourceModule.PAYMENT.value: "支付充值",
    CreditRecordSourceModule.ADMIN.value: "后台管理",
    CreditRecordSourceModule.UNKNOWN.value: "历史未知",
}

CREDIT_RECORD_SOURCE_STEP_CODE_LABELS = {
    CreditRecordSourceStepCode.MATERIAL_INPUT.value: "素材输入",
    CreditRecordSourceStepCode.IMAGE_PROMPT_OPTIMIZE.value: "图片提词优化",
    CreditRecordSourceStepCode.IMAGE_GENERATE.value: "图片生成",
    CreditRecordSourceStepCode.VIDEO_PROMPT_OPTIMIZE.value: "视频提词优化",
    CreditRecordSourceStepCode.VIDEO_GENERATE.value: "视频生成",
    CreditRecordSourceStepCode.VIDEO_ANALYSIS.value: "视频分析",
    CreditRecordSourceStepCode.UNKNOWN.value: "历史未知",
}

CREDIT_RECORD_BILLING_SCENE_LABELS = {
    CreditRecordBillingScene.AI_CREATION_IMAGE_GENERATE.value: "AI创作图片生成",
    CreditRecordBillingScene.AI_CREATION_VIDEO_GENERATE.value: "AI创作视频生成",
    CreditRecordBillingScene.GENERATION_RECORD_TEXT_PROMPT_OPTIMIZE.value: "项目记录提词优化",
    CreditRecordBillingScene.GENERATION_RECORD_IMAGE_GENERATE.value: "项目记录图片生成",
    CreditRecordBillingScene.GENERATION_RECORD_VIDEO_GENERATE.value: "项目记录视频生成",
    CreditRecordBillingScene.GENERATION_RECORD_FILE_PARSE.value: "项目记录文件解析",
    CreditRecordBillingScene.GENERATION_RECORD_VISION_INPUT.value: "项目记录图片理解",
    CreditRecordBillingScene.HOT_OPENING_PROJECT_CREATE.value: "爆款开头复刻创建项目",
    CreditRecordBillingScene.HOT_OPENING_IMAGE_PROMPT_OPTIMIZE.value: "爆款开头复刻图片提词优化",
    CreditRecordBillingScene.HOT_OPENING_IMAGE_GENERATE.value: "爆款开头复刻图片生成",
    CreditRecordBillingScene.HOT_OPENING_VIDEO_PROMPT_OPTIMIZE.value: "爆款开头复刻视频提词优化",
    CreditRecordBillingScene.HOT_OPENING_VIDEO_GENERATE.value: "爆款开头复刻视频生成",
    CreditRecordBillingScene.SHOT_VIDEO_ANALYSIS.value: "拆镜视频分析",
    CreditRecordBillingScene.SHOT_ORIGINAL_VIDEO_ANALYSIS.value: "拆镜复刻原视频分析",
    CreditRecordBillingScene.SHOT_SEGMENT_VIDEO_ANALYSIS.value: "拆镜复刻片段视频分析",
    CreditRecordBillingScene.SHOT_VIDEO_SPLIT.value: "拆镜切片",
    CreditRecordBillingScene.SHOT_SEGMENT_REPLICATE_CREATE.value: "从切片创建复刻项目",
    CreditRecordBillingScene.SHOT_IMAGE_PROMPT_OPTIMIZE.value: "拆镜复刻图片提词优化",
    CreditRecordBillingScene.SHOT_IMAGE_GENERATE.value: "拆镜复刻图片生成",
    CreditRecordBillingScene.SHOT_VIDEO_PROMPT_OPTIMIZE.value: "拆镜复刻视频提词优化",
    CreditRecordBillingScene.SHOT_VIDEO_GENERATE.value: "拆镜复刻视频生成",
    CreditRecordBillingScene.RECHARGE.value: "充值",
    CreditRecordBillingScene.ADMIN_ADJUST.value: "管理员调整",
    CreditRecordBillingScene.REFUND.value: "回退",
    CreditRecordBillingScene.UNKNOWN.value: "历史未知",
}
