<?php

namespace Database\Seeders;

use App\Enum\Contact\MessageChannel;
use App\Models\Contact\ContactCategory;
use App\Models\Contact\ContactTemplate;
use App\Models\Solicitor\Solicitor;
use Illuminate\Database\Seeder;

class ContactTemplateSeeder extends Seeder
{
    public function run(): void
    {
        $solicitor = Solicitor::firstOrFail();

        $clientCat = ContactCategory::firstOrCreate(['name' => 'Client Correspondence']);
        $schemeCat = ContactCategory::firstOrCreate(['name' => 'Scheme Correspondence']);

        foreach ($this->templates($clientCat->id, $schemeCat->id) as $template) {
            ContactTemplate::updateOrCreate(
                ['solicitor_id' => $solicitor->id, 'key' => $template['key']],
                array_merge($template, [
                    'solicitor_id'         => $solicitor->id,
                    'channel'              => MessageChannel::EMAIL,
                    'is_active'            => true,
                    'allow_manual_send'    => true,
                    'allow_automatic_send' => false,
                    'config'               => ['include_signature' => false],
                ])
            );
        }
    }

    private function templates(int $clientCatId, int $schemeCatId): array
    {
        return [

            // ---------------------------------------------------------------
            // Client Correspondence
            // ---------------------------------------------------------------

            [
                'key'         => 'client_welcome_email',
                'name'        => 'Client Welcome Email',
                'category_id' => $clientCatId,
                'subject'     => 'Welcome to {{ solicitor.name }} – Your Redress Claim',
                'description' => 'Sent after initial intake call with attached CFA, LOA and application forms.',
                'body_html_template' => "<p>Dear {{ client.full_name }},</p>\n<p>Your Reference: {{ client.reference }}</p>\n<p>Thank you for choosing {{ solicitor.name }} to support you with your redress claim.</p>\n<p>We appreciate that taking this step may not have been easy, and we want to reassure you that our team will guide and support you throughout the process with sensitivity, professionalism, and care.</p>\n<p>Please find attached:</p>\n<ul>\n<li>Client Care Letter</li>\n<li>Conditional Fee Agreement</li>\n<li>Letter of Authority</li>\n<li>Proof of Address &amp; Proof of Identification Information</li>\n<li>Scottish Redress Scheme Application Forms (Part 1 &amp; Part 3)</li>\n</ul>\n<p><strong>What Happens Next</strong></p>\n<p>Once we receive your signed Conditional Fee Agreement (&quot;CFA&quot;) and supporting documents, we will begin progressing your claim. This process may include:</p>\n<ul>\n<li>Reviewing your circumstances and eligibility</li>\n<li>Gathering relevant evidence and documentation</li>\n<li>Preparing and submitting your application/claim</li>\n<li>Corresponding with the relevant redress body on your behalf</li>\n<li>Keeping you updated throughout the process</li>\n</ul>\n<p><strong>Timescales</strong></p>\n<p>Please be aware that redress claims can take time due to the volume and complexity of applications being handled. While every case is different, it is not uncommon for the process to take several months and, in some cases, longer.</p>\n<p>We will always aim to progress matters as quickly as possible and will keep you informed of any important developments.</p>\n<p><strong>Your Wellbeing Matters</strong></p>\n<p>We understand that discussing past experiences and engaging in the redress process can sometimes be emotionally difficult.</p>\n<p>If at any point you are struggling with your mental health or need immediate support, please consider contacting one of the following organisations:</p>\n<p><strong>Emergency &amp; Mental Health Support</strong></p>\n<ul>\n<li>Samaritans – 24/7 confidential support – Call: 116 123 – Website: www.samaritans.org</li>\n<li>NHS Mental Health Support – Call NHS 111 and select the mental health option (available 24/7)</li>\n<li>Emergency Services – If you feel you are at immediate risk or unable to keep yourself safe, please call 999 or attend your nearest A&amp;E department.</li>\n<li>Mind – Website: www.mind.org.uk</li>\n<li>Shout Crisis Text Line – Text &quot;SHOUT&quot; to 85258 for confidential text support 24/7.</li>\n</ul>\n<p><strong>Contacting Us</strong></p>\n<p>If you have any questions or concerns at any stage, please do not hesitate to contact our team on {{ solicitor.phone }} or via WhatsApp on {{ solicitor.whatsapp }}. Alternatively via email at {{ solicitor.email }}.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear {{ client.full_name }},\n\nYour Reference: {{ client.reference }}\n\nThank you for choosing {{ solicitor.name }} to support you with your redress claim.\n\nWe appreciate that taking this step may not have been easy, and we want to reassure you that our team will guide and support you throughout the process with sensitivity, professionalism, and care.\n\nPlease find attached:\n- Client Care Letter\n- Conditional Fee Agreement\n- Letter of Authority\n- Proof of Address & Proof of Identification Information\n- Scottish Redress Scheme Application Forms (Part 1 & Part 3)\n\nWhat Happens Next\n\nOnce we receive your signed Conditional Fee Agreement (\"CFA\") and supporting documents, we will begin progressing your claim. This process may include:\n- Reviewing your circumstances and eligibility\n- Gathering relevant evidence and documentation\n- Preparing and submitting your application/claim\n- Corresponding with the relevant redress body on your behalf\n- Keeping you updated throughout the process\n\nTimescales\n\nPlease be aware that redress claims can take time due to the volume and complexity of applications being handled. While every case is different, it is not uncommon for the process to take several months and, in some cases, longer.\n\nWe will always aim to progress matters as quickly as possible and will keep you informed of any important developments.\n\nYour Wellbeing Matters\n\nWe understand that discussing past experiences and engaging in the redress process can sometimes be emotionally difficult.\n\nIf at any point you are struggling with your mental health or need immediate support, please consider contacting one of the following organisations:\n\nEmergency & Mental Health Support\n- Samaritans - 24/7 confidential support - Call: 116 123 - Website: www.samaritans.org\n- NHS Mental Health Support - Call NHS 111 and select the mental health option (available 24/7)\n- Emergency Services - If you feel you are at immediate risk or unable to keep yourself safe, please call 999 or attend your nearest A&E department.\n- Mind - Website: www.mind.org.uk\n- Shout Crisis Text Line - Text \"SHOUT\" to 85258 for confidential text support 24/7.\n\nContacting Us\n\nIf you have any questions or concerns at any stage, please do not hesitate to contact our team on {{ solicitor.phone }} or via WhatsApp on {{ solicitor.whatsapp }}. Alternatively via email at {{ solicitor.email }}.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'application_sent',
                'name'        => 'Application Sent',
                'category_id' => $clientCatId,
                'subject'     => 'Your Scottish Redress Scheme Application Has Been Submitted',
                'description' => 'Sent to the client once their application has been submitted to The Scottish Redress Scheme.',
                'body_html_template' => "<p>Dear {{ client.full_name }},</p>\n<p>Your Reference: {{ client.reference }}</p>\n<p>We are pleased to inform you that your application has now been sent to The Scottish Redress Scheme. We will hopefully receive an acknowledgement from The Scheme in the coming weeks, and you will be assigned a unique reference number linked to your application.</p>\n<p>Depending on processing times, we would usually receive a response in approximately 14 days, but this can differ depending on the volume of applications being handled by The Scheme.</p>\n<p>As soon as we receive an acknowledgement from The Scheme we will provide a further update.</p>\n<p>If you require anything further in the interim, please do not hesitate to contact the office.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear {{ client.full_name }},\n\nYour Reference: {{ client.reference }}\n\nWe are pleased to inform you that your application has now been sent to The Scottish Redress Scheme. We will hopefully receive an acknowledgement from The Scheme in the coming weeks, and you will be assigned a unique reference number linked to your application.\n\nDepending on processing times, we would usually receive a response in approximately 14 days, but this can differ depending on the volume of applications being handled by The Scheme.\n\nAs soon as we receive an acknowledgement from The Scheme we will provide a further update.\n\nIf you require anything further in the interim, please do not hesitate to contact the office.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'awaiting_signed_documents',
                'name'        => 'Awaiting Signed Documents',
                'category_id' => $clientCatId,
                'subject'     => 'Action Required: Outstanding Documents – Ref {{ client.reference }}',
                'description' => 'Chaser sent when signed CFA/LOA and ID documents have not been returned.',
                'body_html_template' => "<p>Dear {{ client.full_name }},</p>\n<p>Your Reference: {{ client.reference }}</p>\n<p>We write further to our recent correspondence and your application to The Scottish Redress Scheme.</p>\n<p>Following our initial conversation we sent you the following documents via email:</p>\n<ul>\n<li>Client Care Letter</li>\n<li>Conditional Fee Agreement</li>\n<li>Letter of Authority</li>\n<li>Fee Clarity Information</li>\n<li>Part 1 Application Form</li>\n<li>Part 3 Application Form</li>\n</ul>\n<p>We would be grateful if you can consider the documents and e-sign at your earliest convenience. In addition, we cannot trace receiving your Proof of Identity and Proof of Address documentation. Please provide this at your earliest convenience so we can progress matters.</p>\n<p>If you require any assistance in completing any of the electronic forms, or need further guidance with gathering your Proof of Identity and Proof of Address documentation, please do not hesitate to contact the office on {{ solicitor.phone }}.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear {{ client.full_name }},\n\nYour Reference: {{ client.reference }}\n\nWe write further to our recent correspondence and your application to The Scottish Redress Scheme.\n\nFollowing our initial conversation we sent you the following documents via email:\n- Client Care Letter\n- Conditional Fee Agreement\n- Letter of Authority\n- Fee Clarity Information\n- Part 1 Application Form\n- Part 3 Application Form\n\nWe would be grateful if you can consider the documents and e-sign at your earliest convenience. In addition, we cannot trace receiving your Proof of Identity and Proof of Address documentation. Please provide this at your earliest convenience so we can progress matters.\n\nIf you require any assistance in completing any of the electronic forms, or need further guidance with gathering your Proof of Identity and Proof of Address documentation, please do not hesitate to contact the office on {{ solicitor.phone }}.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'app_number_received',
                'name'        => 'APP Number Received',
                'category_id' => $clientCatId,
                'subject'     => 'Your Application Has Been Accepted – APP Number Received',
                'description' => 'Sent once The Scottish Redress Scheme issues an APP number confirming acceptance.',
                'body_html_template' => "<p>Dear {{ client.full_name }},</p>\n<p>Your Reference: {{ client.reference }}</p>\n<p>We have now received a response from The Scottish Redress Scheme and can confirm your application has been accepted. Your application has been designated a specific reference number, which is: {{ claim.app_number }}.</p>\n<p>We will now be reviewing your application to ensure all requisite information has been captured and documented on your file.</p>\n<p>If you have recalled any other information that may be supportive of your application, please do not hesitate to contact us in the interim.</p>\n<p>In any event, we will contact you shortly to confirm the next steps in your application.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear {{ client.full_name }},\n\nYour Reference: {{ client.reference }}\n\nWe have now received a response from The Scottish Redress Scheme and can confirm your application has been accepted. Your application has been designated a specific reference number, which is: {{ claim.app_number }}.\n\nWe will now be reviewing your application to ensure all requisite information has been captured and documented on your file.\n\nIf you have recalled any other information that may be supportive of your application, please do not hesitate to contact us in the interim.\n\nIn any event, we will contact you shortly to confirm the next steps in your application.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'application_with_dsar_team',
                'name'        => 'Application with DSAR Team',
                'category_id' => $clientCatId,
                'subject'     => 'Update: Data Subject Access Requests Submitted',
                'description' => 'Sent when DSARs have been submitted to institutions and medical practices.',
                'body_html_template' => "<p>Dear {{ client.full_name }},</p>\n<p>Your Reference: {{ client.reference }}</p>\n<p>We are pleased to confirm that we now have all information required to make the relevant Data Subject Access Requests to your relevant institutions and medical practices.</p>\n<p>As part of this process, formal requests will be submitted to the relevant bodies requesting disclosure of all personal data and information they hold which may be supportive of your application. This information is vital as it will help us to review the full details of your application and assess the next steps we may need to take in pursuing the final decision from The Scheme.</p>\n<p>Under current data protection legislation, the data holder typically has up to one calendar month to respond to the request. However, in some circumstances the timeframe can be extended if the request is considered complex or if additional information is required.</p>\n<p>Once we are in receipt of the requested documentation and we have had the opportunity to review the same, we will contact you to advise you as to the next steps in your application.</p>\n<p>Please note, that during this period there may be limited updates whilst we await the response from the data controller, but we will continue to monitor the matter closely and keep you informed of any significant developments.</p>\n<p>In the interim, if you wish to receive an update or need to speak about your application in greater detail, please do not hesitate to contact the office.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear {{ client.full_name }},\n\nYour Reference: {{ client.reference }}\n\nWe are pleased to confirm that we now have all information required to make the relevant Data Subject Access Requests to your relevant institutions and medical practices.\n\nAs part of this process, formal requests will be submitted to the relevant bodies requesting disclosure of all personal data and information they hold which may be supportive of your application. This information is vital as it will help us to review the full details of your application and assess the next steps we may need to take in pursuing the final decision from The Scheme.\n\nUnder current data protection legislation, the data holder typically has up to one calendar month to respond to the request. However, in some circumstances the timeframe can be extended if the request is considered complex or if additional information is required.\n\nOnce we are in receipt of the requested documentation and we have had the opportunity to review the same, we will contact you to advise you as to the next steps in your application.\n\nPlease note, that during this period there may be limited updates whilst we await the response from the data controller, but we will continue to monitor the matter closely and keep you informed of any significant developments.\n\nIn the interim, if you wish to receive an update or need to speak about your application in greater detail, please do not hesitate to contact the office.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'no_answer_chasing',
                'name'        => 'No Answer – Chasing',
                'category_id' => $clientCatId,
                'subject'     => 'Attempted Contact – Scottish Redress Application',
                'description' => 'Sent after a failed call attempt to prompt the client to make contact.',
                'body_html_template' => "<p>Dear {{ client.full_name }},</p>\n<p>Your Reference: {{ client.reference }}</p>\n<p>I hope you are well.</p>\n<p>I attempted to call you a few moments ago, unfortunately you were unavailable. The purpose of the call was to take further details to progress your Scottish Redress Application.</p>\n<p>Please can you contact me on {{ solicitor.phone }} so we can progress matters, alternatively please can you respond to this email with a convenient time for me to return the call.</p>\n<p>I look forward to hearing from you.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear {{ client.full_name }},\n\nYour Reference: {{ client.reference }}\n\nI hope you are well.\n\nI attempted to call you a few moments ago, unfortunately you were unavailable. The purpose of the call was to take further details to progress your Scottish Redress Application.\n\nPlease can you contact me on {{ solicitor.phone }} so we can progress matters, alternatively please can you respond to this email with a convenient time for me to return the call.\n\nI look forward to hearing from you.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'seven_day_closure_warning',
                'name'        => '7 Day Closure Warning',
                'category_id' => $clientCatId,
                'subject'     => 'Important: File Closure Warning – Action Required',
                'description' => 'Final warning sent before file closure when the client has not responded to repeated contact attempts.',
                'body_html_template' => "<p>Dear {{ client.full_name }},</p>\n<p>Your Reference: {{ client.reference }}</p>\n<p>We are writing to you in relation to your application to The Scottish Redress Scheme.</p>\n<p>We have attempted to contact you on numerous occasions, but unfortunately we have been unsuccessful to date. In order to progress your application, we need to speak to you as a matter of urgency.</p>\n<p>If we do not hear from you within 7 days from the date of this correspondence we will have no option but to consider closing your file. We hope this will not be necessary as we wish to assist you if possible, but we cannot leave matters in abeyance indefinitely.</p>\n<p>We would be grateful if you can contact the office upon receipt of this correspondence on {{ solicitor.phone }} or via WhatsApp on {{ solicitor.whatsapp }}.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear {{ client.full_name }},\n\nYour Reference: {{ client.reference }}\n\nWe are writing to you in relation to your application to The Scottish Redress Scheme.\n\nWe have attempted to contact you on numerous occasions, but unfortunately we have been unsuccessful to date. In order to progress your application, we need to speak to you as a matter of urgency.\n\nIf we do not hear from you within 7 days from the date of this correspondence we will have no option but to consider closing your file. We hope this will not be necessary as we wish to assist you if possible, but we cannot leave matters in abeyance indefinitely.\n\nWe would be grateful if you can contact the office upon receipt of this correspondence on {{ solicitor.phone }} or via WhatsApp on {{ solicitor.whatsapp }}.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'requesting_poi',
                'name'        => 'Requesting Proof of ID',
                'category_id' => $clientCatId,
                'subject'     => 'Action Required: Proof of Identification Needed',
                'description' => 'Sent when photographic ID has not been received from the client.',
                'body_html_template' => "<p>Dear {{ client.full_name }},</p>\n<p>Your Reference: {{ client.reference }}</p>\n<p>To progress your DSAR/Scottish Redress Scheme application, please provide one form of acceptable Proof of Identification.</p>\n<p>We are required to verify your identity to ensure that personal information is disclosed securely and only to the correct individual.</p>\n<p>Please provide one form of photographic identification from the list below:</p>\n<p><strong>Accepted photographic identification:</strong></p>\n<ul>\n<li>Passport</li>\n<li>Driving licence</li>\n<li>National identity card</li>\n</ul>\n<p>Please ensure copies are clear and legible. Documents can be submitted as clear scans or photographs. You can provide these documents in response to this email, alternatively you can send them via WhatsApp on {{ solicitor.whatsapp }}.</p>\n<p>If you have any questions or require assistance, please do not hesitate to contact us.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear {{ client.full_name }},\n\nYour Reference: {{ client.reference }}\n\nTo progress your DSAR/Scottish Redress Scheme application, please provide one form of acceptable Proof of Identification.\n\nWe are required to verify your identity to ensure that personal information is disclosed securely and only to the correct individual.\n\nPlease provide one form of photographic identification from the list below:\n\nAccepted photographic identification:\n- Passport\n- Driving licence\n- National identity card\n\nPlease ensure copies are clear and legible. Documents can be submitted as clear scans or photographs. You can provide these documents in response to this email, alternatively you can send them via WhatsApp on {{ solicitor.whatsapp }}.\n\nIf you have any questions or require assistance, please do not hesitate to contact us.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'requesting_poa',
                'name'        => 'Requesting Proof of Address',
                'category_id' => $clientCatId,
                'subject'     => 'Action Required: Proof of Address Needed',
                'description' => 'Sent when proof of address has not been received from the client.',
                'body_html_template' => "<p>Dear {{ client.full_name }},</p>\n<p>Your Reference: {{ client.reference }}</p>\n<p>To progress your DSAR/Scottish Redress Scheme application, please provide one form of acceptable Proof of Address dated within the last 3 months.</p>\n<p><strong>Accepted documents include:</strong></p>\n<ul>\n<li>Utility bill (gas, electric, water, broadband)</li>\n<li>Bank or building society statement</li>\n<li>Council tax letter/bill</li>\n<li>HMRC or DWP correspondence</li>\n<li>Tenancy agreement (if current)</li>\n<li>Official government-issued correspondence</li>\n</ul>\n<p><strong>Please ensure the document clearly shows:</strong></p>\n<ul>\n<li>Your full name</li>\n<li>Your current address</li>\n<li>The issue date</li>\n</ul>\n<p>Documents can be submitted as clear scans or photographs. You can provide these documents in response to this email, alternatively you can send them via WhatsApp on {{ solicitor.whatsapp }}.</p>\n<p>If you have any questions or difficulties providing the above, please let us know.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear {{ client.full_name }},\n\nYour Reference: {{ client.reference }}\n\nTo progress your DSAR/Scottish Redress Scheme application, please provide one form of acceptable Proof of Address dated within the last 3 months.\n\nAccepted documents include:\n- Utility bill (gas, electric, water, broadband)\n- Bank or building society statement\n- Council tax letter/bill\n- HMRC or DWP correspondence\n- Tenancy agreement (if current)\n- Official government-issued correspondence\n\nPlease ensure the document clearly shows:\n- Your full name\n- Your current address\n- The issue date\n\nDocuments can be submitted as clear scans or photographs. You can provide these documents in response to this email, alternatively you can send them via WhatsApp on {{ solicitor.whatsapp }}.\n\nIf you have any questions or difficulties providing the above, please let us know.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'requesting_poi_and_poa',
                'name'        => 'Requesting POI & POA',
                'category_id' => $clientCatId,
                'subject'     => 'Action Required: Proof of ID and Address Needed',
                'description' => 'Sent when both photographic ID and proof of address are outstanding.',
                'body_html_template' => "<p>Dear {{ client.full_name }},</p>\n<p>Your Reference: {{ client.reference }}</p>\n<p>To progress your DSAR/Scottish Redress Scheme application, please provide one form of acceptable Proof of Identification and one form of acceptable Proof of Address dated within the last 3 months.</p>\n<p>We are required to verify your identity to ensure that personal information is disclosed securely and only to the correct individual.</p>\n<p><strong>Proof of Address</strong></p>\n<p>Please provide one form of acceptable proof of address:</p>\n<p><strong>Accepted documents include:</strong></p>\n<ul>\n<li>Utility bill (gas, electric, water, broadband)</li>\n<li>Bank or building society statement</li>\n<li>Council tax letter/bill</li>\n<li>HMRC or DWP correspondence</li>\n<li>Tenancy agreement (if current)</li>\n<li>Official government-issued correspondence</li>\n</ul>\n<p><strong>Please ensure the document clearly shows:</strong></p>\n<ul>\n<li>Your full name</li>\n<li>Your current address</li>\n<li>The issue date</li>\n</ul>\n<p><strong>Photographic Identification</strong></p>\n<p>Please provide one form of photographic identification from the list below:</p>\n<p><strong>Accepted photographic identification:</strong></p>\n<ul>\n<li>Passport</li>\n<li>Driving licence</li>\n<li>National identity card</li>\n</ul>\n<p>Please ensure copies are clear and legible. Documents can be submitted as clear scans or photographs. You can provide these documents in response to this email, alternatively you can send them via WhatsApp on {{ solicitor.whatsapp }}.</p>\n<p>If you have any questions or require assistance, please do not hesitate to contact us.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear {{ client.full_name }},\n\nYour Reference: {{ client.reference }}\n\nTo progress your DSAR/Scottish Redress Scheme application, please provide one form of acceptable Proof of Identification and one form of acceptable Proof of Address dated within the last 3 months.\n\nWe are required to verify your identity to ensure that personal information is disclosed securely and only to the correct individual.\n\nProof of Address\n\nPlease provide one form of acceptable proof of address:\n\nAccepted documents include:\n- Utility bill (gas, electric, water, broadband)\n- Bank or building society statement\n- Council tax letter/bill\n- HMRC or DWP correspondence\n- Tenancy agreement (if current)\n- Official government-issued correspondence\n\nPlease ensure the document clearly shows:\n- Your full name\n- Your current address\n- The issue date\n\nPhotographic Identification\n\nPlease provide one form of photographic identification from the list below:\n\nAccepted photographic identification:\n- Passport\n- Driving licence\n- National identity card\n\nPlease ensure copies are clear and legible. Documents can be submitted as clear scans or photographs. You can provide these documents in response to this email, alternatively you can send them via WhatsApp on {{ solicitor.whatsapp }}.\n\nIf you have any questions or require assistance, please do not hesitate to contact us.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'closure_no_contact',
                'name'        => 'Closure Letter – No Contact',
                'category_id' => $clientCatId,
                'subject'     => 'Notice of File Closure – {{ client.reference }}',
                'description' => 'Terminates the CFA and closes the file after prolonged non-contact from the client.',
                'body_html_template' => "<p>Dear {{ client.full_name }},</p>\n<p>Your Reference: {{ client.reference }}</p>\n<p>Despite our attempts, we have still not received any contact from you for a significant period. Unfortunately, as stated in our last correspondence we are not able to leave matters in abeyance indefinitely.</p>\n<p>After careful consideration, we regret to inform you that we are no longer able to continue acting on your behalf and hereby give notice that we are terminating the Conditional Fee Agreement dated {{ claim.cfa_date }} with immediate effect.</p>\n<p>If you wish to continue with your application, you should seek alternative legal advice as soon as possible. If you choose to instruct another solicitor, we will cooperate in the transfer of your file upon receipt of your written authority.</p>\n<p>We will retain your file and personal data in accordance with our regulatory and legal obligations, including the UK General Data Protection Regulation, The Data Protection Act 2018, and the Solicitors Regulation Authority requirements.</p>\n<p>After the applicable retention period expires, your file and personal data will be securely destroyed or anonymised in accordance with our data retention policy.</p>\n<p>We are sorry that we are unable to continue acting for you and wish you well moving forward.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear {{ client.full_name }},\n\nYour Reference: {{ client.reference }}\n\nDespite our attempts, we have still not received any contact from you for a significant period. Unfortunately, as stated in our last correspondence we are not able to leave matters in abeyance indefinitely.\n\nAfter careful consideration, we regret to inform you that we are no longer able to continue acting on your behalf and hereby give notice that we are terminating the Conditional Fee Agreement dated {{ claim.cfa_date }} with immediate effect.\n\nIf you wish to continue with your application, you should seek alternative legal advice as soon as possible. If you choose to instruct another solicitor, we will cooperate in the transfer of your file upon receipt of your written authority.\n\nWe will retain your file and personal data in accordance with our regulatory and legal obligations, including the UK General Data Protection Regulation, The Data Protection Act 2018, and the Solicitors Regulation Authority requirements.\n\nAfter the applicable retention period expires, your file and personal data will be securely destroyed or anonymised in accordance with our data retention policy.\n\nWe are sorry that we are unable to continue acting for you and wish you well moving forward.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'closure_not_acceptable_care',
                'name'        => 'Closure Letter – Not Acceptable Care Setting',
                'category_id' => $clientCatId,
                'subject'     => 'Outcome of Your Scottish Redress Scheme Application',
                'description' => 'Closes the file when the Scheme rejects the application due to an ineligible care setting.',
                'body_html_template' => "<p>Dear {{ client.full_name }},</p>\n<p>Your Reference: {{ client.reference }}</p>\n<p>We have submitted your application to The Scottish Redress Scheme and have now received a response. Unfortunately, the Scheme have not accepted your application as the care setting you were placed in is classed as a short-term residential or holiday/respite care, rather than the type of long-term care setting covered by the relevant legislation, namely The Redress for Survivors (Historical Child Abuse in Care) (Scotland) Act 2021.</p>\n<p>We understand this will be disappointing, but unfortunately, we cannot continue to act for you under the Conditional Fee Agreement and have no option but to cancel the agreement with immediate effect.</p>\n<p>If you wish to continue with your application, you should seek alternative legal advice as soon as possible or you are able to proceed independently. If you choose to instruct another solicitor, we will cooperate in the transfer of your file upon receipt of your written authority.</p>\n<p>We will retain your file and personal data in accordance with our regulatory and legal obligations, including the UK General Data Protection Regulation, The Data Protection Act 2018, and the Solicitors Regulation Authority requirements.</p>\n<p>After the applicable retention period expires, your file and personal data will be securely destroyed or anonymised in accordance with our data retention policy.</p>\n<p>We are sorry that we are unable to continue acting for you and wish you well moving forward.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear {{ client.full_name }},\n\nYour Reference: {{ client.reference }}\n\nWe have submitted your application to The Scottish Redress Scheme and have now received a response. Unfortunately, the Scheme have not accepted your application as the care setting you were placed in is classed as a short-term residential or holiday/respite care, rather than the type of long-term care setting covered by the relevant legislation, namely The Redress for Survivors (Historical Child Abuse in Care) (Scotland) Act 2021.\n\nWe understand this will be disappointing, but unfortunately, we cannot continue to act for you under the Conditional Fee Agreement and have no option but to cancel the agreement with immediate effect.\n\nIf you wish to continue with your application, you should seek alternative legal advice as soon as possible or you are able to proceed independently. If you choose to instruct another solicitor, we will cooperate in the transfer of your file upon receipt of your written authority.\n\nWe will retain your file and personal data in accordance with our regulatory and legal obligations, including the UK General Data Protection Regulation, The Data Protection Act 2018, and the Solicitors Regulation Authority requirements.\n\nAfter the applicable retention period expires, your file and personal data will be securely destroyed or anonymised in accordance with our data retention policy.\n\nWe are sorry that we are unable to continue acting for you and wish you well moving forward.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            // ---------------------------------------------------------------
            // Scheme Correspondence
            // ---------------------------------------------------------------

            [
                'key'         => 'scheme_enc_application',
                'name'        => 'Enc Application',
                'category_id' => $schemeCatId,
                'subject'     => 'Our Ref: {{ client.reference }} – Application Submission',
                'description' => 'Formal letter to the Scheme enclosing the completed application forms and signed CFA.',
                'body_html_template' => "<p>Dear Sir/Madam,</p>\n<p>Our Reference: {{ client.reference }}<br>Our Client: {{ client.full_name }}</p>\n<p>Please find enclosed herewith:</p>\n<ul>\n<li>Part 1 Redress Application Form</li>\n<li>Part 2 Redress Application Form</li>\n<li>Signed Conditional Fee Agreement</li>\n<li>Signed Letter of Authority</li>\n</ul>\n<p>We would be grateful if you are able to acknowledge receipt of this application, and we look forward to receiving the resulting APP number in due course.</p>\n<p>Please ensure all correspondence is directed to {{ solicitor.email }} and we would be grateful if you could quote the aforementioned reference number on all correspondence.</p>\n<p>Should you require any further information, please do not hesitate to contact us.</p>\n<p>Yours faithfully,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear Sir/Madam,\n\nOur Reference: {{ client.reference }}\nOur Client: {{ client.full_name }}\n\nPlease find enclosed herewith:\n- Part 1 Redress Application Form\n- Part 2 Redress Application Form\n- Signed Conditional Fee Agreement\n- Signed Letter of Authority\n\nWe would be grateful if you are able to acknowledge receipt of this application, and we look forward to receiving the resulting APP number in due course.\n\nPlease ensure all correspondence is directed to {{ solicitor.email }} and we would be grateful if you could quote the aforementioned reference number on all correspondence.\n\nShould you require any further information, please do not hesitate to contact us.\n\nYours faithfully,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'scheme_chasing_response',
                'name'        => 'Chasing Application Response',
                'category_id' => $schemeCatId,
                'subject'     => 'Our Ref: {{ client.reference }} – Chasing APP Number',
                'description' => 'Follow-up to the Scheme when the APP number has not been received within expected timescales.',
                'body_html_template' => "<p>Dear Sir/Madam,</p>\n<p>Our Reference: {{ client.reference }}<br>Our Client: {{ client.full_name }}</p>\n<p>We write further to our email dated {{ claim.app_submission_date }} enclosing the following documents:</p>\n<ul>\n<li>Part 1 Redress Application Form</li>\n<li>Part 2 Redress Application Form</li>\n<li>Signed Conditional Fee Agreement</li>\n<li>Signed Letter of Authority</li>\n</ul>\n<p>We note we are still yet to receive the resulting APP number, and would be grateful if you can provide an update as to estimated timescales in response. Alternatively, if you require any further information in order to progress the application, please do not hesitate to contact the office.</p>\n<p>We look forward to hearing from you and thank you in anticipation of your assistance.</p>\n<p>Kind regards,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear Sir/Madam,\n\nOur Reference: {{ client.reference }}\nOur Client: {{ client.full_name }}\n\nWe write further to our email dated {{ claim.app_submission_date }} enclosing the following documents:\n- Part 1 Redress Application Form\n- Part 2 Redress Application Form\n- Signed Conditional Fee Agreement\n- Signed Letter of Authority\n\nWe note we are still yet to receive the resulting APP number, and would be grateful if you can provide an update as to estimated timescales in response. Alternatively, if you require any further information in order to progress the application, please do not hesitate to contact the office.\n\nWe look forward to hearing from you and thank you in anticipation of your assistance.\n\nKind regards,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

            [
                'key'         => 'scheme_ackn_app_number',
                'name'        => 'Ackn APP Number',
                'category_id' => $schemeCatId,
                'subject'     => 'Our Ref: {{ client.reference }} – Acknowledgement of APP Number',
                'description' => 'Sent to the Scheme acknowledging receipt of the APP number and confirming next steps.',
                'body_html_template' => "<p>Dear Sir/Madam,</p>\n<p>Our Reference: {{ client.reference }}<br>Our Client: {{ client.full_name }}<br>APP Number: {{ claim.app_number }}</p>\n<p>We write in relation to the aforementioned reference and APP Number. We acknowledge receipt of your recent correspondence.</p>\n<p>We are now in the process of obtaining all relevant documentation in support of our client's application and will provide this, alongside a detailed witness statement, as soon as practicably possible.</p>\n<p>If you require anything in the interim, please do not hesitate to contact the office on {{ solicitor.phone }} or via email at {{ solicitor.email }}.</p>\n<p>Yours faithfully,</p>\n<p>{{ claim.handler_name }}<br>{{ solicitor.name }}</p>",
                'body_text_template' => "Dear Sir/Madam,\n\nOur Reference: {{ client.reference }}\nOur Client: {{ client.full_name }}\nAPP Number: {{ claim.app_number }}\n\nWe write in relation to the aforementioned reference and APP Number. We acknowledge receipt of your recent correspondence.\n\nWe are now in the process of obtaining all relevant documentation in support of our client's application and will provide this, alongside a detailed witness statement, as soon as practicably possible.\n\nIf you require anything in the interim, please do not hesitate to contact the office on {{ solicitor.phone }} or via email at {{ solicitor.email }}.\n\nYours faithfully,\n{{ claim.handler_name }}\n{{ solicitor.name }}",
            ],

        ];
    }
}
