|
| 1 | +=== STRUCTURED TEXT EXTRACTED WITH python-docx === |
| 2 | + |
| 3 | + 1: Farmer Profile Report |
| 4 | + 2: This is a template for creating a Word document (.docx) for comprehensive farmer profile PDF generation. Convert this markdown to a Word document and save as farmer-profile-template.docx. |
| 5 | + 3: {{ farmer.name }} - Farmer Profile |
| 6 | + 4: Report ID: {{ farmer.farmerCode }}-PROFILE-{{ generatedAt }} |
| 7 | + 5: Executive Summary |
| 8 | + 6: This comprehensive farmer profile provides detailed information about {{ farmer.name }}, including personal details, agricultural activities, location information, organizational relationships, payment methods, and supporting documentation. |
| 9 | + 7: 1. Personal Information |
| 10 | + 8: 2. Location Information |
| 11 | + 9: Geographic Details |
| 12 | + 10: Administrative Levels |
| 13 | + 11: {% if farmer.administrativeLevels %} |
| 14 | + 12: {% else %} |
| 15 | + 13: No information on administrative levels available. |
| 16 | + 14: {% endif %} |
| 17 | + 15: 3. Agricultural Information |
| 18 | + 16: Primary Activities |
| 19 | + 17: Additional Agricultural Activities |
| 20 | + 18: {% if farmer.otherActivities %} |
| 21 | + 19: {% for activity in farmer.otherActivities %} |
| 22 | + 20: {{ activity }} |
| 23 | + 21: {% endfor %} |
| 24 | + 22: {% else %} |
| 25 | + 23: No additional activities specified. |
| 26 | + 24: {% endif %} |
| 27 | + 25: 4. Organization Information |
| 28 | + 26: Primary Organization |
| 29 | + 27: Additional Organizations |
| 30 | + 28: {% if farmer.organizationIds %} The farmer is associated with {{ farmer.organizationIds | length }} additional organization(s) for business intelligence and credit scoring purposes. |
| 31 | + 29: Organization IDs: {{ farmer.organizationIds | join(', ') }} |
| 32 | + 30: {% else %} |
| 33 | + 31: No additional organizational relationships. |
| 34 | + 32: {% endif %} |
| 35 | + 33: 5. Payment Information |
| 36 | + 34: {% if farmer.paymentDetails %} |
| 37 | + 35: {% for payment in farmer.paymentDetails %} |
| 38 | + 36: Payment Method {{ loop.index }} |
| 39 | + 37: Type: {{ payment.type | title | replace('_', ' ') }} |
| 40 | + 38: {% if payment.type == 'bank_transfer' %} |
| 41 | + 39: {% elif payment.type == 'mobile_money' %} |
| 42 | + 40: {% endif %} |
| 43 | + 41: {% endfor %} |
| 44 | + 42: {% else %} |
| 45 | + 43: No payment methods have been configured for this farmer. |
| 46 | + 44: {% endif %} |
| 47 | + 45: 6. Document Repository |
| 48 | + 46: Proof of Stake/Insurable Interest |
| 49 | + 47: {% if farmer.proofOfStake %} |
| 50 | + 48: Total Documents: {{ farmer.proofOfStake | length }} |
| 51 | + 49: {% else %} |
| 52 | + 50: No proof of stake documents have been uploaded. |
| 53 | + 51: {% endif %} |
| 54 | + 52: Document Storage Information |
| 55 | + 53: All documents are securely stored in encrypted cloud storage with access controls and audit logging. Documents can be retrieved through the farmer management system. |
| 56 | + 54: 7. Farm Location Map |
| 57 | + 55: {% if farmer.latitude and farmer.longitude %} GPS Coordinates: {{ farmer.latitude }}, {{ farmer.longitude }} |
| 58 | + 56: Note: A detailed satellite map showing the exact farm location is available in the digital version of this report. The coordinates provided above can be used with any mapping service to locate the farm. |
| 59 | + 57: Google Maps Link: Google Maps |
| 60 | + 58: {% if farmer.aez %} Agro-Ecological Zone: {{ farmer.aez }} This zone classification helps determine appropriate agricultural practices and risk assessments for the region. |
| 61 | + 59: {% endif %} |
| 62 | + 60: {% else %} Farm location coordinates are not available. Please update the farmer profile with GPS coordinates for accurate location mapping. |
| 63 | + 61: {% endif %} |
| 64 | + 62: 8. KYC & Compliance Status |
| 65 | + 63: Data Quality Assessment |
| 66 | + 64: {% if farmer.email and farmer.latitude and farmer.primaryActivity and farmer.paymentDetails %} ✅ Excellent - All required fields are complete |
| 67 | + 65: {% elif farmer.phone and farmer.name %} |
| 68 | + 66: ⚠️ Good - Core information present, some optional fields missing |
| 69 | + 67: {% else %} |
| 70 | + 68: ❌ Needs Attention - Critical information missing |
| 71 | + 69: {% endif %} |
| 72 | + 70: 9. Historical Activity |
| 73 | + 71: Policy History |
| 74 | + 72: {% if farmer.policies and farmer.policies | length > 0 %} |
| 75 | + 73: The farmer has {{ farmer.policies | length }} insurance policies in the system. |
| 76 | + 74: {% else %} |
| 77 | + 75: No insurance policies found for this farmer. |
| 78 | + 76: {% endif %} |
| 79 | + 77: Quote History |
| 80 | + 78: {% if farmer.quotes and farmer.quotes | length > 0 %} |
| 81 | + 79: The farmer has {{ farmer.quotes | length }} insurance quotes in the system. |
| 82 | + 80: {% else %} |
| 83 | + 81: No insurance quotes found for this farmer. |
| 84 | + 82: {% endif %} |
| 85 | + 83: 10. Risk Assessment & Recommendations |
| 86 | + 84: Location Risk Factors |
| 87 | + 85: {% if farmer.latitude and farmer.longitude %} |
| 88 | + 86: ✅ GPS Coordinates Available - Enables precise risk modeling |
| 89 | + 87: {% if farmer.aez %} |
| 90 | + 88: ✅ AEZ Classification - Zone {{ farmer.aez }} agricultural practices identified |
| 91 | + 89: {% else %} |
| 92 | + 90: ⚠️ AEZ Pending - Agro-ecological zone classification needed |
| 93 | + 91: {% endif %} |
| 94 | + 92: {% else %} |
| 95 | + 93: ❌ Location Missing - GPS coordinates required for risk assessment |
| 96 | + 94: {% endif %} |
| 97 | + 95: Data Completeness Score |
| 98 | + 96: {% set completeness_score = 0 %}{% if farmer.name %}{% set completeness_score = completeness_score + 10 %}{% endif %}{% if farmer.phone %}{% set completeness_score = completeness_score + 10 %}{% endif %}{% if farmer.email %}{% set completeness_score = completeness_score + 10 %}{% endif %}{% if farmer.latitude and farmer.longitude %}{% set completeness_score = completeness_score + 15 %}{% endif %}{% if farmer.primaryActivity or farmer.crop %}{% set completeness_score = completeness_score + 15 %}{% endif %}{% if farmer.area %}{% set completeness_score = completeness_score + 10 %}{% endif %}{% if farmer.paymentDetails %}{% set completeness_score = completeness_score + 15 %}{% endif %}{% if farmer.proofOfStake %}{% set completeness_score = completeness_score + 15 %}{% endif %} |
| 99 | + 97: Profile Completeness: {{ completeness_score }}% |
| 100 | + 98: {% if completeness_score >= 80 %}🟢 Excellent - Profile is comprehensive and ready for all services {% elif completeness_score >= 60 %}🟡 Good - Profile is sufficient for basic services |
| 101 | + 99: {% else %}🔴 Needs Improvement - Additional information required{% endif %} |
| 102 | + 100: Report Footer |
| 103 | + 101: Generated By: {{ user.name }} ({{ user.email }}) |
| 104 | + 102: Organization: {{ user.organization.name }} |
| 105 | + 103: Report Type: Comprehensive Farmer Profile |
| 106 | + 104: System Version: {{ systemVersion | default('v1.0') }} |
| 107 | + 105: Data Privacy Notice: This document contains personal and confidential information. Handle according to your organization's data protection policies and applicable privacy regulations. |
| 108 | + 106: Document Authenticity: This report was generated automatically from the farmer management system. For verification, contact {{ user.organization.name }} at {{ user.email }}. |
| 109 | + 107: Field | Value |
| 110 | + 108: Full Name | {{ farmer.name }} |
| 111 | + 109: Farmer Code | {{ farmer.farmerCode }} |
| 112 | + 110: Phone Number | {{ farmer.phone }} |
| 113 | + 111: Email Address | {% if farmer.email %}{{ farmer.email }}{% else %}Not provided{% endif %} |
| 114 | + 112: Registration Date | {{ farmer.createdAt }} |
| 115 | + 113: Last Updated | {{ farmer.updatedAt }} |
| 116 | + 114: Status | {% if farmer.isActive %}Active{% else %}Inactive{% endif %} |
| 117 | + 115: Field | Value |
| 118 | + 116: Country | {{ farmer.countryCode }} |
| 119 | + 117: Coordinates | {% if farmer.latitude and farmer.longitude %}{{ farmer.latitude }}, {{ farmer.longitude }}{% else %}Not available{% endif %} |
| 120 | + 118: AEZ (Agro-Ecological Zone) | {% if farmer.aez %}{{ farmer.aez }}{% else %}Not determined{% endif %} |
| 121 | + 119: {%tr for level, value in farmer.administrativeLevels.items() %} | {%tr for level, value in farmer.administrativeLevels.items() %} |
| 122 | + 120: Level {{ level }} | {{ value }} |
| 123 | + 121: {%tr endfor %} | {%tr endfor %} |
| 124 | + 122: Field | Value |
| 125 | + 123: Primary Activity/Products | {% if farmer.primaryActivity %}{{ farmer.primaryActivity }}{% elif farmer.crop %}{{ farmer.crop }}{% else %}Not specified{% endif %} |
| 126 | + 124: Farm Size | {% if farmer.area %}{{ farmer.area }} hectares{% else %}Not specified{% endif %} |
| 127 | + 125: Field | Value |
| 128 | + 126: Organization Name | {{ farmer.organization.name }} |
| 129 | + 127: Organization Code | {{ farmer.organization.code }} |
| 130 | + 128: Organization ID | {{ farmer.organization.id }} |
| 131 | + 129: Field | Value |
| 132 | + 130: Account Name | {{ payment.account_name }} |
| 133 | + 131: Bank Name | {{ payment.bank_name }} |
| 134 | + 132: Currency | {{ payment.currency }} |
| 135 | + 133: {%tr if payment.branch_name_or_code %} | {%tr if payment.branch_name_or_code %} |
| 136 | + 134: Branch | {{ payment.branch_name_or_code }} |
| 137 | + 135: {%tr endif %} | {%tr endif %} |
| 138 | + 136: Field | Value |
| 139 | + 137: Mobile Number | {{ payment.registered_mobile_number }} |
| 140 | + 138: Full Name | {{ payment.full_name }} |
| 141 | + 139: {%tr if payment.provider %} | {%tr if payment.provider %} |
| 142 | + 140: Provider | {{ payment.provider }} |
| 143 | + 141: {%tr endif %} | {%tr endif %} |
| 144 | + 142: Document # | Filename | Type | Upload Date | File Size |
| 145 | + 143: {%tr for doc in farmer.proofOfStake %} | {%tr for doc in farmer.proofOfStake %} | {%tr for doc in farmer.proofOfStake %} | {%tr for doc in farmer.proofOfStake %} | {%tr for doc in farmer.proofOfStake %} |
| 146 | + 144: {{ loop.index }} | {{ doc.filename }} | {{ doc.type }} | {{ doc.uploadedAt }} | {{ doc.size | filesizeformat }} |
| 147 | + 145: {%tr endfor %} | {%tr endfor %} | {%tr endfor %} | {%tr endfor %} | {%tr endfor %} |
| 148 | + 146: Field | Value |
| 149 | + 147: KYC Status | {% if farmer.kycStatus %}{{ farmer.kycStatus }}{% else %}Pending{% endif %} |
| 150 | + 148: Account Status | {% if farmer.isActive %}Active{% else %}Inactive{% endif %} |
| 151 | + 149: Data Completeness | {% if farmer.email and farmer.latitude and farmer.primaryActivity %}Complete{% else %} |
| 152 | + 150: Needs Update{% endif %} |
| 153 | + 151: Field | Value |
| 154 | + 152: Member Since | {{ farmer.createdAt }} |
| 155 | + 153: Profile Last Updated | {{ farmer.updatedAt }} |
| 156 | + 154: Days as Member | {{ daysSinceRegistration }} |
| 157 | + |
| 158 | +=== SUMMARY === |
| 159 | +Total lines: 154 |
| 160 | +Total characters: 8523 |
0 commit comments