botserver/templates/hr/employees.gbai/employees.gbdialog/add-employee.bas
Rodrigo Rodriguez (Pragmatismo) 50eae38d36 Looking at this diff, I can see it's a comprehensive documentation
update and code refactoring focused on:

1. Adding new documentation pages to the table of contents
2. Restructuring the bot templates documentation
3. Changing keyword syntax from underscore format to space format (e.g.,
   `SET_BOT_MEMORY` → `SET BOT MEMORY`)
4. Updating compiler and keyword registration to support the new
   space-based syntax
5. Adding new keyword modules (social media, lead scoring, templates,
   etc.)

Refactor BASIC keywords to use spaces instead of underscores

Change keyword syntax from underscore format (SET_BOT_MEMORY) to more
natural space-separated format (SET BOT MEMORY) throughout the codebase.

Key changes:
- Update Rhai custom syntax registration to use space tokens
- Simplify compiler preprocessing (fewer replacements needed)
- Update all template .bas files to use new syntax
- Expand documentation with consolidated examples and new sections
- Add new keyword modules: social_media, lead_scoring, send_template,
  core_functions, qrcode, sms, procedures, import_export, llm_macros,
  on_form_submit
2025-11-30 10:53:59 -03:00

73 lines
2.5 KiB
QBasic

PARAM name AS STRING LIKE "John Smith" DESCRIPTION "Employee's full name"
PARAM email AS STRING LIKE "john.smith@company.com" DESCRIPTION "Employee's work email address"
PARAM jobtitle AS STRING LIKE "Software Engineer" DESCRIPTION "Job title/position"
PARAM department AS STRING LIKE "Engineering" DESCRIPTION "Department name"
PARAM hiredate AS DATE LIKE "2024-01-15" DESCRIPTION "Employment start date (YYYY-MM-DD)"
PARAM phone AS STRING LIKE "+1-555-123-4567" DESCRIPTION "Optional: Phone number"
PARAM manageremail AS STRING LIKE "manager@company.com" DESCRIPTION "Optional: Manager's email"
DESCRIPTION "Adds a new employee to the HR system. Collects required information and creates the employee record with a unique employee number."
' Validate required fields
IF name = "" THEN
TALK "I need the employee's full name to continue."
name = HEAR
END IF
IF email = "" THEN
TALK "What is the employee's work email address?"
email = HEAR
END IF
IF jobtitle = "" THEN
TALK "What is the job title/position?"
jobtitle = HEAR
END IF
IF department = "" THEN
TALK "Which department will they be joining?"
department = HEAR
END IF
IF hiredate = "" THEN
TALK "What is their start date? (YYYY-MM-DD format)"
hiredate = HEAR
END IF
' Generate employee number
let currentyear = FORMAT NOW() AS "YYYY"
let employeenumber = "EMP" + currentyear + "-" + FORMAT RANDOM(1000, 9999)
' Save employee record
SAVE "employees.csv", employeenumber, name, email, jobtitle, department, hiredate, phone, manageremail
' Store in bot memory for session
SET BOT MEMORY "last_employee", employeenumber
' Send notifications
let hrnotification = "New employee added: " + name + " (" + employeenumber + ") - " + jobtitle + " in " + department
SEND MAIL "hr@company.com", "New Employee Added", hrnotification
' Notify manager if provided
IF manageremail != "" THEN
let managernotification = "A new team member has been added:\n\nName: " + name + "\nTitle: " + jobtitle + "\nStart Date: " + hiredate
SEND MAIL manageremail, "New Team Member: " + name, managernotification
END IF
' Confirm to user
TALK "✅ **Employee Added Successfully!**"
TALK ""
TALK "**Employee Details:**"
TALK "• **Employee Number:** " + employeenumber
TALK "• **Name:** " + name
TALK "• **Email:** " + email
TALK "• **Job Title:** " + jobtitle
TALK "• **Department:** " + department
TALK "• **Start Date:** " + hiredate
IF manageremail != "" THEN
TALK "• **Manager:** " + manageremail
END IF
TALK ""
TALK "📧 Notifications sent to HR and the assigned manager."