@@ -2,7 +2,7 @@ import { addSignature, fillPDFFormFromValues, PDFFieldDefinition } from '../pdf-
22import { PDFDocument , PDFFont } from 'pdf-lib' ;
33import { getFullName } from './utils.js' ;
44import { isNil } from 'lodash-es' ;
5- import { W8BenETaxFormValues } from './frontend-types.js' ;
5+ import { NFFEStatus , W8BenETaxFormValues } from './frontend-types.js' ;
66import { getCountryName } from '../i18n.js' ;
77import dayjs from '../dayjs.js' ;
88
@@ -136,6 +136,30 @@ export const W8BenEFieldsDefinition: Partial<Record<keyof W8BenETaxFormValues, P
136136 reference : 'topmostSubform[0].Page2[0].f2_4[0]' ,
137137 giin : 'topmostSubform[0].Page2[0].Line9a_ReadOrder[0].f2_2[0]' ,
138138 usOwners : 'topmostSubform[0].Page8[0].Table_Part29[0].BodyRow1[0].f8_3[0]' ,
139+ certifyStatus : {
140+ type : 'multi' ,
141+ if : ( hasCertified : boolean ) => hasCertified ,
142+ fields : [
143+ // [A-NFFE] I certify that the entity is a foreign (non-US) entity...
144+ {
145+ formPath : 'topmostSubform[0].Page7[0].c7_5[0]' ,
146+ if : ( v , values : W8BenETaxFormValues ) => values . nffeStatus === NFFEStatus . ActiveNFFE ,
147+ } ,
148+ // [P-NFFE] I certify that the entity is a foreign entity...
149+ {
150+ formPath : 'topmostSubform[0].Page7[0].c7_6[0]' ,
151+ if : ( v , values : W8BenETaxFormValues ) => values . nffeStatus === NFFEStatus . PassiveNFFE ,
152+ } ,
153+ // I certify that the entity is a nonprofit organization
154+ {
155+ formPath : 'topmostSubform[0].Page7[0].c7_2[0]' ,
156+ if : ( v , values : W8BenETaxFormValues ) => values . nffeStatus === NFFEStatus . NonProfitOrganization ,
157+ } ,
158+ ] ,
159+ } ,
160+ // @ts -expect-error TODO: fix this
161+ entityHasNoUSOwners : 'topmostSubform[0].Page7[0].c7_7[0]' ,
162+ hasCapacityToSign : 'topmostSubform[0].Page8[0].c8_3[0]' ,
139163 signer : {
140164 formPath : 'topmostSubform[0].Page8[0].f8_31[0]' ,
141165 transform : getFullName ,
0 commit comments