New-Thanasoft/thanasoft-back/app/Providers/AppServiceProvider.php
nyavokevin 9cbc1bcbdb feat(ui): add price lists and group-based quote flows
Add price list management across the API, store, services, routes,
navigation, and sales views.

Support quotes for either a client or a client group, including PDF
download and nullable client validation for group-based recipients.

Extend client groups to manage assigned clients directly from the form
and detail views, and refresh supplier, intervention, stock, and order
screens with updated interactions and layouts.
2026-04-02 12:07:11 +03:00

127 lines
6.1 KiB
PHP

<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Schema;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
// Repository interface to implementation bindings
$this->app->bind(\App\Repositories\ClientRepositoryInterface::class, function ($app) {
return new \App\Repositories\ClientRepository(
$app->make(\App\Models\Client::class),
$app->make(\App\Repositories\ClientActivityTimelineRepositoryInterface::class)
);
});
$this->app->bind(\App\Repositories\ClientGroupRepositoryInterface::class, function ($app) {
return new \App\Repositories\ClientGroupRepository($app->make(\App\Models\ClientGroup::class));
});
$this->app->bind(\App\Repositories\PriceListRepositoryInterface::class, function ($app) {
return new \App\Repositories\PriceListRepository($app->make(\App\Models\PriceList::class));
});
$this->app->bind(\App\Repositories\ClientContactRepositoryInterface::class, function ($app) {
return new \App\Repositories\ClientContactRepository($app->make(\App\Models\ClientContact::class));
});
$this->app->bind(\App\Repositories\ContactRepositoryInterface::class, function ($app) {
return new \App\Repositories\ContactRepository($app->make(\App\Models\Contact::class));
});
$this->app->bind(\App\Repositories\ClientLocationRepositoryInterface::class, function ($app) {
return new \App\Repositories\ClientLocationRepository($app->make(\App\Models\ClientLocation::class));
});
$this->app->bind(\App\Repositories\FournisseurRepositoryInterface::class, function ($app) {
return new \App\Repositories\FournisseurRepository($app->make(\App\Models\Fournisseur::class));
});
$this->app->bind(\App\Repositories\ProductRepositoryInterface::class, function ($app) {
return new \App\Repositories\ProductRepository($app->make(\App\Models\Product::class));
});
$this->app->bind(\App\Repositories\ProductCategoryRepositoryInterface::class, function ($app) {
return new \App\Repositories\ProductCategoryRepository($app->make(\App\Models\ProductCategory::class));
});
// Employee management repository bindings
$this->app->bind(\App\Repositories\EmployeeRepositoryInterface::class, function ($app) {
return new \App\Repositories\EmployeeRepository($app->make(\App\Models\Employee::class));
});
$this->app->bind(\App\Repositories\ThanatopractitionerRepositoryInterface::class, function ($app) {
return new \App\Repositories\ThanatopractitionerRepository($app->make(\App\Models\Thanatopractitioner::class));
});
$this->app->bind(\App\Repositories\PractitionerDocumentRepositoryInterface::class, function ($app) {
return new \App\Repositories\PractitionerDocumentRepository($app->make(\App\Models\PractitionerDocument::class));
});
$this->app->bind(\App\Repositories\InterventionRepositoryInterface::class, \App\Repositories\InterventionRepository::class);
$this->app->bind(\App\Repositories\DeceasedRepositoryInterface::class, \App\Repositories\DeceasedRepository::class);
$this->app->bind(\App\Repositories\InterventionPractitionerRepositoryInterface::class, \App\Repositories\InterventionPractitionerRepository::class);
$this->app->bind(\App\Repositories\FileRepositoryInterface::class, \App\Repositories\FileRepository::class);
$this->app->bind(\App\Repositories\ProductCategoryRepositoryInterface::class, \App\Repositories\ProductCategoryRepository::class);
$this->app->bind(\App\Repositories\InvoiceRepositoryInterface::class, function ($app) {
return new \App\Repositories\InvoiceRepository(
$app->make(\App\Models\Invoice::class),
$app->make(\App\Repositories\InvoiceLineRepositoryInterface::class),
$app->make(\App\Repositories\ClientActivityTimelineRepositoryInterface::class)
);
});
$this->app->bind(\App\Repositories\InvoiceLineRepositoryInterface::class, \App\Repositories\InvoiceLineRepository::class);
$this->app->bind(\App\Repositories\AvoirRepositoryInterface::class, function ($app) {
return new \App\Repositories\AvoirRepository(
$app->make(\App\Models\Avoir::class),
$app->make(\App\Repositories\AvoirLineRepositoryInterface::class),
$app->make(\App\Repositories\ClientActivityTimelineRepositoryInterface::class)
);
});
$this->app->bind(\App\Repositories\AvoirLineRepositoryInterface::class, \App\Repositories\AvoirLineRepository::class);
$this->app->bind(\App\Repositories\QuoteRepositoryInterface::class, function ($app) {
return new \App\Repositories\QuoteRepository(
$app->make(\App\Models\Quote::class),
$app->make(\App\Repositories\QuoteLineRepositoryInterface::class),
$app->make(\App\Repositories\InvoiceRepositoryInterface::class),
$app->make(\App\Repositories\ClientActivityTimelineRepositoryInterface::class)
);
});
$this->app->bind(\App\Repositories\QuoteLineRepositoryInterface::class, \App\Repositories\QuoteLineRepository::class);
$this->app->bind(\App\Repositories\QuoteLineRepositoryInterface::class, \App\Repositories\QuoteLineRepository::class);
$this->app->bind(\App\Repositories\ClientActivityTimelineRepositoryInterface::class, \App\Repositories\ClientActivityTimelineRepository::class);
$this->app->bind(\App\Repositories\PurchaseOrderRepositoryInterface::class, \App\Repositories\PurchaseOrderRepository::class);
$this->app->bind(\App\Repositories\DeceasedDocumentRepositoryInterface::class, \App\Repositories\DeceasedDocumentRepository::class);
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
Schema::defaultStringLength(191);
}
}