diff --git a/config/voyager-crm.php b/config/voyager-crm.php index 5022809..4faee10 100644 --- a/config/voyager-crm.php +++ b/config/voyager-crm.php @@ -4,12 +4,12 @@ /* * The config_key for voyager-crm package. */ - 'config_key' => env('VOYAGER_CRM_CONFIG_KEY', 'joy-voyager-crm'), + 'config_key' => env('VOYAGER_CRM_CONFIG_KEY', 'joy-voyager-crm'), /* * The route_prefix for voyager-crm package. */ - 'route_prefix' => env('VOYAGER_CRM_ROUTE_PREFIX', 'joy-voyager-crm'), + 'route_prefix' => env('VOYAGER_CRM_ROUTE_PREFIX', 'joy-voyager-crm'), /* |-------------------------------------------------------------------------- @@ -20,48 +20,7 @@ | */ - 'controllers' => [ + 'controllers' => [ 'namespace' => 'Joy\\VoyagerCrm\\Http\\Controllers', ], - - 'default_status' => 'Active', - 'statuses' => [ - 'Active' => 'Active', - 'Inactive' => 'Inactive', - ], - - 'currencies' => [ - 'default_status' => 'Active', - 'statuses' => [ - 'Active' => 'Active', - 'Inactive' => 'Inactive', - ] - ], - - 'surveys' => [ - 'default_status' => 'Published', - 'statuses' => [ - 'Published' => 'Published', - 'Draft' => 'Draft', - ] - ], - - 'bugs' => [ - 'default_type' => 'Type1', - 'types' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', - ], - 'default_status' => 'Active', - 'statuses' => [ - 'Active' => 'Active', - 'Inactive' => 'Inactive', - ], - 'default_priority' => 'Low', - 'priorities' => [ - 'Low' => 'Low', - 'Medium' => 'Medium', - 'High' => 'High', - ] - ] ]; diff --git a/database/factories/AccountFactory.php b/database/factories/AccountFactory.php index 3850ed6..242f924 100644 --- a/database/factories/AccountFactory.php +++ b/database/factories/AccountFactory.php @@ -22,13 +22,54 @@ class AccountFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name(), - 'description' => $this->faker->text(500), - 'account_type' => $this->faker->randomElement([ - 'Type1', - 'Type2', + 'name' => $this->faker->name(), + 'description' => $this->faker->text(500), + 'account_type' => $this->faker->randomKey([ + '' => 'None', + 'Analyst' => 'Analyst', + 'Competitor' => 'Competitor', + 'Customer' => 'Customer', + 'Integrator' => 'Integrator', + 'Investor' => 'Investor', + 'Partner' => 'Partner', + 'Press' => 'Press', + 'Prospect' => 'Prospect', + 'Reseller' => 'Reseller', + 'Other' => 'Other', + ]), + 'industry' => $this->faker->randomKey([ + '' => 'None', + 'Apparel' => 'Apparel', + 'Banking' => 'Banking', + 'Biotechnology' => 'Biotechnology', + 'Chemicals' => 'Chemicals', + 'Communications' => 'Communications', + 'Construction' => 'Construction', + 'Consulting' => 'Consulting', + 'Education' => 'Education', + 'Electronics' => 'Electronics', + 'Energy' => 'Energy', + 'Engineering' => 'Engineering', + 'Entertainment' => 'Entertainment', + 'Environmental' => 'Environmental', + 'Finance' => 'Finance', + 'Government' => 'Government', + 'Healthcare' => 'Healthcare', + 'Hospitality' => 'Hospitality', + 'Insurance' => 'Insurance', + 'Machinery' => 'Machinery', + 'Manufacturing' => 'Manufacturing', + 'Media' => 'Media', + 'Not For Profit' => 'Not For Profit', + 'Recreation' => 'Recreation', + 'Retail' => 'Retail', + 'Shipping' => 'Shipping', + 'Technology' => 'Technology', + 'Telecommunications' => 'Telecommunications', + 'Transportation' => 'Transportation', + 'Utilities' => 'Utilities', + 'Other' => 'Other', ]), - 'industry' => $this->faker->word(10), 'annual_revenue' => $this->faker->word(10), 'phone_fax' => $this->faker->phoneNumber(), 'billing_address_street' => $this->faker->streetName(), diff --git a/database/factories/AlertFactory.php b/database/factories/AlertFactory.php index df5c42a..ef865fa 100644 --- a/database/factories/AlertFactory.php +++ b/database/factories/AlertFactory.php @@ -29,10 +29,7 @@ public function definition() 'accounts', 'contacts', ]), - 'type' => $this->faker->randomElement([ - 'Type1', - 'Type2', - ]), + 'type' => $this->faker->word(), 'url_redirect' => $this->faker->url(), // 'reminder_id' => null, 'created_at' => $this->faker->dateTime(), diff --git a/database/factories/AmProjecttemplateFactory.php b/database/factories/AmProjecttemplateFactory.php index c059a4f..d1fc33d 100644 --- a/database/factories/AmProjecttemplateFactory.php +++ b/database/factories/AmProjecttemplateFactory.php @@ -25,14 +25,16 @@ public function definition() 'name' => $this->faker->name(), 'description' => $this->faker->text(500), 'priority' => $this->faker->randomElement([ - 'Low', - 'Medium', - 'High', + 'High' => 'High', + 'Medium' => 'Medium', + 'Low' => 'Low', ]), - 'status' => $this->faker->randomElement([ - 'Draft', - 'Active', - 'Inactive', + 'status' => $this->faker->randomKey([ + 'Draft' => 'Draft', + 'In Review' => 'In Review', + 'Underway' => 'Underway', + 'On_Hold' => 'On Hold', + 'Completed' => 'Completed', ]), 'override_business_hours' => $this->faker->boolean(), 'created_at' => $this->faker->dateTime(), diff --git a/database/factories/AmTasktemplateFactory.php b/database/factories/AmTasktemplateFactory.php index 3a268b0..d51873f 100644 --- a/database/factories/AmTasktemplateFactory.php +++ b/database/factories/AmTasktemplateFactory.php @@ -25,25 +25,28 @@ public function definition() 'name' => $this->faker->name(), 'description' => $this->faker->text(500), 'priority' => $this->faker->randomElement([ - 'Low', - 'Medium', - 'High', + 'High' => 'High', + 'Medium' => 'Medium', + 'Low' => 'Low', ]), 'percent_complete' => $this->faker->numberBetween(1, 100), 'predecessors' => $this->faker->randomNumber(), 'milestone_flag' => $this->faker->boolean(), - 'relationship_type' => $this->faker->randomElement([ - 'FS', + 'relationship_type' => $this->faker->randomKey([ + 'FS' => 'Finish to Start', + 'SS' => 'Start to Start', ]), 'task_number' => $this->faker->randomNumber(6), 'order_number' => $this->faker->randomNumber(6), 'estimated_effort' => $this->faker->numberBetween(1, 10), 'utilization' => $this->faker->text(10), 'duration' => $this->faker->numberBetween(1, 100), - 'status' => $this->faker->randomElement([ - 'Not Started', - 'Active', - 'Inactive', + 'status' => $this->faker->randomKey([ + 'Not Started' => 'Not Started', + 'In Progress' => 'In Progress', + 'Completed' => 'Completed', + 'Pending Input' => 'Pending Input', + 'Deferred' => 'Deferred', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/AodIndexeventFactory.php b/database/factories/AodIndexeventFactory.php index 355e137..f6a4ec5 100644 --- a/database/factories/AodIndexeventFactory.php +++ b/database/factories/AodIndexeventFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\AodIndexevent; +use TCG\Voyager\Facades\Voyager; class AodIndexeventFactory extends Factory { @@ -21,13 +22,35 @@ class AodIndexeventFactory extends Factory */ public function definition() { + $recordType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ]); + return [ 'name' => $this->faker->name(), 'description' => $this->faker->text(500), 'error' => $this->faker->text(50), 'success' => $this->faker->boolean(), - 'record_id' => null, - 'record_module' => $this->faker->word(), + 'record_module' => $recordType, + 'record_id' => optional($recordType)->factory(), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), diff --git a/database/factories/AorChartFactory.php b/database/factories/AorChartFactory.php index 9fe8a20..8477398 100644 --- a/database/factories/AorChartFactory.php +++ b/database/factories/AorChartFactory.php @@ -25,9 +25,13 @@ public function definition() 'name' => $this->faker->name(), 'description' => $this->faker->text(500), 'aor_report_id' => null, - 'type' => $this->faker->randomElement([ - 'Type1', - 'Type2', + 'type' => $this->faker->randomKey([ + 'bar' => 'Bar chart', + 'line' => 'Line chart', + 'pie' => 'Pie chart', + 'radar' => 'Radar chart', + 'stacked_bar' => 'Stacked bar', + 'grouped_bar' => 'Grouped bar', ]), 'x_field' => $this->faker->numberBetween(1, 100), 'y_field' => $this->faker->numberBetween(1, 100), diff --git a/database/factories/AorConditionFactory.php b/database/factories/AorConditionFactory.php index 93a3a33..53f5c60 100644 --- a/database/factories/AorConditionFactory.php +++ b/database/factories/AorConditionFactory.php @@ -26,27 +26,35 @@ public function definition() 'description' => $this->faker->text(500), 'aor_report_id' => null, 'condition_order' => $this->faker->numberBetween(1, 100), - 'logic_op' => null, + 'logic_op' => $this->faker->randomKey([ + 'And' => 'And', + 'OR' => 'OR', + ]), 'parenthesis' => null, 'module_path' => null, - 'field' => $this->faker->word(), + 'field' => $this->faker->randomKey([ + 'RegularUser' => 'Regular User', + 'Administrator' => 'Administrator', + ]), 'operator' => $this->faker->randomKey([ - 'equal_to' => 'equal_to', - 'not_equal_to' => 'not_equal_to', - 'contains' => 'contains', - 'not_contains' => 'not_contains', - 'starts_with' => 'starts_with', - 'not_starts_with' => 'not_starts_with', - 'ends_with' => 'ends_with', - 'not_ends_with' => 'not_ends_with', - 'is_null' => 'is_null', - 'not_null' => 'not_null', - 'in' => 'in', - 'not_in' => 'not_in', + 'Equal_To' => 'Equal To', + 'Not_Equal_To' => 'Not Equal To', + 'Greater_Than' => 'Greater Than', + 'Less_Than' => 'Less Than', + 'Greater_Than_or_Equal_To' => 'Greater Than or Equal To', + 'Less_Than_or_Equal_To' => 'Less Than or Equal To', + 'Contains' => 'Contains', + 'Not_Contains' => 'Not Contains', + 'Starts_With' => 'Starts With', + 'Ends_With' => 'Ends With', ]), 'value_type' => $this->faker->randomKey([ - 'value' => 'value', - 'field' => 'field', + 'Value' => 'Value', + 'Field' => 'Field', + 'Date' => 'Date', + 'Multi' => 'One of', + 'Period' => 'Period', + 'CurrentUserID' => 'Current User', ]), 'value' => $this->faker->text(50), 'parameter' => $this->faker->boolean(), diff --git a/database/factories/AosContractFactory.php b/database/factories/AosContractFactory.php index ef3c974..928efef 100644 --- a/database/factories/AosContractFactory.php +++ b/database/factories/AosContractFactory.php @@ -36,8 +36,7 @@ public function definition() 'company_signed_date' => $this->faker->dateTimeBetween('-1month', 'now')->format('Y-m-d'), 'renewal_reminder_date' => $this->faker->dateTimeBetween('-1month', 'now'), 'contract_type' => $this->faker->randomKey([ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'Type' => 'Type', ]), 'total_contract_value' => $this->faker->randomFloat(2), 'total_contract_value_usdollar' => $this->faker->randomFloat(2), @@ -57,8 +56,9 @@ public function definition() 'total_amount' => $this->faker->randomFloat(2), 'total_amount_usdollar' => $this->faker->randomFloat(2), 'status' => $this->faker->randomKey([ - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'Not Started' => 'Not Started', + 'In Progress' => 'In Progress', + 'Signed' => 'Signed', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/AosInvoiceFactory.php b/database/factories/AosInvoiceFactory.php index 1253afb..9758253 100644 --- a/database/factories/AosInvoiceFactory.php +++ b/database/factories/AosInvoiceFactory.php @@ -61,8 +61,10 @@ public function definition() 'due_date' => $this->faker->dateTimeBetween('-1month', 'now')->format('Y-m-d'), 'template_ddown_c' => null, 'status' => $this->faker->randomKey([ - 'Active' => 'Active', - 'Inactive' => 'Inactive', + '' => 'None', + 'Paid' => 'Paid', + 'Unpaid' => 'Unpaid', + 'Cancelled' => 'Cancelled', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/AosLineItemGroupFactory.php b/database/factories/AosLineItemGroupFactory.php index 32894b2..832eee7 100644 --- a/database/factories/AosLineItemGroupFactory.php +++ b/database/factories/AosLineItemGroupFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\AosLineItemGroup; +use TCG\Voyager\Facades\Voyager; class AosLineItemGroupFactory extends Factory { @@ -21,6 +22,13 @@ class AosLineItemGroupFactory extends Factory */ public function definition() { + $parentType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosContract') => 'Contract', + ]); + return [ 'name' => $this->faker->name(), 'description' => $this->faker->text(500), @@ -36,8 +44,8 @@ public function definition() 'subtotal_tax_amount_usdollar' => $this->faker->randomFloat(6), 'total_amount' => $this->faker->randomFloat(6), 'total_amount_usdollar' => $this->faker->randomFloat(6), - 'parent_type' => null, - 'parent_id' => null, + 'parent_type' => $parentType, + 'parent_id' => optional($parentType)->factory(), 'number' => $this->faker->numberBetween(1, 100), 'currency_id' => null, 'created_at' => $this->faker->dateTime(), diff --git a/database/factories/AosPdfTemplateFactory.php b/database/factories/AosPdfTemplateFactory.php index 443a058..ba5950c 100644 --- a/database/factories/AosPdfTemplateFactory.php +++ b/database/factories/AosPdfTemplateFactory.php @@ -22,12 +22,16 @@ class AosPdfTemplateFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name(), - 'description' => $this->faker->text(500), - 'active' => $this->faker->boolean(), - 'type' => $this->faker->randomElement([ - 'Type1', - 'Type2', + 'name' => $this->faker->name(), + 'description' => $this->faker->text(500), + 'active' => $this->faker->boolean(), + 'type' => $this->faker->randomKey([ + 'AOS_Quotes' => 'Quotes', + 'AOS_Invoices' => 'Invoices', + 'AOS_Contracts' => 'Contracts', + 'Accounts' => 'Accounts', + 'Contacts' => 'Contacts', + 'Leads' => 'Leads', ]), 'pdfheader' => $this->faker->paragraphs(10, true), 'pdffooter' => $this->faker->paragraphs(10, true), @@ -38,12 +42,12 @@ public function definition() 'margin_header' => $this->faker->numberBetween(10, 20), 'margin_footer' => $this->faker->numberBetween(10, 20), 'page_size' => $this->faker->numberBetween(100, 200) . ' KB', - 'orientation' => $this->faker->randomElement([ - 'LANDSCAPE', - 'PORTRAIT', + 'orientation' => $this->faker->randomKey([ + 'Portrait' => 'Portrait', + 'Landscape' => 'Landscape', ]), - 'created_at' => $this->faker->dateTime(), - 'updated_at' => $this->faker->dateTime(), + 'created_at' => $this->faker->dateTime(), + 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), ]; } diff --git a/database/factories/AosProductFactory.php b/database/factories/AosProductFactory.php index fff7c74..d199a0b 100644 --- a/database/factories/AosProductFactory.php +++ b/database/factories/AosProductFactory.php @@ -29,7 +29,37 @@ public function definition() 'aos_product_category_id' => null, 'maincode' => $this->faker->text(20), 'part_number' => $this->faker->text(20), - 'category' => $this->faker->text(20), + 'category' => $this->faker->randomElement([ + '' => 'None', + 'Accounts' => 'Accounts', + 'Activities' => 'Activities', + 'Bugs' => 'Bugs', + 'Calendar' => 'Calendar', + 'Calls' => 'Calls', + 'Campaigns' => 'Campaigns', + 'Cases' => 'Cases', + 'Contacts' => 'Contacts', + 'Currencies' => 'Currencies', + 'Dashboard' => 'Dashboard', + 'Documents' => 'Documents', + 'Emails' => 'Emails', + 'Feeds' => 'Feeds', + 'Forecasts' => 'Forecasts', + 'Help' => 'Help', + 'Home' => 'Home', + 'Leads' => 'Leads', + 'Meetings' => 'Meetings', + 'Notes' => 'Notes', + 'Opportunities' => 'Opportunities', + 'Outlook Plugin' => 'Outlook Plugin', + 'Projects' => 'Projects', + 'Quotes' => 'Quotes', + 'Releases' => 'Releases', + 'RSS' => 'RSS', + 'Studio' => 'Studio', + 'Upgrade' => 'Upgrade', + 'Users' => 'Users', + ]), 'type' => $this->faker->text(20), 'url' => $this->faker->text(20), 'product_image' => null, diff --git a/database/factories/AosProductsQuoteFactory.php b/database/factories/AosProductsQuoteFactory.php index a9ed486..ee5cc6a 100644 --- a/database/factories/AosProductsQuoteFactory.php +++ b/database/factories/AosProductsQuoteFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\AosProductsQuote; +use TCG\Voyager\Facades\Voyager; class AosProductsQuoteFactory extends Factory { @@ -21,6 +22,28 @@ class AosProductsQuoteFactory extends Factory */ public function definition() { + $parentType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ]); + return [ 'name' => $this->faker->name(), 'description' => $this->faker->text(500), @@ -45,8 +68,8 @@ public function definition() 'product_total_price' => $this->faker->randomFloat(2), 'product_total_price_usdollar' => $this->faker->randomFloat(2), 'vat' => $this->faker->text(50), - 'parent_type' => null, - 'parent_id' => null, + 'parent_type' => $parentType, + 'parent_id' => optional($parentType)->factory(), 'product_id' => null, 'group_id' => null, 'created_at' => $this->faker->dateTime(), diff --git a/database/factories/AosQuoteFactory.php b/database/factories/AosQuoteFactory.php index 1fe9f14..811dccf 100644 --- a/database/factories/AosQuoteFactory.php +++ b/database/factories/AosQuoteFactory.php @@ -39,18 +39,29 @@ public function definition() 'shipping_address_postalcode' => $this->faker->postcode(), 'shipping_address_country' => $this->faker->country(), 'shipping_tax' => $this->faker->text(50), - 'term' => $this->faker->text(50), + 'term' => $this->faker->randomKey([ + '' => 'None', + 'Net 15' => 'Nett 15', + 'Net 30' => 'Nett 30', + ]), 'stage' => $this->faker->randomKey([ - 'Stage1' => 'Stage1', - 'Stage2' => 'Stage2', + 'Draft' => 'Draft', + 'Negotiation' => 'Negotiation', + 'Delivered' => 'Delivered', + 'On Hold' => 'On Hold', + 'Confirmed' => 'Confirmed', + 'Closed Accepted' => 'Closed Accepted', + 'Closed Lost' => 'Closed Lost', + 'Closed Dead' => 'Closed Dead', ]), 'approval_status' => $this->faker->randomKey([ - 'Approval1' => 'Approval1', - 'Approval2' => 'Approval2', + '' => 'None', + 'Approved' => 'Approved', + 'Not Approved' => 'Not Approved', ]), 'invoice_status' => $this->faker->randomKey([ - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'Not Invoiced' => 'Not Invoiced', + 'Invoiced' => 'Invoiced', ]), 'expiration' => $this->faker->dateTimeBetween('-1month', 'now')->format('Y-m-d'), diff --git a/database/factories/AowProcessedFactory.php b/database/factories/AowProcessedFactory.php index 0f131da..eab10e7 100644 --- a/database/factories/AowProcessedFactory.php +++ b/database/factories/AowProcessedFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\AowProcessed; +use TCG\Voyager\Facades\Voyager; class AowProcessedFactory extends Factory { @@ -21,16 +22,39 @@ class AowProcessedFactory extends Factory */ public function definition() { + $parentType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ]); + return [ 'name' => $this->faker->name(), 'description' => $this->faker->text(500), 'aow_workflow_id' => null, - 'parent_type' => null, - 'parent_id' => null, + 'parent_type' => $parentType, + 'parent_id' => optional($parentType)->factory(), 'status' => $this->faker->randomKey([ + 'Complete' => 'Complete', + 'Running' => 'Running', 'Pending' => 'Pending', - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'Failed' => 'Failed', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/AowWorkflowFactory.php b/database/factories/AowWorkflowFactory.php index 7cee900..53541b5 100644 --- a/database/factories/AowWorkflowFactory.php +++ b/database/factories/AowWorkflowFactory.php @@ -25,17 +25,26 @@ public function definition() 'name' => $this->faker->name(), 'description' => $this->faker->text(500), 'flow_module' => $this->faker->randomElement([ + // @FIXME 'accounts', 'contacts', 'opportunites', 'meetings', ]), - 'flow_run_on' => $this->faker->text(30), + 'flow_run_on' => $this->faker->randomKey([ + 'All_Records' => 'All Records', + 'New_Records' => 'New Records', + 'Modified_Records' => 'Modified Records', + ]), 'status' => $this->faker->randomElement([ 'Active', 'Inactive', ]), - 'run_when' => $this->faker->text(20), + 'run_when' => $this->faker->randomKey([ + 'Always' => 'Always', + 'On_Save' => 'Only On Save', + 'In_Scheduler' => 'Only In The Scheduler', + ]), 'multiple_runs' => $this->faker->boolean(), 'run_on_import' => $this->faker->boolean(), 'created_at' => $this->faker->dateTime(), diff --git a/database/factories/BugFactory.php b/database/factories/BugFactory.php index cfab9a2..85357e2 100644 --- a/database/factories/BugFactory.php +++ b/database/factories/BugFactory.php @@ -27,34 +27,79 @@ public function definition() 'bug_number' => $this->faker->unique()->numberBetween(1, 1000), 'type' => $this->faker->randomKey([ config('joy-voyager-crm.bugs.types', [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'Defect' => 'Defect', + 'Feature' => 'Feature', ]) ]), 'status' => $this->faker->randomKey([ config('joy-voyager-crm.bugs.statuses', [ - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'New' => 'New', + 'Assigned' => 'Assigned', + 'Closed' => 'Closed', + 'Pending' => 'Pending', + 'Rejected' => 'Rejected', ]), ]), 'priority' => $this->faker->randomKey([ config('joy-voyager-crm.bugs.priorities', [ - 'Low' => 'Low', - 'Medium' => 'Medium', + 'Urgent' => 'Urgent', 'High' => 'High', + 'Medium' => 'Medium', + 'Low' => 'Low', ]), ]), 'resolution' => $this->faker->randomKey([ config('joy-voyager-crm.bugs.resolutions', [ - 'Yes' => 'Yes', - 'No' => 'No', + '' => 'None', + 'Accepted' => 'Accepted', + 'Duplicate' => 'Duplicate', + 'Fixed' => 'Fixed', + 'Out of Date' => 'Out of Date', + 'Invalid' => 'Invalid', + 'Later' => 'Later', ]), ]), 'work_log' => $this->faker->text(100), // 'found_in_release' => null, // 'fixed_in_release' => null, - 'source' => $this->faker->text(10), - 'product_category' => $this->faker->text(10), + 'source' => $this->faker->randomKey([ + '' => 'None', + 'Internal' => 'Internal', + 'Forum' => 'Forum', + 'Web' => 'Web', + 'InboundEmail' => 'Email', + ]), + 'product_category' => $this->faker->randomKey([ + '' => 'None', + 'Accounts' => 'Accounts', + 'Activities' => 'Activities', + 'Bugs' => 'Bugs', + 'Calendar' => 'Calendar', + 'Calls' => 'Calls', + 'Campaigns' => 'Campaigns', + 'Cases' => 'Cases', + 'Contacts' => 'Contacts', + 'Currencies' => 'Currencies', + 'Dashboard' => 'Dashboard', + 'Documents' => 'Documents', + 'Emails' => 'Emails', + 'Feeds' => 'Feeds', + 'Forecasts' => 'Forecasts', + 'Help' => 'Help', + 'Home' => 'Home', + 'Leads' => 'Leads', + 'Meetings' => 'Meetings', + 'Notes' => 'Notes', + 'Opportunities' => 'Opportunities', + 'Outlook Plugin' => 'Outlook Plugin', + 'Projects' => 'Projects', + 'Quotes' => 'Quotes', + 'Releases' => 'Releases', + 'RSS' => 'RSS', + 'Studio' => 'Studio', + 'Upgrade' => 'Upgrade', + 'Users' => 'Users', + ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), diff --git a/database/factories/CallFactory.php b/database/factories/CallFactory.php index 1cd9229..7f8bf9d 100644 --- a/database/factories/CallFactory.php +++ b/database/factories/CallFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\Call; +use TCG\Voyager\Facades\Voyager; class CallFactory extends Factory { @@ -21,6 +22,28 @@ class CallFactory extends Factory */ public function definition() { + $parentType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Contact') => 'Contact', + Voyager::modelClass('Task') => 'Task', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('Bug') => 'Bug', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + + Voyager::modelClass('Project') => 'Project', + Voyager::modelClass('ProjectTask') => 'Task Task', + + Voyager::modelClass('Prospect') => 'Target', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ]); + return [ 'name' => $this->faker->name(), 'description' => $this->faker->text(500), @@ -28,24 +51,61 @@ public function definition() 'duration_minutes' => $this->faker->numberBetween(1, 60), 'date_start' => $this->faker->dateTimeBetween('-3months', '-2months'), 'date_end' => $this->faker->dateTimeBetween('-2months', '-1month'), - 'parent_type' => null, - 'parent_id' => null, - 'status' => $this->faker->randomElement([ - 'Active', - 'Inactive', - 'Planned', + 'parent_type' => $parentType, + 'parent_id' => optional($parentType)->factory(), + 'status' => $this->faker->randomKey([ + 'Planned' => 'Planned', + 'Held' => 'Held', + 'Not Held' => 'Not Held', ]), - 'direction' => $this->faker->randomElement([ - 'INCOMING', - 'OUTGOING', + 'direction' => $this->faker->randomKey([ + 'Inbound' => 'Inbound', + 'Outbound' => 'Outbound', + ]), + 'reminder_time' => $this->faker->randomKey([ + 60 => '1 minute prior', + 300 => '5 minutes prior', + 600 => '10 minutes prior', + 900 => '15 minutes prior', + 1800 => '30 minutes prior', + 3600 => '1 hour prior', + 7200 => '2 hours prior', + 10800 => '3 hours prior', + 18000 => '5 hours prior', + 86400 => '1 day prior', + ]), + 'email_reminder_time' => $this->faker->randomKey([ + 60 => '1 minute prior', + 300 => '5 minutes prior', + 600 => '10 minutes prior', + 900 => '15 minutes prior', + 1800 => '30 minutes prior', + 3600 => '1 hour prior', + 7200 => '2 hours prior', + 10800 => '3 hours prior', + 18000 => '5 hours prior', + 86400 => '1 day prior', ]), - 'reminder_time' => $this->faker->randomNumber(8), - 'email_reminder_time' => $this->faker->randomNumber(8), 'email_reminder_sent' => $this->faker->boolean(), 'outlook_id' => null, - 'repeat_type' => null, - 'repeat_interval' => null, - 'repeat_dow' => null, + 'repeat_type' => $this->faker->randomKey([ + '' => 'None', + 'Daily' => 'Daily', + 'Weekly' => 'Weekly', + 'Monthly' => 'Monthly', + 'Yearly' => 'Yearly', + ]), + 'repeat_interval' => $this->faker->numberBetween(1, 10), + 'repeat_dow' => $this->faker->randomKey([ + '0' => '', + '1' => 'Sunday', + '2' => 'Monday', + '3' => 'Tuesday', + '4' => 'Wednesday', + '5' => 'Thursday', + '6' => 'Friday', + '7' => 'Saturday', + ]), 'repeat_until' => null, 'repeat_count' => null, 'repeat_parent_id' => null, diff --git a/database/factories/CallsLeadFactory.php b/database/factories/CallsLeadFactory.php index 4c73cff..cb9d1af 100644 --- a/database/factories/CallsLeadFactory.php +++ b/database/factories/CallsLeadFactory.php @@ -29,9 +29,9 @@ public function definition() '0' => 'N', ]), 'accept_status' => $this->faker->randomKey([ - 'none' => 'none', - 'Accept1' => 'Accept1', - 'Accept2' => 'Accept2', + 'none' => 'none', + 'Accepted' => 'Accepted', + 'Rejected' => 'Rejected', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/CallsUserFactory.php b/database/factories/CallsUserFactory.php index bd00d91..2fd3c50 100644 --- a/database/factories/CallsUserFactory.php +++ b/database/factories/CallsUserFactory.php @@ -29,9 +29,9 @@ public function definition() '0' => 'N', ]), 'accept_status' => $this->faker->randomKey([ - 'none' => 'none', - 'Accept1' => 'Accept1', - 'Accept2' => 'Accept2', + 'none' => 'none', + 'Accepted' => 'Accepted', + 'Rejected' => 'Rejected', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/CampaignFactory.php b/database/factories/CampaignFactory.php index ee2945b..0afa1d6 100644 --- a/database/factories/CampaignFactory.php +++ b/database/factories/CampaignFactory.php @@ -34,24 +34,36 @@ public function definition() 'budget' => $this->faker->randomFloat(2), 'actual_cost' => $this->faker->randomFloat(2), 'expected_revenue' => $this->faker->randomFloat(2), - 'campaign_type' => $this->faker->randomElement([ - 'Type1', - 'Type2', + 'campaign_type' => $this->faker->randomKey([ + '' => 'None', + 'Telesales' => 'Telesales', + 'Mail' => 'Mail', + 'Email' => 'Email', + 'Print' => 'Print', + 'Web' => 'Web', + 'Radio' => 'Radio', + 'Television' => 'Television', + 'NewsLetter' => 'Newsletter', + 'Survey' => 'Survey', ]), 'objective' => $this->faker->paragraphs(10, true), 'content' => $this->faker->paragraphs(10, true), 'frequency' => $this->faker->randomKey([ - 'every minute' => 'Every minute', - 'hourly' => 'Hourly', - 'daily' => 'Daily', - 'weekly' => 'Weekly', - 'mothly' => 'Mothly', - 'yearly' => 'Yearly', + '' => 'None', + 'Weekly' => 'Weekly', + 'Monthly' => 'Monthly', + 'Quarterly' => 'Quarterly', + 'Annually' => 'Annually', ]), // 'survey_id' => null, - 'status' => $this->faker->randomElement([ - 'Active', - 'Inactive', + 'status' => $this->faker->randomKey([ + '' => 'None', + 'Planning' => 'Planning', + 'Active' => 'Active', + 'Inactive' => 'Inactive', + 'Complete' => 'Complete', + //'In Queue' => 'In Queue', + //'Sending' => 'Sending', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/CampaignLogFactory.php b/database/factories/CampaignLogFactory.php index a952309..71f2bea 100644 --- a/database/factories/CampaignLogFactory.php +++ b/database/factories/CampaignLogFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\CampaignLog; +use TCG\Voyager\Facades\Voyager; class CampaignLogFactory extends Factory { @@ -21,19 +22,41 @@ class CampaignLogFactory extends Factory */ public function definition() { + $targetType = $this->faker->randomKey([ + Voyager::modelClass('Lead') => 'Leads', + Voyager::modelClass('Prospect') => 'Prospects', + Voyager::modelClass('Contact') => 'Contacts', + Voyager::modelClass('Account') => 'Accounts', + ]); + + $relatedType = $this->faker->randomKey([ + Voyager::modelClass('Contact') => 'Contacts', + Voyager::modelClass('Email') => 'Emails', + Voyager::modelClass('Lead') => 'Leads', + Voyager::modelClass('Opportunity') => 'Opportunities', + ]); + return [ 'id' => null, 'campaign_id' => null, 'target_tracker_key' => null, - 'target_id' => null, - 'target_type' => null, + 'target_type' => $targetType, + 'target_id' => $targetType::factory(), 'activity_type' => $this->faker->randomKey([ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + '' => 'None', + 'targeted' => 'Message Sent/Attempted', + 'send error' => 'Bounced Messages,Other', + 'invalid email' => 'Bounced Messages,Invalid Email', + 'link' => 'Click-thru Link', + 'viewed' => 'Viewed Message', + 'removed' => 'Opted Out', + 'lead' => 'Leads Created', + 'contact' => 'Contacts Created', + 'blocked' => 'Suppressed by address or domain', ]), 'activity_date' => $this->faker->dateTimeBetween('-1month', 'now'), - 'related_id' => null, - 'related_type' => null, + 'related_type' => $relatedType, + 'related_id' => $relatedType::factory(), 'archived' => $this->faker->boolean(), 'hits' => $this->faker->numberBetween(1, 100), 'list_id' => null, diff --git a/database/factories/ContactFactory.php b/database/factories/ContactFactory.php index ac10428..9fad694 100644 --- a/database/factories/ContactFactory.php +++ b/database/factories/ContactFactory.php @@ -23,7 +23,15 @@ public function definition() { return [ 'description' => $this->faker->text(500), - 'salutation' => $this->faker->title(), + 'salutation' => $this->faker->randomKey([ + '' => 'None', + 'Mr.' => 'Mr.', + 'Ms.' => 'Ms.', + 'Mrs.' => 'Mrs.', + 'Miss' => 'Miss', + 'Dr.' => 'Dr.', + 'Prof.' => 'Prof.', + ]), 'first_name' => $this->faker->firstName(), 'last_name' => $this->faker->lastName(), 'title' => $this->faker->word(), @@ -47,11 +55,28 @@ public function definition() 'alt_address_country' => $this->faker->country(), 'assistant' => $this->faker->name(), 'assistant_phone' => $this->faker->phoneNumber(), - 'lead_source' => $this->faker->word(), + 'lead_source' => $this->faker->randomKey([ + '' => 'None', + 'Cold Call' => 'Cold Call', + 'Existing Customer' => 'Existing Customer', + 'Self Generated' => 'Self Generated', + 'Employee' => 'Employee', + 'Partner' => 'Partner', + 'Public Relations' => 'Public Relations', + 'Direct Mail' => 'Direct Mail', + 'Conference' => 'Conference', + 'Trade Show' => 'Trade Show', + 'Web Site' => 'Web Site', + 'Word of mouth' => 'Word of mouth', + 'Email' => 'Email', + 'Campaign' => 'Campaign', + 'Other' => 'Other', + ]), + 'joomla_account_id' => $this->faker->word(), 'portal_user_type' => $this->faker->randomKey([ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'RegularUser' => 'Regular User', + 'Administrator' => 'Administrator', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/CrmCaseFactory.php b/database/factories/CrmCaseFactory.php index be2d4a1..9cabae2 100644 --- a/database/factories/CrmCaseFactory.php +++ b/database/factories/CrmCaseFactory.php @@ -26,17 +26,16 @@ public function definition() 'description' => $this->faker->text(500), // 'case_number' => $this->faker->numberBetween(1, 100), // Auto incrementing 'type' => $this->faker->randomKey([ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'Administration' => 'Administration', + 'Product' => 'Product', + 'User' => 'User', ]), 'priority' => $this->faker->randomKey([ - 'Priority1' => 'Priority1', - 'Priority2' => 'Priority2', - ]), - 'resolution' => $this->faker->randomKey([ - 'Resolution1' => 'Resolution1', - 'Resolution2' => 'Resolution2', + 'P1' => 'High', + 'P2' => 'Medium', + 'P3' => 'Low', ]), + 'resolution' => $this->faker->paragraphs(10, true), 'work_log' => $this->faker->paragraphs(10, true), 'account_id' => null, 'state' => $this->faker->randomKey([ @@ -45,8 +44,12 @@ public function definition() ]), 'contact_created_by_id' => null, 'status' => $this->faker->randomKey([ - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'Open_New' => 'New', + 'Open_Assigned' => 'Assigned', + 'Closed_Closed' => 'Closed', + 'Open_Pending Input' => 'Pending Input', + 'Closed_Rejected' => 'Rejected', + 'Closed_Duplicate' => 'Duplicate', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/CurrencyFactory.php b/database/factories/CurrencyFactory.php index db3212d..0d66310 100644 --- a/database/factories/CurrencyFactory.php +++ b/database/factories/CurrencyFactory.php @@ -23,7 +23,7 @@ public function definition() { $currencyCode = $this->faker->unique()->currencyCode(); - $currencies = json_decode(file_get_contents(__DIR__ . '/json/currencies.json')); + $currencies = json_decode(file_get_contents(__DIR__ . '/../json/currencies.json')); $randomCurrency = $this->faker->unique()->randomElement($currencies); return [ diff --git a/database/factories/DocumentFactory.php b/database/factories/DocumentFactory.php index 86527b0..d600948 100644 --- a/database/factories/DocumentFactory.php +++ b/database/factories/DocumentFactory.php @@ -26,22 +26,48 @@ public function definition() 'description' => $this->faker->text(500), 'doc_id' => $this->faker->text(50), 'doc_type' => $this->faker->randomKey([ - 'DocType1' => 'DocType1', - 'DocType2' => 'DocType2', + 'Sugar' => 'SuiteCRM', + 'WebEx' => 'WebEx', + 'GoToMeeting' => 'GoToMeeting', + 'IBMSmartCloud' => 'IBM SmartCloud', + 'Google' => 'Google', + 'Box' => 'Box.net', + 'Facebook' => 'Facebook', + 'Twitter' => 'Twitter', ]), 'doc_url' => $this->faker->url(), 'active_date' => $this->faker->dateTimeBetween('-1month', 'now')->format('Y-m-d'), 'exp_date' => $this->faker->dateTimeBetween('-1month', 'now')->format('Y-m-d'), - 'category_id' => $this->faker->word(), - 'subcategory_id' => $this->faker->word(), - 'status_id' => $this->faker->word(), + 'category_id' => $this->faker->randomKey([ + '' => 'None', + 'Marketing' => 'Marketing', + 'Knowledege Base' => 'Knowledge Base', + 'Sales' => 'Sales', + ]), + 'subcategory_id' => $this->faker->randomKey([ + '' => 'None', + 'Marketing Collateral' => 'Marketing Collateral', + 'Product Brochures' => 'Product Brochures', + 'FAQ' => 'FAQ', + ]), + 'status_id' => $this->faker->randomKey([ + 'Active' => 'Active', + 'Draft' => 'Draft', + 'FAQ' => 'FAQ', + 'Expired' => 'Expired', + 'Under Review' => 'Under Review', + 'Pending' => 'Pending', + ]), 'document_revision_id' => null, 'related_doc_id' => null, 'related_doc_rev_id' => null, 'is_template' => $this->faker->boolean(), 'template_type' => $this->faker->randomKey([ - 'TemplateType1' => 'TemplateType1', - 'TemplateType2' => 'TemplateType2', + '' => 'None', + 'mailmerge' => 'Mail Merge', + 'eula' => 'EULA', + 'nda' => 'NDA', + 'license' => 'License Agreement', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/EmailAddressFactory.php b/database/factories/EmailAddressFactory.php new file mode 100644 index 0000000..8c64516 --- /dev/null +++ b/database/factories/EmailAddressFactory.php @@ -0,0 +1,45 @@ +faker->unique()->safeEmail(); + return [ + 'email_address' => $email, + 'email_address_caps' => Str::upper($email), + 'invalid_email' => $this->faker->boolean(), + 'opt_out' => $this->faker->boolean(), + 'confirm_opt_in' => $this->faker->randomKey([ + 'not-opt-in' => 'Disabled', + 'opt-in' => 'Opt In', + 'confirmed-opt-in' => 'Confirmed Opt In' + ]), + 'confirm_opt_in_date' => $this->faker->dateTimeBetween('-1month', 'now'), + 'confirm_opt_in_sent_date' => $this->faker->dateTimeBetween('-1month', 'now'), + 'confirm_opt_in_fail_date' => null, + 'confirm_opt_in_token' => Str::random(20), + 'created_at' => $this->faker->dateTime(), + 'updated_at' => $this->faker->dateTime(), + // 'deleted_at' => $this->faker->dateTime(), + ]; + } +} diff --git a/database/factories/EmailFactory.php b/database/factories/EmailFactory.php index 6758418..f7a1b71 100644 --- a/database/factories/EmailFactory.php +++ b/database/factories/EmailFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\Email; +use TCG\Voyager\Facades\Voyager; class EmailFactory extends Factory { @@ -21,6 +22,28 @@ class EmailFactory extends Factory */ public function definition() { + $parentType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ]); + return [ 'name' => $this->faker->name(), // 'description' => $this->faker->text(500), @@ -28,31 +51,35 @@ public function definition() 'last_synced' => $this->faker->dateTimeBetween('-1month', 'now'), 'date_sent_received' => $this->faker->dateTimeBetween('-1month', 'now'), // 'message_id' => null, - 'type' => $this->faker->randomElement([ - 'Type1', - 'Type2', + 'type' => $this->faker->randomKey([ + 'out' => 'Sent', + 'archived' => 'Archived', + 'draft' => 'Draft', + 'inbound' => 'Inbound', + 'campaign' => 'Campaign', ]), - 'status' => $this->faker->randomElement([ - 'Active', - 'Inactive', + 'status' => $this->faker->randomKey([ + 'archived' => 'Archived', + 'closed' => 'Closed', + 'draft' => 'In Draft', + 'read' => 'Read', + 'replied' => 'Replied', + 'sent' => 'Sent', + 'send_error' => 'Send Error', + 'unread' => 'Unread', ]), 'flagged' => $this->faker->boolean(), 'reply_to_status' => $this->faker->boolean(), 'intent' => $this->faker->text('10'), 'mailbox_id' => null, - 'parent_type' => $this->faker->randomElement([ - 'opportunities', - 'cases', - 'leads', - 'project', - 'prospects', - 'bugs', - 'project_task', - 'accounts', - ]), - 'parent_id' => null, + 'parent_type' => $parentType, + 'parent_id' => optional($parentType)->factory(), 'uid' => null, - 'category_id' => null, + 'category_id' => $this->faker->randomKey([ + '' => 'None', + 'Archived' => 'Archived', + // TODO: add more categories here... + ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), diff --git a/database/factories/EmailTemplateFactory.php b/database/factories/EmailTemplateFactory.php index 3ff954d..4ca7b3c 100644 --- a/database/factories/EmailTemplateFactory.php +++ b/database/factories/EmailTemplateFactory.php @@ -48,9 +48,11 @@ public function definition() 'body' => strip_tags($html), 'body_html' => $html, 'text_only' => $this->faker->boolean(), - 'type' => $this->faker->randomElement([ - 'Type1', - 'Type2', + 'type' => $this->faker->randomKey([ + '' => 'None', + 'campaign' => 'Campaign', + 'email' => 'Email', + 'event' => 'Event', ]), 'published' => $this->faker->randomElement([ 'Yes', diff --git a/database/factories/EmailsBeanFactory.php b/database/factories/EmailsBeanFactory.php index bdc3e80..bd14e5f 100644 --- a/database/factories/EmailsBeanFactory.php +++ b/database/factories/EmailsBeanFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\EmailsBean; +use TCG\Voyager\Facades\Voyager; class EmailsBeanFactory extends Factory { @@ -21,10 +22,19 @@ class EmailsBeanFactory extends Factory */ public function definition() { + $beanType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', // cn (11/22/2005) added to support Emails + ]); + return [ 'email_id' => null, - 'bean_id' => null, - 'bean_module' => null, + 'bean_module' => $beanType, + 'bean_id' => optional($beanType)->factory(), 'campaign_data' => $this->faker->paragraphs(10, true), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/FavoriteFactory.php b/database/factories/FavoriteFactory.php index cb887ca..3d0c823 100644 --- a/database/factories/FavoriteFactory.php +++ b/database/factories/FavoriteFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\Favorite; +use TCG\Voyager\Facades\Voyager; class FavoriteFactory extends Factory { @@ -21,11 +22,33 @@ class FavoriteFactory extends Factory */ public function definition() { + $parentType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Contact') => 'Contact', + Voyager::modelClass('Task') => 'Task', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('Bug') => 'Bug', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + + Voyager::modelClass('Project') => 'Project', + Voyager::modelClass('ProjectTask') => 'Task Task', + + Voyager::modelClass('Prospect') => 'Target', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ]); + return [ 'name' => $this->faker->name(), 'description' => $this->faker->text(500), - // 'parent_id' => null, // @TODO voyager morphTo relationship - // 'parent_type' => null, + 'parent_type' => $parentType, + 'parent_id' => optional($parentType)->factory(), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), diff --git a/database/factories/FolderFactory.php b/database/factories/FolderFactory.php index f49336d..19097f2 100644 --- a/database/factories/FolderFactory.php +++ b/database/factories/FolderFactory.php @@ -24,9 +24,11 @@ public function definition() return [ 'name' => $this->faker->name(), // 'description' => $this->faker->text(500), - 'folder_type' => $this->faker->randomElement([ - 'Type1', - 'Type2', + 'folder_type' => $this->faker->randomKey([ + 'inbound' => 'inbound', + 'draft' => 'draft', + 'sent' => 'sent', + 'archived' => 'archived', ]), 'parent_folder' => null, 'has_child' => $this->faker->boolean(), diff --git a/database/factories/FpEventFactory.php b/database/factories/FpEventFactory.php index b99ad42..3a5a1bf 100644 --- a/database/factories/FpEventFactory.php +++ b/database/factories/FpEventFactory.php @@ -34,8 +34,9 @@ public function definition() 'accept_redirect' => $this->faker->word(), 'decline_redirect' => $this->faker->word(), 'activity_status_type' => $this->faker->randomKey([ - 'Active' => 'Active', - 'Inactive' => 'Inactive', + '' => '--None--', + 'active' => 'Active', + 'inactive' => 'Inactive', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/ImportMapFactory.php b/database/factories/ImportMapFactory.php index 510c4cf..b32acf2 100644 --- a/database/factories/ImportMapFactory.php +++ b/database/factories/ImportMapFactory.php @@ -25,22 +25,8 @@ public function definition() 'name' => $this->faker->name(), // 'description' => $this->faker->text(500), 'source' => null, - 'enclosure' => $this->faker->randomElement([ - ' ', - ',', - ';', - // '\t', - '|', - // ' ', - ]), - 'delimiter' => $this->faker->randomElement([ - ' ', - ',', - ';', - // '\t', - '|', - // ' ', - ]), + 'enclosure' => '"', + 'delimiter' => ',', 'module' => null, 'content' => null, 'default_values' => null, diff --git a/database/factories/InboundEmailFactory.php b/database/factories/InboundEmailFactory.php index 2e22a4b..ca23c9f 100644 --- a/database/factories/InboundEmailFactory.php +++ b/database/factories/InboundEmailFactory.php @@ -35,9 +35,10 @@ public function definition() 'service' => $this->faker->text(10), 'mailbox' => $this->faker->text(50), 'delete_seen' => $this->faker->boolean(), - 'mailbox_type' => $this->faker->randomElement([ - 'MailboxType1', - 'MailboxType2', + 'mailbox_type' => $this->faker->randomKey([ + 'pick' => '--None--', + 'createcase' => 'Create Case', + 'bounce' => 'Bounce Handling', ]), // 'template_id' => null, // 'stored_options' => null, diff --git a/database/factories/JjwgMapFactory.php b/database/factories/JjwgMapFactory.php index daaf3d1..6824cb4 100644 --- a/database/factories/JjwgMapFactory.php +++ b/database/factories/JjwgMapFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\JjwgMap; +use TCG\Voyager\Facades\Voyager; class JjwgMapFactory extends Factory { @@ -21,6 +22,28 @@ class JjwgMapFactory extends Factory */ public function definition() { + $parentType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ]); + return [ 'name' => $this->faker->name(), 'description' => $this->faker->text(500), @@ -30,8 +53,8 @@ public function definition() 'Km', ]), 'module_type' => null, - 'parent_type' => null, - 'parent_id' => null, + 'parent_type' => $parentType, + 'parent_id' => optional($parentType)->factory(), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), diff --git a/database/factories/JobQueueFactory.php b/database/factories/JobQueueFactory.php index b781097..c82069e 100644 --- a/database/factories/JobQueueFactory.php +++ b/database/factories/JobQueueFactory.php @@ -26,8 +26,10 @@ public function definition() 'scheduler_id' => null, 'execute_time' => $this->faker->dateTimeBetween('-1month', 'now'), 'resolution' => $this->faker->randomKey([ - 'Resolution1' => 'Resolution1', - 'Resolution2' => 'Resolution2', + 'queued' => 'queued', + 'partial' => 'partial', + 'success' => 'success', + 'failure' => 'failure', ]), 'message' => $this->faker->paragraphs(10, true), 'target' => $this->faker->word(), @@ -39,8 +41,9 @@ public function definition() 'client' => $this->faker->word(), 'percent_complete' => $this->faker->numberBetween(1, 100), 'status' => $this->faker->randomElement([ - 'Pending' => 'Pending', - 'Finished' => 'Finished', + 'queued' => 'queued', + 'running' => 'running', + 'done' => 'done', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/LeadFactory.php b/database/factories/LeadFactory.php index f214e2d..f912547 100644 --- a/database/factories/LeadFactory.php +++ b/database/factories/LeadFactory.php @@ -23,7 +23,15 @@ public function definition() { return [ 'description' => $this->faker->text(500), - 'salutation' => $this->faker->title(), + 'salutation' => $this->faker->randomKey([ + '' => 'None', + 'Mr.' => 'Mr.', + 'Ms.' => 'Ms.', + 'Mrs.' => 'Mrs.', + 'Miss' => 'Miss', + 'Dr.' => 'Dr.', + 'Prof.' => 'Prof.', + ]), 'first_name' => $this->faker->firstName(), 'last_name' => $this->faker->lastName(), 'title' => $this->faker->word(), @@ -58,7 +66,23 @@ public function definition() 'converted' => $this->faker->boolean(), 'refered_by' => $this->faker->name(), - 'lead_source' => $this->faker->word(), + 'lead_source' => $this->faker->randomKey([ + '' => 'None', + 'Cold Call' => 'Cold Call', + 'Existing Customer' => 'Existing Customer', + 'Self Generated' => 'Self Generated', + 'Employee' => 'Employee', + 'Partner' => 'Partner', + 'Public Relations' => 'Public Relations', + 'Direct Mail' => 'Direct Mail', + 'Conference' => 'Conference', + 'Trade Show' => 'Trade Show', + 'Web Site' => 'Web Site', + 'Word of mouth' => 'Word of mouth', + 'Email' => 'Email', + 'Campaign' => 'Campaign', + 'Other' => 'Other', + ]), 'lead_source_description' => $this->faker->paragraphs(10, true), @@ -76,8 +100,13 @@ public function definition() 'portal_app' => $this->faker->word(), 'website' => $this->faker->domainName(), 'status' => $this->faker->randomKey([ - 'Active' => 'Active', - 'Inactive' => 'Inactive', + '' => 'None', + 'New' => 'New', + 'Assigned' => 'Assigned', + 'In Process' => 'In Process', + 'Converted' => 'Converted', + 'Recycled' => 'Recycled', + 'Dead' => 'Dead', ]), 'status_description' => $this->faker->paragraphs(10, true), diff --git a/database/factories/MeetingFactory.php b/database/factories/MeetingFactory.php index af7d97d..7061228 100644 --- a/database/factories/MeetingFactory.php +++ b/database/factories/MeetingFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\Meeting; +use TCG\Voyager\Facades\Voyager; class MeetingFactory extends Factory { @@ -21,6 +22,28 @@ class MeetingFactory extends Factory */ public function definition() { + $parentType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Contact') => 'Contact', + Voyager::modelClass('Task') => 'Task', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('Bug') => 'Bug', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + + Voyager::modelClass('Project') => 'Project', + Voyager::modelClass('ProjectTask') => 'Task Task', + + Voyager::modelClass('Prospect') => 'Target', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ]); + return [ 'name' => $this->faker->name(), 'description' => $this->faker->text(500), @@ -35,25 +58,66 @@ public function definition() 'duration_minutes' => $this->faker->numberBetween(0, 60), 'date_start' => $this->faker->dateTimeBetween('-1month', 'now'), 'date_end' => $this->faker->dateTimeBetween('-1month', '+1month'), + 'parent_type' => $parentType, + 'parent_id' => optional($parentType)->factory(), 'status' => $this->faker->randomKey( config('joy-voyager-crm.meetings.statuses', [ - 'Planned' => 'Planned', + 'Planned' => 'Planned', + 'Held' => 'Held', + 'Not Held' => 'Not Held', ]) ), 'type' => $this->faker->randomKey( config('joy-voyager-crm.meetings.types', [ - 'Type1' => 'Type1', - 'Sugar' => 'Sugar', + 'Other' => 'Other', + 'Sugar' => 'SuiteCRM', ]) ), - 'reminder_time' => $this->faker->unixTime(), - 'email_reminder_time' => $this->faker->unixTime(), + 'reminder_time' => $this->faker->randomKey([ + 60 => '1 minute prior', + 300 => '5 minutes prior', + 600 => '10 minutes prior', + 900 => '15 minutes prior', + 1800 => '30 minutes prior', + 3600 => '1 hour prior', + 7200 => '2 hours prior', + 10800 => '3 hours prior', + 18000 => '5 hours prior', + 86400 => '1 day prior', + ]), + 'email_reminder_time' => $this->faker->randomKey([ + 60 => '1 minute prior', + 300 => '5 minutes prior', + 600 => '10 minutes prior', + 900 => '15 minutes prior', + 1800 => '30 minutes prior', + 3600 => '1 hour prior', + 7200 => '2 hours prior', + 10800 => '3 hours prior', + 18000 => '5 hours prior', + 86400 => '1 day prior', + ]), 'email_reminder_sent' => $this->faker->boolean(), 'outlook_id' => $this->faker->text(50), 'sequence' => $this->faker->numberBetween(0, 100), - 'repeat_type' => null, - 'repeat_interval' => null, - 'repeat_dow' => $this->faker->numberBetween(0, 6), + 'repeat_type' => $this->faker->randomKey([ + '' => 'None', + 'Daily' => 'Daily', + 'Weekly' => 'Weekly', + 'Monthly' => 'Monthly', + 'Yearly' => 'Yearly', + ]), + 'repeat_interval' => $this->faker->numberBetween(1, 10), + 'repeat_dow' => $this->faker->randomKey([ + '0' => '', + '1' => 'Sunday', + '2' => 'Monday', + '3' => 'Tuesday', + '4' => 'Wednesday', + '5' => 'Thursday', + '6' => 'Friday', + '7' => 'Saturday', + ]), 'repeat_until' => $this->faker->date('Y-m-d', '+1month'), 'repeat_count' => $this->faker->numberBetween(0, 100), 'repeat_parent_id' => null, diff --git a/database/factories/MeetingsContactFactory.php b/database/factories/MeetingsContactFactory.php index 98d6d99..57da482 100644 --- a/database/factories/MeetingsContactFactory.php +++ b/database/factories/MeetingsContactFactory.php @@ -22,19 +22,20 @@ class MeetingsContactFactory extends Factory public function definition() { return [ - 'meeting_id' => null, - 'contact_id' => null, - 'required' => $this->faker->randomKey([ + 'meeting_id' => null, + 'contact_id' => null, + 'required' => $this->faker->randomKey([ '1' => 'Yes', '0' => 'No', ]), - 'accept_status' => $this->faker->randomKey([ - 'none' => 'none', - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'accept_status' => $this->faker->randomKey([ + 'accept' => 'Accepted', + 'decline' => 'Declined', + 'tentative' => 'Tentative', + 'none' => 'None', ]), - 'created_at' => $this->faker->dateTime(), - 'updated_at' => $this->faker->dateTime(), + 'created_at' => $this->faker->dateTime(), + 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), ]; } diff --git a/database/factories/MeetingsLeadFactory.php b/database/factories/MeetingsLeadFactory.php index ff71809..1d17755 100644 --- a/database/factories/MeetingsLeadFactory.php +++ b/database/factories/MeetingsLeadFactory.php @@ -29,9 +29,10 @@ public function definition() '0' => 'N', ]), 'accept_status' => $this->faker->randomKey([ - 'none' => 'none', - 'Accept1' => 'Accept1', - 'Accept2' => 'Accept2', + 'accept' => 'Accepted', + 'decline' => 'Declined', + 'tentative' => 'Tentative', + 'none' => 'None', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/MeetingsUserFactory.php b/database/factories/MeetingsUserFactory.php index b0821d8..d2df6b0 100644 --- a/database/factories/MeetingsUserFactory.php +++ b/database/factories/MeetingsUserFactory.php @@ -29,9 +29,10 @@ public function definition() '0' => 'N', ]), 'accept_status' => $this->faker->randomKey([ - 'none' => 'none', - 'Accept1' => 'Accept1', - 'Accept2' => 'Accept2', + 'accept' => 'Accepted', + 'decline' => 'Declined', + 'tentative' => 'Tentative', + 'none' => 'None', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/NoteFactory.php b/database/factories/NoteFactory.php index 9c14b9f..2dac3ce 100644 --- a/database/factories/NoteFactory.php +++ b/database/factories/NoteFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\Note; +use TCG\Voyager\Facades\Voyager; class NoteFactory extends Factory { @@ -21,14 +22,39 @@ class NoteFactory extends Factory */ public function definition() { + $parentType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Contact') => 'Contact', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('Campaign') => 'Campaign', + Voyager::modelClass('Task') => 'Task', + Voyager::modelClass('Email') => 'Email', + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + Voyager::modelClass('ProjectTask') => 'Project Task', + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + + Voyager::modelClass('Meeting') => 'Meeting', + Voyager::modelClass('Call') => 'Call', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ]); + return [ 'name' => $this->faker->name(), 'description' => $this->faker->text(500), 'name' => $this->faker->text(50), 'file_mime_type' => $this->faker->text(50), 'filename' => $this->faker->text(50), - 'parent_type' => $this->faker->text(50), - 'parent_id' => null, + 'parent_type' => $parentType, + 'parent_id' => optional($parentType)->factory(), 'contact_id' => null, 'portal_flag' => $this->faker->boolean(), 'embed_flag' => $this->faker->boolean(), diff --git a/database/factories/OpportunityFactory.php b/database/factories/OpportunityFactory.php index 78a3b17..30f628b 100644 --- a/database/factories/OpportunityFactory.php +++ b/database/factories/OpportunityFactory.php @@ -25,21 +25,57 @@ public function definition() 'name' => $this->faker->name(), 'description' => $this->faker->text(500), 'opportunity_type' => $this->faker->randomKey([ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + '' => 'None', + 'Existing Business' => 'Existing Business', + 'New Business' => 'New Business', ]), 'campaign_id' => null, - 'lead_source' => $this->faker->word(), + 'lead_source' => $this->faker->randomKey([ + '' => 'None', + 'Cold Call' => 'Cold Call', + 'Existing Customer' => 'Existing Customer', + 'Self Generated' => 'Self Generated', + 'Employee' => 'Employee', + 'Partner' => 'Partner', + 'Public Relations' => 'Public Relations', + 'Direct Mail' => 'Direct Mail', + 'Conference' => 'Conference', + 'Trade Show' => 'Trade Show', + 'Web Site' => 'Web Site', + 'Word of mouth' => 'Word of mouth', + 'Email' => 'Email', + 'Campaign' => 'Campaign', + 'Other' => 'Other', + ]), 'amount' => $this->faker->randomFloat(2), 'amount_usdollar' => $this->faker->randomFloat(2), 'currency_id' => null, 'date_closed' => $this->faker->dateTimeBetween('-1month', 'now')->format('Y-m-d'), 'next_step' => $this->faker->text(50), 'sales_stage' => $this->faker->randomKey([ - 'Stage1' => 'Stage1', - 'Stage2' => 'Stage2', + 'Prospecting' => 'Prospecting', + 'Qualification' => 'Qualification', + 'Needs Analysis' => 'Needs Analysis', + 'Value Proposition' => 'Value Proposition', + 'Id. Decision Makers' => 'Identifying Decision Makers', + 'Perception Analysis' => 'Perception Analysis', + 'Proposal/Price Quote' => 'Proposal/Price Quote', + 'Negotiation/Review' => 'Negotiation/Review', + 'Closed Won' => 'Closed Won', + 'Closed Lost' => 'Closed Lost', + ]), + 'probability' => $this->faker->randomKey([// keys must be the same as sales_stage_dom + '10' => 'Prospecting', + '20' => 'Qualification', + '25' => 'Needs Analysis', + '30' => 'Value Proposition', + '40' => 'Id. Decision Makers', + '50' => 'Perception Analysis', + '65' => 'Proposal/Price Quote', + '80' => 'Negotiation/Review', + '100' => 'Closed Won', + '0' => 'Closed Lost', ]), - 'probability' => $this->faker->randomFloat(2), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), diff --git a/database/factories/OutboundEmailFactory.php b/database/factories/OutboundEmailFactory.php index 2aee0f5..268df34 100644 --- a/database/factories/OutboundEmailFactory.php +++ b/database/factories/OutboundEmailFactory.php @@ -23,20 +23,23 @@ public function definition() { return [ 'name' => $this->faker->name(), - 'type' => $this->faker->randomElement([ - 'Type1', - 'Type2', - ]), + 'type' => 'user', 'smtp_from_name' => $this->faker->text(50), 'smtp_from_addr' => $this->faker->text(50), - 'mail_sendtype' => $this->faker->text(8), + 'mail_sendtype' => $this->faker->randomKey([ + 'SMTP' => 'SMTP', + ]), 'mail_smtptype' => $this->faker->text(20), 'mail_smtpserver' => $this->faker->text(50), 'mail_smtpport' => $this->faker->numberBetween(1000, 2000), 'mail_smtpuser' => $this->faker->text(50), 'mail_smtppass' => $this->faker->text(50), 'mail_smtpauth_req' => $this->faker->boolean(), - 'mail_smtpssl' => (string) (int) $this->faker->boolean(), + 'mail_smtpssl' => $this->faker->randomKey([ + '0' => '', + '1' => 'SSL', + '2' => 'TLS', + ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), diff --git a/database/factories/ProjectFactory.php b/database/factories/ProjectFactory.php index 440dcbc..2372925 100644 --- a/database/factories/ProjectFactory.php +++ b/database/factories/ProjectFactory.php @@ -28,8 +28,11 @@ public function definition() 'estimated_end_date' => $this->faker->dateTimeBetween('-1month', '+1month')->format('Y-m-d'), 'status' => $this->faker->randomKey( config('joy-voyager-crm.projects.statuses', [ - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'Draft' => 'Draft', + 'In Review' => 'In Review', + 'Underway' => 'Underway', + 'On_Hold' => 'On Hold', + 'Completed' => 'Completed', ]) ), 'priority' => $this->faker->randomKey( diff --git a/database/factories/ProjectTaskFactory.php b/database/factories/ProjectTaskFactory.php index d098a00..8a482e5 100644 --- a/database/factories/ProjectTaskFactory.php +++ b/database/factories/ProjectTaskFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\ProjectTask; +use TCG\Voyager\Facades\Voyager; class ProjectTaskFactory extends Factory { @@ -22,18 +23,20 @@ class ProjectTaskFactory extends Factory public function definition() { return [ - // 'project_id' => null, + 'project_id' => Voyager::model('Project')->factory(), 'project_task_id' => $this->faker->randomNumber(6), 'name' => $this->faker->name(), - 'relationship_type' => $this->faker->randomElement([ - 'Type1', - 'Type2', + 'relationship_type' => $this->faker->randomKey([ + 'FS' => 'Finish to Start', + 'SS' => 'Start to Start', ]), 'description' => $this->faker->text(500), 'status' => $this->faker->randomElement([ - 'Active', - 'Inactive', - 'Planned', + 'Not Started' => 'Not Started', + 'In Progress' => 'In Progress', + 'Completed' => 'Completed', + 'Pending Input' => 'Pending Input', + 'Deferred' => 'Deferred', ]), 'predecessors' => $this->faker->text(50), 'date_start' => $this->faker->dateTimeBetween('-1month', 'now')->format('Y-m-d'), @@ -41,12 +44,9 @@ public function definition() 'time_finish' => $this->faker->dateTimeBetween('-1month', 'now')->getTimestamp(), 'date_finish' => $this->faker->dateTimeBetween('-1month', 'now')->format('Y-m-d'), 'duration' => $this->faker->numberBetween(10, 100), - 'duration_unit' => $this->faker->randomElement([ - 'Seconds', - 'Hours', - 'Days', - 'Weeks', - 'Months', + 'duration_unit' => $this->faker->randomKey([ + 'Days' => 'Days', + 'Hours' => 'Hours', ]), 'actual_duration' => $this->faker->numberBetween(10, 100), 'percent_complete' => $this->faker->numberBetween(0, 100), @@ -54,16 +54,22 @@ public function definition() 'time_due' => $this->faker->time(), 'parent_task_id' => $this->faker->randomNumber(6), 'priority' => $this->faker->randomElement([ - 'Low', - 'Medium', - 'High', + 'High' => 'High', + 'Medium' => 'Medium', + 'Low' => 'Low', ]), 'milestone_flag' => $this->faker->boolean(), 'order_number' => $this->faker->randomNumber(6), 'task_number' => $this->faker->randomNumber(6), 'estimated_effort' => $this->faker->numberBetween(1, 5), 'actual_effort' => $this->faker->numberBetween(1, 5), - 'utilization' => $this->faker->numberBetween(1, 100), + 'utilization' => $this->faker->randomKey([ + '0' => 'none', + '25' => '25', + '50' => '50', + '75' => '75', + '100' => '100', + ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/ProspectFactory.php b/database/factories/ProspectFactory.php index 0ee399a..8e214dd 100644 --- a/database/factories/ProspectFactory.php +++ b/database/factories/ProspectFactory.php @@ -23,7 +23,15 @@ public function definition() { return [ 'description' => $this->faker->text(500), - 'salutation' => $this->faker->title(), + 'salutation' => $this->faker->randomKey([ + '' => 'None', + 'Mr.' => 'Mr.', + 'Ms.' => 'Ms.', + 'Mrs.' => 'Mrs.', + 'Miss' => 'Miss', + 'Dr.' => 'Dr.', + 'Prof.' => 'Prof.', + ]), 'first_name' => $this->faker->firstName(), 'last_name' => $this->faker->lastName(), 'title' => $this->faker->word(), @@ -63,7 +71,7 @@ public function definition() // 'lead_source' => $this->faker->word(), // 'lead_source_description' => $this->faker->paragraphs(10, true), - + 'birthdate' => $this->faker->dateTimeBetween('-1month', 'now')->format('Y-m-d'), 'lead_id' => null, diff --git a/database/factories/ProspectListFactory.php b/database/factories/ProspectListFactory.php index 6ff6123..000f434 100644 --- a/database/factories/ProspectListFactory.php +++ b/database/factories/ProspectListFactory.php @@ -24,9 +24,13 @@ public function definition() return [ 'name' => $this->faker->name(), 'description' => $this->faker->text(500), - 'list_type' => $this->faker->randomElement([ - 'Type1', - 'Type2', + 'list_type' => $this->faker->randomKey([ + 'default' => 'Default', + 'seed' => 'Seed', + 'exempt_domain' => 'Suppression List - By Domain', + 'exempt_address' => 'Suppression List - By Email Address', + 'exempt' => 'Suppression List - By Id', + 'test' => 'Test', ]), 'domain_name' => $this->faker->text(10), 'created_at' => $this->faker->dateTime(), diff --git a/database/factories/ProspectListsProspectFactory.php b/database/factories/ProspectListsProspectFactory.php index c4fb3a2..1babdee 100644 --- a/database/factories/ProspectListsProspectFactory.php +++ b/database/factories/ProspectListsProspectFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\ProspectListsProspect; +use TCG\Voyager\Facades\Voyager; class ProspectListsProspectFactory extends Factory { @@ -21,10 +22,18 @@ class ProspectListsProspectFactory extends Factory */ public function definition() { + $relatedType = $this->faker->randomKey([ + Voyager::modelClass('Lead') => 'Leads', + Voyager::modelClass('User') => 'User', + Voyager::modelClass('Prospect') => 'Prospects', + Voyager::modelClass('Contact') => 'Contacts', + Voyager::modelClass('Account') => 'Accounts', + ]); + return [ 'prospect_list_id' => null, - 'related_id' => null, - 'related_type' => null, + 'related_type' => $relatedType, + 'related_id' => $relatedType::factory(), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), diff --git a/database/factories/SecuritygroupsRecordFactory.php b/database/factories/SecuritygroupsRecordFactory.php index 129001b..dd5c814 100644 --- a/database/factories/SecuritygroupsRecordFactory.php +++ b/database/factories/SecuritygroupsRecordFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\SecuritygroupsRecord; +use TCG\Voyager\Facades\Voyager; class SecuritygroupsRecordFactory extends Factory { @@ -21,10 +22,32 @@ class SecuritygroupsRecordFactory extends Factory */ public function definition() { + $recordType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ]); + return [ 'securitygroup_id' => null, - 'record_id' => null, - 'module' => $this->faker->word(), + 'module' => $recordType, + 'record_id' => optional($recordType)->factory(), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), diff --git a/database/factories/SpotFactory.php b/database/factories/SpotFactory.php index cea6ca7..2dee17b 100644 --- a/database/factories/SpotFactory.php +++ b/database/factories/SpotFactory.php @@ -25,9 +25,15 @@ public function definition() 'name' => $this->faker->name(), 'description' => $this->faker->text(500), 'config' => null, - 'type' => $this->faker->randomElement([ - 'Type1', - 'Type2', + 'type' => $this->faker->randomKey([ + 'getSalesSpotsData' => 'Sales', + 'getAccountsSpotsData' => 'Accounts', + 'getLeadsSpotsData' => 'Leads', + 'getServiceSpotsData' => 'Service', + 'getMarketingSpotsData' => 'Marketing', + 'getMarketingActivitySpotsData' => 'Marketing Activity', + 'getActivitiesSpotsData' => 'Activities', + 'getQuotesSpotsData' => 'Quotes' ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/SugarfeedFactory.php b/database/factories/SugarfeedFactory.php index 304e847..af89791 100644 --- a/database/factories/SugarfeedFactory.php +++ b/database/factories/SugarfeedFactory.php @@ -28,8 +28,8 @@ public function definition() 'related_id' => null, 'link_url' => $this->faker->word(), 'link_type' => $this->faker->randomKey([ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'sugar' => 'SuiteCRM Email Client', + 'mailto' => 'External Email Client', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/SurveyFactory.php b/database/factories/SurveyFactory.php index 755570a..04ade4b 100644 --- a/database/factories/SurveyFactory.php +++ b/database/factories/SurveyFactory.php @@ -26,8 +26,9 @@ public function definition() 'description' => $this->faker->text(500), 'status' => $this->faker->randomKey( config('joy-voyager-crm.surveys.statuses', [ - 'Draft' => 'Draft', - 'Published' => 'Published', + 'Draft' => 'Draft', + 'Public' => 'Public', + 'Closed' => 'Closed', ]) ), 'submit_text' => $this->faker->text(10), diff --git a/database/factories/SurveyquestionFactory.php b/database/factories/SurveyquestionFactory.php index 4312405..78e28de 100644 --- a/database/factories/SurveyquestionFactory.php +++ b/database/factories/SurveyquestionFactory.php @@ -26,8 +26,17 @@ public function definition() 'description' => $this->faker->text(500), 'sort_order' => $this->faker->numberBetween(1, 100), 'type' => $this->faker->randomKey([ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'Text' => 'Text', + 'Textbox' => 'Textbox', + 'Checkbox' => 'Checkbox', + 'Radio' => 'Radio', + 'Dropdown' => 'Dropdown', + 'Multiselect' => 'Multiselect', + 'Matrix' => 'Matrix', + 'DateTime' => 'DateTime', + 'Date' => 'Date', + 'Scale' => 'Scale', + 'Rating' => 'Rating', ]), 'happiness_question' => $this->faker->boolean(), 'survey_id' => null, diff --git a/database/factories/TaskFactory.php b/database/factories/TaskFactory.php index d86ff63..ceb9a46 100644 --- a/database/factories/TaskFactory.php +++ b/database/factories/TaskFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\Task; +use TCG\Voyager\Facades\Voyager; class TaskFactory extends Factory { @@ -21,6 +22,28 @@ class TaskFactory extends Factory */ public function definition() { + $parentType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Contact') => 'Contact', + Voyager::modelClass('Task') => 'Task', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('Bug') => 'Bug', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + + Voyager::modelClass('Project') => 'Project', + Voyager::modelClass('ProjectTask') => 'Task Task', + + Voyager::modelClass('Prospect') => 'Target', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ]); + return [ 'name' => $this->faker->name(), 'description' => $this->faker->text(500), @@ -28,8 +51,8 @@ public function definition() 'date_due' => $this->faker->dateTimeBetween('-1month', 'now')->format('Y-m-d'), 'date_start_flag' => $this->faker->boolean(), 'date_start' => $this->faker->dateTimeBetween('-1month', 'now')->format('Y-m-d'), - 'parent_type' => null, - 'parent_id' => null, + 'parent_type' => $parentType, + 'parent_id' => optional($parentType)->factory(), 'contact_id' => null, 'priority' => $this->faker->randomKey([ 'Low' => 'Low', @@ -37,9 +60,11 @@ public function definition() 'High' => 'High', ]), 'status' => $this->faker->randomKey([ - 'Not Started' => 'Not Started', - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'Not Started' => 'Not Started', + 'In Progress' => 'In Progress', + 'Completed' => 'Completed', + 'Pending Input' => 'Pending Input', + 'Deferred' => 'Deferred', ]), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index cd364b5..c33266c 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -18,60 +18,68 @@ class UserFactory extends Factory public function definition() { return [ - 'name' => $this->faker->name(), - 'email' => $this->faker->unique()->safeEmail(), - 'email_verified_at' => now(), - 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password - 'remember_token' => Str::random(10), + 'name' => $this->faker->name(), + 'email' => $this->faker->unique()->safeEmail(), + 'email_verified_at' => now(), + 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password + 'remember_token' => Str::random(10), // 'avatar' => $this->faker->avatar(), // 'role_id' => $this->faker->role_id(), // 'settings' => $this->faker->settings(), - 'created_at' => $this->faker->dateTime(), - 'updated_at' => $this->faker->dateTime(), + 'created_at' => $this->faker->dateTime(), + 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), - 'user_name' => $this->faker->unique()->name(), - 'user_hash' => Str::random(10), + 'user_name' => $this->faker->unique()->name(), + 'user_hash' => Str::random(10), 'system_generated_password' => $this->faker->boolean(), - 'pwd_last_changed' => $this->faker->dateTime(), + 'pwd_last_changed' => $this->faker->dateTime(), // 'authenticate_id' => $this->faker->authenticate_id(), - 'sugar_login' => $this->faker->boolean(), - 'first_name' => $this->faker->firstName(), - 'last_name' => $this->faker->lastName(), - 'is_admin' => $this->faker->boolean(), - 'external_auth_only' => $this->faker->boolean(), - 'receive_notifications' => $this->faker->boolean(), - 'description' => $this->faker->text(500), + 'sugar_login' => $this->faker->boolean(), + 'first_name' => $this->faker->firstName(), + 'last_name' => $this->faker->lastName(), + 'is_admin' => $this->faker->boolean(), + 'external_auth_only' => $this->faker->boolean(), + 'receive_notifications' => $this->faker->boolean(), + 'description' => $this->faker->text(500), // 'modified_by_id' => $this->faker->modified_by_id(), // 'created_by_id' => $this->faker->created_by_id(), - 'title' => $this->faker->title(), + 'title' => $this->faker->title(), // 'photo' => $this->faker->photo(), - 'department' => $this->faker->word(), - 'phone_home' => $this->faker->phoneNumber(), - 'phone_mobile' => $this->faker->phoneNumber(), - 'phone_work' => $this->faker->phoneNumber(), - 'phone_other' => $this->faker->phoneNumber(), - 'phone_fax' => $this->faker->phoneNumber(), - 'status' => $this->faker->randomElement([ + 'department' => $this->faker->word(), + 'phone_home' => $this->faker->phoneNumber(), + 'phone_mobile' => $this->faker->phoneNumber(), + 'phone_work' => $this->faker->phoneNumber(), + 'phone_other' => $this->faker->phoneNumber(), + 'phone_fax' => $this->faker->phoneNumber(), + 'status' => $this->faker->randomElement([ 'Active', 'Inactive', ]), - 'address_street' => $this->faker->streetName(), - 'address_city' => $this->faker->city(), - 'address_state' => $this->faker->state(), - 'address_country' => $this->faker->country(), - 'address_postalcode' => $this->faker->postcode(), - 'portal_only' => $this->faker->boolean(), - 'show_on_employees' => $this->faker->boolean(), - 'employee_status' => $this->faker->randomElement([ - 'Active', - 'Inactive', + 'address_street' => $this->faker->streetName(), + 'address_city' => $this->faker->city(), + 'address_state' => $this->faker->state(), + 'address_country' => $this->faker->country(), + 'address_postalcode' => $this->faker->postcode(), + 'portal_only' => $this->faker->boolean(), + 'show_on_employees' => $this->faker->boolean(), + 'employee_status' => $this->faker->randomKey([ + 'Active' => 'Active', + 'Terminated' => 'Terminated', + 'Leave of Absence' => 'Leave of Absence', ]), // 'messenger_id' => $this->faker->messenger_id(), - // 'messenger_type' => $this->faker->messenger_type(), + 'messenger_type' => $this->faker->randomElement([ + '' => 'None', + 'MSN' => 'MSN', + 'Yahoo!' => 'Yahoo!', + 'AOL' => 'AOL', + ]), // 'reports_to_id' => $this->faker->reports_to_id(), - 'is_group' => $this->faker->boolean(), + 'is_group' => $this->faker->boolean(), // 'factor_auth' => $this->faker->factor_auth(), - // 'factor_auth_interface' => $this->faker->factor_auth_interface() + 'factor_auth_interface' => $this->faker->randomKey([ + 'FactorAuthEmailCode' => 'Email Code', + ]) ]; } diff --git a/database/factories/UsersLastImportFactory.php b/database/factories/UsersLastImportFactory.php index b62e23c..08be4bd 100644 --- a/database/factories/UsersLastImportFactory.php +++ b/database/factories/UsersLastImportFactory.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Factories\Factory; use Joy\VoyagerCrm\Models\UsersLastImport; +use TCG\Voyager\Facades\Voyager; class UsersLastImportFactory extends Factory { @@ -21,10 +22,32 @@ class UsersLastImportFactory extends Factory */ public function definition() { + $beanType = $this->faker->randomKey([ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ]); + return [ 'import_module' => $this->faker->word(), - 'bean_type' => $this->faker->word(), - 'bean_id' => null, + 'bean_type' => $beanType, + 'bean_id' => optional($beanType)->factory(), 'created_at' => $this->faker->dateTime(), 'updated_at' => $this->faker->dateTime(), // 'deleted_at' => $this->faker->dateTime(), diff --git a/database/factories/json/currencies.json b/database/json/currencies.json similarity index 100% rename from database/factories/json/currencies.json rename to database/json/currencies.json diff --git a/database/migrations/2022_12_12_000001_create_calls_table.php b/database/migrations/2022_12_12_000001_create_calls_table.php index f0161b6..9259a9a 100644 --- a/database/migrations/2022_12_12_000001_create_calls_table.php +++ b/database/migrations/2022_12_12_000001_create_calls_table.php @@ -27,7 +27,7 @@ public function up() $table->string('parent_type')->nullable(); $table->string('status', 100)->nullable()->default('Planned')->index('idx_status'); $table->string('direction', 100)->nullable(); - $table->uuid('parent_id')->nullable()->comment('opportunities, cases, leads, project, aos_contracts, prospects, bugs, project_task, accounts'); + $table->uuid('parent_id')->nullable(); $table->integer('reminder_time')->nullable()->default(-1); $table->integer('email_reminder_time')->nullable()->default(-1); $table->boolean('email_reminder_sent')->nullable()->default(false); diff --git a/database/migrations/2022_12_12_000006_create_campaign_log_table.php b/database/migrations/2022_12_12_000006_create_campaign_log_table.php index c8c9735..8c0b656 100644 --- a/database/migrations/2022_12_12_000006_create_campaign_log_table.php +++ b/database/migrations/2022_12_12_000006_create_campaign_log_table.php @@ -17,12 +17,12 @@ public function up() $table->uuid('id')->primary(); $table->uuid('campaign_id')->nullable()->index('idx_camp_campaign_id'); $table->uuid('target_tracker_key')->nullable()->index('idx_camp_tracker'); - $table->uuid('target_id')->nullable()->index('idx_target_id')->comment('[leads prospects contacts accounts]'); $table->string('target_type', 100)->nullable(); + $table->uuid('target_id')->nullable()->index('idx_target_id')->comment('[leads prospects contacts accounts]'); $table->string('activity_type', 100)->nullable(); $table->dateTime('activity_date')->nullable(); - $table->uuid('related_id')->nullable()->comment('[contacts emails leads opportunities]'); $table->string('related_type', 100)->nullable(); + $table->uuid('related_id')->nullable()->comment('[contacts emails leads opportunities]'); $table->boolean('archived')->nullable()->default(false); $table->integer('hits')->nullable()->default(0); $table->uuid('list_id')->nullable(); diff --git a/database/migrations/2022_12_12_000006_create_emailman_table.php b/database/migrations/2022_12_12_000006_create_emailman_table.php index b1e4841..d5ddaaf 100644 --- a/database/migrations/2022_12_12_000006_create_emailman_table.php +++ b/database/migrations/2022_12_12_000006_create_emailman_table.php @@ -25,8 +25,8 @@ public function up() $table->boolean('in_queue')->nullable()->default(false); $table->dateTime('in_queue_date')->nullable(); $table->integer('send_attempts')->nullable()->default(0); - $table->uuid('related_id')->nullable(); $table->string('related_type', 100)->nullable(); + $table->uuid('related_id')->nullable(); $table->boolean('related_confirm_opt_in')->nullable()->default(false); $table->index(['list_id', 'user_id', 'deleted_at'], 'idx_eman_list'); diff --git a/database/migrations/2022_12_12_000006_create_prospect_lists_prospects_table.php b/database/migrations/2022_12_12_000006_create_prospect_lists_prospects_table.php index ba1b2e5..6beb25c 100644 --- a/database/migrations/2022_12_12_000006_create_prospect_lists_prospects_table.php +++ b/database/migrations/2022_12_12_000006_create_prospect_lists_prospects_table.php @@ -16,8 +16,8 @@ public function up() $table->comment(''); $table->uuid('id')->primary(); $table->uuid('prospect_list_id')->nullable(); + $table->string('related_type', 100)->nullable(); $table->uuid('related_id')->nullable(); - $table->string('related_type', 25)->nullable(); $table->index(['prospect_list_id', 'deleted_at'], 'idx_plp_pro_id'); $table->index(['related_id', 'related_type', 'prospect_list_id'], 'idx_plp_rel_id'); diff --git a/database/seeders/Account/DataRowsTableSeeder.php b/database/seeders/Account/DataRowsTableSeeder.php index 279a6a9..c0bf4a9 100644 --- a/database/seeders/Account/DataRowsTableSeeder.php +++ b/database/seeders/Account/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -74,10 +73,19 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => '', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + '' => 'None', + 'Analyst' => 'Analyst', + 'Competitor' => 'Competitor', + 'Customer' => 'Customer', + 'Integrator' => 'Integrator', + 'Investor' => 'Investor', + 'Partner' => 'Partner', + 'Press' => 'Press', + 'Prospect' => 'Prospect', + 'Reseller' => 'Reseller', + 'Other' => 'Other', ], ], ])->save(); @@ -86,7 +94,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'industry'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.industry'), 'required' => 0, 'browse' => 1, @@ -95,6 +103,42 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Apparel' => 'Apparel', + 'Banking' => 'Banking', + 'Biotechnology' => 'Biotechnology', + 'Chemicals' => 'Chemicals', + 'Communications' => 'Communications', + 'Construction' => 'Construction', + 'Consulting' => 'Consulting', + 'Education' => 'Education', + 'Electronics' => 'Electronics', + 'Energy' => 'Energy', + 'Engineering' => 'Engineering', + 'Entertainment' => 'Entertainment', + 'Environmental' => 'Environmental', + 'Finance' => 'Finance', + 'Government' => 'Government', + 'Healthcare' => 'Healthcare', + 'Hospitality' => 'Hospitality', + 'Insurance' => 'Insurance', + 'Machinery' => 'Machinery', + 'Manufacturing' => 'Manufacturing', + 'Media' => 'Media', + 'Not For Profit' => 'Not For Profit', + 'Recreation' => 'Recreation', + 'Retail' => 'Retail', + 'Shipping' => 'Shipping', + 'Technology' => 'Technology', + 'Telecommunications' => 'Telecommunications', + 'Transportation' => 'Transportation', + 'Utilities' => 'Utilities', + 'Other' => 'Other', + ], + ], ])->save(); } diff --git a/database/seeders/Alert/DataRowsTableSeeder.php b/database/seeders/Alert/DataRowsTableSeeder.php index 36c4c8a..c194b2a 100644 --- a/database/seeders/Alert/DataRowsTableSeeder.php +++ b/database/seeders/Alert/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -143,7 +142,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'type'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'select_dropdown', + 'type' => 'text', 'display_name' => __('joy-voyager-crm::seeders.data_rows.type'), 'required' => 0, 'browse' => 1, @@ -152,13 +151,6 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, - 'details' => [ - 'default' => 'Type1', - 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', - ], - ], ])->save(); } diff --git a/database/seeders/AmProjecttemplate/DataRowsTableSeeder.php b/database/seeders/AmProjecttemplate/DataRowsTableSeeder.php index 033e437..12ede2e 100644 --- a/database/seeders/AmProjecttemplate/DataRowsTableSeeder.php +++ b/database/seeders/AmProjecttemplate/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -74,11 +73,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'High', + 'default' => 'Medium', 'options' => [ - 'Low' => 'Low', - 'Medium' => 'Medium', 'High' => 'High', + 'Medium' => 'Medium', + 'Low' => 'Low', ], ], ])->save(); @@ -114,9 +113,11 @@ public function run() 'details' => [ 'default' => 'Draft', 'options' => [ - 'Draft' => 'Draft', - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'Draft' => 'Draft', + 'In Review' => 'In Review', + 'Underway' => 'Underway', + 'On_Hold' => 'On Hold', + 'Completed' => 'Completed', ], ], ])->save(); diff --git a/database/seeders/AmTasktemplate/DataRowsTableSeeder.php b/database/seeders/AmTasktemplate/DataRowsTableSeeder.php index e4404c2..0f95b0d 100644 --- a/database/seeders/AmTasktemplate/DataRowsTableSeeder.php +++ b/database/seeders/AmTasktemplate/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -74,11 +73,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Low', + 'default' => 'Medium', 'options' => [ - 'Low' => 'Low', - 'Medium' => 'Medium', 'High' => 'High', + 'Medium' => 'Medium', + 'Low' => 'Low', ], ], ])->save(); @@ -144,7 +143,8 @@ public function run() 'details' => [ 'default' => 'FS', 'options' => [ - 'FS' => 'FS', + 'FS' => 'Finish to Start', + 'SS' => 'Start to Start', ], ], ])->save(); @@ -240,9 +240,11 @@ public function run() 'details' => [ 'default' => 'Not Started', 'options' => [ - 'Not Started' => 'Not Started', - 'Inactive' => 'Inactive', - 'Active' => 'Active', + 'Not Started' => 'Not Started', + 'In Progress' => 'In Progress', + 'Completed' => 'Completed', + 'Pending Input' => 'Pending Input', + 'Deferred' => 'Deferred', ], ], ])->save(); diff --git a/database/seeders/AodIndexevent/DataRowsTableSeeder.php b/database/seeders/AodIndexevent/DataRowsTableSeeder.php index d1994fb..870fa94 100644 --- a/database/seeders/AodIndexevent/DataRowsTableSeeder.php +++ b/database/seeders/AodIndexevent/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -91,6 +90,45 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'record_module'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'select_dropdown', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.record_module'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ], + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'record_id'); if (!$dataRow->exists) { $dataRow->fill([ @@ -106,11 +144,11 @@ public function run() ])->save(); } - $dataRow = $this->dataRow($dataType, 'record_module'); + $dataRow = $this->dataRow($dataType, 'aod_index_event_morphto_record_relationship'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.record_module'), + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.record'), 'required' => 0, 'browse' => 1, 'read' => 1, @@ -118,6 +156,98 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'recordable', + 'type_column' => 'record_module', + 'column' => 'record_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bug'), + 'model' => Voyager::modelClass('Bug'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project'), + 'model' => Voyager::modelClass('Project'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project_task'), + 'model' => Voyager::modelClass('ProjectTask'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.task'), + 'model' => Voyager::modelClass('Task'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_product'), + 'model' => Voyager::modelClass('AosProduct'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], ])->save(); } diff --git a/database/seeders/AorChart/DataRowsTableSeeder.php b/database/seeders/AorChart/DataRowsTableSeeder.php index 08657a7..ffa8b27 100644 --- a/database/seeders/AorChart/DataRowsTableSeeder.php +++ b/database/seeders/AorChart/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -114,10 +113,14 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => null, 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'bar' => 'Bar chart', + 'line' => 'Line chart', + 'pie' => 'Pie chart', + 'radar' => 'Radar chart', + 'stacked_bar' => 'Stacked bar', + 'grouped_bar' => 'Grouped bar', ], ], ])->save(); diff --git a/database/seeders/AorCondition/DataRowsTableSeeder.php b/database/seeders/AorCondition/DataRowsTableSeeder.php index 0450b0d..258c32e 100644 --- a/database/seeders/AorCondition/DataRowsTableSeeder.php +++ b/database/seeders/AorCondition/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -129,10 +128,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'LogicOp1', + 'default' => 'And', 'options' => [ - 'LogicOp1' => 'LogicOp1', - 'LogicOp2' => 'LogicOp2', + 'And' => 'And', + 'OR' => 'OR', ], ], ])->save(); @@ -153,10 +152,11 @@ public function run() ])->save(); } + // Must override the view and CAST array to json $dataRow = $this->dataRow($dataType, 'module_path'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'select_dropdown', + 'type' => 'text', 'display_name' => __('joy-voyager-crm::seeders.data_rows.module_path'), 'required' => 0, 'browse' => 1, @@ -165,13 +165,6 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, - 'details' => [ - 'default' => 'Module1', - 'options' => [ - 'Module1' => 'Module1', - 'Module2' => 'Module2', - ], - ], ])->save(); } @@ -188,10 +181,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Field1', + 'default' => 'RegularUser', 'options' => [ - 'Field1' => 'Field1', - 'Field2' => 'Field2', + 'RegularUser' => 'Regular User', + 'Administrator' => 'Administrator', ], ], ])->save(); @@ -210,10 +203,18 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Operator1', + 'default' => 'Equal_To', 'options' => [ - 'Operator1' => 'Operator1', - 'Operator2' => 'Operator2', + 'Equal_To' => 'Equal To', + 'Not_Equal_To' => 'Not Equal To', + 'Greater_Than' => 'Greater Than', + 'Less_Than' => 'Less Than', + 'Greater_Than_or_Equal_To' => 'Greater Than or Equal To', + 'Less_Than_or_Equal_To' => 'Less Than or Equal To', + 'Contains' => 'Contains', + 'Not_Contains' => 'Not Contains', + 'Starts_With' => 'Starts With', + 'Ends_With' => 'Ends With', ], ], ])->save(); @@ -232,10 +233,14 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'value', + 'default' => 'Value', 'options' => [ - 'value' => 'value', - 'field' => 'field', + 'Value' => 'Value', + 'Field' => 'Field', + 'Date' => 'Date', + 'Multi' => 'One of', + 'Period' => 'Period', + 'CurrentUserID' => 'Current User', ], ], ])->save(); diff --git a/database/seeders/AorReport/DataRowsTableSeeder.php b/database/seeders/AorReport/DataRowsTableSeeder.php index a3eb25d..25676f6 100644 --- a/database/seeders/AorReport/DataRowsTableSeeder.php +++ b/database/seeders/AorReport/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -76,6 +75,7 @@ public function run() 'details' => [ 'default' => null, 'options' => [ + // @TODO All data types except AOR_ and AOW_ 'accounts' => 'accounts', 'contacts' => 'contacts', 'opportunities' => 'opportunities', diff --git a/database/seeders/AorScheduledReport/DataRowsTableSeeder.php b/database/seeders/AorScheduledReport/DataRowsTableSeeder.php index 2355818..0895687 100644 --- a/database/seeders/AorScheduledReport/DataRowsTableSeeder.php +++ b/database/seeders/AorScheduledReport/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -104,10 +103,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => 'Active', 'options' => [ - 'Inactive' => 'Inactive', 'Active' => 'Active', + 'Inactive' => 'Inactive', ], ], ])->save(); diff --git a/database/seeders/AosContract/DataRowsTableSeeder.php b/database/seeders/AosContract/DataRowsTableSeeder.php index 1860b64..dc65cdb 100644 --- a/database/seeders/AosContract/DataRowsTableSeeder.php +++ b/database/seeders/AosContract/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -274,10 +273,9 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => 'Type', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'Type' => 'Type', ], ], ])->save(); @@ -656,10 +654,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => 'Not Started', 'options' => [ - 'Inactive' => 'Inactive', - 'Active' => 'Active', + 'Not Started' => 'Not Started', + 'In Progress' => 'In Progress', + 'Signed' => 'Signed', ], ], ])->save(); diff --git a/database/seeders/AosInvoice/DataRowsTableSeeder.php b/database/seeders/AosInvoice/DataRowsTableSeeder.php index 88a1915..fe890f2 100644 --- a/database/seeders/AosInvoice/DataRowsTableSeeder.php +++ b/database/seeders/AosInvoice/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -687,10 +686,12 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => '', 'options' => [ - 'Inactive' => 'Inactive', - 'Active' => 'Active', + '' => 'None', + 'Paid' => 'Paid', + 'Unpaid' => 'Unpaid', + 'Cancelled' => 'Cancelled', ], ], ])->save(); diff --git a/database/seeders/AosLineItemGroup/DataRowsTableSeeder.php b/database/seeders/AosLineItemGroup/DataRowsTableSeeder.php index 60b6f89..7ac9caa 100644 --- a/database/seeders/AosLineItemGroup/DataRowsTableSeeder.php +++ b/database/seeders/AosLineItemGroup/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -244,7 +243,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'parent_type'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_type'), 'required' => 0, 'browse' => 1, @@ -253,6 +252,15 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosContract') => 'Contract', + ], + ], ])->save(); } @@ -271,6 +279,47 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'aos_line_item_group_morphto_parent_relationship'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'parentable', + 'type_column' => 'parent_type', + 'column' => 'parent_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + ] + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'number'); if (!$dataRow->exists) { $dataRow->fill([ diff --git a/database/seeders/AosPdfTemplate/DataRowsTableSeeder.php b/database/seeders/AosPdfTemplate/DataRowsTableSeeder.php index 3208766..5953278 100644 --- a/database/seeders/AosPdfTemplate/DataRowsTableSeeder.php +++ b/database/seeders/AosPdfTemplate/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -89,10 +88,14 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => '', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'AOS_Quotes' => 'Quotes', + 'AOS_Invoices' => 'Invoices', + 'AOS_Contracts' => 'Contracts', + 'Accounts' => 'Accounts', + 'Contacts' => 'Contacts', + 'Leads' => 'Leads', ], ], ])->save(); @@ -246,10 +249,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'LANDSCAPE', + 'default' => 'Portrait', 'options' => [ - 'LANDSCAPE' => 'LANDSCAPE', - 'PORTRAIT' => 'PORTRAIT', + 'Portrait' => 'Portrait', + 'Landscape' => 'Landscape', ], ], ])->save(); diff --git a/database/seeders/AosProduct/DataRowsTableSeeder.php b/database/seeders/AosProduct/DataRowsTableSeeder.php index 8c32655..372f09b 100644 --- a/database/seeders/AosProduct/DataRowsTableSeeder.php +++ b/database/seeders/AosProduct/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -214,7 +213,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'category'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.category'), 'required' => 0, 'browse' => 1, @@ -223,6 +222,40 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Accounts' => 'Accounts', + 'Activities' => 'Activities', + 'Bugs' => 'Bugs', + 'Calendar' => 'Calendar', + 'Calls' => 'Calls', + 'Campaigns' => 'Campaigns', + 'Cases' => 'Cases', + 'Contacts' => 'Contacts', + 'Currencies' => 'Currencies', + 'Dashboard' => 'Dashboard', + 'Documents' => 'Documents', + 'Emails' => 'Emails', + 'Feeds' => 'Feeds', + 'Forecasts' => 'Forecasts', + 'Help' => 'Help', + 'Home' => 'Home', + 'Leads' => 'Leads', + 'Meetings' => 'Meetings', + 'Notes' => 'Notes', + 'Opportunities' => 'Opportunities', + 'Outlook Plugin' => 'Outlook Plugin', + 'Projects' => 'Projects', + 'Quotes' => 'Quotes', + 'Releases' => 'Releases', + 'RSS' => 'RSS', + 'Studio' => 'Studio', + 'Upgrade' => 'Upgrade', + 'Users' => 'Users', + ], + ], ])->save(); } diff --git a/database/seeders/AosProductsQuote/DataRowsTableSeeder.php b/database/seeders/AosProductsQuote/DataRowsTableSeeder.php index b6a55fe..f2e40dc 100644 --- a/database/seeders/AosProductsQuote/DataRowsTableSeeder.php +++ b/database/seeders/AosProductsQuote/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -404,7 +403,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'parent_type'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_type'), 'required' => 0, 'browse' => 1, @@ -413,6 +412,30 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ], + ], ])->save(); } @@ -431,6 +454,113 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'aos_products_quote_morphto_parent_relationship'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'parentable', + 'type_column' => 'parent_type', + 'column' => 'parent_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bug'), + 'model' => Voyager::modelClass('Bug'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project'), + 'model' => Voyager::modelClass('Project'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project_task'), + 'model' => Voyager::modelClass('ProjectTask'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.task'), + 'model' => Voyager::modelClass('Task'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_product'), + 'model' => Voyager::modelClass('AosProduct'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'aos_products_quote_belongsto_aos_product_relationship'); if (!$dataRow->exists) { $dataRow->fill([ diff --git a/database/seeders/AosQuote/DataRowsTableSeeder.php b/database/seeders/AosQuote/DataRowsTableSeeder.php index cd42ad4..6c1e55d 100644 --- a/database/seeders/AosQuote/DataRowsTableSeeder.php +++ b/database/seeders/AosQuote/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -404,7 +403,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'term'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.term'), 'required' => 0, 'browse' => 1, @@ -413,6 +412,14 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Net 15' => 'Nett 15', + 'Net 30' => 'Nett 30', + ], + ], ])->save(); } @@ -429,10 +436,16 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Stage1', + 'default' => 'Draft', 'options' => [ - 'Stage1' => 'Stage1', - 'Stage2' => 'Stage2', + 'Draft' => 'Draft', + 'Negotiation' => 'Negotiation', + 'Delivered' => 'Delivered', + 'On Hold' => 'On Hold', + 'Confirmed' => 'Confirmed', + 'Closed Accepted' => 'Closed Accepted', + 'Closed Lost' => 'Closed Lost', + 'Closed Dead' => 'Closed Dead', ], ], ])->save(); @@ -451,10 +464,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Approval1', + 'default' => '', 'options' => [ - 'Approval1' => 'Approval1', - 'Approval2' => 'Approval2', + '' => 'None', + 'Approved' => 'Approved', + 'Not Approved' => 'Not Approved', ], ], ])->save(); @@ -473,10 +487,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Active', + 'default' => 'Not Invoiced', 'options' => [ - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'Not Invoiced' => 'Not Invoiced', + 'Invoiced' => 'Invoiced', ], ], ])->save(); diff --git a/database/seeders/AowAction/DataRowsTableSeeder.php b/database/seeders/AowAction/DataRowsTableSeeder.php index c1345bf..18c695b 100644 --- a/database/seeders/AowAction/DataRowsTableSeeder.php +++ b/database/seeders/AowAction/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -129,10 +128,12 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'ActionType1', + 'default' => '', 'options' => [ - 'ActionType1' => 'ActionType1', - 'ActionType2' => 'ActionType2', + 'CreateRecord' => 'CreateRecord', + 'ModifyRecord' => 'ModifyRecord', + 'SendEmail' => 'SendEmail', + 'ComputeField' => 'ComputeField', ], ], ])->save(); diff --git a/database/seeders/AowProcessed/DataRowsTableSeeder.php b/database/seeders/AowProcessed/DataRowsTableSeeder.php index 8d96fc2..09840fd 100644 --- a/database/seeders/AowProcessed/DataRowsTableSeeder.php +++ b/database/seeders/AowProcessed/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -104,7 +103,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'parent_type'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_type'), 'required' => 0, 'browse' => 1, @@ -113,6 +112,30 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ], + ], ])->save(); } @@ -131,6 +154,113 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'aow_processed_morphto_parent_relationship'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'parentable', + 'type_column' => 'parent_type', + 'column' => 'parent_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bug'), + 'model' => Voyager::modelClass('Bug'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project'), + 'model' => Voyager::modelClass('Project'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project_task'), + 'model' => Voyager::modelClass('ProjectTask'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.task'), + 'model' => Voyager::modelClass('Task'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_product'), + 'model' => Voyager::modelClass('AosProduct'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'created_at'); if (!$dataRow->exists) { $dataRow->fill([ diff --git a/database/seeders/AowProcessedAowAction/DataRowsTableSeeder.php b/database/seeders/AowProcessedAowAction/DataRowsTableSeeder.php index 851a5b4..6f0c9b6 100644 --- a/database/seeders/AowProcessedAowAction/DataRowsTableSeeder.php +++ b/database/seeders/AowProcessedAowAction/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -126,9 +125,10 @@ public function run() 'details' => [ 'default' => 'Pending', 'options' => [ + 'Complete' => 'Complete', + 'Running' => 'Running', 'Pending' => 'Pending', - 'Inactive' => 'Inactive', - 'Active' => 'Active', + 'Failed' => 'Failed', ], ], ])->save(); diff --git a/database/seeders/AowWorkflow/DataRowsTableSeeder.php b/database/seeders/AowWorkflow/DataRowsTableSeeder.php index 1487ee8..1a300fc 100644 --- a/database/seeders/AowWorkflow/DataRowsTableSeeder.php +++ b/database/seeders/AowWorkflow/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -76,6 +75,7 @@ public function run() 'details' => [ 'default' => null, 'options' => [ + // @TODO @fixme All datatypes except AOW_ 'accounts' => 'accounts', 'contacts' => 'contacts', ], @@ -86,7 +86,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'flow_run_on'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.flow_run_on'), 'required' => 0, 'browse' => 1, @@ -95,13 +95,21 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + 'All_Records' => 'All Records', + 'New_Records' => 'New Records', + 'Modified_Records' => 'Modified Records', + ], + ], ])->save(); } $dataRow = $this->dataRow($dataType, 'run_when'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.run_when'), 'required' => 0, 'browse' => 1, @@ -110,6 +118,14 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + 'Always' => 'Always', + 'On_Save' => 'Only On Save', + 'In_Scheduler' => 'Only In The Scheduler', + ], + ], ])->save(); } diff --git a/database/seeders/Bug/DataRowsTableSeeder.php b/database/seeders/Bug/DataRowsTableSeeder.php index e356f49..8a9c158 100644 --- a/database/seeders/Bug/DataRowsTableSeeder.php +++ b/database/seeders/Bug/DataRowsTableSeeder.php @@ -90,8 +90,8 @@ public function run() 'details' => [ 'default' => config('joy-voyager-crm.bugs.default_type', 'Type1'), 'options' => config('joy-voyager-crm.bugs.types', [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'Defect' => 'Defect', + 'Feature' => 'Feature', ]), ], ])->save(); @@ -110,11 +110,12 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => config('joy-voyager-crm.bugs.default_priority', 'Low'), + 'default' => config('joy-voyager-crm.bugs.default_priority', 'Medium'), 'options' => config('joy-voyager-crm.bugs.priorities', [ - 'Low' => 'Low', - 'Medium' => 'Medium', + 'Urgent' => 'Urgent', 'High' => 'High', + 'Medium' => 'Medium', + 'Low' => 'Low', ]), ], ])->save(); @@ -133,10 +134,15 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => config('joy-voyager-crm.bugs.default_resolution', 'No'), + 'default' => config('joy-voyager-crm.bugs.default_resolution', ''), 'options' => config('joy-voyager-crm.bugs.resolutions', [ - 'Yes' => 'Yes', - 'No' => 'No', + '' => 'None', + 'Accepted' => 'Accepted', + 'Duplicate' => 'Duplicate', + 'Fixed' => 'Fixed', + 'Out of Date' => 'Out of Date', + 'Invalid' => 'Invalid', + 'Later' => 'Later', ]), ], ])->save(); @@ -240,7 +246,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'source'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.source'), 'required' => 0, 'browse' => 1, @@ -249,13 +255,23 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Internal' => 'Internal', + 'Forum' => 'Forum', + 'Web' => 'Web', + 'InboundEmail' => 'Email', + ], + ], ])->save(); } $dataRow = $this->dataRow($dataType, 'product_category'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.product_category'), 'required' => 0, 'browse' => 1, @@ -264,6 +280,40 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Accounts' => 'Accounts', + 'Activities' => 'Activities', + 'Bugs' => 'Bugs', + 'Calendar' => 'Calendar', + 'Calls' => 'Calls', + 'Campaigns' => 'Campaigns', + 'Cases' => 'Cases', + 'Contacts' => 'Contacts', + 'Currencies' => 'Currencies', + 'Dashboard' => 'Dashboard', + 'Documents' => 'Documents', + 'Emails' => 'Emails', + 'Feeds' => 'Feeds', + 'Forecasts' => 'Forecasts', + 'Help' => 'Help', + 'Home' => 'Home', + 'Leads' => 'Leads', + 'Meetings' => 'Meetings', + 'Notes' => 'Notes', + 'Opportunities' => 'Opportunities', + 'Outlook Plugin' => 'Outlook Plugin', + 'Projects' => 'Projects', + 'Quotes' => 'Quotes', + 'Releases' => 'Releases', + 'RSS' => 'RSS', + 'Studio' => 'Studio', + 'Upgrade' => 'Upgrade', + 'Users' => 'Users', + ], + ], ])->save(); } @@ -280,10 +330,13 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => config('joy-voyager-crm.bugs.default_status', 'Active'), + 'default' => config('joy-voyager-crm.bugs.default_status', 'New'), 'options' => config('joy-voyager-crm.bugs.statuses', [ - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'New' => 'New', + 'Assigned' => 'Assigned', + 'Closed' => 'Closed', + 'Pending' => 'Pending', + 'Rejected' => 'Rejected', ]), ], ])->save(); diff --git a/database/seeders/Call/DataRowsTableSeeder.php b/database/seeders/Call/DataRowsTableSeeder.php index 41be838..1c441a2 100644 --- a/database/seeders/Call/DataRowsTableSeeder.php +++ b/database/seeders/Call/DataRowsTableSeeder.php @@ -133,19 +133,180 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'INCOMING', + 'default' => 'Outbound', 'options' => [ - 'INCOMING' => 'INCOMING', - 'OUTGOING' => 'OUTGOING', + 'Inbound' => 'Inbound', + 'Outbound' => 'Outbound', ], ], ])->save(); } + $dataRow = $this->dataRow($dataType, 'parent_type'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'select_dropdown', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_type'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Contact') => 'Contact', + Voyager::modelClass('Task') => 'Task', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('Bug') => 'Bug', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + + Voyager::modelClass('Project') => 'Project', + Voyager::modelClass('ProjectTask') => 'Task Task', + + Voyager::modelClass('Prospect') => 'Target', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ], + ], + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'parent_id'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'text', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_id'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'call_morphto_parent_relationship'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'parentable', + 'type_column' => 'parent_type', + 'column' => 'parent_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.task'), + 'model' => Voyager::modelClass('Task'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bug'), + 'model' => Voyager::modelClass('Bug'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project'), + 'model' => Voyager::modelClass('Project'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project_task'), + 'model' => Voyager::modelClass('ProjectTask'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_product'), + 'model' => Voyager::modelClass('AosProduct'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'reminder_time'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'number', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.reminder_time'), 'required' => 0, 'browse' => 1, @@ -154,13 +315,28 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + 60 => '1 minute prior', + 300 => '5 minutes prior', + 600 => '10 minutes prior', + 900 => '15 minutes prior', + 1800 => '30 minutes prior', + 3600 => '1 hour prior', + 7200 => '2 hours prior', + 10800 => '3 hours prior', + 18000 => '5 hours prior', + 86400 => '1 day prior', + ], + ], ])->save(); } $dataRow = $this->dataRow($dataType, 'email_reminder_time'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'number', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.email_reminder_time'), 'required' => 0, 'browse' => 1, @@ -169,6 +345,21 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + 60 => '1 minute prior', + 300 => '5 minutes prior', + 600 => '10 minutes prior', + 900 => '15 minutes prior', + 1800 => '30 minutes prior', + 3600 => '1 hour prior', + 7200 => '2 hours prior', + 10800 => '3 hours prior', + 18000 => '5 hours prior', + 86400 => '1 day prior', + ], + ], ])->save(); } @@ -205,29 +396,39 @@ public function run() $dataRow = $this->dataRow($dataType, 'repeat_type'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.repeat_type'), 'required' => 0, - 'browse' => 0, - 'read' => 0, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Daily' => 'Daily', + 'Weekly' => 'Weekly', + 'Monthly' => 'Monthly', + 'Yearly' => 'Yearly', + ], + ], ])->save(); } $dataRow = $this->dataRow($dataType, 'repeat_interval'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'number', 'display_name' => __('joy-voyager-crm::seeders.data_rows.repeat_interval'), 'required' => 0, - 'browse' => 0, - 'read' => 0, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, 'order' => ++$order, ])->save(); } @@ -235,15 +436,28 @@ public function run() $dataRow = $this->dataRow($dataType, 'repeat_dow'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.repeat_dow'), 'required' => 0, - 'browse' => 0, - 'read' => 0, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '0' => '', + '1' => 'Sunday', + '2' => 'Monday', + '3' => 'Tuesday', + '4' => 'Wednesday', + '5' => 'Thursday', + '6' => 'Friday', + '7' => 'Saturday', + ], + ], ])->save(); } @@ -320,11 +534,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Active', + 'default' => 'Planned', 'options' => [ - 'Active' => 'Active', - 'Inactive' => 'Inactive', 'Planned' => 'Planned', + 'Held' => 'Held', + 'Not Held' => 'Not Held', ], ], ])->save(); diff --git a/database/seeders/CallsLead/DataRowsTableSeeder.php b/database/seeders/CallsLead/DataRowsTableSeeder.php index ea5a0db..4024196 100644 --- a/database/seeders/CallsLead/DataRowsTableSeeder.php +++ b/database/seeders/CallsLead/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -89,7 +88,7 @@ public function run() 'type' => 'belongsTo', 'column' => 'lead_id', 'key' => 'id', - 'label' => 'name', + 'label' => 'first_name', 'pivot_table' => 'leads', 'pivot' => 0, ], @@ -148,9 +147,9 @@ public function run() 'details' => [ 'default' => 'none', 'options' => [ - 'none' => 'none', - 'Accept1' => 'Accept1', - 'Accept2' => 'Accept2', + 'none' => 'none', + 'Accepted' => 'Accepted', + 'Rejected' => 'Rejected', ], ], ])->save(); diff --git a/database/seeders/CallsUser/DataRowsTableSeeder.php b/database/seeders/CallsUser/DataRowsTableSeeder.php index 45cd20e..aaa09d0 100644 --- a/database/seeders/CallsUser/DataRowsTableSeeder.php +++ b/database/seeders/CallsUser/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -148,9 +147,9 @@ public function run() 'details' => [ 'default' => 'none', 'options' => [ - 'none' => 'none', - 'Accept1' => 'Accept1', - 'Accept2' => 'Accept2', + 'none' => 'none', + 'Accepted' => 'Accepted', + 'Rejected' => 'Rejected', ], ], ])->save(); diff --git a/database/seeders/Campaign/DataRowsTableSeeder.php b/database/seeders/Campaign/DataRowsTableSeeder.php index 8673b99..6d135f0 100644 --- a/database/seeders/Campaign/DataRowsTableSeeder.php +++ b/database/seeders/Campaign/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -249,10 +248,18 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => '', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + '' => 'None', + 'Telesales' => 'Telesales', + 'Mail' => 'Mail', + 'Email' => 'Email', + 'Print' => 'Print', + 'Web' => 'Web', + 'Radio' => 'Radio', + 'Television' => 'Television', + 'NewsLetter' => 'Newsletter', + 'Survey' => 'Survey', ], ], ])->save(); @@ -303,12 +310,11 @@ public function run() 'details' => [ 'default' => null, 'options' => [ - 'every minute' => 'Every minute', - 'hourly' => 'Hourly', - 'daily' => 'Daily', - 'weekly' => 'Weekly', - 'mothly' => 'Mothly', - 'yearly' => 'Yearly', + '' => 'None', + 'Weekly' => 'Weekly', + 'Monthly' => 'Monthly', + 'Quarterly' => 'Quarterly', + 'Annually' => 'Annually', ], ], ])->save(); @@ -367,10 +373,15 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => '', 'options' => [ - 'Inactive' => 'Inactive', + '' => 'None', + 'Planning' => 'Planning', 'Active' => 'Active', + 'Inactive' => 'Inactive', + 'Complete' => 'Complete', + //'In Queue' => 'In Queue', + //'Sending' => 'Sending', ], ], ])->save(); diff --git a/database/seeders/CampaignLog/DataRowsTableSeeder.php b/database/seeders/CampaignLog/DataRowsTableSeeder.php index 29f6dc3..331b735 100644 --- a/database/seeders/CampaignLog/DataRowsTableSeeder.php +++ b/database/seeders/CampaignLog/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -86,6 +85,31 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'target_type'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'select_dropdown', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.target_type'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'default' => null, + 'options' => [ + Voyager::modelClass('Contact') => 'Contacts', + Voyager::modelClass('User') => 'Users', + Voyager::modelClass('Prospect') => 'Prospects', + Voyager::modelClass('Lead') => 'Leads', + Voyager::modelClass('Account') => 'Accounts', + ], + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'target_id'); if (!$dataRow->exists) { $dataRow->fill([ @@ -101,11 +125,11 @@ public function run() ])->save(); } - $dataRow = $this->dataRow($dataType, 'target_type'); + $dataRow = $this->dataRow($dataType, 'campaign_log_morphto_target_relationship'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.target_type'), + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.target'), 'required' => 0, 'browse' => 1, 'read' => 1, @@ -113,6 +137,44 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'targetable', + 'type_column' => 'target_type', + 'column' => 'target_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'first_name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.user'), + 'model' => Voyager::modelClass('User'), + 'key' => 'id', + 'label' => 'first_name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'first_name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'first_name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], ])->save(); } @@ -129,10 +191,18 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => '', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + '' => 'None', + 'targeted' => 'Message Sent/Attempted', + 'send error' => 'Bounced Messages,Other', + 'invalid email' => 'Bounced Messages,Invalid Email', + 'link' => 'Click-thru Link', + 'viewed' => 'Viewed Message', + 'removed' => 'Opted Out', + 'lead' => 'Leads Created', + 'contact' => 'Contacts Created', + 'blocked' => 'Suppressed by address or domain', ], ], ])->save(); @@ -153,6 +223,30 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'related_type'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'select_dropdown', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.related_type'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'default' => null, + 'options' => [ + Voyager::modelClass('Contact') => 'Contacts', + Voyager::modelClass('Email') => 'Emails', + Voyager::modelClass('Lead') => 'Leads', + Voyager::modelClass('Opportunity') => 'Opportunities', + ], + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'related_id'); if (!$dataRow->exists) { $dataRow->fill([ @@ -168,11 +262,11 @@ public function run() ])->save(); } - $dataRow = $this->dataRow($dataType, 'related_type'); + $dataRow = $this->dataRow($dataType, 'campaign_log_morphto_related_relationship'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.related_type'), + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.related'), 'required' => 0, 'browse' => 1, 'read' => 1, @@ -180,6 +274,38 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'relatedable', + 'type_column' => 'related_type', + 'column' => 'related_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'first_name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.email'), + 'model' => Voyager::modelClass('Email'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'first_name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + ] + ], ])->save(); } diff --git a/database/seeders/Contact/DataRowsTableSeeder.php b/database/seeders/Contact/DataRowsTableSeeder.php index 0dbbdc6..46f2049 100644 --- a/database/seeders/Contact/DataRowsTableSeeder.php +++ b/database/seeders/Contact/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -49,7 +48,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'salutation'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.salutation'), 'required' => 0, 'browse' => 1, @@ -58,6 +57,18 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Mr.' => 'Mr.', + 'Ms.' => 'Ms.', + 'Mrs.' => 'Mrs.', + 'Miss' => 'Miss', + 'Dr.' => 'Dr.', + 'Prof.' => 'Prof.', + ], + ], ])->save(); } @@ -454,7 +465,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'lead_source'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead_source'), 'required' => 0, 'browse' => 1, @@ -463,6 +474,26 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => 'Self Generated', + 'options' => [ + '' => 'None', + 'Cold Call' => 'Cold Call', + 'Existing Customer' => 'Existing Customer', + 'Self Generated' => 'Self Generated', + 'Employee' => 'Employee', + 'Partner' => 'Partner', + 'Public Relations' => 'Public Relations', + 'Direct Mail' => 'Direct Mail', + 'Conference' => 'Conference', + 'Trade Show' => 'Trade Show', + 'Web Site' => 'Web Site', + 'Word of mouth' => 'Word of mouth', + 'Email' => 'Email', + 'Campaign' => 'Campaign', + 'Other' => 'Other', + ], + ], ])->save(); } @@ -604,10 +635,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => 'RegularUser', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'RegularUser' => 'Regular User', + 'Administrator' => 'Administrator', ], ], ])->save(); diff --git a/database/seeders/CrmCase/DataRowsTableSeeder.php b/database/seeders/CrmCase/DataRowsTableSeeder.php index 919c7eb..c307183 100644 --- a/database/seeders/CrmCase/DataRowsTableSeeder.php +++ b/database/seeders/CrmCase/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -89,10 +88,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => 'User', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'Administration' => 'Administration', + 'Product' => 'Product', + 'User' => 'User', ], ], ])->save(); @@ -111,10 +111,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Priority1', + 'default' => 'P2', 'options' => [ - 'Priority1' => 'Priority1', - 'Priority2' => 'Priority2', + 'P1' => 'High', + 'P2' => 'Medium', + 'P3' => 'Low', ], ], ])->save(); @@ -123,22 +124,15 @@ public function run() $dataRow = $this->dataRow($dataType, 'resolution'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'select_dropdown', + 'type' => 'text_area', 'display_name' => __('joy-voyager-crm::seeders.data_rows.resolution'), 'required' => 0, - 'browse' => 1, + 'browse' => 0, 'read' => 1, 'edit' => 1, 'add' => 1, 'delete' => 1, 'order' => ++$order, - 'details' => [ - 'default' => 'Resolution1', - 'options' => [ - 'Resolution1' => 'Resolution1', - 'Resolution2' => 'Resolution2', - ], - ], ])->save(); } @@ -272,15 +266,17 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'model' => Voyager::modelClass('Bug'), - 'table' => 'bugs', - 'type' => 'belongsToMany', - 'column' => 'id', - 'key' => 'id', - 'label' => 'name', - 'pivot_table' => 'bugs', - 'pivot' => '1', - 'taggable' => '0', + 'model' => Voyager::modelClass('Bug'), + 'table' => 'bugs', + 'type' => 'belongsToMany', + 'column' => 'id', + 'key' => 'id', + 'label' => 'name', + 'pivot_table' => 'cases_bugs', + 'foreign_pivot_key' => 'case_id', + 'related_pivot_key' => 'bug_id', + 'pivot' => '1', + 'taggable' => '0', ], ])->save(); } @@ -298,10 +294,14 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => 'Open_New', 'options' => [ - 'Inactive' => 'Inactive', - 'Active' => 'Active', + 'Open_New' => 'New', + 'Open_Assigned' => 'Assigned', + 'Closed_Closed' => 'Closed', + 'Open_Pending Input' => 'Pending Input', + 'Closed_Rejected' => 'Rejected', + 'Closed_Duplicate' => 'Duplicate', ], ], ])->save(); diff --git a/database/seeders/Currency/CurrenciesTableSeeder.php b/database/seeders/Currency/CurrenciesTableSeeder.php index 7b9a96e..9952388 100644 --- a/database/seeders/Currency/CurrenciesTableSeeder.php +++ b/database/seeders/Currency/CurrenciesTableSeeder.php @@ -3,6 +3,7 @@ namespace Joy\VoyagerCrm\Database\Seeders\Currency; use Illuminate\Database\Seeder; +use Illuminate\Support\Carbon; use TCG\Voyager\Facades\Voyager; class CurrenciesTableSeeder extends Seeder @@ -18,9 +19,37 @@ public function run() return false; } - $count = 20; - Voyager::model('Currency')->factory() - ->count($count) - ->create(); + $currencies = json_decode(file_get_contents(__DIR__ . '/../../json/currencies.json')); + + foreach ($currencies as $currencyEach) { + $currency = $this->currency($currencyEach->code); + if (!$currency->exists) { + $currency->name = $currencyEach->name; + $currency->symbol = $currencyEach->symbol_native; + $currency->iso4217 = $currencyEach->code; + $currency->decimal = $currencyEach->decimal; + $currency->rounding = $currencyEach->rounding; + $currency->conversion_rate = null; + $currency->status = 'Active'; + $currency->created_at = Carbon::now(); + $currency->updated_at = Carbon::now(); + // $currency->deleted_at => Carbon::now(); + $currency->save(); + } + } + } + + /** + * [currency description]. + * + * @param [type] $iso4217 [description] + * + * @return [type] [description] + */ + protected function currency($iso4217) + { + return Voyager::model('Currency')->firstOrNew([ + 'iso4217' => $iso4217, + ]); } } diff --git a/database/seeders/Currency/VoyagerDummyDatabaseSeeder.php b/database/seeders/Currency/VoyagerDummyDatabaseSeeder.php index bf0ccf0..5fd03fe 100644 --- a/database/seeders/Currency/VoyagerDummyDatabaseSeeder.php +++ b/database/seeders/Currency/VoyagerDummyDatabaseSeeder.php @@ -13,8 +13,8 @@ class VoyagerDummyDatabaseSeeder extends Seeder */ public function run() { - $this->call([ - DummyCurrenciesTableSeeder::class - ]); + // $this->call([ + // DummyCurrenciesTableSeeder::class + // ]); } } diff --git a/database/seeders/Document/DataRowsTableSeeder.php b/database/seeders/Document/DataRowsTableSeeder.php index f60705a..a060552 100644 --- a/database/seeders/Document/DataRowsTableSeeder.php +++ b/database/seeders/Document/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -89,10 +88,16 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'DocType1', + 'default' => 'Sugar', 'options' => [ - 'DocType1' => 'DocType1', - 'DocType2' => 'DocType2', + 'Sugar' => 'SuiteCRM', + 'WebEx' => 'WebEx', + 'GoToMeeting' => 'GoToMeeting', + 'IBMSmartCloud' => 'IBM SmartCloud', + 'Google' => 'Google', + 'Box' => 'Box.net', + 'Facebook' => 'Facebook', + 'Twitter' => 'Twitter', ], ], ])->save(); @@ -146,7 +151,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'category_id'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.category_id'), 'required' => 0, 'browse' => 1, @@ -155,13 +160,22 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Marketing' => 'Marketing', + 'Knowledege Base' => 'Knowledge Base', + 'Sales' => 'Sales', + ], + ], ])->save(); } $dataRow = $this->dataRow($dataType, 'subcategory_id'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.subcategory_id'), 'required' => 0, 'browse' => 1, @@ -170,13 +184,22 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Marketing Collateral' => 'Marketing Collateral', + 'Product Brochures' => 'Product Brochures', + 'FAQ' => 'FAQ', + ], + ], ])->save(); } $dataRow = $this->dataRow($dataType, 'status_id'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.status_id'), 'required' => 0, 'browse' => 1, @@ -185,6 +208,17 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + 'Active' => 'Active', + 'Draft' => 'Draft', + 'FAQ' => 'FAQ', + 'Expired' => 'Expired', + 'Under Review' => 'Under Review', + 'Pending' => 'Pending', + ], + ], ])->save(); } @@ -336,10 +370,13 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'TemplateType1', + 'default' => '', 'options' => [ - 'TemplateType1' => 'TemplateType1', - 'TemplateType2' => 'TemplateType2', + '' => 'None', + 'mailmerge' => 'Mail Merge', + 'eula' => 'EULA', + 'nda' => 'NDA', + 'license' => 'License Agreement', ], ], ])->save(); diff --git a/database/seeders/Email/DataRowsTableSeeder.php b/database/seeders/Email/DataRowsTableSeeder.php index d5fd084..3dc485e 100644 --- a/database/seeders/Email/DataRowsTableSeeder.php +++ b/database/seeders/Email/DataRowsTableSeeder.php @@ -103,10 +103,13 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => '', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'out' => 'Sent', + 'archived' => 'Archived', + 'draft' => 'Draft', + 'inbound' => 'Inbound', + 'campaign' => 'Campaign', ], ], ])->save(); @@ -185,16 +188,27 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => null, + 'default' => '', 'options' => [ - 'opportunities' => 'opportunities', - 'cases' => 'cases', - 'leads' => 'leads', - 'project' => 'project', - 'prospects' => 'prospects', - 'bugs' => 'bugs', - 'project_task' => 'project_task', - 'accounts' => 'accounts', + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', ], ], ])->save(); @@ -215,6 +229,113 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'email_morphto_parent_relationship'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'parentable', + 'type_column' => 'parent_type', + 'column' => 'parent_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bug'), + 'model' => Voyager::modelClass('Bug'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project'), + 'model' => Voyager::modelClass('Project'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project_task'), + 'model' => Voyager::modelClass('ProjectTask'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.task'), + 'model' => Voyager::modelClass('Task'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_product'), + 'model' => Voyager::modelClass('AosProduct'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'uid'); if (!$dataRow->exists) { $dataRow->fill([ @@ -233,7 +354,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'category_id'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.category_id'), 'required' => 0, 'browse' => 1, @@ -242,6 +363,14 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Archived' => 'Archived', + // TODO: add more categories here... + ], + ], ])->save(); } @@ -258,10 +387,16 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Active', + 'default' => 'unread', 'options' => [ - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'archived' => 'Archived', + 'closed' => 'Closed', + 'draft' => 'In Draft', + 'read' => 'Read', + 'replied' => 'Replied', + 'sent' => 'Sent', + 'send_error' => 'Send Error', + 'unread' => 'Unread', ], ], ])->save(); diff --git a/database/seeders/EmailAddress/DataRowsTableSeeder.php b/database/seeders/EmailAddress/DataRowsTableSeeder.php new file mode 100644 index 0000000..62272ff --- /dev/null +++ b/database/seeders/EmailAddress/DataRowsTableSeeder.php @@ -0,0 +1,237 @@ +where('slug', 'email-addresses')->firstOrFail(); + $order = Voyager::model('DataRow')->whereDataTypeId($dataType->id)->max('order') ?? 0; + + $dataRow = $this->dataRow($dataType, 'id'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'text', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.id'), + 'required' => 1, + 'browse' => 0, + 'read' => 0, + 'edit' => 0, + 'add' => 0, + 'delete' => 0, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'email_address'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'text', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.email_address'), + 'required' => 1, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'email_address_caps'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'text', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.email_address_caps'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'invalid_email'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'checkbox', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.invalid_email'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'opt_out'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'checkbox', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opt_out'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'confirm_opt_in'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'select_dropdown', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.confirm_opt_in'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'default' => 'not-opt-in', + 'options' => [ + 'not-opt-in' => 'Disabled', + 'opt-in' => 'Opt In', + 'confirmed-opt-in' => 'Confirmed Opt In' + ], + ], + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'confirm_opt_in_date'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'timestamp', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.confirm_opt_in_date'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'confirm_opt_in_sent_date'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'timestamp', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.confirm_opt_in_sent_date'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'confirm_opt_in_fail_date'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'timestamp', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.confirm_opt_in_fail_date'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'confirm_opt_in_token'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'text', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.confirm_opt_in_token'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'created_at'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'timestamp', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.created_at'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 0, + 'add' => 0, + 'delete' => 0, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'updated_at'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'timestamp', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.updated_at'), + 'required' => 0, + 'browse' => 0, + 'read' => 0, + 'edit' => 0, + 'add' => 0, + 'delete' => 0, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'deleted_at'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'timestamp', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.deleted_at'), + 'required' => 0, + 'browse' => 0, + 'read' => 0, + 'edit' => 0, + 'add' => 0, + 'delete' => 0, + 'order' => ++$order, + ])->save(); + } + } + + /** + * [dataRow description]. + * + * @param [type] $type [description] + * @param [type] $field [description] + * + * @return [type] [description] + */ + protected function dataRow($type, $field) + { + return Voyager::model('DataRow')->firstOrNew([ + 'data_type_id' => $type->id, + 'field' => $field, + ]); + } +} diff --git a/database/seeders/EmailAddress/DataTypesTableSeeder.php b/database/seeders/EmailAddress/DataTypesTableSeeder.php new file mode 100644 index 0000000..8a63124 --- /dev/null +++ b/database/seeders/EmailAddress/DataTypesTableSeeder.php @@ -0,0 +1,43 @@ +dataType('slug', 'email-addresses'); + if (!$dataType->exists) { + $dataType->fill([ + 'name' => 'email_addresses', + 'display_name_singular' => __('joy-voyager-crm::seeders.data_types.email_address.singular'), + 'display_name_plural' => __('joy-voyager-crm::seeders.data_types.email_address.plural'), + 'icon' => 'fa-solid fa-envelope', + 'model_name' => Voyager::modelClass('EmailAddress'), + // 'policy_name' => 'Joy\\VoyagerCrm\\Policies\\EmailAddressPolicy', + // 'controller' => 'Joy\\VoyagerCrm\\Http\\Controllers\\VoyagerCrmController', + 'generate_permissions' => 1, + 'description' => '', + ])->save(); + } + } + + /** + * [dataType description]. + * + * @param [type] $field [description] + * @param [type] $for [description] + * + * @return [type] [description] + */ + protected function dataType($field, $for) + { + return Voyager::model('DataType')->firstOrNew([$field => $for]); + } +} diff --git a/database/seeders/EmailAddress/DummyEmailAddressesTableSeeder.php b/database/seeders/EmailAddress/DummyEmailAddressesTableSeeder.php new file mode 100644 index 0000000..ad68c5b --- /dev/null +++ b/database/seeders/EmailAddress/DummyEmailAddressesTableSeeder.php @@ -0,0 +1,22 @@ +factory() + ->count($count) + ->create(); + } +} diff --git a/database/seeders/EmailAddress/EmailAddressesTableSeeder.php b/database/seeders/EmailAddress/EmailAddressesTableSeeder.php new file mode 100644 index 0000000..a017c51 --- /dev/null +++ b/database/seeders/EmailAddress/EmailAddressesTableSeeder.php @@ -0,0 +1,26 @@ +query()->count() > 0) { + return false; + } + + $count = 20; + Voyager::model('EmailAddress')->factory() + ->count($count) + ->create(); + } +} diff --git a/database/seeders/EmailAddress/MenuItemsTableSeeder.php b/database/seeders/EmailAddress/MenuItemsTableSeeder.php new file mode 100644 index 0000000..9688663 --- /dev/null +++ b/database/seeders/EmailAddress/MenuItemsTableSeeder.php @@ -0,0 +1,38 @@ +where('name', 'admin')->firstOrFail(); + + $maxOrder = Voyager::model('MenuItem')->max('order') ?? 0; + + $menuItem = Voyager::model('MenuItem')->firstOrNew([ + 'menu_id' => $menu->id, + 'title' => __('joy-voyager-crm::seeders.menu_items.email_addresses'), + 'url' => '', + 'parent_id' => $parentMenuId, + 'route' => 'voyager.email-addresses.index', + ]); + if (!$menuItem->exists) { + $menuItem->fill([ + 'target' => '_self', + 'icon_class' => 'fa-solid fa-envelope', + 'color' => null, + 'parent_id' => $parentMenuId, + 'order' => ++$maxOrder, + ])->save(); + } + } +} diff --git a/database/seeders/EmailAddress/PermissionsTableSeeder.php b/database/seeders/EmailAddress/PermissionsTableSeeder.php new file mode 100644 index 0000000..88577db --- /dev/null +++ b/database/seeders/EmailAddress/PermissionsTableSeeder.php @@ -0,0 +1,17 @@ +generateFor('email_addresses'); + } +} diff --git a/database/seeders/EmailAddress/SettingsTableSeeder.php b/database/seeders/EmailAddress/SettingsTableSeeder.php new file mode 100644 index 0000000..a900cbd --- /dev/null +++ b/database/seeders/EmailAddress/SettingsTableSeeder.php @@ -0,0 +1,52 @@ +findSetting('email_address.key1'); + $order = Voyager::model('Setting')->max('order') ?? 0; + if (!$setting->exists) { + $setting->fill([ + 'display_name' => __('joy-voyager-crm::seeders.settings.email_address.key1'), + 'value' => 'Joy Voyager', + 'details' => '', + 'type' => 'text', + 'order' => ++$order, + 'group' => 'EmailAddress', + ])->save(); + } + + $setting = $this->findSetting('email_address.image'); + if (!$setting->exists) { + $setting->fill([ + 'display_name' => __('joy-voyager-crm::seeders.settings.email_address.image'), + 'value' => '', + 'details' => '', + 'type' => 'image', + 'order' => ++$order, + 'group' => 'EmailAddress', + ])->save(); + } + } + + /** + * [setting description]. + * + * @param [type] $key [description] + * + * @return [type] [description] + */ + protected function findSetting($key) + { + return Voyager::model('Setting')->firstOrNew(['key' => $key]); + } +} diff --git a/database/seeders/EmailAddress/TranslationsTableSeeder.php b/database/seeders/EmailAddress/TranslationsTableSeeder.php new file mode 100644 index 0000000..4301256 --- /dev/null +++ b/database/seeders/EmailAddress/TranslationsTableSeeder.php @@ -0,0 +1,111 @@ +dataTypesTranslations(); + $this->emailAddressesTranslations(); + $this->menusTranslations(); + } + + /** + * Auto generate Categories Translations. + * + * @return void + */ + private function emailAddressesTranslations() + { + // Adding translations for 'email_addresses' + // + $cat = Voyager::model('EmailAddress')->where('name', 'email_address-1')->first(); + if ($cat->exists) { + $this->trans('pt', $this->arr(['email_addresses', 'name'], $cat->id), 'email-address-1'); + $this->trans('pt', $this->arr(['email_addresses', 'description'], $cat->id), 'EmailAddress 1'); + } + $cat = Voyager::model('EmailAddress')->where('name', 'email_address-2')->first(); + if ($cat->exists) { + $this->trans('pt', $this->arr(['email_addresses', 'name'], $cat->id), 'email-address-2'); + $this->trans('pt', $this->arr(['email_addresses', 'description'], $cat->id), 'EmailAddress 2'); + } + } + + /** + * Auto generate DataTypes Translations. + * + * @return void + */ + private function dataTypesTranslations() + { + // Adding translations for 'display_name_singular' + // + $_fld = 'display_name_singular'; + $_tpl = ['data_types', $_fld]; + + $dtp = Voyager::model('DataType')->where($_fld, __('joy-voyager-crm::seeders.data_types.category.singular'))->firstOrFail(); + if ($dtp->exists) { + $this->trans('pt', $this->arr($_tpl, $dtp->id), 'EmailAddress'); + } + + // Adding translations for 'display_name_plural' + // + $_fld = 'display_name_plural'; + $_tpl = ['data_types', $_fld]; + $dtp = Voyager::model('DataType')->where($_fld, __('joy-voyager-crm::seeders.data_types.category.plural'))->firstOrFail(); + if ($dtp->exists) { + $this->trans('pt', $this->arr($_tpl, $dtp->id), 'EmailAddresses'); + } + } + + /** + * Auto generate Menus Translations. + * + * @return void + */ + private function menusTranslations() + { + $_tpl = ['menu_items', 'title']; + $_item = $this->findMenuItem(__('joy-voyager-crm::seeders.menu_items.email_addresses')); + if ($_item->exists) { + $this->trans('pt', $this->arr($_tpl, $_item->id), 'EmailAddresses'); + } + } + + private function findMenuItem($title) + { + return Voyager::model('MenuItem')->where('title', $title)->firstOrFail(); + } + + private function arr($par, $id) + { + return [ + 'table_name' => $par[0], + 'column_name' => $par[1], + 'foreign_key' => $id, + ]; + } + + private function trans($lang, $keys, $value) + { + $_t = Voyager::model('Translation')->firstOrNew(array_merge($keys, [ + 'locale' => $lang, + ])); + + if (!$_t->exists) { + $_t->fill(array_merge( + $keys, + ['value' => $value] + ))->save(); + } + } +} diff --git a/database/seeders/EmailAddress/VoyagerDatabaseSeeder.php b/database/seeders/EmailAddress/VoyagerDatabaseSeeder.php new file mode 100644 index 0000000..50c8022 --- /dev/null +++ b/database/seeders/EmailAddress/VoyagerDatabaseSeeder.php @@ -0,0 +1,31 @@ +call([ + DataTypesTableSeeder::class, + DataRowsTableSeeder::class, + // MenusTableSeeder::class, + // MenuItemsTableSeeder::class, + // RolesTableSeeder::class, + PermissionsTableSeeder::class, + 'Database\\Seeders\\PermissionRoleTableSeeder', + // SettingsTableSeeder::class, + // UserSettingsPermissionsTableSeeder::class, + 'Database\\Seeders\\PermissionRoleTableSeeder', + // UserSettingsTableSeeder::class, + EmailAddressesTableSeeder::class, + ]); + } +} diff --git a/database/seeders/EmailAddress/VoyagerDummyDatabaseSeeder.php b/database/seeders/EmailAddress/VoyagerDummyDatabaseSeeder.php new file mode 100644 index 0000000..f5ceee0 --- /dev/null +++ b/database/seeders/EmailAddress/VoyagerDummyDatabaseSeeder.php @@ -0,0 +1,20 @@ +call([ + DummyEmailAddressesTableSeeder::class + ]); + } +} diff --git a/database/seeders/EmailMarketing/DataRowsTableSeeder.php b/database/seeders/EmailMarketing/DataRowsTableSeeder.php index 4eab6d7..77cb664 100644 --- a/database/seeders/EmailMarketing/DataRowsTableSeeder.php +++ b/database/seeders/EmailMarketing/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -335,10 +334,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => 'Active', 'options' => [ - 'Inactive' => 'Inactive', 'Active' => 'Active', + 'Inactive' => 'Inactive', ], ], ])->save(); diff --git a/database/seeders/EmailTemplate/DataRowsTableSeeder.php b/database/seeders/EmailTemplate/DataRowsTableSeeder.php index 6ccedaa..52a4e11 100644 --- a/database/seeders/EmailTemplate/DataRowsTableSeeder.php +++ b/database/seeders/EmailTemplate/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -134,10 +133,12 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => '', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + '' => 'None', + 'campaign' => 'Campaign', + 'email' => 'Email', + 'event' => 'Event', ], ], ])->save(); diff --git a/database/seeders/Emailman/DataTypesTableSeeder.php b/database/seeders/Emailman/DataTypesTableSeeder.php index d753745..67bcd35 100644 --- a/database/seeders/Emailman/DataTypesTableSeeder.php +++ b/database/seeders/Emailman/DataTypesTableSeeder.php @@ -16,7 +16,7 @@ public function run() $dataType = $this->dataType('slug', 'emailmans'); if (!$dataType->exists) { $dataType->fill([ - 'name' => 'emailmans', + 'name' => 'emailman', 'display_name_singular' => __('joy-voyager-crm::seeders.data_types.emailman.singular'), 'display_name_plural' => __('joy-voyager-crm::seeders.data_types.emailman.plural'), 'icon' => 'fas fa-envelopes-bulk', diff --git a/database/seeders/Emailman/PermissionsTableSeeder.php b/database/seeders/Emailman/PermissionsTableSeeder.php index 87f5921..21907b4 100644 --- a/database/seeders/Emailman/PermissionsTableSeeder.php +++ b/database/seeders/Emailman/PermissionsTableSeeder.php @@ -13,6 +13,6 @@ class PermissionsTableSeeder extends Seeder */ public function run() { - Voyager::model('Permission')->generateFor('emailmans'); + Voyager::model('Permission')->generateFor('emailman'); } } diff --git a/database/seeders/Emailman/TranslationsTableSeeder.php b/database/seeders/Emailman/TranslationsTableSeeder.php index 5894d6d..ac4d620 100644 --- a/database/seeders/Emailman/TranslationsTableSeeder.php +++ b/database/seeders/Emailman/TranslationsTableSeeder.php @@ -30,17 +30,17 @@ public function run() */ private function emailmansTranslations() { - // Adding translations for 'emailmans' + // Adding translations for 'emailman' // $cat = Voyager::model('Emailman')->where('name', 'emailman-1')->first(); if ($cat->exists) { - $this->trans('pt', $this->arr(['emailmans', 'name'], $cat->id), 'emailman-1'); - $this->trans('pt', $this->arr(['emailmans', 'description'], $cat->id), 'Emailman 1'); + $this->trans('pt', $this->arr(['emailman', 'name'], $cat->id), 'emailman-1'); + $this->trans('pt', $this->arr(['emailman', 'description'], $cat->id), 'Emailman 1'); } $cat = Voyager::model('Emailman')->where('name', 'emailman-2')->first(); if ($cat->exists) { - $this->trans('pt', $this->arr(['emailmans', 'name'], $cat->id), 'emailman-2'); - $this->trans('pt', $this->arr(['emailmans', 'description'], $cat->id), 'Emailman 2'); + $this->trans('pt', $this->arr(['emailman', 'name'], $cat->id), 'emailman-2'); + $this->trans('pt', $this->arr(['emailman', 'description'], $cat->id), 'Emailman 2'); } } diff --git a/database/seeders/EmailsBean/DataRowsTableSeeder.php b/database/seeders/EmailsBean/DataRowsTableSeeder.php index 848eb8b..e23bdef 100644 --- a/database/seeders/EmailsBean/DataRowsTableSeeder.php +++ b/database/seeders/EmailsBean/DataRowsTableSeeder.php @@ -44,13 +44,13 @@ public function run() 'delete' => 0, 'order' => ++$order, 'details' => [ - 'model' => Voyager::modelClass('User'), - 'table' => 'users', + 'model' => Voyager::modelClass('Email'), + 'table' => 'emails', 'type' => 'belongsTo', 'column' => 'email_id', 'key' => 'id', 'label' => 'name', - 'pivot_table' => 'users', + 'pivot_table' => 'emails', 'pivot' => 0, ], ])->save(); @@ -71,6 +71,32 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'bean_module'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'select_dropdown', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bean_module'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', + ], + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'bean_id'); if (!$dataRow->exists) { $dataRow->fill([ @@ -86,11 +112,11 @@ public function run() ])->save(); } - $dataRow = $this->dataRow($dataType, 'bean_module'); + $dataRow = $this->dataRow($dataType, 'emails_bean_morphto_bean_relationship'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.bean_module'), + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bean'), 'required' => 0, 'browse' => 1, 'read' => 1, @@ -98,6 +124,44 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'beanable', + 'type_column' => 'bean_module', + 'column' => 'bean_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + ] + ], ])->save(); } diff --git a/database/seeders/Favorite/DataRowsTableSeeder.php b/database/seeders/Favorite/DataRowsTableSeeder.php index 0963126..5dea059 100644 --- a/database/seeders/Favorite/DataRowsTableSeeder.php +++ b/database/seeders/Favorite/DataRowsTableSeeder.php @@ -60,33 +60,164 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'parent_type'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'select_dropdown', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_type'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Contact') => 'Contact', + Voyager::modelClass('Task') => 'Task', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('Bug') => 'Bug', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + + Voyager::modelClass('Project') => 'Project', + Voyager::modelClass('ProjectTask') => 'Task Task', + + Voyager::modelClass('Prospect') => 'Target', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ], + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'parent_id'); if (!$dataRow->exists) { $dataRow->fill([ 'type' => 'text', 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_id'), 'required' => 0, - 'browse' => 0, - 'read' => 0, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, 'order' => ++$order, ])->save(); } - $dataRow = $this->dataRow($dataType, 'parent_type'); + $dataRow = $this->dataRow($dataType, 'favorite_morphto_parent_relationship'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_type'), + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent'), 'required' => 0, - 'browse' => 0, - 'read' => 0, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'parentable', + 'type_column' => 'parent_type', + 'column' => 'parent_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.task'), + 'model' => Voyager::modelClass('Task'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bug'), + 'model' => Voyager::modelClass('Bug'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project'), + 'model' => Voyager::modelClass('Project'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project_task'), + 'model' => Voyager::modelClass('ProjectTask'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_product'), + 'model' => Voyager::modelClass('AosProduct'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], ])->save(); } diff --git a/database/seeders/Folder/DataRowsTableSeeder.php b/database/seeders/Folder/DataRowsTableSeeder.php index 431cf43..85870a6 100644 --- a/database/seeders/Folder/DataRowsTableSeeder.php +++ b/database/seeders/Folder/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -59,10 +58,12 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => '', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'inbound' => 'inbound', + 'draft' => 'draft', + 'sent' => 'sent', + 'archived' => 'archived', ], ], ])->save(); diff --git a/database/seeders/FpEvent/DataRowsTableSeeder.php b/database/seeders/FpEvent/DataRowsTableSeeder.php index f3278cc..03f6f7b 100644 --- a/database/seeders/FpEvent/DataRowsTableSeeder.php +++ b/database/seeders/FpEvent/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -234,10 +233,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => '', 'options' => [ - 'Inactive' => 'Inactive', - 'Active' => 'Active', + '' => '--None--', + 'active' => 'Active', + 'inactive' => 'Inactive', ], ], ])->save(); diff --git a/database/seeders/ImportMap/DataRowsTableSeeder.php b/database/seeders/ImportMap/DataRowsTableSeeder.php index 8d01b08..ad54ab7 100644 --- a/database/seeders/ImportMap/DataRowsTableSeeder.php +++ b/database/seeders/ImportMap/DataRowsTableSeeder.php @@ -63,7 +63,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'enclosure'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'select_dropdown', + 'type' => 'text', 'display_name' => __('joy-voyager-crm::seeders.data_rows.enclosure'), 'required' => 0, 'browse' => 1, @@ -72,25 +72,14 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, - 'details' => [ - 'default' => 'Type1', - 'options' => [ - ' ' => ' ', - ',' => ',', - ';' => ';', - // '\t' => '\t', - '|' => '|', - // ' ' => ' ', - ], - ], ])->save(); } $dataRow = $this->dataRow($dataType, 'delimiter'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'select_dropdown', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.enclosure'), + 'type' => 'text', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.delimiter'), 'required' => 0, 'browse' => 1, 'read' => 1, @@ -98,17 +87,6 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, - 'details' => [ - 'default' => 'Type1', - 'options' => [ - ' ' => ' ', - ',' => ',', - ';' => ';', - // // '\t' => '\t', - '|' => '|', - // ' ' => ' ', - ], - ], ])->save(); } diff --git a/database/seeders/InboundEmail/DataRowsTableSeeder.php b/database/seeders/InboundEmail/DataRowsTableSeeder.php index 32838c7..5239a3c 100644 --- a/database/seeders/InboundEmail/DataRowsTableSeeder.php +++ b/database/seeders/InboundEmail/DataRowsTableSeeder.php @@ -163,10 +163,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'MailboxType1', + 'default' => 'pick', 'options' => [ - 'MailboxType1' => 'MailboxType1', - 'MailboxType2' => 'MailboxType2', + 'pick' => '--None--', + 'createcase' => 'Create Case', + 'bounce' => 'Bounce Handling', ], ], ])->save(); @@ -260,10 +261,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => 'Active', 'options' => [ - 'Inactive' => 'Inactive', 'Active' => 'Active', + 'Inactive' => 'Inactive', ], ], ])->save(); diff --git a/database/seeders/JjwgMap/DataRowsTableSeeder.php b/database/seeders/JjwgMap/DataRowsTableSeeder.php index e2dc363..a6dfa92 100644 --- a/database/seeders/JjwgMap/DataRowsTableSeeder.php +++ b/database/seeders/JjwgMap/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -116,15 +115,39 @@ public function run() $dataRow = $this->dataRow($dataType, 'parent_type'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_type'), 'required' => 0, - 'browse' => 0, - 'read' => 0, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ], + ], ])->save(); } @@ -134,36 +157,118 @@ public function run() 'type' => 'text', 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_id'), 'required' => 0, - 'browse' => 0, - 'read' => 0, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, 'order' => ++$order, ])->save(); } - $dataRow = $this->dataRow($dataType, 'jjwg_map_belongsto_assigned_user_relationship'); + $dataRow = $this->dataRow($dataType, 'jjwg_map_morphto_parent_relationship'); if (!$dataRow->exists) { $dataRow->fill([ 'type' => 'relationship', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.assigned_user'), + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent'), 'required' => 0, 'browse' => 1, 'read' => 1, 'edit' => 1, 'add' => 1, - 'delete' => 0, + 'delete' => 1, 'order' => ++$order, 'details' => [ - 'model' => Voyager::modelClass('User'), - 'table' => 'users', - 'type' => 'belongsTo', - 'column' => 'assigned_user_id', - 'key' => 'id', - 'label' => 'name', - 'pivot_table' => 'users', - 'pivot' => 0, + 'type' => 'morphTo', + 'function' => 'parentable', + 'type_column' => 'parent_type', + 'column' => 'parent_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bug'), + 'model' => Voyager::modelClass('Bug'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project'), + 'model' => Voyager::modelClass('Project'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project_task'), + 'model' => Voyager::modelClass('ProjectTask'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.task'), + 'model' => Voyager::modelClass('Task'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_product'), + 'model' => Voyager::modelClass('AosProduct'), + 'key' => 'id', + 'label' => 'name', + ] + ] ], ])->save(); } diff --git a/database/seeders/JobQueue/DataRowsTableSeeder.php b/database/seeders/JobQueue/DataRowsTableSeeder.php index 7226654..0f48528 100644 --- a/database/seeders/JobQueue/DataRowsTableSeeder.php +++ b/database/seeders/JobQueue/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -114,10 +113,12 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Resolution1', + 'default' => 'queued', 'options' => [ - 'Resolution1' => 'Resolution1', - 'Resolution2' => 'Resolution2', + 'queued' => 'queued', + 'partial' => 'partial', + 'success' => 'success', + 'failure' => 'failure', ], ], ])->save(); @@ -271,10 +272,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Pending', + 'default' => 'queued', 'options' => [ - 'Pending' => 'Pending', - 'Finished' => 'Finished', + 'queued' => 'queued', + 'running' => 'running', + 'done' => 'done', ], ], ])->save(); diff --git a/database/seeders/Lead/DataRowsTableSeeder.php b/database/seeders/Lead/DataRowsTableSeeder.php index f06a8d0..1b38ea4 100644 --- a/database/seeders/Lead/DataRowsTableSeeder.php +++ b/database/seeders/Lead/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -49,7 +48,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'salutation'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.salutation'), 'required' => 0, 'browse' => 1, @@ -58,6 +57,18 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Mr.' => 'Mr.', + 'Ms.' => 'Ms.', + 'Mrs.' => 'Mrs.', + 'Miss' => 'Miss', + 'Dr.' => 'Dr.', + 'Prof.' => 'Prof.', + ], + ], ])->save(); } @@ -484,7 +495,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'lead_source'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead_source'), 'required' => 0, 'browse' => 1, @@ -493,6 +504,26 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => 'Self Generated', + 'options' => [ + '' => 'None', + 'Cold Call' => 'Cold Call', + 'Existing Customer' => 'Existing Customer', + 'Self Generated' => 'Self Generated', + 'Employee' => 'Employee', + 'Partner' => 'Partner', + 'Public Relations' => 'Public Relations', + 'Direct Mail' => 'Direct Mail', + 'Conference' => 'Conference', + 'Trade Show' => 'Trade Show', + 'Web Site' => 'Web Site', + 'Word of mouth' => 'Word of mouth', + 'Email' => 'Email', + 'Campaign' => 'Campaign', + 'Other' => 'Other', + ], + ], ])->save(); } @@ -896,10 +927,15 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => '', 'options' => [ - 'Inactive' => 'Inactive', - 'Active' => 'Active', + '' => 'None', + 'New' => 'New', + 'Assigned' => 'Assigned', + 'In Process' => 'In Process', + 'Converted' => 'Converted', + 'Recycled' => 'Recycled', + 'Dead' => 'Dead', ], ], ])->save(); diff --git a/database/seeders/Meeting/DataRowsTableSeeder.php b/database/seeders/Meeting/DataRowsTableSeeder.php index 8eb075d..146356c 100644 --- a/database/seeders/Meeting/DataRowsTableSeeder.php +++ b/database/seeders/Meeting/DataRowsTableSeeder.php @@ -225,6 +225,167 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'parent_type'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'select_dropdown', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_type'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Contact') => 'Contact', + Voyager::modelClass('Task') => 'Task', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('Bug') => 'Bug', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + + Voyager::modelClass('Project') => 'Project', + Voyager::modelClass('ProjectTask') => 'Task Task', + + Voyager::modelClass('Prospect') => 'Target', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ], + ], + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'parent_id'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'text', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_id'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'meeting_morphto_parent_relationship'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'parentable', + 'type_column' => 'parent_type', + 'column' => 'parent_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.task'), + 'model' => Voyager::modelClass('Task'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bug'), + 'model' => Voyager::modelClass('Bug'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project'), + 'model' => Voyager::modelClass('Project'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project_task'), + 'model' => Voyager::modelClass('ProjectTask'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_product'), + 'model' => Voyager::modelClass('AosProduct'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'status'); if (!$dataRow->exists) { $dataRow->fill([ @@ -240,7 +401,9 @@ public function run() 'details' => [ 'default' => config('joy-voyager-crm.meetings.default_status', 'Planned'), 'options' => config('joy-voyager-crm.meetings.statuses', [ - 'Planned' => 'Planned', + 'Planned' => 'Planned', + 'Held' => 'Held', + 'Not Held' => 'Not Held', ]), ], ])->save(); @@ -261,9 +424,8 @@ public function run() 'details' => [ 'default' => config('joy-voyager-crm.meetings.default_type', 'Sugar'), 'options' => config('joy-voyager-crm.meetings.types', [ - 'Sugar' => 'Sugar', - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'Other' => 'Other', + 'Sugar' => 'SuiteCRM', ]), ], ])->save(); @@ -272,7 +434,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'reminder_time'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'number', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.reminder_time'), 'required' => 0, 'browse' => 1, @@ -281,13 +443,28 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + 60 => '1 minute prior', + 300 => '5 minutes prior', + 600 => '10 minutes prior', + 900 => '15 minutes prior', + 1800 => '30 minutes prior', + 3600 => '1 hour prior', + 7200 => '2 hours prior', + 10800 => '3 hours prior', + 18000 => '5 hours prior', + 86400 => '1 day prior', + ], + ], ])->save(); } $dataRow = $this->dataRow($dataType, 'email_reminder_time'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'number', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.email_reminder_time'), 'required' => 0, 'browse' => 1, @@ -296,6 +473,21 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + 60 => '1 minute prior', + 300 => '5 minutes prior', + 600 => '10 minutes prior', + 900 => '15 minutes prior', + 1800 => '30 minutes prior', + 3600 => '1 hour prior', + 7200 => '2 hours prior', + 10800 => '3 hours prior', + 18000 => '5 hours prior', + 86400 => '1 day prior', + ], + ], ])->save(); } @@ -347,29 +539,39 @@ public function run() $dataRow = $this->dataRow($dataType, 'repeat_type'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.repeat_type'), 'required' => 0, - 'browse' => 0, - 'read' => 0, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Daily' => 'Daily', + 'Weekly' => 'Weekly', + 'Monthly' => 'Monthly', + 'Yearly' => 'Yearly', + ], + ], ])->save(); } $dataRow = $this->dataRow($dataType, 'repeat_interval'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'number', 'display_name' => __('joy-voyager-crm::seeders.data_rows.repeat_interval'), 'required' => 0, - 'browse' => 0, - 'read' => 0, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, 'order' => ++$order, ])->save(); } @@ -377,7 +579,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'repeat_dow'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'number', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.repeat_dow'), 'required' => 0, 'browse' => 1, @@ -386,6 +588,19 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '0' => '', + '1' => 'Sunday', + '2' => 'Monday', + '3' => 'Tuesday', + '4' => 'Wednesday', + '5' => 'Thursday', + '6' => 'Friday', + '7' => 'Saturday', + ], + ], ])->save(); } diff --git a/database/seeders/MeetingsContact/DataRowsTableSeeder.php b/database/seeders/MeetingsContact/DataRowsTableSeeder.php index 7b94046..13217ae 100644 --- a/database/seeders/MeetingsContact/DataRowsTableSeeder.php +++ b/database/seeders/MeetingsContact/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -148,9 +147,10 @@ public function run() 'details' => [ 'default' => 'none', 'options' => [ - 'none' => 'none', - 'Inactive' => 'Inactive', - 'Active' => 'Active', + 'accept' => 'Accepted', + 'decline' => 'Declined', + 'tentative' => 'Tentative', + 'none' => 'None', ], ], ])->save(); diff --git a/database/seeders/MeetingsLead/DataRowsTableSeeder.php b/database/seeders/MeetingsLead/DataRowsTableSeeder.php index 0e39163..c736035 100644 --- a/database/seeders/MeetingsLead/DataRowsTableSeeder.php +++ b/database/seeders/MeetingsLead/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -89,7 +88,7 @@ public function run() 'type' => 'belongsTo', 'column' => 'lead_id', 'key' => 'id', - 'label' => 'name', + 'label' => 'first_name', 'pivot_table' => 'leads', 'pivot' => 0, ], @@ -148,9 +147,10 @@ public function run() 'details' => [ 'default' => 'none', 'options' => [ - 'none' => 'none', - 'Accept1' => 'Accept1', - 'Accept2' => 'Accept2', + 'accept' => 'Accepted', + 'decline' => 'Declined', + 'tentative' => 'Tentative', + 'none' => 'None', ], ], ])->save(); diff --git a/database/seeders/MeetingsUser/DataRowsTableSeeder.php b/database/seeders/MeetingsUser/DataRowsTableSeeder.php index efb21b6..bf9a424 100644 --- a/database/seeders/MeetingsUser/DataRowsTableSeeder.php +++ b/database/seeders/MeetingsUser/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -148,9 +147,10 @@ public function run() 'details' => [ 'default' => 'none', 'options' => [ - 'none' => 'none', - 'Accept1' => 'Accept1', - 'Accept2' => 'Accept2', + 'accept' => 'Accepted', + 'decline' => 'Declined', + 'tentative' => 'Tentative', + 'none' => 'None', ], ], ])->save(); diff --git a/database/seeders/MenuItemsTableSeeder.php b/database/seeders/MenuItemsTableSeeder.php index 17a98e3..b7014f0 100644 --- a/database/seeders/MenuItemsTableSeeder.php +++ b/database/seeders/MenuItemsTableSeeder.php @@ -3,8 +3,6 @@ namespace Joy\VoyagerCrm\Database\Seeders; use Illuminate\Database\Seeder; -use TCG\Voyager\Models\Menu; -use TCG\Voyager\Models\MenuItem; use TCG\Voyager\Facades\Voyager; class MenuItemsTableSeeder extends Seeder @@ -323,6 +321,7 @@ public function run($parentMenuId = null) \Joy\VoyagerCrm\Database\Seeders\SecuritygroupsRecord\MenuItemsTableSeeder::class, \Joy\VoyagerCrm\Database\Seeders\EmailsBean\MenuItemsTableSeeder::class, \Joy\VoyagerCrm\Database\Seeders\Tracker\MenuItemsTableSeeder::class, + \Joy\VoyagerCrm\Database\Seeders\EmailAddress\MenuItemsTableSeeder::class, ], false, ['parentMenuId' => $othersMenuItem->id] diff --git a/database/seeders/Note/DataRowsTableSeeder.php b/database/seeders/Note/DataRowsTableSeeder.php index cbfbf73..e0accb5 100644 --- a/database/seeders/Note/DataRowsTableSeeder.php +++ b/database/seeders/Note/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -94,7 +93,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'parent_type'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_type'), 'required' => 0, 'browse' => 1, @@ -103,46 +102,179 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Contact') => 'Contact', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('Campaign') => 'Campaign', + Voyager::modelClass('Task') => 'Task', + Voyager::modelClass('Email') => 'Email', + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + Voyager::modelClass('ProjectTask') => 'Project Task', + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + + Voyager::modelClass('Meeting') => 'Meeting', + Voyager::modelClass('Call') => 'Call', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ], + ], ])->save(); } - $dataRow = $this->dataRow($dataType, 'note_belongsto_parent_relationship'); + $dataRow = $this->dataRow($dataType, 'parent_id'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'relationship', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent'), + 'type' => 'text', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_id'), 'required' => 0, 'browse' => 1, 'read' => 1, 'edit' => 1, 'add' => 1, - 'delete' => 0, + 'delete' => 1, 'order' => ++$order, - 'details' => [ - 'model' => Voyager::modelClass('Note'), - 'table' => 'notes', - 'type' => 'belongsTo', - 'column' => 'parent_id', - 'key' => 'id', - 'label' => 'name', - 'pivot_table' => 'notes', - 'pivot' => 0, - ], ])->save(); } - $dataRow = $this->dataRow($dataType, 'parent_id'); + $dataRow = $this->dataRow($dataType, 'note_morphto_parent_relationship'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_id'), - 'required' => 1, + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent'), + 'required' => 0, 'browse' => 1, 'read' => 1, 'edit' => 1, 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'parentable', + 'type_column' => 'parent_type', + 'column' => 'parent_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.campaign'), + 'model' => Voyager::modelClass('Campaign'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.task'), + 'model' => Voyager::modelClass('Task'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.email'), + 'model' => Voyager::modelClass('Email'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bug'), + 'model' => Voyager::modelClass('Bug'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project'), + 'model' => Voyager::modelClass('Project'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project_task'), + 'model' => Voyager::modelClass('ProjectTask'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.meeting'), + 'model' => Voyager::modelClass('Meeting'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.call'), + 'model' => Voyager::modelClass('Call'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_product'), + 'model' => Voyager::modelClass('AosProduct'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], ])->save(); } diff --git a/database/seeders/Opportunity/DataRowsTableSeeder.php b/database/seeders/Opportunity/DataRowsTableSeeder.php index b782a97..f86d83f 100644 --- a/database/seeders/Opportunity/DataRowsTableSeeder.php +++ b/database/seeders/Opportunity/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -74,10 +73,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => '', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + '' => 'None', + 'Existing Business' => 'Existing Business', + 'New Business' => 'New Business', ], ], ])->save(); @@ -126,7 +126,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'lead_source'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead_source'), 'required' => 0, 'browse' => 1, @@ -135,6 +135,26 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => 'Self Generated', + 'options' => [ + '' => 'None', + 'Cold Call' => 'Cold Call', + 'Existing Customer' => 'Existing Customer', + 'Self Generated' => 'Self Generated', + 'Employee' => 'Employee', + 'Partner' => 'Partner', + 'Public Relations' => 'Public Relations', + 'Direct Mail' => 'Direct Mail', + 'Conference' => 'Conference', + 'Trade Show' => 'Trade Show', + 'Web Site' => 'Web Site', + 'Word of mouth' => 'Word of mouth', + 'Email' => 'Email', + 'Campaign' => 'Campaign', + 'Other' => 'Other', + ], + ], ])->save(); } @@ -251,10 +271,18 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Stage1', + 'default' => 'Prospecting', 'options' => [ - 'Stage1' => 'Stage1', - 'Stage2' => 'Stage2', + 'Prospecting' => 'Prospecting', + 'Qualification' => 'Qualification', + 'Needs Analysis' => 'Needs Analysis', + 'Value Proposition' => 'Value Proposition', + 'Id. Decision Makers' => 'Identifying Decision Makers', + 'Perception Analysis' => 'Perception Analysis', + 'Proposal/Price Quote' => 'Proposal/Price Quote', + 'Negotiation/Review' => 'Negotiation/Review', + 'Closed Won' => 'Closed Won', + 'Closed Lost' => 'Closed Lost', ], ], ])->save(); @@ -263,7 +291,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'probability'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'number', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.probability'), 'required' => 0, 'browse' => 1, @@ -272,6 +300,48 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => 'Prospecting', + 'options' => [ + '10' => 'Prospecting', + '20' => 'Qualification', + '25' => 'Needs Analysis', + '30' => 'Value Proposition', + '40' => 'Id. Decision Makers', + '50' => 'Perception Analysis', + '65' => 'Proposal/Price Quote', + '80' => 'Negotiation/Review', + '100' => 'Closed Won', + '0' => 'Closed Lost', + ], + ], + ])->save(); + } + + $dataRow = $this->dataRow($dataType, 'opportunity_morphmany_calls_relationship'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.calls'), + 'required' => 0, + 'browse' => 0, + 'read' => 0, + 'edit' => 0, + 'add' => 0, + 'delete' => 0, + 'order' => ++$order, + 'details' => [ + 'model' => Voyager::modelClass('Call'), + 'table' => 'calls', + 'type' => 'morphMany', + 'function' => 'parentable', + 'type_column' => 'parent_type', + 'column' => 'parent_id', + 'key' => 'id', + 'label' => 'name', + 'pivot_table' => 'calls', + 'pivot' => 0, + ], ])->save(); } diff --git a/database/seeders/OutboundEmail/DataRowsTableSeeder.php b/database/seeders/OutboundEmail/DataRowsTableSeeder.php index 4fcddba..4bc4ad0 100644 --- a/database/seeders/OutboundEmail/DataRowsTableSeeder.php +++ b/database/seeders/OutboundEmail/DataRowsTableSeeder.php @@ -48,7 +48,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'type'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'select_dropdown', + 'type' => 'text', 'display_name' => __('joy-voyager-crm::seeders.data_rows.type'), 'required' => 0, 'browse' => 1, @@ -57,13 +57,6 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, - 'details' => [ - 'default' => 'Type1', - 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', - ], - ], ])->save(); } @@ -100,7 +93,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'mail_sendtype'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.mail_sendtype'), 'required' => 0, 'browse' => 1, @@ -109,6 +102,12 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => 'SMTP', + 'options' => [ + 'SMTP' => 'SMTP', + ], + ], ])->save(); } @@ -205,7 +204,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'mail_smtpssl'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.mail_smtpssl'), 'required' => 0, 'browse' => 1, @@ -214,6 +213,14 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '0' => '', + '1' => 'SSL', + '2' => 'TLS', + ], + ], ])->save(); } diff --git a/database/seeders/Project/DataRowsTableSeeder.php b/database/seeders/Project/DataRowsTableSeeder.php index 668732d..e3cba9e 100644 --- a/database/seeders/Project/DataRowsTableSeeder.php +++ b/database/seeders/Project/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -104,10 +103,13 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => config('joy-voyager-crm.projects.default_status', 'Active'), + 'default' => config('joy-voyager-crm.projects.default_status', 'Draft'), 'options' => config('joy-voyager-crm.projects.statuses', [ - 'Active' => 'Active', - 'Inactive' => 'Inactive', + 'Draft' => 'Draft', + 'In Review' => 'In Review', + 'Underway' => 'Underway', + 'On_Hold' => 'On Hold', + 'Completed' => 'Completed', ]), ], ])->save(); @@ -128,9 +130,9 @@ public function run() 'details' => [ 'default' => config('joy-voyager-crm.projects.default_priority', 'Low'), 'options' => config('joy-voyager-crm.projects.priorities', [ - 'Low' => 'Low', - 'Medium' => 'Medium', 'High' => 'High', + 'Medium' => 'Medium', + 'Low' => 'Low', ]), ], ])->save(); diff --git a/database/seeders/ProjectTask/DataRowsTableSeeder.php b/database/seeders/ProjectTask/DataRowsTableSeeder.php index 4ef9f10..4bda2ac 100644 --- a/database/seeders/ProjectTask/DataRowsTableSeeder.php +++ b/database/seeders/ProjectTask/DataRowsTableSeeder.php @@ -88,10 +88,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => 'FS', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'FS' => 'Finish to Start', + 'SS' => 'Start to Start', ], ], ])->save(); @@ -202,11 +202,8 @@ public function run() 'details' => [ 'default' => null, 'options' => [ - 'Seconds' => 'Seconds', - 'Hours' => 'Hours', - 'Days' => 'Days', - 'Weeks' => 'Weeks', - 'Months' => 'Months', + 'Days' => 'Days', + 'Hours' => 'Hours', ], ], ])->save(); @@ -300,11 +297,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Low', + 'default' => 'Medium', 'options' => [ - 'Low' => 'Low', - 'Medium' => 'Medium', 'High' => 'High', + 'Medium' => 'Medium', + 'Low' => 'Low', ], ], ])->save(); @@ -388,7 +385,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'utilization'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'number', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.utilization'), 'required' => 0, 'browse' => 1, @@ -397,6 +394,16 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '0', + 'options' => [ + '0' => 'none', + '25' => '25', + '50' => '50', + '75' => '75', + '100' => '100', + ], + ], ])->save(); } @@ -413,11 +420,13 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => 'Not Started', 'options' => [ - 'Inactive' => 'Inactive', - 'Active' => 'Active', - 'Planned' => 'Planned', + 'Not Started' => 'Not Started', + 'In Progress' => 'In Progress', + 'Completed' => 'Completed', + 'Pending Input' => 'Pending Input', + 'Deferred' => 'Deferred', ], ], ])->save(); diff --git a/database/seeders/Prospect/DataRowsTableSeeder.php b/database/seeders/Prospect/DataRowsTableSeeder.php index 3925ddd..02d61ef 100644 --- a/database/seeders/Prospect/DataRowsTableSeeder.php +++ b/database/seeders/Prospect/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -49,7 +48,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'salutation'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.salutation'), 'required' => 0, 'browse' => 1, @@ -58,6 +57,18 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'Mr.' => 'Mr.', + 'Ms.' => 'Ms.', + 'Mrs.' => 'Mrs.', + 'Miss' => 'Miss', + 'Dr.' => 'Dr.', + 'Prof.' => 'Prof.', + ], + ], ])->save(); } @@ -514,7 +525,7 @@ public function run() 'type' => 'belongsTo', 'column' => 'lead_id', 'key' => 'id', - 'label' => 'name', + 'label' => 'first_name', 'pivot_table' => 'leads', 'pivot' => 0, ], diff --git a/database/seeders/ProspectList/DataRowsTableSeeder.php b/database/seeders/ProspectList/DataRowsTableSeeder.php index 064184e..4fd3302 100644 --- a/database/seeders/ProspectList/DataRowsTableSeeder.php +++ b/database/seeders/ProspectList/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -74,10 +73,14 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => 'default', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'default' => 'Default', + 'seed' => 'Seed', + 'exempt_domain' => 'Suppression List - By Domain', + 'exempt_address' => 'Suppression List - By Email Address', + 'exempt' => 'Suppression List - By Id', + 'test' => 'Test', ], ], ])->save(); @@ -124,6 +127,31 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'prospect_list_hasmany_prospects_list_prospect_relationship'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospects_list_prospect'), + 'required' => 0, + 'browse' => 0, + 'read' => 0, + 'edit' => 0, + 'add' => 0, + 'delete' => 0, + 'order' => ++$order, + 'details' => [ + 'model' => Voyager::modelClass('ProspectListsProspect'), + 'table' => 'prospect_lists_prospects', + 'type' => 'hasMany', + 'column' => 'prospect_list_id', + 'key' => 'id', + 'label' => 'id', + 'pivot_table' => 'prospect_lists_prospects', + 'pivot' => 0, + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'prospect_list_belongsto_assigned_user_relationship'); if (!$dataRow->exists) { $dataRow->fill([ diff --git a/database/seeders/ProspectListsProspect/DataRowsTableSeeder.php b/database/seeders/ProspectListsProspect/DataRowsTableSeeder.php index 376cc7f..b3feb09 100644 --- a/database/seeders/ProspectListsProspect/DataRowsTableSeeder.php +++ b/database/seeders/ProspectListsProspect/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -71,6 +70,31 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'related_type'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'select_dropdown', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.related_type'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'default' => null, + 'options' => [ + Voyager::modelClass('Lead') => 'Leads', + Voyager::modelClass('User') => 'User', + Voyager::modelClass('Prospect') => 'Prospects', + Voyager::modelClass('Contact') => 'Contacts', + Voyager::modelClass('Account') => 'Accounts', + ], + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'related_id'); if (!$dataRow->exists) { $dataRow->fill([ @@ -86,11 +110,11 @@ public function run() ])->save(); } - $dataRow = $this->dataRow($dataType, 'related_type'); + $dataRow = $this->dataRow($dataType, 'prospect_lists_prospect_morphto_related_relationship'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.related_type'), + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.related'), 'required' => 0, 'browse' => 1, 'read' => 1, @@ -98,6 +122,44 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'relatedable', + 'type_column' => 'related_type', + 'column' => 'related_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'first_name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.user'), + 'model' => Voyager::modelClass('User'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'first_name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'first_name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], ])->save(); } @@ -145,86 +207,6 @@ public function run() 'order' => ++$order, ])->save(); } - - $dataRow = $this->dataRow($dataType, 'prospect_lists_prospect_belongsto_created_by_relationship'); - if (!$dataRow->exists) { - $dataRow->fill([ - 'type' => 'relationship', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.created_by'), - 'required' => 0, - 'browse' => 1, - 'read' => 1, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, - 'order' => ++$order, - 'details' => [ - 'model' => Voyager::modelClass('User'), - 'table' => 'users', - 'type' => 'belongsTo', - 'column' => 'created_by_id', - 'key' => 'id', - 'label' => 'name', - 'pivot_table' => 'users', - 'pivot' => 0, - ], - ])->save(); - } - - $dataRow = $this->dataRow($dataType, 'created_by_id'); - if (!$dataRow->exists) { - $dataRow->fill([ - 'type' => 'text', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.created_by'), - 'required' => 0, - 'browse' => 1, - 'read' => 1, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, - 'order' => ++$order, - ])->save(); - } - - $dataRow = $this->dataRow($dataType, 'prospect_lists_prospect_belongsto_modified_by_relationship'); - if (!$dataRow->exists) { - $dataRow->fill([ - 'type' => 'relationship', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.modified_by'), - 'required' => 0, - 'browse' => 1, - 'read' => 1, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, - 'order' => ++$order, - 'details' => [ - 'model' => Voyager::modelClass('User'), - 'table' => 'users', - 'type' => 'belongsTo', - 'column' => 'modified_by_id', - 'key' => 'id', - 'label' => 'name', - 'pivot_table' => 'users', - 'pivot' => 0, - ], - ])->save(); - } - - $dataRow = $this->dataRow($dataType, 'modified_by_id'); - if (!$dataRow->exists) { - $dataRow->fill([ - 'type' => 'text', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.modified_by'), - 'required' => 0, - 'browse' => 1, - 'read' => 1, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, - 'order' => ++$order, - ])->save(); - } } /** diff --git a/database/seeders/ProspectListsProspect/DummyProspectListsProspectsTableSeeder.php b/database/seeders/ProspectListsProspect/DummyProspectListsProspectsTableSeeder.php index 7d48e41..88f6102 100644 --- a/database/seeders/ProspectListsProspect/DummyProspectListsProspectsTableSeeder.php +++ b/database/seeders/ProspectListsProspect/DummyProspectListsProspectsTableSeeder.php @@ -17,6 +17,11 @@ public function run() $count = 20; Voyager::model('ProspectListsProspect')->factory() ->count($count) + ->state(function (array $attributes) use ($count) { + return [ + 'prospect_list_id' => optional(Voyager::model('ProspectList')->inRandomOrder()->take(1)->first())->id, + ]; + }) ->create(); } } diff --git a/database/seeders/ProspectListsProspect/ProspectListsProspectsTableSeeder.php b/database/seeders/ProspectListsProspect/ProspectListsProspectsTableSeeder.php index f58a68c..2d07a74 100644 --- a/database/seeders/ProspectListsProspect/ProspectListsProspectsTableSeeder.php +++ b/database/seeders/ProspectListsProspect/ProspectListsProspectsTableSeeder.php @@ -21,6 +21,11 @@ public function run() $count = 20; Voyager::model('ProspectListsProspect')->factory() ->count($count) + ->state(function (array $attributes) use ($count) { + return [ + 'prospect_list_id' => optional(Voyager::model('ProspectList')->inRandomOrder()->take(1)->first())->id, + ]; + }) ->create(); } } diff --git a/database/seeders/Release/DataRowsTableSeeder.php b/database/seeders/Release/DataRowsTableSeeder.php index 44863e9..c78dd62 100644 --- a/database/seeders/Release/DataRowsTableSeeder.php +++ b/database/seeders/Release/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -74,10 +73,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => 'Active', 'options' => [ - 'Inactive' => 'Inactive', 'Active' => 'Active', + 'Inactive' => 'Inactive', ], ], ])->save(); diff --git a/database/seeders/RemindersInvitee/DataRowsTableSeeder.php b/database/seeders/RemindersInvitee/DataRowsTableSeeder.php index 5aaa39d..c2252d4 100644 --- a/database/seeders/RemindersInvitee/DataRowsTableSeeder.php +++ b/database/seeders/RemindersInvitee/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -101,6 +100,7 @@ public function run() ])->save(); } + // @TODO @FIXME morph relation $dataRow = $this->dataRow($dataType, 'related_invitee_module'); if (!$dataRow->exists) { $dataRow->fill([ diff --git a/database/seeders/Scheduler/DataRowsTableSeeder.php b/database/seeders/Scheduler/DataRowsTableSeeder.php index af74a24..91c1c6f 100644 --- a/database/seeders/Scheduler/DataRowsTableSeeder.php +++ b/database/seeders/Scheduler/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -179,10 +178,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => 'Active', 'options' => [ - 'Inactive' => 'Inactive', 'Active' => 'Active', + 'Inactive' => 'Inactive', ], ], ])->save(); diff --git a/database/seeders/SecuritygroupsRecord/DataRowsTableSeeder.php b/database/seeders/SecuritygroupsRecord/DataRowsTableSeeder.php index f4081cf..b113b29 100644 --- a/database/seeders/SecuritygroupsRecord/DataRowsTableSeeder.php +++ b/database/seeders/SecuritygroupsRecord/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -71,6 +70,45 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'module'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'select_dropdown', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.module'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ], + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'record_id'); if (!$dataRow->exists) { $dataRow->fill([ @@ -86,11 +124,11 @@ public function run() ])->save(); } - $dataRow = $this->dataRow($dataType, 'module'); + $dataRow = $this->dataRow($dataType, 'securitygroups_record_morphto_record_relationship'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.module'), + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.record'), 'required' => 0, 'browse' => 1, 'read' => 1, @@ -98,6 +136,98 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'recordable', + 'type_column' => 'module', + 'column' => 'record_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bug'), + 'model' => Voyager::modelClass('Bug'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project'), + 'model' => Voyager::modelClass('Project'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project_task'), + 'model' => Voyager::modelClass('ProjectTask'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.task'), + 'model' => Voyager::modelClass('Task'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_product'), + 'model' => Voyager::modelClass('AosProduct'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], ])->save(); } diff --git a/database/seeders/Spot/DataRowsTableSeeder.php b/database/seeders/Spot/DataRowsTableSeeder.php index 4cab2c8..cbf0ac9 100644 --- a/database/seeders/Spot/DataRowsTableSeeder.php +++ b/database/seeders/Spot/DataRowsTableSeeder.php @@ -88,10 +88,16 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => '', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'getSalesSpotsData' => 'Sales', + 'getAccountsSpotsData' => 'Accounts', + 'getLeadsSpotsData' => 'Leads', + 'getServiceSpotsData' => 'Service', + 'getMarketingSpotsData' => 'Marketing', + 'getMarketingActivitySpotsData' => 'Marketing Activity', + 'getActivitiesSpotsData' => 'Activities', + 'getQuotesSpotsData' => 'Quotes' ], ], ])->save(); diff --git a/database/seeders/Sugarfeed/DataRowsTableSeeder.php b/database/seeders/Sugarfeed/DataRowsTableSeeder.php index 20c2b47..7e0ffb5 100644 --- a/database/seeders/Sugarfeed/DataRowsTableSeeder.php +++ b/database/seeders/Sugarfeed/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -119,10 +118,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => 'sugar', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'sugar' => 'SuiteCRM Email Client', + 'mailto' => 'External Email Client', ], ], ])->save(); diff --git a/database/seeders/Survey/DataRowsTableSeeder.php b/database/seeders/Survey/DataRowsTableSeeder.php index 14398d5..bb66950 100644 --- a/database/seeders/Survey/DataRowsTableSeeder.php +++ b/database/seeders/Survey/DataRowsTableSeeder.php @@ -135,8 +135,9 @@ public function run() 'details' => [ 'default' => config('joy-voyager-crm.surveys.default_status', 'Active'), 'options' => config('joy-voyager-crm.surveys.statuses', [ - 'Draft' => 'Draft', - 'Published' => 'Published', + 'Draft' => 'Draft', + 'Public' => 'Public', + 'Closed' => 'Closed', ]), ], ])->save(); diff --git a/database/seeders/Surveyquestion/DataRowsTableSeeder.php b/database/seeders/Surveyquestion/DataRowsTableSeeder.php index ff0c717..85292df 100644 --- a/database/seeders/Surveyquestion/DataRowsTableSeeder.php +++ b/database/seeders/Surveyquestion/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -89,10 +88,19 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Type1', + 'default' => 'Text', 'options' => [ - 'Type1' => 'Type1', - 'Type2' => 'Type2', + 'Text' => 'Text', + 'Textbox' => 'Textbox', + 'Checkbox' => 'Checkbox', + 'Radio' => 'Radio', + 'Dropdown' => 'Dropdown', + 'Multiselect' => 'Multiselect', + 'Matrix' => 'Matrix', + 'DateTime' => 'DateTime', + 'Date' => 'Date', + 'Scale' => 'Scale', + 'Rating' => 'Rating', ], ], ])->save(); diff --git a/database/seeders/Task/DataRowsTableSeeder.php b/database/seeders/Task/DataRowsTableSeeder.php index d233999..7023f8f 100644 --- a/database/seeders/Task/DataRowsTableSeeder.php +++ b/database/seeders/Task/DataRowsTableSeeder.php @@ -4,7 +4,6 @@ use Illuminate\Database\Seeder; use TCG\Voyager\Facades\Voyager; -use TCG\Voyager\Models\DataRow; class DataRowsTableSeeder extends Seeder { @@ -124,7 +123,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'parent_type'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent_type'), 'required' => 0, 'browse' => 1, @@ -133,6 +132,30 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Contact') => 'Contact', + Voyager::modelClass('Task') => 'Task', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('Bug') => 'Bug', // cn (11/22/2005) added to support Emails + + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + + Voyager::modelClass('Project') => 'Project', + Voyager::modelClass('ProjectTask') => 'Task Task', + + Voyager::modelClass('Prospect') => 'Target', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ], + ], ])->save(); } @@ -151,6 +174,113 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'task_morphto_parent_relationship'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.parent'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'parentable', + 'type_column' => 'parent_type', + 'column' => 'parent_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.task'), + 'model' => Voyager::modelClass('Task'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bug'), + 'model' => Voyager::modelClass('Bug'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project'), + 'model' => Voyager::modelClass('Project'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project_task'), + 'model' => Voyager::modelClass('ProjectTask'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_product'), + 'model' => Voyager::modelClass('AosProduct'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'task_belongsto_contact_relationship'); if (!$dataRow->exists) { $dataRow->fill([ @@ -204,11 +334,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Low', + 'default' => 'Medium', 'options' => [ - 'Low' => 'Low', - 'Medium' => 'Medium', 'High' => 'High', + 'Medium' => 'Medium', + 'Low' => 'Low', ], ], ])->save(); @@ -229,9 +359,11 @@ public function run() 'details' => [ 'default' => 'Not Started', 'options' => [ - 'Not Started' => 'Not Started', - 'Inactive' => 'Inactive', - 'Active' => 'Active', + 'Not Started' => 'Not Started', + 'In Progress' => 'In Progress', + 'Completed' => 'Completed', + 'Pending Input' => 'Pending Input', + 'Deferred' => 'Deferred', ], ], ])->save(); diff --git a/database/seeders/User/DataRowsTableSeeder.php b/database/seeders/User/DataRowsTableSeeder.php index ec6f73a..66b234c 100644 --- a/database/seeders/User/DataRowsTableSeeder.php +++ b/database/seeders/User/DataRowsTableSeeder.php @@ -637,10 +637,10 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => 'Active', 'options' => [ - 'Inactive' => 'Inactive', 'Active' => 'Active', + 'Inactive' => 'Inactive', ], ], ])->save(); @@ -764,10 +764,11 @@ public function run() 'delete' => 1, 'order' => ++$order, 'details' => [ - 'default' => 'Inactive', + 'default' => 'Active', 'options' => [ - 'Inactive' => 'Inactive', - 'Active' => 'Active', + 'Active' => 'Active', + 'Terminated' => 'Terminated', + 'Leave of Absence' => 'Leave of Absence', ], ], ])->save(); @@ -791,15 +792,24 @@ public function run() $dataRow = $this->dataRow($dataType, 'messenger_type'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.messenger_type'), 'required' => 0, - 'browse' => 0, - 'read' => 0, - 'edit' => 0, - 'add' => 0, - 'delete' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + 'MSN' => 'MSN', + 'Yahoo!' => 'Yahoo!', + 'AOL' => 'AOL', + ], + ], ])->save(); } @@ -876,22 +886,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'factor_auth_interface'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', - 'display_name' => __('joy-voyager-crm::seeders.data_rows.factor_auth_interface'), - 'required' => 0, - 'browse' => 1, - 'read' => 1, - 'edit' => 1, - 'add' => 1, - 'delete' => 1, - 'order' => ++$order, - ])->save(); - } - - $dataRow = $this->dataRow($dataType, 'factor_auth_interface'); - if (!$dataRow->exists) { - $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.factor_auth_interface'), 'required' => 0, 'browse' => 1, @@ -900,6 +895,12 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => 'FactorAuthEmailCode', + 'options' => [ + 'FactorAuthEmailCode' => 'Email Code', + ], + ], ])->save(); } } diff --git a/database/seeders/UsersLastImport/DataRowsTableSeeder.php b/database/seeders/UsersLastImport/DataRowsTableSeeder.php index f11b439..18638dc 100644 --- a/database/seeders/UsersLastImport/DataRowsTableSeeder.php +++ b/database/seeders/UsersLastImport/DataRowsTableSeeder.php @@ -49,7 +49,7 @@ public function run() $dataRow = $this->dataRow($dataType, 'bean_type'); if (!$dataRow->exists) { $dataRow->fill([ - 'type' => 'text', + 'type' => 'select_dropdown', 'display_name' => __('joy-voyager-crm::seeders.data_rows.bean_type'), 'required' => 0, 'browse' => 1, @@ -58,6 +58,30 @@ public function run() 'add' => 1, 'delete' => 1, 'order' => ++$order, + 'details' => [ + 'default' => '', + 'options' => [ + '' => 'None', + Voyager::modelClass('Account') => 'Account', + Voyager::modelClass('Opportunity') => 'Opportunity', + Voyager::modelClass('CrmCase') => 'Case', + Voyager::modelClass('Lead') => 'Lead', + Voyager::modelClass('Contact') => 'Contact', + + Voyager::modelClass('Bug') => 'Bug', + Voyager::modelClass('Project') => 'Project', + + Voyager::modelClass('Prospect') => 'Target', + Voyager::modelClass('ProjectTask') => 'Project Task', + + Voyager::modelClass('Task') => 'Task', + + Voyager::modelClass('AosContract') => 'Contract', + Voyager::modelClass('AosInvoice') => 'Invoice', + Voyager::modelClass('AosQuote') => 'Quote', + Voyager::modelClass('AosProduct') => 'Product', + ], + ], ])->save(); } @@ -76,6 +100,113 @@ public function run() ])->save(); } + $dataRow = $this->dataRow($dataType, 'aod_index_event_morphto_bean_relationship'); + if (!$dataRow->exists) { + $dataRow->fill([ + 'type' => 'relationship', + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bean'), + 'required' => 0, + 'browse' => 1, + 'read' => 1, + 'edit' => 1, + 'add' => 1, + 'delete' => 1, + 'order' => ++$order, + 'details' => [ + 'type' => 'morphTo', + 'function' => 'beanable', + 'type_column' => 'bean_type', + 'column' => 'bean_id', + 'types' => [ + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.account'), + 'model' => Voyager::modelClass('Account'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.opportunity'), + 'model' => Voyager::modelClass('Opportunity'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.crm_case'), + 'model' => Voyager::modelClass('CrmCase'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.lead'), + 'model' => Voyager::modelClass('Lead'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.contact'), + 'model' => Voyager::modelClass('Contact'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.bug'), + 'model' => Voyager::modelClass('Bug'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project'), + 'model' => Voyager::modelClass('Project'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.prospect'), + 'model' => Voyager::modelClass('Prospect'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.project_task'), + 'model' => Voyager::modelClass('ProjectTask'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.task'), + 'model' => Voyager::modelClass('Task'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_contract'), + 'model' => Voyager::modelClass('AosContract'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_invoice'), + 'model' => Voyager::modelClass('AosInvoice'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_quote'), + 'model' => Voyager::modelClass('AosQuote'), + 'key' => 'id', + 'label' => 'name', + ], + [ + 'display_name' => __('joy-voyager-crm::seeders.data_rows.aos_product'), + 'model' => Voyager::modelClass('AosProduct'), + 'key' => 'id', + 'label' => 'name', + ] + ] + ], + ])->save(); + } + $dataRow = $this->dataRow($dataType, 'created_at'); if (!$dataRow->exists) { $dataRow->fill([ diff --git a/database/seeders/UsersLastImport/DataTypesTableSeeder.php b/database/seeders/UsersLastImport/DataTypesTableSeeder.php index 0cc8579..481e1a2 100644 --- a/database/seeders/UsersLastImport/DataTypesTableSeeder.php +++ b/database/seeders/UsersLastImport/DataTypesTableSeeder.php @@ -16,7 +16,7 @@ public function run() $dataType = $this->dataType('slug', 'users-last-imports'); if (!$dataType->exists) { $dataType->fill([ - 'name' => 'users_last_imports', + 'name' => 'users_last_import', 'display_name_singular' => __('joy-voyager-crm::seeders.data_types.users_last_import.singular'), 'display_name_plural' => __('joy-voyager-crm::seeders.data_types.users_last_import.plural'), 'icon' => 'voyager-bread voyager-crm-users_last_import voyager-upload', diff --git a/database/seeders/UsersLastImport/PermissionsTableSeeder.php b/database/seeders/UsersLastImport/PermissionsTableSeeder.php index 4170a7e..ce85261 100644 --- a/database/seeders/UsersLastImport/PermissionsTableSeeder.php +++ b/database/seeders/UsersLastImport/PermissionsTableSeeder.php @@ -13,6 +13,6 @@ class PermissionsTableSeeder extends Seeder */ public function run() { - Voyager::model('Permission')->generateFor('users_last_imports'); + Voyager::model('Permission')->generateFor('users_last_import'); } } diff --git a/database/seeders/UsersLastImport/TranslationsTableSeeder.php b/database/seeders/UsersLastImport/TranslationsTableSeeder.php index 466926e..3f8d752 100644 --- a/database/seeders/UsersLastImport/TranslationsTableSeeder.php +++ b/database/seeders/UsersLastImport/TranslationsTableSeeder.php @@ -30,17 +30,17 @@ public function run() */ private function usersLastImportsTranslations() { - // Adding translations for 'users_last_imports' + // Adding translations for 'users_last_import' // $cat = Voyager::model('UsersLastImport')->where('name', 'users_last_import-1')->first(); if ($cat->exists) { - $this->trans('pt', $this->arr(['users_last_imports', 'name'], $cat->id), 'users-last-import-1'); - $this->trans('pt', $this->arr(['users_last_imports', 'description'], $cat->id), 'UsersLastImport 1'); + $this->trans('pt', $this->arr(['users_last_import', 'name'], $cat->id), 'users-last-import-1'); + $this->trans('pt', $this->arr(['users_last_import', 'description'], $cat->id), 'UsersLastImport 1'); } $cat = Voyager::model('UsersLastImport')->where('name', 'users_last_import-2')->first(); if ($cat->exists) { - $this->trans('pt', $this->arr(['users_last_imports', 'name'], $cat->id), 'users-last-import-2'); - $this->trans('pt', $this->arr(['users_last_imports', 'description'], $cat->id), 'UsersLastImport 2'); + $this->trans('pt', $this->arr(['users_last_import', 'name'], $cat->id), 'users-last-import-2'); + $this->trans('pt', $this->arr(['users_last_import', 'description'], $cat->id), 'UsersLastImport 2'); } } diff --git a/database/seeders/VoyagerDatabaseSeeder.php b/database/seeders/VoyagerDatabaseSeeder.php index 070b3a6..7d27128 100644 --- a/database/seeders/VoyagerDatabaseSeeder.php +++ b/database/seeders/VoyagerDatabaseSeeder.php @@ -108,6 +108,7 @@ public function run() \Joy\VoyagerCrm\Database\Seeders\Prospect\VoyagerDatabaseSeeder::class, \Joy\VoyagerCrm\Database\Seeders\MeetingsLead\VoyagerDatabaseSeeder::class, \Joy\VoyagerCrm\Database\Seeders\Surveyquestionresponse\VoyagerDatabaseSeeder::class, + \Joy\VoyagerCrm\Database\Seeders\CampaignLog\VoyagerDatabaseSeeder::class, \Joy\VoyagerCrm\Database\Seeders\Emailman\VoyagerDatabaseSeeder::class, \Joy\VoyagerCrm\Database\Seeders\ProspectListsProspect\VoyagerDatabaseSeeder::class, \Joy\VoyagerCrm\Database\Seeders\UsersLastImport\VoyagerDatabaseSeeder::class, @@ -116,6 +117,7 @@ public function run() \Joy\VoyagerCrm\Database\Seeders\SecuritygroupsRecord\VoyagerDatabaseSeeder::class, \Joy\VoyagerCrm\Database\Seeders\EmailsBean\VoyagerDatabaseSeeder::class, \Joy\VoyagerCrm\Database\Seeders\Tracker\VoyagerDatabaseSeeder::class, + \Joy\VoyagerCrm\Database\Seeders\EmailAddress\VoyagerDatabaseSeeder::class, // \Joy\VoyagerBreadActivity\Database\Seeders\VoyagerDatabaseSeeder::class, // \Joy\VoyagerBreadArticle\Database\Seeders\VoyagerDatabaseSeeder::class, // \Joy\VoyagerBreadArticleCategory\Database\Seeders\VoyagerDatabaseSeeder::class, diff --git a/database/seeders/VoyagerDummyDatabaseSeeder.php b/database/seeders/VoyagerDummyDatabaseSeeder.php index 0b7cd35..6a26b6f 100644 --- a/database/seeders/VoyagerDummyDatabaseSeeder.php +++ b/database/seeders/VoyagerDummyDatabaseSeeder.php @@ -116,6 +116,7 @@ public function run() \Joy\VoyagerCrm\Database\Seeders\SecuritygroupsRecord\VoyagerDummyDatabaseSeeder::class, \Joy\VoyagerCrm\Database\Seeders\EmailsBean\VoyagerDummyDatabaseSeeder::class, \Joy\VoyagerCrm\Database\Seeders\Tracker\VoyagerDummyDatabaseSeeder::class, + \Joy\VoyagerCrm\Database\Seeders\EmailAddress\VoyagerDummyDatabaseSeeder::class, // \Joy\VoyagerBreadActivity\Database\Seeders\VoyagerDummyDatabaseSeeder::class, // \Joy\VoyagerBreadArticle\Database\Seeders\VoyagerDummyDatabaseSeeder::class, // \Joy\VoyagerBreadArticleCategory\Database\Seeders\VoyagerDummyDatabaseSeeder::class, diff --git a/resources/lang/en/seeders.php b/resources/lang/en/seeders.php index 6a12bde..997df6b 100644 --- a/resources/lang/en/seeders.php +++ b/resources/lang/en/seeders.php @@ -602,6 +602,21 @@ 'bean_type' => 'Bean type', 'signature' => 'Signature', 'signature_html' => 'Signature html', + 'project' => 'Project', + 'prospect' => 'Prospect', + 'project_task' => 'Project task', + 'related' => 'Related', + 'email_address' => 'Email address', + 'email_address_caps' => 'Email address caps', + 'invalid_email' => 'Invalid email', + 'opt_out' => 'Opt out', + 'confirm_opt_in' => 'Confirm opt in', + 'confirm_opt_in_date' => 'Confirm opt in date', + 'confirm_opt_in_sent_date' => 'Confirm opt in sent date', + 'confirm_opt_in_fail_date' => 'Confirm opt in fail date', + 'confirm_opt_in_token' => 'Confirm opt in token', + 'record_id' => 'Record Id', + 'record' => 'Record', ], 'data_types' => [ 'user' => [ @@ -1130,7 +1145,11 @@ ], 'tracker' => [ 'singular' => 'Tracker', - 'plural' => 'Tracker', + 'plural' => 'Trackers', + ], + 'email_address' => [ + 'singular' => 'Email Address', + 'plural' => 'Email Addresses', ] ], 'menu_items' => [ @@ -1271,6 +1290,11 @@ 'custom_fields' => 'Custom fields', 'emails_beans' => 'Emails beans', 'trackers' => 'Trackers', + 'email_addresses' => 'Email Addresses', + 'crm_case' => 'Case', + 'task' => 'Task', + 'aos_quote' => 'Aos Quote', + 'aos_invoice' => 'Aos Invoice', ], 'settings' => [ 'user' => [ diff --git a/src/Console/Commands/AodIndexUnindexed.php b/src/Console/Commands/AodIndexUnindexed.php new file mode 100644 index 0000000..065c30f --- /dev/null +++ b/src/Console/Commands/AodIndexUnindexed.php @@ -0,0 +1,21 @@ +output->title('Starting AodIndexUnindexed'); + + // Your magic here + + $this->output->success('AodIndexUnindexed successful'); + } +} diff --git a/src/Console/Commands/AodOptimiseIndex.php b/src/Console/Commands/AodOptimiseIndex.php new file mode 100644 index 0000000..dd721e5 --- /dev/null +++ b/src/Console/Commands/AodOptimiseIndex.php @@ -0,0 +1,21 @@ +output->title('Starting AodOptimiseIndex'); + + // Your magic here + + $this->output->success('AodOptimiseIndex successful'); + } +} diff --git a/src/Console/Commands/AorRunScheduledReports.php b/src/Console/Commands/AorRunScheduledReports.php new file mode 100644 index 0000000..def0686 --- /dev/null +++ b/src/Console/Commands/AorRunScheduledReports.php @@ -0,0 +1,21 @@ +output->title('Starting AorRunScheduledReports'); + + // Your magic here + + $this->output->success('AorRunScheduledReports successful'); + } +} diff --git a/src/Console/Commands/CleanJobQueue.php b/src/Console/Commands/CleanJobQueue.php new file mode 100644 index 0000000..4dc8ff3 --- /dev/null +++ b/src/Console/Commands/CleanJobQueue.php @@ -0,0 +1,21 @@ +output->title('Starting CleanJobQueue'); + + // Your magic here + + $this->output->success('CleanJobQueue successful'); + } +} diff --git a/src/Console/Commands/PerformLuceneIndexing.php b/src/Console/Commands/PerformLuceneIndexing.php new file mode 100644 index 0000000..f2d53d8 --- /dev/null +++ b/src/Console/Commands/PerformLuceneIndexing.php @@ -0,0 +1,21 @@ +output->title('Starting PerformLuceneIndexing'); + + // Your magic here + + $this->output->success('PerformLuceneIndexing successful'); + } +} diff --git a/src/Console/Commands/PollMonitoredInboxes.php b/src/Console/Commands/PollMonitoredInboxes.php new file mode 100644 index 0000000..fb88901 --- /dev/null +++ b/src/Console/Commands/PollMonitoredInboxes.php @@ -0,0 +1,21 @@ +output->title('Starting PollMonitoredInboxes'); + + // Your magic here + + $this->output->success('PollMonitoredInboxes successful'); + } +} diff --git a/src/Console/Commands/PollMonitoredInboxesAop.php b/src/Console/Commands/PollMonitoredInboxesAop.php new file mode 100644 index 0000000..0edd485 --- /dev/null +++ b/src/Console/Commands/PollMonitoredInboxesAop.php @@ -0,0 +1,21 @@ +output->title('Starting PollMonitoredInboxesAop'); + + // Your magic here + + $this->output->success('PollMonitoredInboxesAop successful'); + } +} diff --git a/src/Console/Commands/PollMonitoredInboxesForBouncedCampaignEmails.php b/src/Console/Commands/PollMonitoredInboxesForBouncedCampaignEmails.php new file mode 100644 index 0000000..9485898 --- /dev/null +++ b/src/Console/Commands/PollMonitoredInboxesForBouncedCampaignEmails.php @@ -0,0 +1,21 @@ +output->title('Starting PollMonitoredInboxesForBouncedCampaignEmails'); + + // Your magic here + + $this->output->success('PollMonitoredInboxesForBouncedCampaignEmails successful'); + } +} diff --git a/src/Console/Commands/ProcessAowWorkflow.php b/src/Console/Commands/ProcessAowWorkflow.php new file mode 100644 index 0000000..f7fe388 --- /dev/null +++ b/src/Console/Commands/ProcessAowWorkflow.php @@ -0,0 +1,21 @@ +output->title('Starting ProcessAowWorkflow'); + + // Your magic here + + $this->output->success('ProcessAowWorkflow successful'); + } +} diff --git a/src/Console/Commands/PruneDatabase.php b/src/Console/Commands/PruneDatabase.php new file mode 100644 index 0000000..eb16e6b --- /dev/null +++ b/src/Console/Commands/PruneDatabase.php @@ -0,0 +1,21 @@ +output->title('Starting PruneDatabase'); + + // Your magic here + + $this->output->success('PruneDatabase successful'); + } +} diff --git a/src/Console/Commands/RefreshJobs.php b/src/Console/Commands/RefreshJobs.php new file mode 100644 index 0000000..7b28c02 --- /dev/null +++ b/src/Console/Commands/RefreshJobs.php @@ -0,0 +1,24 @@ +output->title('Starting RefreshJobs'); + + // return true; + + $this->output->success('RefreshJobs successful'); + } +} diff --git a/src/Console/Commands/RemoveDocumentsFromFs.php b/src/Console/Commands/RemoveDocumentsFromFs.php new file mode 100644 index 0000000..c42fa50 --- /dev/null +++ b/src/Console/Commands/RemoveDocumentsFromFs.php @@ -0,0 +1,21 @@ +output->title('Starting RemoveDocumentsFromFs'); + + // Your magic here + + $this->output->success('RemoveDocumentsFromFs successful'); + } +} diff --git a/src/Console/Commands/RunMassEmailCampaign.php b/src/Console/Commands/RunMassEmailCampaign.php new file mode 100644 index 0000000..d80b0ea --- /dev/null +++ b/src/Console/Commands/RunMassEmailCampaign.php @@ -0,0 +1,21 @@ +output->title('Starting RunMassEmailCampaign'); + + // Your magic here + + $this->output->success('RunMassEmailCampaign successful'); + } +} diff --git a/src/Console/Commands/SecurityAudit.php b/src/Console/Commands/SecurityAudit.php new file mode 100644 index 0000000..05bf112 --- /dev/null +++ b/src/Console/Commands/SecurityAudit.php @@ -0,0 +1,21 @@ +output->title('Starting SecurityAudit'); + + // Your magic here + + $this->output->success('SecurityAudit successful'); + } +} diff --git a/src/Console/Commands/SendEmailReminders.php b/src/Console/Commands/SendEmailReminders.php new file mode 100644 index 0000000..1124cff --- /dev/null +++ b/src/Console/Commands/SendEmailReminders.php @@ -0,0 +1,21 @@ +output->title('Starting SendEmailReminders'); + + // Your magic here + + $this->output->success('SendEmailReminders successful'); + } +} diff --git a/src/Console/Commands/SyncGoogleCalendar.php b/src/Console/Commands/SyncGoogleCalendar.php new file mode 100644 index 0000000..e49f423 --- /dev/null +++ b/src/Console/Commands/SyncGoogleCalendar.php @@ -0,0 +1,21 @@ +output->title('Starting SyncGoogleCalendar'); + + // Your magic here + + $this->output->success('SyncGoogleCalendar successful'); + } +} diff --git a/src/Console/Commands/TrimSugarFeeds.php b/src/Console/Commands/TrimSugarFeeds.php new file mode 100644 index 0000000..37a0258 --- /dev/null +++ b/src/Console/Commands/TrimSugarFeeds.php @@ -0,0 +1,21 @@ +output->title('Starting TrimSugarFeeds'); + + // Your magic here + + $this->output->success('TrimSugarFeeds successful'); + } +} diff --git a/src/Console/Commands/TrimTracker.php b/src/Console/Commands/TrimTracker.php new file mode 100644 index 0000000..be628e5 --- /dev/null +++ b/src/Console/Commands/TrimTracker.php @@ -0,0 +1,21 @@ +output->title('Starting TrimTracker'); + + // Your magic here + + $this->output->success('TrimTracker successful'); + } +} diff --git a/src/Models/EmailAddress.php b/src/Models/EmailAddress.php index 2516a59..258fc82 100644 --- a/src/Models/EmailAddress.php +++ b/src/Models/EmailAddress.php @@ -5,8 +5,13 @@ namespace Joy\VoyagerCrm\Models; use Carbon\Carbon; -use Illuminate\Database\Eloquent\Model; -use Illuminate\Database\Eloquent\SoftDeletes; +use Joy\VoyagerCrm\Database\Factories\EmailAddressFactory; + +use Illuminate\Database\Eloquent\{ + Factories\HasFactory, + Model, + SoftDeletes +}; /** * Class EmailAddress @@ -32,6 +37,7 @@ class EmailAddress extends Model use SoftDeletes; use Traits\Uuids; // use Traits\CreatedModifiedBy; + use HasFactory; protected $table = 'email_addresses'; public $incrementing = false; @@ -68,4 +74,14 @@ class EmailAddress extends Model 'confirm_opt_in_fail_date', 'confirm_opt_in_token', ]; + + /** + * Create a new factory instance for the model. + * + * @return \Illuminate\Database\Eloquent\Factories\Factory + */ + protected static function newFactory() + { + return EmailAddressFactory::new(); + } } diff --git a/src/VoyagerCrmServiceProvider.php b/src/VoyagerCrmServiceProvider.php index 4f1e902..bd1a76e 100644 --- a/src/VoyagerCrmServiceProvider.php +++ b/src/VoyagerCrmServiceProvider.php @@ -4,230 +4,254 @@ namespace Joy\VoyagerCrm; -use Illuminate\Support\Facades\Route; -use Illuminate\Support\ServiceProvider; -use Joy\VoyagerCrm\Models\Account; -use Joy\VoyagerCrm\Models\AccountsAudit; -use Joy\VoyagerCrm\Models\AccountsBug; -use Joy\VoyagerCrm\Models\AccountsCase; -use Joy\VoyagerCrm\Models\AccountsContact; -use Joy\VoyagerCrm\Models\AccountsCstm; -use Joy\VoyagerCrm\Models\AccountsOpportunity; -use Joy\VoyagerCrm\Models\AclAction; -use Joy\VoyagerCrm\Models\AclRole; -use Joy\VoyagerCrm\Models\AclRolesAction; -use Joy\VoyagerCrm\Models\AclRolesUser; -use Joy\VoyagerCrm\Models\AddressBook; -use Joy\VoyagerCrm\Models\Alert; -use Joy\VoyagerCrm\Models\AmProjecttemplate; -use Joy\VoyagerCrm\Models\AmProjecttemplatesAudit; -use Joy\VoyagerCrm\Models\AmProjecttemplatesContacts1C; -use Joy\VoyagerCrm\Models\AmProjecttemplatesProject1C; -use Joy\VoyagerCrm\Models\AmProjecttemplatesUsers1C; -use Joy\VoyagerCrm\Models\AmTasktemplate; -use Joy\VoyagerCrm\Models\AmTasktemplatesAmProjecttemplatesC; -use Joy\VoyagerCrm\Models\AmTasktemplatesAudit; -use Joy\VoyagerCrm\Models\AobhBusinesshour; -use Joy\VoyagerCrm\Models\AodIndex; -use Joy\VoyagerCrm\Models\AodIndexAudit; -use Joy\VoyagerCrm\Models\AodIndexevent; -use Joy\VoyagerCrm\Models\AodIndexeventAudit; -use Joy\VoyagerCrm\Models\AokKnowledgeBaseCategoriesAudit; -use Joy\VoyagerCrm\Models\AokKnowledgebase; -use Joy\VoyagerCrm\Models\AokKnowledgebaseAudit; -use Joy\VoyagerCrm\Models\AokKnowledgebaseBaseCategory; -use Joy\VoyagerCrm\Models\AokKnowledgebaseCategory; -use Joy\VoyagerCrm\Models\AopCaseEvent; -use Joy\VoyagerCrm\Models\AopCaseEventsAudit; -use Joy\VoyagerCrm\Models\AopCaseUpdate; -use Joy\VoyagerCrm\Models\AopCaseUpdatesAudit; -use Joy\VoyagerCrm\Models\AorChart; -use Joy\VoyagerCrm\Models\AorCondition; -use Joy\VoyagerCrm\Models\AorField; -use Joy\VoyagerCrm\Models\AorReport; -use Joy\VoyagerCrm\Models\AorReportsAudit; -use Joy\VoyagerCrm\Models\AorScheduledReport; -use Joy\VoyagerCrm\Models\AosContract; -use Joy\VoyagerCrm\Models\AosContractsAudit; -use Joy\VoyagerCrm\Models\AosContractsDocument; -use Joy\VoyagerCrm\Models\AosInvoice; -use Joy\VoyagerCrm\Models\AosInvoicesAudit; -use Joy\VoyagerCrm\Models\AosLineItemGroup; -use Joy\VoyagerCrm\Models\AosLineItemGroupsAudit; -use Joy\VoyagerCrm\Models\AosPdfTemplate; -use Joy\VoyagerCrm\Models\AosPdfTemplatesAudit; -use Joy\VoyagerCrm\Models\AosProduct; -use Joy\VoyagerCrm\Models\AosProductCategoriesAudit; -use Joy\VoyagerCrm\Models\AosProductCategory; -use Joy\VoyagerCrm\Models\AosProductsAudit; -use Joy\VoyagerCrm\Models\AosProductsQuote; -use Joy\VoyagerCrm\Models\AosProductsQuotesAudit; -use Joy\VoyagerCrm\Models\AosQuote; -use Joy\VoyagerCrm\Models\AosQuotesAosInvoicesC; -use Joy\VoyagerCrm\Models\AosQuotesAudit; -use Joy\VoyagerCrm\Models\AosQuotesOsContractsC; -use Joy\VoyagerCrm\Models\AosQuotesProjectC; -use Joy\VoyagerCrm\Models\AowAction; -use Joy\VoyagerCrm\Models\AowCondition; -use Joy\VoyagerCrm\Models\AowProcessed; -use Joy\VoyagerCrm\Models\AowProcessedAowAction; -use Joy\VoyagerCrm\Models\AowWorkflow; -use Joy\VoyagerCrm\Models\AowWorkflowAudit; -use Joy\VoyagerCrm\Models\Bug; -use Joy\VoyagerCrm\Models\BugsAudit; -use Joy\VoyagerCrm\Models\Call; -use Joy\VoyagerCrm\Models\CallsContact; -use Joy\VoyagerCrm\Models\CallsLead; -use Joy\VoyagerCrm\Models\CallsReschedule; -use Joy\VoyagerCrm\Models\CallsRescheduleAudit; -use Joy\VoyagerCrm\Models\CallsUser; -use Joy\VoyagerCrm\Models\Campaign; -use Joy\VoyagerCrm\Models\CampaignLog; -use Joy\VoyagerCrm\Models\CampaignTrkr; -use Joy\VoyagerCrm\Models\CampaignsAudit; -use Joy\VoyagerCrm\Models\CasesAudit; -use Joy\VoyagerCrm\Models\CasesBug; -use Joy\VoyagerCrm\Models\CasesCstm; -use Joy\VoyagerCrm\Models\Config; -use Joy\VoyagerCrm\Models\Contact; -use Joy\VoyagerCrm\Models\ContactsAudit; -use Joy\VoyagerCrm\Models\ContactsBug; -use Joy\VoyagerCrm\Models\ContactsCase; -use Joy\VoyagerCrm\Models\ContactsCstm; -use Joy\VoyagerCrm\Models\ContactsUser; -use Joy\VoyagerCrm\Models\CrmCase; -use Joy\VoyagerCrm\Models\CronRemoveDocument; -use Joy\VoyagerCrm\Models\Currency; -use Joy\VoyagerCrm\Models\CustomField; -use Joy\VoyagerCrm\Models\Document; -use Joy\VoyagerCrm\Models\DocumentRevision; -use Joy\VoyagerCrm\Models\DocumentsAccount; -use Joy\VoyagerCrm\Models\DocumentsBug; -use Joy\VoyagerCrm\Models\DocumentsCase; -use Joy\VoyagerCrm\Models\DocumentsContact; -use Joy\VoyagerCrm\Models\DocumentsOpportunity; -use Joy\VoyagerCrm\Models\Eapm; -use Joy\VoyagerCrm\Models\Email; -use Joy\VoyagerCrm\Models\EmailAddrBeanRel; -use Joy\VoyagerCrm\Models\EmailAddress; -use Joy\VoyagerCrm\Models\EmailAddressesAudit; -use Joy\VoyagerCrm\Models\EmailCache; -use Joy\VoyagerCrm\Models\EmailMarketing; -use Joy\VoyagerCrm\Models\EmailMarketingProspectList; -use Joy\VoyagerCrm\Models\EmailTemplate; -use Joy\VoyagerCrm\Models\Emailman; -use Joy\VoyagerCrm\Models\EmailsBean; -use Joy\VoyagerCrm\Models\EmailsEmailAddrRel; -use Joy\VoyagerCrm\Models\EmailsText; -use Joy\VoyagerCrm\Models\Favorite; -use Joy\VoyagerCrm\Models\FieldsMetaDatum; -use Joy\VoyagerCrm\Models\Folder; -use Joy\VoyagerCrm\Models\FoldersRel; -use Joy\VoyagerCrm\Models\FoldersSubscription; -use Joy\VoyagerCrm\Models\FpEvent; -use Joy\VoyagerCrm\Models\FpEventLocation; -use Joy\VoyagerCrm\Models\FpEventLocationsAudit; -use Joy\VoyagerCrm\Models\FpEventLocationsFpEvents1C; -use Joy\VoyagerCrm\Models\FpEventsAudit; -use Joy\VoyagerCrm\Models\FpEventsContactsC; -use Joy\VoyagerCrm\Models\FpEventsFpEventDelegates1C; -use Joy\VoyagerCrm\Models\FpEventsFpEventLocations1C; -use Joy\VoyagerCrm\Models\FpEventsLeads1C; -use Joy\VoyagerCrm\Models\FpEventsProspects1C; -use Joy\VoyagerCrm\Models\ImportMap; -use Joy\VoyagerCrm\Models\InboundEmail; -use Joy\VoyagerCrm\Models\InboundEmailAutoreply; -use Joy\VoyagerCrm\Models\InboundEmailCacheT; -use Joy\VoyagerCrm\Models\JjwgAddressCache; -use Joy\VoyagerCrm\Models\JjwgAddressCacheAudit; -use Joy\VoyagerCrm\Models\JjwgArea; -use Joy\VoyagerCrm\Models\JjwgAreasAudit; -use Joy\VoyagerCrm\Models\JjwgMap; -use Joy\VoyagerCrm\Models\JjwgMapsAudit; -use Joy\VoyagerCrm\Models\JjwgMapsJjwgAreasC; -use Joy\VoyagerCrm\Models\JjwgMapsJjwgMarkersC; -use Joy\VoyagerCrm\Models\JjwgMarker; -use Joy\VoyagerCrm\Models\JjwgMarkersAudit; -use Joy\VoyagerCrm\Models\JobQueue; -use Joy\VoyagerCrm\Models\Lead; -use Joy\VoyagerCrm\Models\LeadsAudit; -use Joy\VoyagerCrm\Models\LeadsCstm; -use Joy\VoyagerCrm\Models\LinkedDocument; -use Joy\VoyagerCrm\Models\Meeting; -use Joy\VoyagerCrm\Models\MeetingsContact; -use Joy\VoyagerCrm\Models\MeetingsCstm; -use Joy\VoyagerCrm\Models\MeetingsLead; -use Joy\VoyagerCrm\Models\MeetingsUser; -use Joy\VoyagerCrm\Models\Note; -use Joy\VoyagerCrm\Models\Oauth2client; -use Joy\VoyagerCrm\Models\Oauth2token; -use Joy\VoyagerCrm\Models\OauthConsumer; -use Joy\VoyagerCrm\Models\OauthNonce; -use Joy\VoyagerCrm\Models\OauthToken; -use Joy\VoyagerCrm\Models\OpportunitiesAudit; -use Joy\VoyagerCrm\Models\OpportunitiesContact; -use Joy\VoyagerCrm\Models\OpportunitiesCstm; -use Joy\VoyagerCrm\Models\Opportunity; -use Joy\VoyagerCrm\Models\OutboundEmail; -use Joy\VoyagerCrm\Models\OutboundEmailAudit; -use Joy\VoyagerCrm\Models\Project; -use Joy\VoyagerCrm\Models\ProjectContacts1C; -use Joy\VoyagerCrm\Models\ProjectCstm; -use Joy\VoyagerCrm\Models\ProjectTask; -use Joy\VoyagerCrm\Models\ProjectTaskAudit; -use Joy\VoyagerCrm\Models\ProjectUsers1C; -use Joy\VoyagerCrm\Models\ProjectsAccount; -use Joy\VoyagerCrm\Models\ProjectsBug; -use Joy\VoyagerCrm\Models\ProjectsCase; -use Joy\VoyagerCrm\Models\ProjectsContact; -use Joy\VoyagerCrm\Models\ProjectsOpportunity; -use Joy\VoyagerCrm\Models\ProjectsProduct; -use Joy\VoyagerCrm\Models\Prospect; -use Joy\VoyagerCrm\Models\ProspectList; -use Joy\VoyagerCrm\Models\ProspectListCampaign; -use Joy\VoyagerCrm\Models\ProspectListsProspect; -use Joy\VoyagerCrm\Models\ProspectsCstm; -use Joy\VoyagerCrm\Models\Relationship; -use Joy\VoyagerCrm\Models\Release; -use Joy\VoyagerCrm\Models\Reminder; -use Joy\VoyagerCrm\Models\RemindersInvitee; -use Joy\VoyagerCrm\Models\Role; -use Joy\VoyagerCrm\Models\RolesModule; -use Joy\VoyagerCrm\Models\RolesUser; -use Joy\VoyagerCrm\Models\SavedSearch; -use Joy\VoyagerCrm\Models\Scheduler; -use Joy\VoyagerCrm\Models\Securitygroup; -use Joy\VoyagerCrm\Models\SecuritygroupsAclRole; -use Joy\VoyagerCrm\Models\SecuritygroupsAudit; -use Joy\VoyagerCrm\Models\SecuritygroupsDefault; -use Joy\VoyagerCrm\Models\SecuritygroupsRecord; -use Joy\VoyagerCrm\Models\SecuritygroupsUser; -use Joy\VoyagerCrm\Models\Spot; -use Joy\VoyagerCrm\Models\Sugarfeed; -use Joy\VoyagerCrm\Models\Survey; -use Joy\VoyagerCrm\Models\Surveyquestion; -use Joy\VoyagerCrm\Models\Surveyquestionoption; -use Joy\VoyagerCrm\Models\SurveyquestionoptionsAudit; -use Joy\VoyagerCrm\Models\SurveyquestionoptionsSurveyquestionresponse; -use Joy\VoyagerCrm\Models\Surveyquestionresponse; -use Joy\VoyagerCrm\Models\SurveyquestionresponsesAudit; -use Joy\VoyagerCrm\Models\SurveyquestionsAudit; -use Joy\VoyagerCrm\Models\Surveyresponse; -use Joy\VoyagerCrm\Models\SurveyresponsesAudit; -use Joy\VoyagerCrm\Models\SurveysAudit; -use Joy\VoyagerCrm\Models\Task; -use Joy\VoyagerCrm\Models\Templatesectionline; -use Joy\VoyagerCrm\Models\Tracker; -use Joy\VoyagerCrm\Models\UpgradeHistory; -use Joy\VoyagerCrm\Models\User; -use Joy\VoyagerCrm\Models\UserPreference; -use Joy\VoyagerCrm\Models\UsersFeed; -use Joy\VoyagerCrm\Models\UsersLastImport; -use Joy\VoyagerCrm\Models\UsersPasswordLink; -use Joy\VoyagerCrm\Models\UsersSignature; -use Joy\VoyagerCrm\Models\Vcal; +use Illuminate\Console\Scheduling\Schedule; use TCG\Voyager\Facades\Voyager; +use Illuminate\Support\{ + Facades\Route, + ServiceProvider +}; +use Joy\VoyagerCrm\Console\Commands\{ + AodIndexUnindexed, + AodOptimiseIndex, + AorRunScheduledReports, + CleanJobQueue, + PerformLuceneIndexing, + PollMonitoredInboxes, + PollMonitoredInboxesAop, + PollMonitoredInboxesForBouncedCampaignEmails, + ProcessAowWorkflow, + PruneDatabase, + RefreshJobs, + RemoveDocumentsFromFs, + RunMassEmailCampaign, + SecurityAudit, + SendEmailReminders, + SyncGoogleCalendar, + TrimSugarFeeds, + TrimTracker +}; +use Joy\VoyagerCrm\Models\{ + Account, + AccountsAudit, + AccountsBug, + AccountsCase, + AccountsContact, + AccountsCstm, + AccountsOpportunity, + AclAction, + AclRole, + AclRolesAction, + AclRolesUser, + AddressBook, + Alert, + AmProjecttemplate, + AmProjecttemplatesAudit, + AmProjecttemplatesContacts1C, + AmProjecttemplatesProject1C, + AmProjecttemplatesUsers1C, + AmTasktemplate, + AmTasktemplatesAmProjecttemplatesC, + AmTasktemplatesAudit, + AobhBusinesshour, + AodIndex, + AodIndexAudit, + AodIndexevent, + AodIndexeventAudit, + AokKnowledgebase, + AokKnowledgebaseAudit, + AokKnowledgebaseBaseCategory, + AokKnowledgeBaseCategoriesAudit, + AokKnowledgebaseCategory, + AopCaseEvent, + AopCaseEventsAudit, + AopCaseUpdate, + AopCaseUpdatesAudit, + AorChart, + AorCondition, + AorField, + AorReport, + AorReportsAudit, + AorScheduledReport, + AosContract, + AosContractsAudit, + AosContractsDocument, + AosInvoice, + AosInvoicesAudit, + AosLineItemGroup, + AosLineItemGroupsAudit, + AosPdfTemplate, + AosPdfTemplatesAudit, + AosProduct, + AosProductCategoriesAudit, + AosProductCategory, + AosProductsAudit, + AosProductsQuote, + AosProductsQuotesAudit, + AosQuote, + AosQuotesAosInvoicesC, + AosQuotesAudit, + AosQuotesOsContractsC, + AosQuotesProjectC, + AowAction, + AowCondition, + AowProcessed, + AowProcessedAowAction, + AowWorkflow, + AowWorkflowAudit, + Bug, + BugsAudit, + Call, + CallsContact, + CallsLead, + CallsReschedule, + CallsRescheduleAudit, + CallsUser, + Campaign, + CampaignLog, + CampaignsAudit, + CampaignTrkr, + CasesAudit, + CasesBug, + CasesCstm, + Config, + Contact, + ContactsAudit, + ContactsBug, + ContactsCase, + ContactsCstm, + ContactsUser, + CrmCase, + CronRemoveDocument, + Currency, + CustomField, + Document, + DocumentRevision, + DocumentsAccount, + DocumentsBug, + DocumentsCase, + DocumentsContact, + DocumentsOpportunity, + Eapm, + Email, + EmailAddrBeanRel, + EmailAddress, + EmailAddressesAudit, + EmailCache, + Emailman, + EmailMarketing, + EmailMarketingProspectList, + EmailsBean, + EmailsEmailAddrRel, + EmailsText, + EmailTemplate, + Favorite, + FieldsMetaDatum, + Folder, + FoldersRel, + FoldersSubscription, + FpEvent, + FpEventLocation, + FpEventLocationsAudit, + FpEventLocationsFpEvents1C, + FpEventsAudit, + FpEventsContactsC, + FpEventsFpEventDelegates1C, + FpEventsFpEventLocations1C, + FpEventsLeads1C, + FpEventsProspects1C, + ImportMap, + InboundEmail, + InboundEmailAutoreply, + InboundEmailCacheT, + JjwgAddressCache, + JjwgAddressCacheAudit, + JjwgArea, + JjwgAreasAudit, + JjwgMap, + JjwgMapsAudit, + JjwgMapsJjwgAreasC, + JjwgMapsJjwgMarkersC, + JjwgMarker, + JjwgMarkersAudit, + JobQueue, + Lead, + LeadsAudit, + LeadsCstm, + LinkedDocument, + Meeting, + MeetingsContact, + MeetingsCstm, + MeetingsLead, + MeetingsUser, + Note, + Oauth2client, + Oauth2token, + OauthConsumer, + OauthNonce, + OauthToken, + OpportunitiesAudit, + OpportunitiesContact, + OpportunitiesCstm, + Opportunity, + OutboundEmail, + OutboundEmailAudit, + Project, + ProjectContacts1C, + ProjectCstm, + ProjectsAccount, + ProjectsBug, + ProjectsCase, + ProjectsContact, + ProjectsOpportunity, + ProjectsProduct, + ProjectTask, + ProjectTaskAudit, + ProjectUsers1C, + Prospect, + ProspectList, + ProspectListCampaign, + ProspectListsProspect, + ProspectsCstm, + Relationship, + Release, + Reminder, + RemindersInvitee, + RolesModule, + SavedSearch, + Scheduler, + Securitygroup, + SecuritygroupsAclRole, + SecuritygroupsAudit, + SecuritygroupsDefault, + SecuritygroupsRecord, + SecuritygroupsUser, + Spot, + Sugarfeed, + Survey, + Surveyquestion, + Surveyquestionoption, + SurveyquestionoptionsAudit, + SurveyquestionoptionsSurveyquestionresponse, + Surveyquestionresponse, + SurveyquestionresponsesAudit, + SurveyquestionsAudit, + Surveyresponse, + SurveyresponsesAudit, + SurveysAudit, + Task, + Templatesectionline, + Tracker, + UpgradeHistory, + User, + UserPreference, + UsersFeed, + UsersLastImport, + UsersPasswordLink, + UsersSignature, + Vcal +}; + /** * Class VoyagerCrmServiceProvider * @@ -479,6 +503,8 @@ public function boot() $this->loadMigrationsFrom(__DIR__ . '/../database/migrations'); $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'joy-voyager-crm'); + + $this->bootSchedulers(); } /** @@ -538,6 +564,108 @@ protected function registerPublishables(): void protected function registerCommands(): void { - // + $this->app->singleton('command.joy-voyager-crm.refresh-jobs', function () { + return new RefreshJobs(); + }); + $this->app->singleton('command.joy-voyager-crm.poll-monitored-inboxes', function () { + return new PollMonitoredInboxes(); + }); + $this->app->singleton('command.joy-voyager-crm.run-mass-email-campaign', function () { + return new RunMassEmailCampaign(); + }); + $this->app->singleton('command.joy-voyager-crm.prune-database', function () { + return new PruneDatabase(); + }); + $this->app->singleton('command.joy-voyager-crm.security-audit', function () { + return new SecurityAudit(); + }); + $this->app->singleton('command.joy-voyager-crm.trim-tracker', function () { + return new TrimTracker(); + }); + $this->app->singleton('command.joy-voyager-crm.poll-monitored-inboxes-for-bounced-campaign-emails', function () { + return new PollMonitoredInboxesForBouncedCampaignEmails(); + }); + $this->app->singleton('command.joy-voyager-crm.send-email-reminders', function () { + return new SendEmailReminders(); + }); + $this->app->singleton('command.joy-voyager-crm.remove-documents-from-fs', function () { + return new RemoveDocumentsFromFs(); + }); + $this->app->singleton('command.joy-voyager-crm.trim-sugar-feeds', function () { + return new TrimSugarFeeds(); + }); + $this->app->singleton('command.joy-voyager-crm.sync-google-calendar', function () { + return new SyncGoogleCalendar(); + }); + $this->app->singleton('command.joy-voyager-crm.clean-job-queue', function () { + return new CleanJobQueue(); + }); + $this->app->singleton('command.joy-voyager-crm.poll-monitored-inboxes-aop', function () { + return new PollMonitoredInboxesAop(); + }); + $this->app->singleton('command.joy-voyager-crm.aod-index-unindexed', function () { + return new AodIndexUnindexed(); + }); + $this->app->singleton('command.joy-voyager-crm.aod-optimise-index', function () { + return new AodOptimiseIndex(); + }); + $this->app->singleton('command.joy-voyager-crm.perform-lucene-indexing', function () { + return new PerformLuceneIndexing(); + }); + $this->app->singleton('command.joy-voyager-crm.aor-run-scheduled-reports', function () { + return new AorRunScheduledReports(); + }); + $this->app->singleton('command.joy-voyager-crm.process-aow-workflow', function () { + return new ProcessAowWorkflow(); + }); + + $this->commands([ + 'command.joy-voyager-crm.refresh-jobs', + 'command.joy-voyager-crm.poll-monitored-inboxes', + 'command.joy-voyager-crm.run-mass-email-campaign', + 'command.joy-voyager-crm.prune-database', + 'command.joy-voyager-crm.security-audit', + 'command.joy-voyager-crm.trim-tracker', + 'command.joy-voyager-crm.poll-monitored-inboxes-for-bounced-campaign-emails', + 'command.joy-voyager-crm.send-email-reminders', + 'command.joy-voyager-crm.remove-documents-from-fs', + 'command.joy-voyager-crm.trim-sugar-feeds', + 'command.joy-voyager-crm.sync-google-calendar', + 'command.joy-voyager-crm.clean-job-queue', + 'command.joy-voyager-crm.poll-monitored-inboxes-aop', + 'command.joy-voyager-crm.aod-index-unindexed', + 'command.joy-voyager-crm.aod-optimise-index', + 'command.joy-voyager-crm.perform-lucene-indexing', + 'command.joy-voyager-crm.aor-run-scheduled-reports', + 'command.joy-voyager-crm.process-aow-workflow', + ]); + } + + protected function bootSchedulers(): void + { + // Schedule the command if we are using the application via the CLI + if ($this->app->runningInConsole()) { + $this->app->booted(function () { + $schedule = $this->app->make(Schedule::class); + $schedule->command('joy-voyager-crm:process_aow_workflow')->everyMinute(); + $schedule->command('joy-voyager-crm:aor_run_scheduled_reports')->everyMinute(); + $schedule->command('joy-voyager-crm:trim_tracker')->monthlyOn(1, '2:00'); + $schedule->command('joy-voyager-crm:poll_monitored_inboxes_aop')->everyMinute(); + $schedule->command('joy-voyager-crm:poll_monitored_inboxes_for_bounced_campaign_emails')->twiceDaily(2, 6); + $schedule->command('joy-voyager-crm:run_mass_email_campaign')->twiceDaily(2, 6); + $schedule->command('joy-voyager-crm:prune_database')->monthlyOn(1, '4:00'); + $schedule->command('joy-voyager-crm:aod_index_unindexed')->daily(); + $schedule->command('joy-voyager-crm:aod_optimise_index')->everyThreeHours(); + $schedule->command('joy-voyager-crm:send_email_reminders')->everyMinute(); + $schedule->command('joy-voyager-crm:clean_job_queue')->dailyAt('5:00'); + $schedule->command('joy-voyager-crm:remove_documents_from_fs')->monthlyOn(1, '3:00'); + $schedule->command('joy-voyager-crm:trim_sugar_feeds')->monthlyOn(1, '2:00'); + $schedule->command('joy-voyager-crm:sync_google_calendar')->everyFifteenMinutes(); + // $schedule->command('joy-voyager-crm:refresh_jobs')->everyMinute(); + // $schedule->command('joy-voyager-crm:poll_monitored_inboxes')->everyMinute(); + // $schedule->command('joy-voyager-crm:security_audit')->everyMinute(); + // $schedule->command('joy-voyager-crm:perform_lucene_indexing')->everyMinute(); + }); + } } } diff --git a/src/helper.php b/src/helper.php index 9f40daa..d38e680 100644 --- a/src/helper.php +++ b/src/helper.php @@ -1,7 +1,5 @@