feat(customers): enhance customer retrieval with filtering options

- Updated `findAll` method in `CustomersController` to accept filtering parameters.
- Implemented filtering logic in `CustomersService` to retrieve customers based on type and search query.
- Added `PosCustomerFilterDto` for query validation.
- Updated customer-related DTOs to make fields optional and added length validation where necessary.
- Modified customer-related logic in `sales-invoice-tsp.utils.ts` to accommodate new DTO structure.
- Added unique constraints to `customer_individuals` and `customer_legal` tables in the database migration.
- Removed commented-out code in `PosMiddleware` for cleaner codebase.
- Set default value for `is_default_guild_good` to false in `OwnedGoodsService`.
This commit is contained in:
2026-06-03 18:00:06 +03:30
parent b2d8fdc8a0
commit 5ce560ce97
19 changed files with 946 additions and 613 deletions
@@ -619,8 +619,6 @@ export const SalesInvoiceScalarFieldEnum = {
id: 'id',
code: 'code',
total_amount: 'total_amount',
tax_amount: 'tax_amount',
discount_amount: 'discount_amount',
invoice_number: 'invoice_number',
invoice_date: 'invoice_date',
type: 'type',
@@ -634,7 +632,9 @@ export const SalesInvoiceScalarFieldEnum = {
customer_id: 'customer_id',
consumer_account_id: 'consumer_account_id',
pos_id: 'pos_id',
settlement_type: 'settlement_type'
settlement_type: 'settlement_type',
discount_amount: 'discount_amount',
tax_amount: 'tax_amount'
} as const
export type SalesInvoiceScalarFieldEnum = (typeof SalesInvoiceScalarFieldEnum)[keyof typeof SalesInvoiceScalarFieldEnum]
@@ -650,14 +650,15 @@ export const SalesInvoiceItemScalarFieldEnum = {
unit_price: 'unit_price',
total_amount: 'total_amount',
created_at: 'created_at',
discount_amount: 'discount_amount',
tax_amount: 'tax_amount',
discount: 'discount',
notes: 'notes',
payload: 'payload',
good_snapshot: 'good_snapshot',
invoice_id: 'invoice_id',
good_id: 'good_id',
service_id: 'service_id'
service_id: 'service_id',
discount_amount: 'discount_amount',
tax_amount: 'tax_amount'
} as const
export type SalesInvoiceItemScalarFieldEnum = (typeof SalesInvoiceItemScalarFieldEnum)[keyof typeof SalesInvoiceItemScalarFieldEnum]