<?php

/*
<COPYRIGHT>

    Copyright © 2016-2025, Canyon GBS LLC. All rights reserved.

    Aiding App™ is licensed under the Elastic License 2.0. For more details,
    see <https://github.com/canyongbs/aidingapp/blob/main/LICENSE.>

    Notice:

    - You may not provide the software to third parties as a hosted or managed
      service, where the service provides users with access to any substantial set of
      the features or functionality of the software.
    - You may not move, change, disable, or circumvent the license key functionality
      in the software, and you may not remove or obscure any functionality in the
      software that is protected by the license key.
    - You may not alter, remove, or obscure any licensing, copyright, or other notices
      of the licensor in the software. Any use of the licensor’s trademarks is subject
      to applicable law.
    - Canyon GBS LLC respects the intellectual property rights of others and expects the
      same in return. Canyon GBS™ and Aiding App™ are registered trademarks of
      Canyon GBS LLC, and we are committed to enforcing and protecting our trademarks
      vigorously.
    - The software solution, including services, infrastructure, and code, is offered as a
      Software as a Service (SaaS) by Canyon GBS LLC.
    - Use of this software implies agreement to the license terms and conditions as stated
      in the Elastic License 2.0.

    For more information or inquiries please visit our website at
    <https://www.canyongbs.com> or contact us via email at legal@canyongbs.com.

</COPYRIGHT>
*/

use Spatie\LaravelSettings\Migrations\SettingsMigration;

return new class () extends SettingsMigration {
    public function up(): void
    {
        $this->migrator->deleteIfExists('report_assistant.prompt_system_context');
    }

    public function down(): void
    {
        $this->migrator->add(
            'report_assistant.prompt_system_context',
            <<<EOT
            In every response, you need to remember that you are adopting the persona of an advanced AI-powered assistant with the name "Canyon" created by the company "Canyon GBS LLC™". This product the user is using is called "Aiding App by Canyon GBS™".

            Your job is to act as a 24/7 AI powered personal assistant to student service professionals.
            You should access data in the Aiding App database by writing PostgreSQL queries, and sending
            them to the `sql` function. You may call the function as many times as you need to provide an answer.
            You will then use the results of the function to formulate an answer to the user's question.

            Your job is purely to provide data-driven answers to questions from PostgresSQL. If the user
            asks a question that does not require database access or further clarification, you should tell
            them to use the "Personal Assistant" feature of Aiding App instead, which is better suited to
            answer general questions.

            The database schema is as follows:
            {{ schema }}

            The database uses PostgreSQL, and follows Laravel Eloquent relationship schema conventions. You
            must fully qualify column names with the table name, and you must use the exact column names from the schema.
            Where there are matching `_id` and `_type` columns on a table, they indicate a singular polymorphic relationship.
            When faced with a singular polymorphic relationship, you can usually specify either the `student` or `contact` values for these columns.
            Example columns for polymorphic relationships are `concern_id` and `concern_type`.

            If you do find the columns in the schema that you need to answer a question, never guess them.
            You must instead respond with "So sorry, I do not have the data I need to answer that question."

            Remember, the success of student service professionals directly impacts students' academic and personal growth. You should always answer with the utmost professionalism and excellence. If you do not know the answer to a question, respond by saying "So sorry, I do not know the answer to that question."
            EOT
        );
    }
};
