Hi Team,
Here is my choice
choice AcceptRequest : (ContractId VendorRequest,ContractId CC_INFO or ContractId LOAN_INFO or ContractId BASIC_INFO or None )
with
name: Optional Text
pan : Optional Text
date_of_birth : Optional Date
address : Optional Text
income : Optional Decimal
credit_score : Optional Int
employment_history : Optional Text
bankruptcy_history : Optional Text
debt_to_income_ratio : Optional Decimal
phone_number : Optional Text
employment_information : Optional Text
credit_history : Optional Text
assets : Optional Text
liabilities : Optional Text
collateral : Optional Text
loan_type : Optional Text
loan_amount : Optional Decimal
interest_rate : Optional Decimal
term : Optional Int
status : Optional Text
date_created : Optional Date
date_updated : Optional Date
controller recipient
do
assert(recipient /= sender)
assert(response == "" )
a<-create this with
sender = sender
recipient = recipient
response = "Request accepted"
if requestType == "CC_INFO"
then do b<-create CC_INFO with name = name,pan = pan,dateOfBirth = date_of_birth,address = address, income = income, creditScore = credit_score,employmentHistory = employment_history,bankruptcyHistory = bankruptcy_history,debtToIncomeRatio = debt_to_income_ratio, owner1=recipient,owner2=sender
pure(a,b)
else
if (requestType == "LOAN_INFO")
then
do b<- create LOAN_INFO with name = name, pan = pan,date_of_birth = date_of_birth,address = address,phone_number = phone_number,employment_information = employment_information,credit_history = credit_history,assets = assets, liabilities = liabilities, collateral = collateral, loan_type = loan_type, loan_amount = loan_amount, interest_rate = interest_rate, term = term, status = status,date_created = date_created,date_updated = date_updated
pure(a,b)
else
if requestType == "BASIC_INFO"
then do b<- create BASIC_INFO with name = name, pan = pan , dob = date_of_birth,address = address, owner1=recipient,owner2=sender
pure(a,b)
else
do pure(None)
I want to return
VendorRequest and (CC_INFO or LOAN_INFO or BASIC_INFO ) based on the request type
None - if the request type does not match either CC_INFO or LOAN_INFO or BASIC_INFO
please help me to resolve on returning the Contracts
Thanks in advance