Discounts
Description
Discounts adds commercial discount management to Enso.
The package covers both client and supplier discounts, split into three discount families: general discounts, product discounts, and service discounts. Each family exposes its own CRUD and table endpoints, while the package also provides a small helper trait for filtering discounts by company or person clients.
It is intended for private Enso deployments that manage commercial pricing rules across products and services.
Installation
This is a proprietary package distributed through the private Enso registry.
Run the package migrations:
php artisan migrate
The package exposes only the backend/API layer. Frontend integration is handled by the companion @enso-ui/discounts package.
Features
- Client discount management for general, product, and service discounts.
- Supplier discount management for general, product, and service discounts.
- Datatable endpoints, Excel export endpoints, and selector endpoints for every discount family.
DiscountTypesenum for classifying discount behavior.HasClienttrait for filtering discounts by company or person client.
Usage
Use the HasClient trait on discount-like queries that need to target a company or a person:
use LaravelEnso\Discounts\Traits\HasClient;
class ClientProductDiscount extends Model
{
use HasClient;
}
The package routes are grouped by target audience and discount type:
discounts.clients.generals.*discounts.clients.products.*discounts.clients.services.*discounts.suppliers.generals.*discounts.suppliers.products.*discounts.suppliers.services.*
API
HTTP routes
Client discounts:
api/discounts/clients/generals/*api/discounts/clients/products/*api/discounts/clients/services/*
Supplier discounts:
api/discounts/suppliers/generals/*api/discounts/suppliers/products/*api/discounts/suppliers/services/*
Each family exposes:
createstoreeditupdatedestroyinitTabletableDataexportExceloptions
Depends On
Required Enso packages:
laravel-enso/core↗laravel-enso/dynamic-methods↗laravel-enso/forms↗laravel-enso/migrator↗laravel-enso/products↗laravel-enso/services↗laravel-enso/tables↗
Runtime companion packages:
Companion frontend package: