diff --git a/Modules/Lead/Config/.gitkeep b/Modules/Lead/Config/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Config/config.php b/Modules/Lead/Config/config.php
deleted file mode 100644
index 03fd4e464d..0000000000
--- a/Modules/Lead/Config/config.php
+++ /dev/null
@@ -1,5 +0,0 @@
- 'Lead',
-];
diff --git a/Modules/Lead/Console/.gitkeep b/Modules/Lead/Console/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Database/Factories/.gitkeep b/Modules/Lead/Database/Factories/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Database/Migrations/.gitkeep b/Modules/Lead/Database/Migrations/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Database/Seeders/.gitkeep b/Modules/Lead/Database/Seeders/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Database/Seeders/LeadDatabaseSeeder.php b/Modules/Lead/Database/Seeders/LeadDatabaseSeeder.php
deleted file mode 100644
index 7a14c0f80d..0000000000
--- a/Modules/Lead/Database/Seeders/LeadDatabaseSeeder.php
+++ /dev/null
@@ -1,36 +0,0 @@
- 'lead.create'],
- ['name' => 'lead.view'],
- ['name' => 'lead.update'],
- ['name' => 'lead.delete'],
- ];
- foreach ($leadPermissions as $permission) {
- Permission::updateOrCreate($permission);
- }
-
- // set permissions for admin role
- $adminRole = Role::where(['name' => 'admin'])->first();
- foreach ($leadPermissions as $permission) {
- $adminRole->givePermissionTo($permission);
- }
- }
-}
diff --git a/Modules/Lead/Entities/.gitkeep b/Modules/Lead/Entities/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Http/Controllers/.gitkeep b/Modules/Lead/Http/Controllers/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Http/Controllers/LeadController.php b/Modules/Lead/Http/Controllers/LeadController.php
deleted file mode 100644
index 4ae4324b89..0000000000
--- a/Modules/Lead/Http/Controllers/LeadController.php
+++ /dev/null
@@ -1,16 +0,0 @@
-registerTranslations();
- $this->registerConfig();
- $this->registerViews();
- $this->registerFactories();
- $this->loadMigrationsFrom(module_path($this->moduleName, 'Database/Migrations'));
- }
-
- /**
- * Register the service provider.
- *
- * @return void
- */
- public function register()
- {
- $this->app->register(RouteServiceProvider::class);
- }
-
- /**
- * Register views.
- *
- * @return void
- */
- public function registerViews()
- {
- $viewPath = resource_path('views/modules/' . $this->moduleNameLower);
-
- $sourcePath = module_path($this->moduleName, 'Resources/views');
-
- $this->publishes([
- $sourcePath => $viewPath,
- ], ['views', $this->moduleNameLower . '-module-views']);
-
- $this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
- }
-
- /**
- * Register translations.
- *
- * @return void
- */
- public function registerTranslations()
- {
- $langPath = resource_path('lang/modules/' . $this->moduleNameLower);
-
- if (is_dir($langPath)) {
- $this->loadTranslationsFrom($langPath, $this->moduleNameLower);
- } else {
- $this->loadTranslationsFrom(module_path($this->moduleName, 'Resources/lang'), $this->moduleNameLower);
- }
- }
-
- /**
- * Register an additional directory of factories.
- *
- * @return void
- */
- public function registerFactories()
- {
- if (! app()->environment('production') && $this->app->runningInConsole()) {
- app(Factory::class)->load(module_path($this->moduleName, 'Database/factories'));
- }
- }
-
- /**
- * Get the services provided by the provider.
- *
- * @return array
- */
- public function provides()
- {
- return [];
- }
-
- /**
- * Register config.
- *
- * @return void
- */
- protected function registerConfig()
- {
- $this->publishes([
- module_path($this->moduleName, 'Config/config.php') => config_path($this->moduleNameLower . '.php'),
- ], 'config');
- $this->mergeConfigFrom(
- module_path($this->moduleName, 'Config/config.php'),
- $this->moduleNameLower
- );
- }
-
- private function getPublishableViewPaths(): array
- {
- $paths = [];
- foreach (\Config::get('view.paths') as $path) {
- if (is_dir($path . '/modules/' . $this->moduleNameLower)) {
- $paths[] = $path . '/modules/' . $this->moduleNameLower;
- }
- }
-
- return $paths;
- }
-}
diff --git a/Modules/Lead/Providers/RouteServiceProvider.php b/Modules/Lead/Providers/RouteServiceProvider.php
deleted file mode 100644
index 7c456ef1da..0000000000
--- a/Modules/Lead/Providers/RouteServiceProvider.php
+++ /dev/null
@@ -1,57 +0,0 @@
-mapApiRoutes();
-
- $this->mapWebRoutes();
- }
-
- /**
- * Define the "web" routes for the application.
- *
- * These routes all receive session state, CSRF protection, etc.
- *
- * @return void
- */
- protected function mapWebRoutes()
- {
- Route::middleware('web')
- ->namespace($this->moduleNamespace)
- ->group(module_path('Lead', '/Routes/web.php'));
- }
-
- /**
- * Define the "api" routes for the application.
- *
- * These routes are typically stateless.
- *
- * @return void
- */
- protected function mapApiRoutes()
- {
- Route::prefix('api')
- ->middleware('api')
- ->namespace($this->moduleNamespace)
- ->group(module_path('Lead', '/Routes/api.php'));
- }
-}
diff --git a/Modules/Lead/Resources/assets/.gitkeep b/Modules/Lead/Resources/assets/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Resources/assets/js/app.js b/Modules/Lead/Resources/assets/js/app.js
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Resources/assets/sass/app.scss b/Modules/Lead/Resources/assets/sass/app.scss
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Resources/lang/.gitkeep b/Modules/Lead/Resources/lang/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Resources/views/.gitkeep b/Modules/Lead/Resources/views/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Resources/views/index.blade.php b/Modules/Lead/Resources/views/index.blade.php
deleted file mode 100644
index 8d77403546..0000000000
--- a/Modules/Lead/Resources/views/index.blade.php
+++ /dev/null
@@ -1,7 +0,0 @@
-@extends('lead::layouts.master')
-
-@section('content')
-
-
Coming Soon!!
-
-@endsection
diff --git a/Modules/Lead/Resources/views/layouts/master.blade.php b/Modules/Lead/Resources/views/layouts/master.blade.php
deleted file mode 100644
index 9010386620..0000000000
--- a/Modules/Lead/Resources/views/layouts/master.blade.php
+++ /dev/null
@@ -1,6 +0,0 @@
-@extends('layouts.app')
-@section('js_scripts')
-@endsection
-
-@section('css_scripts')
-@endsection
diff --git a/Modules/Lead/Routes/.gitkeep b/Modules/Lead/Routes/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Routes/api.php b/Modules/Lead/Routes/api.php
deleted file mode 100644
index 8d6fe8897d..0000000000
--- a/Modules/Lead/Routes/api.php
+++ /dev/null
@@ -1,18 +0,0 @@
-get('/lead', function (Request $request) {
- return $request->user();
-});
diff --git a/Modules/Lead/Routes/web.php b/Modules/Lead/Routes/web.php
deleted file mode 100644
index 534d2beda5..0000000000
--- a/Modules/Lead/Routes/web.php
+++ /dev/null
@@ -1,16 +0,0 @@
-group(function () {
- Route::get('/', 'LeadController@index');
-});
diff --git a/Modules/Lead/Tests/Feature/.gitkeep b/Modules/Lead/Tests/Feature/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/Tests/Unit/.gitkeep b/Modules/Lead/Tests/Unit/.gitkeep
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/Modules/Lead/composer.json b/Modules/Lead/composer.json
deleted file mode 100644
index 24fe4c3960..0000000000
--- a/Modules/Lead/composer.json
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "name": "nwidart/lead",
- "description": "",
- "authors": [
- {
- "name": "Nicolas Widart",
- "email": "n.widart@gmail.com"
- }
- ],
- "extra": {
- "laravel": {
- "providers": [
- "Modules\\Lead\\Providers\\LeadServiceProvider"
- ],
- "aliases": {
-
- }
- }
- },
- "autoload": {
- "psr-4": {
- "Modules\\Lead\\": ""
- }
- }
-}
diff --git a/Modules/Lead/module.json b/Modules/Lead/module.json
deleted file mode 100644
index eba51c523c..0000000000
--- a/Modules/Lead/module.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "name": "Lead",
- "alias": "lead",
- "description": "",
- "keywords": [],
- "order": 0,
- "providers": [
- "Modules\\Lead\\Providers\\LeadServiceProvider"
- ],
- "aliases": {},
- "files": [],
- "requires": []
-}
diff --git a/Modules/Lead/package.json b/Modules/Lead/package.json
deleted file mode 100644
index 4599509fec..0000000000
--- a/Modules/Lead/package.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "private": true,
- "scripts": {
- "dev": "npm run development",
- "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
- "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
- "watch-poll": "npm run watch -- --watch-poll",
- "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
- "prod": "npm run production",
- "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
- },
- "devDependencies": {
- "cross-env": "^7.0",
- "laravel-mix": "^5.0.1",
- "laravel-mix-merge-manifest": "^0.1.2"
- }
-}
diff --git a/Modules/Lead/webpack.mix.js b/Modules/Lead/webpack.mix.js
deleted file mode 100644
index 3b782b4d8e..0000000000
--- a/Modules/Lead/webpack.mix.js
+++ /dev/null
@@ -1,14 +0,0 @@
-const dotenvExpand = require('dotenv-expand');
-dotenvExpand(require('dotenv').config({ path: '../../.env'/*, debug: true*/}));
-
-const mix = require('laravel-mix');
-require('laravel-mix-merge-manifest');
-
-mix.setPublicPath('../../public').mergeManifest();
-
-mix.js(__dirname + '/Resources/assets/js/app.js', 'js/lead.js')
- .sass( __dirname + '/Resources/assets/sass/app.scss', 'css/lead.css');
-
-if (mix.inProduction()) {
- mix.version();
-}
diff --git a/Modules/Prospect/Database/Migrations/2024_10_28_120851_make-nullable-fields.php b/Modules/Prospect/Database/Migrations/2024_10_28_120851_make-nullable-fields.php
new file mode 100644
index 0000000000..2e5feaba06
--- /dev/null
+++ b/Modules/Prospect/Database/Migrations/2024_10_28_120851_make-nullable-fields.php
@@ -0,0 +1,50 @@
+date('proposal_sent_date')->nullable()->change();
+ $table->string('domain')->nullable()->change();
+ $table->string('customer_type')->nullable()->change();
+ $table->text('budget')->nullable()->change();
+ $table->string('proposal_status')->nullable()->change();
+ $table->date('introductory_call')->nullable()->change();
+ $table->date('last_followup_date')->nullable()->change();
+ $table->string('rfp_link')->nullable()->change();
+ $table->string('proposal_link')->nullable()->change();
+ $table->string('currency')->nullable()->change();
+ });
+ }
+
+ /**
+ * Reverse the migrations.
+ *
+ * @return void
+ */
+ public function down()
+ {
+ Schema::table('prospects', function (Blueprint $table) {
+ $table->date('proposal_sent_date')->nullable(false)->change();
+ $table->string('domain')->nullable(false)->change();
+ $table->string('customer_type')->nullable(false)->change();
+ $table->text('budget')->nullable(false)->change();
+ $table->string('proposal_status')->nullable(false)->change();
+ $table->date('introductory_call')->nullable(false)->change();
+ $table->date('last_followup_date')->nullable(false)->change();
+ $table->string('rfp_link')->nullable(false)->change();
+ $table->string('proposal_link')->nullable(false)->change();
+ $table->string('currency')->nullable(false)->change();
+ });
+ }
+}
diff --git a/Modules/Prospect/Entities/Prospect.php b/Modules/Prospect/Entities/Prospect.php
index a1d67722e4..85d850d0d2 100644
--- a/Modules/Prospect/Entities/Prospect.php
+++ b/Modules/Prospect/Entities/Prospect.php
@@ -2,6 +2,7 @@
namespace Modules\Prospect\Entities;
+use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
use Modules\User\Entities\User;
@@ -19,4 +20,10 @@ public function comments()
{
return $this->hasMany(ProspectComment::class);
}
+
+ public function getFormattedDate($date)
+ {
+ return $date ? Carbon::parse($date)->format('M d, Y')
+ : '-';
+ }
}
diff --git a/Modules/Prospect/Http/Controllers/ProspectController.php b/Modules/Prospect/Http/Controllers/ProspectController.php
index 307e6301df..9a7a08b8c1 100644
--- a/Modules/Prospect/Http/Controllers/ProspectController.php
+++ b/Modules/Prospect/Http/Controllers/ProspectController.php
@@ -42,9 +42,9 @@ public function index()
*/
public function create()
{
+ $countries = Country::all();
$user = new User();
$activeUsers = $user->active_users;
- $countries = Country::all();
return view('prospect::create', [
'users' => $activeUsers,
@@ -88,9 +88,9 @@ public function show($id)
public function edit($id)
{
$prospect = Prospect::with(['pocUser', 'comments'])->find($id);
+ $countries = Country::all();
$user = new User();
$activeUsers = $user->active_users;
- $countries = Country::all();
return view('prospect::edit', [
'prospect' => $prospect,
diff --git a/Modules/Prospect/Http/Requests/ProspectRequest.php b/Modules/Prospect/Http/Requests/ProspectRequest.php
index 92c6c46996..fe1ff644d3 100644
--- a/Modules/Prospect/Http/Requests/ProspectRequest.php
+++ b/Modules/Prospect/Http/Requests/ProspectRequest.php
@@ -16,14 +16,16 @@ public function rules()
return [
'org_name' => 'required',
'poc_user_id' => 'required',
- 'proposal_sent_date' => 'required',
- 'domain' => 'required',
- 'customer_type' => 'required',
- 'budget' => 'required',
- 'proposal_status' => 'required',
- 'currency' => 'required',
- 'rfp_link' => 'required',
- 'proposal_link' => 'required',
+ 'proposal_sent_date' => 'nullable|date',
+ 'domain' => 'nullable',
+ 'customer_type' => 'nullable',
+ 'budget' => 'nullable',
+ 'proposal_status' => 'nullable',
+ 'introductory_call' => 'nullable',
+ 'last_followup_date' => 'nullable|date',
+ 'rfp_link' => 'nullable|url',
+ 'proposal_link' => 'nullable|url',
+ 'currency' => 'nullable',
];
}
@@ -47,13 +49,6 @@ public function messages()
return [
'org_name.required' => 'Organization name is required',
'poc_user_id.required' => 'Point of contact user ID is required',
- 'proposal_sent_date.required' => 'Proposal sent date is required',
- 'domain.required' => 'Domain is required',
- 'customer_type.required' => 'Customer type is required',
- 'budget.required' => 'Budget is required',
- 'proposal_status.required' => 'Proposal status is required',
- 'rfp_url.required' => 'RFP URL is required',
- 'proposal_url.required' => 'Proposal URL is required',
];
}
}
diff --git a/Modules/Prospect/Resources/views/create.blade.php b/Modules/Prospect/Resources/views/create.blade.php
index 57347362b4..9a57422a9d 100644
--- a/Modules/Prospect/Resources/views/create.blade.php
+++ b/Modules/Prospect/Resources/views/create.blade.php
@@ -36,22 +36,21 @@