Fixes the audit markdown, question, description I'll add some audit question seeder

This commit is contained in:
2026-02-24 11:47:10 +01:00
parent e98ca8f00c
commit e44ef5fddc
4 changed files with 448 additions and 34 deletions

View File

@@ -0,0 +1,413 @@
<?php
declare(strict_types=1);
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
/**
* Seeds question groups and questions for the Audit category.
* Assumes the Audit category already exists (created by CategorySeeder).
*/
final class AuditQuestionSeeder extends Seeder
{
/**
* Seed all Audit question groups and their questions.
*/
public function run(): void
{
$categoryId = DB::table('categories')->where('name', 'Audit')->value('id');
if ($categoryId === null) {
$categoryId = DB::table('categories')->insertGetId([
'name' => 'Audit',
'sort_order' => 1,
'created_at' => now(),
'updated_at' => now(),
]);
}
$this->seedOpportunityDetails($categoryId);
$this->seedClientBackgroundAndHistory($categoryId);
$this->seedFinancialInformation($categoryId);
$this->seedRegulatoryCompliance($categoryId);
$this->seedRiskAssessment($categoryId);
$this->seedResourceAllocation($categoryId);
$this->seedReportngRequirements($categoryId);
}
/**
* Seed Group 1: Opportunity Details (not scored, no answer options).
*/
private function seedOpportunityDetails(int $categoryId): void
{
$groupId = DB::table('question_groups')->insertGetId([
'category_id' => $categoryId,
'name' => 'Opportunity Details',
'sort_order' => 1,
'description' => null,
'scoring_instructions' => null,
'created_at' => now(),
'updated_at' => now(),
]);
DB::table('questions')->insert([
[
'question_group_id' => $groupId,
'text' => 'What sort of audit opportunity is it?',
'has_yes' => false,
'has_no' => false,
'has_na' => false,
'details' => 'required',
'sort_order' => 1,
'is_scored' => false,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'How many locations involved in this opportunity?',
'has_yes' => false,
'has_no' => false,
'has_na' => false,
'details' => 'required',
'sort_order' => 2,
'is_scored' => false,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'List any locations included in this opportunity where we do not have a Baker Tilly firm.',
'has_yes' => false,
'has_no' => false,
'has_na' => false,
'details' => 'optional',
'sort_order' => 3,
'is_scored' => false,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'Where is the client HQ?',
'has_yes' => false,
'has_no' => false,
'has_na' => false,
'details' => 'required',
'sort_order' => 4,
'is_scored' => false,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'Who is the competition?',
'has_yes' => false,
'has_no' => false,
'has_na' => false,
'details' => 'required',
'sort_order' => 5,
'is_scored' => false,
'created_at' => now(),
'updated_at' => now(),
],
]);
}
/**
* Seed Group 2: Client Background and History (scored, Yes/No options).
*/
private function seedClientBackgroundAndHistory(int $categoryId): void
{
$groupId = DB::table('question_groups')->insertGetId([
'category_id' => $categoryId,
'name' => 'Client Background and History',
'sort_order' => 2,
'description' => null,
'scoring_instructions' => 'If you answer yes, you will score 1 point, if you answer no you will score 0 points',
'created_at' => now(),
'updated_at' => now(),
]);
DB::table('questions')->insert([
[
'question_group_id' => $groupId,
'text' => 'What is the client\'s business and industry?',
'has_yes' => false,
'has_no' => false,
'has_na' => false,
'details' => 'required',
'sort_order' => 1,
'is_scored' => false,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'There have been no significant changes in the client\'s business operations or structure recently?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => 'req_on_no',
'sort_order' => 2,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'Does the sector and/or client come with a reputation which we are comfortable that Baker Tilly is associated with?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => null,
'sort_order' => 3,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'Are there any previous audit reports or findings that need to be considered?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => 'req_on_yes',
'sort_order' => 4,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
]);
}
/**
* Seed Group 3: Financial Information (scored, Yes/No options).
*/
private function seedFinancialInformation(int $categoryId): void
{
$groupId = DB::table('question_groups')->insertGetId([
'category_id' => $categoryId,
'name' => 'Financial Information',
'sort_order' => 3,
'description' => null,
'scoring_instructions' => 'If you answer yes, you will score 1 point, if you answer no you will score 0 points',
'created_at' => now(),
'updated_at' => now(),
]);
DB::table('questions')->insert([
[
'question_group_id' => $groupId,
'text' => 'Has the client provided financial statements or balance sheet?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => 'optional',
'sort_order' => 1,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'Are the client\'s financial statements complete and accurate?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => 'req_on_yes',
'sort_order' => 2,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
]);
}
/**
* Seed Group 4: Regulatory Compliance (scored, Yes/No options).
*/
private function seedRegulatoryCompliance(int $categoryId): void
{
$groupId = DB::table('question_groups')->insertGetId([
'category_id' => $categoryId,
'name' => 'Regulatory Compliance',
'sort_order' => 4,
'description' => null,
'scoring_instructions' => 'If you answer yes, you will score 1 point, if you answer no you will score 0 points',
'created_at' => now(),
'updated_at' => now(),
]);
DB::table('questions')->insert([
[
'question_group_id' => $groupId,
'text' => 'Does the client comply with all relevant regulatory requirements and standards?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => 'req_on_no',
'sort_order' => 1,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'The client has no pending legal or regulatory issues that you know of that could impact the audit?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => 'req_on_no',
'sort_order' => 2,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'The client has been subject to no regulatory investigations or penalties?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => 'req_on_no',
'sort_order' => 3,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
]);
}
/**
* Seed Group 5: Risk Assessment (scored, Yes/No options).
*/
private function seedRiskAssessment(int $categoryId): void
{
$groupId = DB::table('question_groups')->insertGetId([
'category_id' => $categoryId,
'name' => 'Risk Assessment',
'sort_order' => 5,
'description' => null,
'scoring_instructions' => 'If you answer yes, you will score 1 point, if you answer no you will score 0 points',
'created_at' => now(),
'updated_at' => now(),
]);
DB::table('questions')->insert([
[
'question_group_id' => $groupId,
'text' => 'There are no key risks associated with the audit?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => 'req_on_no',
'sort_order' => 1,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'Have you completed a conflict check?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => 'required',
'sort_order' => 2,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'Are you and other BTI member firms independent withi the meaning of local and IESBA rules?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => 'req_on_no',
'sort_order' => 3,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
]);
}
/**
* Seed Group 6: Resource Allocation (scored, mixed Q1 has no answer options and is not scored).
*/
private function seedResourceAllocation(int $categoryId): void
{
$groupId = DB::table('question_groups')->insertGetId([
'category_id' => $categoryId,
'name' => 'Resource Allocation',
'sort_order' => 6,
'description' => null,
'scoring_instructions' => 'If you answer yes, you will score 1 point, if you answer no you will score 0 points',
'created_at' => now(),
'updated_at' => now(),
]);
DB::table('questions')->insert([
[
'question_group_id' => $groupId,
'text' => 'What resources are required for the audit (personnel, time, budget)?',
'has_yes' => false,
'has_no' => false,
'has_na' => false,
'details' => 'optional',
'sort_order' => 1,
'is_scored' => false,
'created_at' => now(),
'updated_at' => now(),
],
[
'question_group_id' => $groupId,
'text' => 'Does your firm have the scale, seniority and degree of expertise available at the riht time to report in accordance with the client\'s schedule?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => 'optional',
'sort_order' => 2,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
]);
}
/**
* Seed Group 7: Reportng Requirements (scored, Yes/No options group name preserves Excel typo).
*/
private function seedReportngRequirements(int $categoryId): void
{
$groupId = DB::table('question_groups')->insertGetId([
'category_id' => $categoryId,
'name' => 'Reportng Requirements',
'sort_order' => 7,
'description' => null,
'scoring_instructions' => 'If you answer yes, you will score 1 point, if you answer no you will score 0 points',
'created_at' => now(),
'updated_at' => now(),
]);
DB::table('questions')->insert([
[
'question_group_id' => $groupId,
'text' => 'Do we understand reporting rules, regulatory environment and stakeholder expectations?',
'has_yes' => true,
'has_no' => true,
'has_na' => false,
'details' => 'optional',
'sort_order' => 1,
'is_scored' => true,
'created_at' => now(),
'updated_at' => now(),
],
]);
}
}

View File

@@ -18,8 +18,7 @@ public function run(): void
{
$this->call([
JonathanSeeder::class,
CategorySeeder::class,
QuestionSeeder::class,
AuditQuestionSeeder::class,
]);
}
}

View File

@@ -6,9 +6,9 @@ ### Score Legend
| Color | Points | Decision |
|-------|--------|----------|
| 🟢 Green | 10+ Points | GO |
| 🟡 Yellow | 5-9 Points | Speak to SL or SSL leadership |
| 🔴 Red | 1-5 Points | NO GO |
| Green | 10+ Points | GO |
| Yellow | 5-9 Points | Speak to SL or SSL leadership |
| Red | 1-5 Points | NO GO |
---
@@ -25,11 +25,13 @@ ### Basic Information
## 1. Opportunity Details
> *Not scored*
| # | Question | Details |
|---|----------|---------|
| 8 | What sort of audit opportunity is it? | [insert details] |
| 9 | How many locations involved in this opportunity? | [insert details] |
| 10 | List any locations included in this opportunity where we do not have a Baker Tilly firm. | [if no insert details] |
| 10 | List any locations included in this opportunity where we do not have a Baker Tilly firm. | [optional] |
| 11 | Where is the client HQ? | [insert details] |
| 12 | Who is the competition? | [insert details] |
@@ -39,12 +41,12 @@ ## 1. Client Background and History
> *If you answer yes, you will score 1 point, if you answer no you will score 0 points*
| # | Question | Yes / No / Not applicable | Insert details |
|---|----------|---------------------------|----------------|
| 14 | What is the client's business and industry? | | [insert details] |
| 15 | There have been no significant changes in the client's business operations or structure recently? | - | [if no insert details] |
| 16 | Does the sector and/or client come with a reputation which we are comfortable that Baker Tilly is associated with? | - | |
| 17 | Are there any previous audit reports or findings that need to be considered? | | [if yes insert details] |
| # | Question | Answer Options | Details |
|---|----------|----------------|---------|
| 14 | What is the client's business and industry? | | [insert details] |
| 15 | There have been no significant changes in the client's business operations or structure recently? | Yes / No | [if no insert details] |
| 16 | Does the sector and/or client come with a reputation which we are comfortable that Baker Tilly is associated with? | Yes / No | — |
| 17 | Are there any previous audit reports or findings that need to be considered? | Yes / No | [if yes insert details] |
---
@@ -52,10 +54,10 @@ ## 2. Financial Information
> *If you answer yes, you will score 1 point, if you answer no you will score 0 points*
| # | Question | Yes / No / Not applicable | Insert details |
|---|----------|---------------------------|----------------|
| 19 | Has the client provided financial statements or balance sheet? | - | [insert details if needed] |
| 20 | Are the client's financial statements complete and accurate? | - | [insert details if needed] |
| # | Question | Answer Options | Details |
|---|----------|----------------|---------|
| 19 | Has the client provided financial statements or balance sheet? | Yes / No | [insert details if needed] |
| 20 | Are the client's financial statements complete and accurate? | Yes / No | [if yes insert details] |
---
@@ -63,11 +65,11 @@ ## 3. Regulatory Compliance
> *If you answer yes, you will score 1 point, if you answer no you will score 0 points*
| # | Question | Yes / No / Not applicable | Insert details |
|---|----------|---------------------------|----------------|
| 22 | Does the client comply with all relevant regulatory requirements and standards? | - | [if no insert details] |
| 23 | The client has no pending legal or regulatory issues that you know of that could impact the audit? | | [if no insert details] |
| 24 | The client has been subject to no regulatory investigations or penalties? | - | [if no insert details] |
| # | Question | Answer Options | Details |
|---|----------|----------------|---------|
| 22 | Does the client comply with all relevant regulatory requirements and standards? | Yes / No | [if no insert details] |
| 23 | The client has no pending legal or regulatory issues that you know of that could impact the audit? | Yes / No | [if no insert details] |
| 24 | The client has been subject to no regulatory investigations or penalties? | Yes / No | [if no insert details] |
---
@@ -75,11 +77,11 @@ ## 4. Risk Assessment
> *If you answer yes, you will score 1 point, if you answer no you will score 0 points*
| # | Question | Yes / No / Not applicable | Insert details |
|---|----------|---------------------------|----------------|
| 26 | There are no key risks associated with the audit? | - | [if no insert details] |
| 27 | Have you completed a conflict check? | - | [insert details] |
| 28 | Are you and other BTI member firms independent with the meaning of local and IESBA rules? | - | [if no insert details] |
| # | Question | Answer Options | Details |
|---|----------|----------------|---------|
| 26 | There are no key risks associated with the audit? | Yes / No | [if no insert details] |
| 27 | Have you completed a conflict check? | Yes / No | [insert details] |
| 28 | Are you and other BTI member firms independent withi the meaning of local and IESBA rules? | Yes / No | [if no insert details] |
---
@@ -87,20 +89,20 @@ ## 5. Resource Allocation
> *If you answer yes, you will score 1 point, if you answer no you will score 0 points*
| # | Question | Yes / No / Not applicable | Insert details |
|---|----------|---------------------------|----------------|
| 30 | What resources are required for the audit (personnel, time, budget)? | - | [insert details if available] |
| 31 | Does your firm have the scale, seniority and degree of expertise available at the right time to report in accordance with the client's schedule? | | [insert details if needed] |
| # | Question | Answer Options | Details |
|---|----------|----------------|---------|
| 30 | What resources are required for the audit (personnel, time, budget)? | | [insert details if available] |
| 31 | Does your firm have the scale, seniority and degree of expertise available at the riht time to report in accordance with the client's schedule? | Yes / No | [insert details if needed] |
---
## 6. Reporting Requirements
## 6. Reportng Requirements
> *If you answer yes, you will score 1 point, if you answer no you will score 0 points*
| # | Question | Yes / No / Not applicable | Insert details |
|---|----------|---------------------------|----------------|
| 33 | Do we understand reporting rules, regulatory environment and stakeholder expectations? | - | [insert details if needed] |
| # | Question | Answer Options | Details |
|---|----------|----------------|---------|
| 33 | Do we understand reporting rules, regulatory environment and stakeholder expectations? | Yes / No | [insert details if needed] |
---