Add register_student.bas for edu bot
This commit is contained in:
parent
bc8f7ac86a
commit
c2a92c32e1
1 changed files with 30 additions and 0 deletions
30
edu.gbai/edu.gbdialog/register_student.bas
Normal file
30
edu.gbai/edu.gbdialog/register_student.bas
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
TABLE students
|
||||||
|
Id uuid key
|
||||||
|
Name string(255)
|
||||||
|
Email string(255)
|
||||||
|
RegisteredAt timestamp
|
||||||
|
END TABLE
|
||||||
|
|
||||||
|
PARAM name AS STRING LIKE "John Doe" DESCRIPTION "Full name of the student"
|
||||||
|
PARAM email AS STRING LIKE "john@example.com" DESCRIPTION "Email address of the student"
|
||||||
|
|
||||||
|
DESCRIPTION "Register a new student by saving their name and email to the students table"
|
||||||
|
|
||||||
|
studentId = UUID()
|
||||||
|
registeredAt = NOW()
|
||||||
|
|
||||||
|
WITH student
|
||||||
|
id = studentId
|
||||||
|
name = name
|
||||||
|
email = email
|
||||||
|
registeredAt = registeredAt
|
||||||
|
END WITH
|
||||||
|
|
||||||
|
SAVE "students", studentId, student
|
||||||
|
|
||||||
|
TALK "Student registered successfully!"
|
||||||
|
TALK "Student ID: " + studentId
|
||||||
|
TALK "Name: " + name
|
||||||
|
TALK "Email: " + email
|
||||||
|
|
||||||
|
RETURN studentId
|
||||||
Loading…
Add table
Reference in a new issue