export function conflictOfInterestForm(form: FormTs) {
// Conflict of Interest Disclosure Form - Compliance and ethics disclosure
// Demonstrates: Checkbox, RadioButton, Datepicker, CheckboxList, Textarea, TextPanel, MatrixQuestion, conditional visibility, dynamic labels, computed values, multi-page
// State to track if any conflicts were disclosed
const hasAnyConflicts = form.computedValue(() => {
const financial = financialSection.radioButton('hasFinancialInterests')?.value() === 'yes';
const relationships = relationshipsSection.radioButton('hasRelationships')?.value() === 'yes';
const outside = outsideSection.radioButton('hasOutsideActivities')?.value() === 'yes';
const gifts = giftsSection.radioButton('receivedGifts')?.value() === 'yes';
return financial || relationships || outside || gifts;
});
// ============================================
// HEADER
// ============================================
form.addRow(row => {
row.addTextPanel('header', {
label: 'Conflict of Interest Disclosure',
computedValue: () => 'Annual disclosure of potential conflicts of interest. Please complete all sections honestly and thoroughly.',
customStyles: {
backgroundColor: '#1e293b',
color: 'white',
padding: '24px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
// ============================================
// SECTION 1: Employee Information
// ============================================
const employeeSection = form.addSubform('employee', {
title: 'Your Information'
});
employeeSection.addRow(row => {
row.addTextbox('fullName', {
label: 'Full Legal Name',
placeholder: 'As it appears on official records',
isRequired: true
}, '1fr');
row.addTextbox('department', {
label: 'Department/Division',
placeholder: 'Your department',
isRequired: true
}, '1fr');
});
employeeSection.addRow(row => {
row.addTextbox('jobTitle', {
label: 'Job Title/Position',
placeholder: 'Your current title',
isRequired: true
}, '1fr');
row.addDropdown('role', {
label: 'Role Type',
options: [
{ id: 'employee', name: 'Employee' },
{ id: 'manager', name: 'Manager/Supervisor' },
{ id: 'executive', name: 'Executive/Officer' },
{ id: 'board', name: 'Board Member/Director' },
{ id: 'contractor', name: 'Contractor/Consultant' }
],
isRequired: true
}, '1fr');
});
employeeSection.addRow(row => {
row.addDatepicker('disclosureDate', {
label: 'Disclosure Date',
isRequired: true
}, '1fr');
row.addDropdown('disclosurePeriod', {
label: 'Disclosure Period',
options: [
{ id: '2024', name: 'Fiscal Year 2024' },
{ id: '2025', name: 'Fiscal Year 2025' },
{ id: '2026', name: 'Fiscal Year 2026' }
],
isRequired: true
}, '1fr');
});
// ============================================
// SECTION 2: Financial Interests
// ============================================
const financialSection = form.addSubform('financial', {
title: 'Financial Interests',
customStyles: () => {
if (financialSection.radioButton('hasFinancialInterests')?.value() === 'yes') {
return { backgroundColor: '#fef3c7', padding: '16px', borderRadius: '8px' };
}
return { padding: '16px', borderRadius: '8px', border: '1px dashed #e5e7eb' };
}
});
financialSection.addRow(row => {
row.addTextPanel('financialInstructions', {
computedValue: () => 'Do you or any immediate family member have a financial interest in any entity that does business with, or competes with, our organization?',
customStyles: {
backgroundColor: '#f1f5f9',
padding: '12px 16px',
borderRadius: '8px',
fontSize: '14px'
}
});
});
financialSection.addRow(row => {
row.addRadioButton('hasFinancialInterests', {
label: 'Financial Interest Disclosure',
options: [
{ id: 'no', name: 'No, I have no financial interests to disclose' },
{ id: 'yes', name: 'Yes, I have financial interests to disclose' }
],
orientation: 'vertical',
isRequired: true
});
});
// Financial interests detail
financialSection.addRow(row => {
row.addCheckboxList('financialTypes', {
label: 'Select all types of financial interests that apply:',
options: [
{ id: 'ownership', name: 'Ownership/Equity stake (stocks, partnership)' },
{ id: 'compensation', name: 'Compensation (salary, fees, commissions)' },
{ id: 'loans', name: 'Loans or debts' },
{ id: 'royalties', name: 'Royalties or licensing fees' },
{ id: 'board-compensation', name: 'Board/Advisory compensation' },
{ id: 'family-employment', name: 'Family member employment' }
],
orientation: 'vertical',
isVisible: () => financialSection.radioButton('hasFinancialInterests')?.value() === 'yes'
});
});
financialSection.addSpacer();
financialSection.addRow(row => {
row.addTextarea('financialDetails', {
label: 'Provide details of each financial interest:',
placeholder: 'For each interest, describe: (1) Entity name, (2) Nature of interest, (3) Approximate value, (4) How it relates to our organization',
rows: 4,
autoExpand: true,
isRequired: () => financialSection.radioButton('hasFinancialInterests')?.value() === 'yes',
isVisible: () => financialSection.radioButton('hasFinancialInterests')?.value() === 'yes'
});
});
// ============================================
// SECTION 3: Personal Relationships
// ============================================
const relationshipsSection = form.addSubform('relationships', {
title: 'Personal Relationships',
customStyles: () => {
if (relationshipsSection.radioButton('hasRelationships')?.value() === 'yes') {
return { backgroundColor: '#fef3c7', padding: '16px', borderRadius: '8px' };
}
return { padding: '16px', borderRadius: '8px', border: '1px dashed #e5e7eb' };
}
});
relationshipsSection.addRow(row => {
row.addTextPanel('relationshipInstructions', {
computedValue: () => 'Do you have any close personal relationships (family, romantic, close friendships) with vendors, contractors, competitors, or other employees that could influence your business decisions?',
customStyles: {
backgroundColor: '#f1f5f9',
padding: '12px 16px',
borderRadius: '8px',
fontSize: '14px'
}
});
});
relationshipsSection.addRow(row => {
row.addRadioButton('hasRelationships', {
label: 'Relationship Disclosure',
options: [
{ id: 'no', name: 'No, I have no relationships to disclose' },
{ id: 'yes', name: 'Yes, I have relationships to disclose' }
],
orientation: 'vertical',
isRequired: true
});
});
relationshipsSection.addRow(row => {
row.addCheckboxList('relationshipTypes', {
label: 'What types of relationships exist?',
options: [
{ id: 'spouse', name: 'Spouse/Domestic Partner' },
{ id: 'parent-child', name: 'Parent/Child' },
{ id: 'sibling', name: 'Sibling' },
{ id: 'extended-family', name: 'Extended family' },
{ id: 'romantic', name: 'Romantic partner' },
{ id: 'close-friend', name: 'Close personal friend' },
{ id: 'former-colleague', name: 'Former colleague/supervisor' }
],
orientation: 'vertical',
isVisible: () => relationshipsSection.radioButton('hasRelationships')?.value() === 'yes'
});
});
relationshipsSection.addSpacer();
relationshipsSection.addRow(row => {
row.addTextarea('relationshipDetails', {
label: 'Describe each relationship and potential conflict:',
placeholder: "For each relationship: (1) Person's name and relationship to you, (2) Their organization/role, (3) How it may create a conflict",
rows: 4,
autoExpand: true,
isRequired: () => relationshipsSection.radioButton('hasRelationships')?.value() === 'yes',
isVisible: () => relationshipsSection.radioButton('hasRelationships')?.value() === 'yes'
});
});
// ============================================
// SECTION 4: Outside Activities
// ============================================
const outsideSection = form.addSubform('outside', {
title: 'Outside Activities & Employment',
customStyles: () => {
if (outsideSection.radioButton('hasOutsideActivities')?.value() === 'yes') {
return { backgroundColor: '#fef3c7', padding: '16px', borderRadius: '8px' };
}
return { padding: '16px', borderRadius: '8px', border: '1px dashed #e5e7eb' };
}
});
outsideSection.addRow(row => {
row.addRadioButton('hasOutsideActivities', {
label: 'Do you have any outside employment, business activities, or board positions?',
options: [
{ id: 'no', name: 'No outside activities to disclose' },
{ id: 'yes', name: 'Yes, I have outside activities to disclose' }
],
orientation: 'vertical',
isRequired: true
});
});
outsideSection.addRow(row => {
row.addCheckboxList('activityTypes', {
label: 'Select all that apply:',
options: [
{ id: 'employment', name: 'Part-time or secondary employment' },
{ id: 'self-employed', name: 'Self-employment or freelancing' },
{ id: 'consulting', name: 'Consulting work' },
{ id: 'board-membership', name: 'Board/Committee membership (other orgs)' },
{ id: 'nonprofit', name: 'Non-profit volunteer leadership' },
{ id: 'teaching', name: 'Teaching or training' },
{ id: 'speaking', name: 'Paid speaking engagements' }
],
orientation: 'vertical',
isVisible: () => outsideSection.radioButton('hasOutsideActivities')?.value() === 'yes'
});
});
outsideSection.addSpacer();
outsideSection.addRow(row => {
row.addTextarea('activityDetails', {
label: 'Describe each outside activity:',
placeholder: 'For each activity: (1) Organization name, (2) Your role, (3) Time commitment, (4) Any overlap with your responsibilities here',
rows: 4,
autoExpand: true,
isRequired: () => outsideSection.radioButton('hasOutsideActivities')?.value() === 'yes',
isVisible: () => outsideSection.radioButton('hasOutsideActivities')?.value() === 'yes'
});
});
// ============================================
// SECTION 5: Gifts & Entertainment
// ============================================
const giftsSection = form.addSubform('gifts', {
title: 'Gifts & Entertainment',
customStyles: () => {
if (giftsSection.radioButton('receivedGifts')?.value() === 'yes') {
return { backgroundColor: '#fef3c7', padding: '16px', borderRadius: '8px' };
}
return { padding: '16px', borderRadius: '8px', border: '1px dashed #e5e7eb' };
}
});
giftsSection.addRow(row => {
row.addRadioButton('receivedGifts', {
label: 'Have you received gifts, meals, travel, or entertainment from vendors, contractors, or others doing business with us (valued over $50)?',
options: [
{ id: 'no', name: 'No gifts to disclose' },
{ id: 'yes', name: 'Yes, I have received gifts to disclose' }
],
orientation: 'vertical',
isRequired: true
});
});
giftsSection.addSpacer();
giftsSection.addRow(row => {
row.addTextarea('giftDetails', {
label: 'List all gifts, meals, travel, or entertainment received:',
placeholder: 'For each item: (1) Description, (2) Approximate value, (3) Who provided it, (4) Date received',
rows: 3,
autoExpand: true,
isRequired: () => giftsSection.radioButton('receivedGifts')?.value() === 'yes',
isVisible: () => giftsSection.radioButton('receivedGifts')?.value() === 'yes'
});
});
// ============================================
// SECTION 6: Mitigation Plan (if conflicts exist)
// ============================================
const mitigationSection = form.addSubform('mitigation', {
title: 'Conflict Mitigation',
isVisible: () => hasAnyConflicts(),
customStyles: {
backgroundColor: '#eff6ff',
padding: '16px',
borderRadius: '8px'
}
});
mitigationSection.addRow(row => {
row.addTextPanel('mitigationInstructions', {
computedValue: () => 'Since you have disclosed potential conflicts, please describe how you plan to manage or mitigate them.',
customStyles: {
backgroundColor: '#dbeafe',
padding: '12px 16px',
borderRadius: '8px',
borderLeft: '4px solid #3b82f6',
fontSize: '14px'
}
});
});
mitigationSection.addRow(row => {
row.addCheckboxList('mitigationMethods', {
label: 'What mitigation steps will you take? (Select all that apply)',
options: [
{ id: 'recusal', name: 'Recuse myself from related decisions' },
{ id: 'disclosure', name: 'Disclose conflict before discussions' },
{ id: 'supervision', name: 'Ensure oversight by uninvolved party' },
{ id: 'divest', name: 'Divest financial interest' },
{ id: 'resign', name: 'Resign from outside position' },
{ id: 'other', name: 'Other mitigation steps' }
],
orientation: 'vertical'
});
});
mitigationSection.addSpacer();
mitigationSection.addRow(row => {
row.addTextarea('mitigationPlan', {
label: 'Describe your specific mitigation plan:',
placeholder: 'Explain in detail how you will prevent conflicts from affecting your judgment or decisions...',
rows: 3,
autoExpand: true,
isRequired: true
});
});
// ============================================
// SECTION 7: Certification
// ============================================
const certificationSection = form.addSubform('certification', {
title: 'Certification & Acknowledgment',
customStyles: {
backgroundColor: '#f8fafc',
padding: '16px',
borderRadius: '8px',
border: '2px solid #1e293b'
}
});
certificationSection.addRow(row => {
row.addTextPanel('policyText', {
computedValue: () => 'By submitting this disclosure, I acknowledge that:\n\n• I have read and understand the organization\'s Conflict of Interest Policy\n• The information provided is complete and accurate to the best of my knowledge\n• I will promptly update this disclosure if circumstances change\n• Failure to disclose conflicts may result in disciplinary action',
customStyles: {
backgroundColor: '#f1f5f9',
padding: '16px',
borderRadius: '8px',
whiteSpace: 'pre-wrap',
fontSize: '14px'
}
});
});
certificationSection.addRow(row => {
row.addCheckbox('certifyAccurate', {
label: 'I certify that all information provided in this disclosure is true and accurate',
isRequired: true
});
});
certificationSection.addRow(row => {
row.addCheckbox('certifyComplete', {
label: 'I certify that I have disclosed all potential conflicts of interest known to me',
isRequired: true
});
});
certificationSection.addRow(row => {
row.addCheckbox('certifyPolicy', {
label: 'I have read and agree to comply with the Conflict of Interest Policy',
isRequired: true
});
});
certificationSection.addRow(row => {
row.addTextbox('signature', {
label: 'Electronic Signature (Type your full name)',
placeholder: 'Type your full legal name as signature',
isRequired: true
}, '1fr');
row.addDatepicker('signatureDate', {
label: 'Date',
isRequired: true
}, '200px');
});
// ============================================
// SECTION 8: Summary
// ============================================
const summarySection = form.addSubform('summary', {
title: 'Disclosure Summary',
isVisible: () => certificationSection.checkbox('certifyAccurate')?.value() === true
});
summarySection.addRow(row => {
row.addTextPanel('summaryContent', {
computedValue: () => {
const name = employeeSection.textbox('fullName')?.value();
const role = employeeSection.dropdown('role')?.value();
const department = employeeSection.textbox('department')?.value();
const period = employeeSection.dropdown('disclosurePeriod')?.value();
const hasFinancial = financialSection.radioButton('hasFinancialInterests')?.value() === 'yes';
const hasRelationships = relationshipsSection.radioButton('hasRelationships')?.value() === 'yes';
const hasOutside = outsideSection.radioButton('hasOutsideActivities')?.value() === 'yes';
const hasGifts = giftsSection.radioButton('receivedGifts')?.value() === 'yes';
const roleLabels: Record<string, string> = {
'employee': 'Employee',
'manager': 'Manager',
'executive': 'Executive',
'board': 'Board Member',
'contractor': 'Contractor'
};
let summary = `COI Disclosure Summary\n`;
summary += `${'═'.repeat(24)}\n\n`;
if (name) summary += `Name: ${name}\n`;
if (role) summary += `Role: ${roleLabels[role] || role}\n`;
if (department) summary += `Dept: ${department}\n`;
if (period) summary += `Period: FY ${period}\n`;
summary += `\n─── Disclosures ───\n`;
summary += `Financial: ${hasFinancial ? 'Yes' : 'None'}\n`;
summary += `Relationships: ${hasRelationships ? 'Yes' : 'None'}\n`;
summary += `Outside Activities: ${hasOutside ? 'Yes' : 'None'}\n`;
summary += `Gifts Received: ${hasGifts ? 'Yes' : 'None'}\n`;
if (hasAnyConflicts()) {
summary += `\n⚠️ Conflicts disclosed - Mitigation required`;
} else {
summary += `\n✓ No conflicts disclosed`;
}
return summary;
},
customStyles: () => {
const baseStyles = {
padding: '16px',
borderRadius: '8px',
whiteSpace: 'pre-wrap',
fontFamily: 'monospace',
fontSize: '14px'
};
if (hasAnyConflicts()) {
return { ...baseStyles, backgroundColor: '#fef3c7', borderLeft: '4px solid #f59e0b' };
}
return { ...baseStyles, backgroundColor: '#d1fae5', borderLeft: '4px solid #10b981' };
}
});
});
// ============================================
// FORM CONFIGURATION
// ============================================
form.configureSubmitButton({
label: 'Submit Disclosure',
isVisible: () => {
const allChecked =
certificationSection.checkbox('certifyAccurate')?.value() === true &&
certificationSection.checkbox('certifyComplete')?.value() === true &&
certificationSection.checkbox('certifyPolicy')?.value() === true;
return allChecked;
}
});
form.configureCompletionScreen({
type: 'text',
title: 'Disclosure Submitted',
message: () => {
if (hasAnyConflicts()) {
return 'Your conflict of interest disclosure has been submitted for review. Given the conflicts disclosed, a member of the Ethics Committee or HR will contact you within 5 business days to discuss your mitigation plan. Please retain a copy of this disclosure for your records.';
}
return 'Your conflict of interest disclosure has been submitted. No conflicts were identified. A confirmation will be sent to you via email. Thank you for maintaining transparency and ethical standards.';
}
});
}