SuperAPI AI Directory

lcrm-presales-itinerary

Marketing & growth

View repository

Updated 10-15 21:38

About this skill

Pre-sales itinerary management

Objectives

Pre-sales can manage their own itineraries (create, delete, modify, query, complete), and sales can query pre-sales itineraries and workload.

Script entry points

  • Main script:node scripts/presales-itinerary.mjs <action> [options]
  • Query script:node scripts/search.mjs presales-itineraries [options]
  • General script:node scripts/request.mjs ...
  • Environment variables:
    • Required:LCRM_API_KEY
    • Optional:LCRM_BASE_URL(default https://crm.langcore.net)

Target APIs

  • Create:POST /api/presales-itineraries
  • Modify:PUT /api/presales-itineraries/{id}
  • Delete:DELETE /api/presales-itineraries/{id}
  • Complete:POST /api/presales-itineraries/{id}/complete
  • Query:GET /api/presales-itineraries/week (supports filtering by time range, user, and opportunity)
  • Auxiliary opportunity lookup:GET /api/presales-itineraries/opportunities?keyword=<关键词>&limit=20

Create API fields

Required:

  • title
  • startTime
  • endTime
  • opportunityId
  • tripType
  • deliveryMode

Optional:

  • remark: remarks, which will be synced to the Feishu calendar event description

Enum constraints

tripType:

  • 需求调研 产品介绍 技术交流 方案沟通 方案撰写 技术预研 POC测试
  • 产品演示 产品部署 标书撰写 讲标支持 商务谈判 内部会议 案例整理 培训学习

deliveryMode:

  • 现场 远程

status:

  • PLANNED PLANNED
  • COMPLETED COMPLETED

Time constraints

  • Must be in half-hour increments (minutes can only be 00 or 30)。
  • endTime must be later than startTime。

Mandatory workflow

  1. First call the script to parse the original text:
    • node scripts/presales-itinerary.mjs ai-parse --text "<用户原文>"
  2. Fill in the fields based on the parsing result:
    • opportunityId When missing, call:
      • node scripts/presales-itinerary.mjs search-opportunities --keyword "<关键词>" --limit 20
      • Then have the user confirm the specific opportunity.
    • tripType or deliveryMode When missing/invalid, have the user choose from the enum.
    • title/startTime/endTime When missing, ask follow-up questions item by item.
  3. Local validation:
    • The time is valid and in half-hour increments.
    • The enum is valid.
  4. Confirmation before submission (mandatory):
    • Display a confirmation card:
      • Title
      • Time range
      • Opportunity (name + customer)
      • Itinerary type
      • Delivery mode
      • Remarks (display if any)
    • Call the create API only after the user explicitly replies "confirm/submit/yes".
  5. Call the create script and return the result:
    • node scripts/presales-itinerary.mjs create --payload '<JSON>'
    • or --payload-file <file>

Example operation commands

Create itinerary

node scripts/presales-itinerary.mjs create \
  --title "朗致产品演示" \
  --start-time "2026-02-12T14:00:00" \
  --end-time "2026-02-12T16:00:00" \
  --opportunity-id "<opportunityId>" \
  --trip-type "产品演示" \
  --delivery-mode "现场"

# 带备注
node scripts/presales-itinerary.mjs create \
  --title "朗致产品演示" \
  --start-time "2026-02-12T14:00:00" \
  --end-time "2026-02-12T16:00:00" \
  --opportunity-id "<opportunityId>" \
  --trip-type "产品演示" \
  --delivery-mode "现场" \
  --remark "需要准备演示环境"

Modify itinerary

node scripts/presales-itinerary.mjs update \
  --id "<itineraryId>" \
  --title "更新后的标题" \
  --start-time "2026-02-12T15:00:00" \
  --end-time "2026-02-12T17:00:00" \
  --opportunity-id "<opportunityId>" \
  --trip-type "方案沟通" \
  --delivery-mode "远程"

# 带备注
node scripts/presales-itinerary.mjs update \
  --id "<itineraryId>" \
  --title "更新后的标题" \
  --start-time "2026-02-12T15:00:00" \
  --end-time "2026-02-12T17:00:00" \
  --opportunity-id "<opportunityId>" \
  --trip-type "方案沟通" \
  --delivery-mode "远程" \
  --remark "更新备注"

Delete itinerary

node scripts/presales-itinerary.mjs delete --id "<itineraryId>"

Complete itinerary

After completing an itinerary, the system will automatically create a business record based on the completion details (the follow-up type is "pre-sales onsite" or "pre-sales remote", depending on the itinerary's delivery mode).

--completion-note Supports rich text (HTML format).

node scripts/presales-itinerary.mjs complete \
  --id "<itineraryId>" \
  --actual-hours 2.5 \
  --completion-note "完成产品演示,客户反馈良好"

Query itinerary

# 查询指定时间段的行程
node scripts/search.mjs presales-itineraries \
  --start-date 2026-02-10 \
  --end-date 2026-02-16

# 查询某个售前的行程(销售查询售前工作负载)
node scripts/search.mjs presales-itineraries \
  --user-id "<userId>" \
  --start-date 2026-02-10 \
  --end-date 2026-02-16

# 查询某个机会的行程
node scripts/search.mjs presales-itineraries \
  --opportunity-id "<opportunityId>"

Missing information prompt template

  • Missing opportunity:请确认要关联的机会(可提供机会名或客户名)。
  • Missing type:请确认行程类型(从系统枚举中选择)。
  • Missing delivery mode:请确认交付形式(现场/远程)。
  • Missing time:请补充开始和结束时间(半小时粒度,例如 2026-02-11T14:00:00 到 2026-02-11T16:30:00)。

Permission description

  • Pre-sales (PreSales): can create, modify, delete, complete, and query their own itineraries
  • Sales (Sales): can query pre-sales itineraries and workload (used to check whether pre-sales are available)
  • Administrator (SystemAdmin): has all permissions