-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathorder_request_form.py
44 lines (35 loc) · 1.62 KB
/
order_request_form.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import os
from abstra.forms import *
from abstra.workflows import set_data
display_markdown("""
<img src="https://abstracloud-webflow-assets.s3.amazonaws.com/5599illustration.gif" width="100" height="100" />
# Request a personal loan 🫰
### Simple, fast, no bureaucracy.
Fill out this form to apply for a loan and get a quick response!
""", button_text="Start")
personal_data = Page() \
.display("Personal Info", size="large") \
.read("Full name:", placeholder = "Michael Scott", key="name") \
.read_email("Email:", placeholder = "[email protected]", key="email") \
.run()
income_data = Page() \
.display("Income info", size="large") \
.read_currency("Monthly income:", currency = "USD", placeholder = "10.000,00", key="income") \
.read("Current employer, if applicable:", placeholder = "Dunder Mifflin", key="employer") \
.run()
loan_data = Page() \
.display("Loan info", size="large") \
.read_currency("Loan amount:", currency="USD", placeholder = "10.000,00", key="loan_amount") \
.read("Number of installments:", placeholder = "12", min=2, max=12, key="installments") \
.run()
set_data("name", personal_data["name"])
set_data("email", personal_data["email"])
set_data("income", income_data["income"])
set_data("employer", income_data["employer"])
set_data("loan_amount", loan_data["loan_amount"])
set_data("installments", loan_data["installments"])
set_data("review_email", os.environ.get("CREDIT_TEAM_EMAIL"))
display_markdown("""
# ✨ Request received!
### Your evaluation will take up to 10 minutes. You'll receive an email with the result.
""", end_program=True, button_text=None)