@@ -13,6 +13,7 @@ import { FilterBar, formatIOSDateString, PaymentView } from '../../../lib'
13
13
import { ConfirmFlowData } from '../../../lib/models/ConfirmFlowData'
14
14
import { PaginationInfo } from '../../../lib/models/PaginationInfo'
15
15
import { TaxForm } from '../../../lib/models/TaxForm'
16
+ import { PaymentProvider } from '../../../lib/models/PaymentProvider'
16
17
import PaymentEditForm from '../../../lib/components/payment-edit/PaymentEdit'
17
18
import PaymentsTable from '../../../lib/components/payments-table/PaymentTable'
18
19
@@ -177,11 +178,11 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
177
178
const missingPaymentProviders = await getPaymentMethods ( 100 , 0 , onHoldUserIds )
178
179
179
180
missingTaxForms . forms . forEach ( ( form : TaxForm ) => {
180
- userHasTaxFormSetup . set ( form . userId , true )
181
+ userHasTaxFormSetup . set ( form . userId , form . status === 'ACTIVE' )
181
182
} )
182
183
183
- missingPaymentProviders . paymentMethods . forEach ( ( method : { userId : string } ) => {
184
- userHasPaymentProvider . set ( method . userId , true )
184
+ missingPaymentProviders . paymentMethods . forEach ( ( method : PaymentProvider ) => {
185
+ userHasPaymentProvider . set ( method . userId , method . status === 'CONNECTED' )
185
186
} )
186
187
} catch ( err ) {
187
188
// Ignore errors
@@ -272,6 +273,13 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
272
273
} , [ fetchWinnings ] )
273
274
274
275
const onPaymentEditCallback = useCallback ( ( payment : Winning ) => {
276
+ let status = payment . status
277
+ if ( status === 'On Hold (Admin)' ) {
278
+ status = 'On Hold'
279
+ } else if ( [ 'On Hold (Member)' , 'On Hold (Tax Form)' , 'On Hold (Payment Provider)' ] . indexOf ( status ) !== - 1 ) {
280
+ status = 'Owed'
281
+ }
282
+
275
283
setConfirmFlow ( {
276
284
action : 'Save' ,
277
285
callback : async ( ) => {
@@ -281,7 +289,7 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
281
289
< PaymentEditForm
282
290
payment = { {
283
291
...payment ,
284
- status : [ 'On Hold (Member)' , 'On Hold (Tax Form)' , 'On Hold (Payment Provider)' ] . indexOf ( payment . status ) !== - 1 ? 'Owed' : payment . status ,
292
+ status,
285
293
} }
286
294
canSave = { setIsConfirmFormValid }
287
295
onValueUpdated = { handleValueUpdated }
@@ -318,9 +326,13 @@ const ListView: FC<ListViewProps> = (props: ListViewProps) => {
318
326
value : 'OWED' ,
319
327
} ,
320
328
{
321
- label : 'On Hold' ,
329
+ label : 'On Hold (Admin) ' ,
322
330
value : 'ON_HOLD_ADMIN' ,
323
331
} ,
332
+ {
333
+ label : 'On Hold (Member)' ,
334
+ value : 'ON_HOLD' ,
335
+ } ,
324
336
{
325
337
label : 'Paid' ,
326
338
value : 'PAID' ,
0 commit comments