@@ -113,16 +113,23 @@ export const aveniaKycMachine = setup({
113113 } ,
114114 FORM_SUBMIT : {
115115 actions : assign ( {
116+ executionInput : ( { context, event } ) => {
117+ if ( ! context . executionInput ) return undefined ;
118+ return {
119+ ...context . executionInput ,
120+ taxId : event . formData . taxId
121+ } ;
122+ } ,
116123 kycFormData : ( { event } ) => {
117124 console . log ( "kycFormData" , event . formData ) ;
118125 return event . formData ;
119- }
126+ } ,
127+ taxId : ( { event } ) => event . formData . taxId
120128 } ) ,
121129 target : "SubaccountSetup"
122130 }
123131 }
124132 } ,
125-
126133 KYBFlow : {
127134 initial : "CompanyVerification" ,
128135 on : {
@@ -134,13 +141,21 @@ export const aveniaKycMachine = setup({
134141 } ,
135142 FORM_SUBMIT : {
136143 actions : assign ( {
144+ executionInput : ( { context, event } ) => {
145+ if ( ! context . executionInput ) return undefined ;
146+ return {
147+ ...context . executionInput ,
148+ taxId : event . formData . taxId
149+ } ;
150+ } ,
137151 kycFormData : ( { event, context } ) => {
138152 console . log ( "kycFormData" , event . formData ) ;
139153 return {
140154 ...context . kycFormData ,
141155 ...event . formData
142156 } ;
143- }
157+ } ,
158+ taxId : ( { event } ) => event . formData . taxId
144159 } ) ,
145160 target : "KYBVerification"
146161 }
@@ -209,6 +224,9 @@ export const aveniaKycMachine = setup({
209224 }
210225 } ,
211226 LivenessCheck : {
227+ exit : assign ( {
228+ livenessCheckOpened : ( ) => false
229+ } ) ,
212230 on : {
213231 LIVENESS_DONE : {
214232 guard : ( { context } ) => context . livenessCheckOpened === true ,
0 commit comments