refactor(inventories): restructure inventory and pos account modules, remove deprecated DTOs and controllers
- Removed create and update DTOs for inventory. - Deleted inventories controller and service. - Introduced new inventory bank accounts module with controller and service. - Added new pos accounts module with controller and service. - Updated Prisma models to reflect changes in bank account relationships. - Adjusted PosAccount and SalesInvoice models for stricter type definitions. - Implemented new response mapping for inventory and pos account services.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
* the global `ResponseMappingInterceptor` understands and normalizes.
|
||||
*/
|
||||
export type MapperWrapper<T> =
|
||||
| { __mapped: 'create' | 'update' | 'single'; data: T }
|
||||
| { __mapped: 'create' | 'update' | 'single' | 'delete'; data: T }
|
||||
| { __mapped: 'list'; items: T[] }
|
||||
| { __mapped: 'paginate'; items: T[]; total: number; page?: number; perPage?: number }
|
||||
| { __mapped: 'sequelize'; rows: T[]; count: number; page?: number; perPage?: number }
|
||||
@@ -23,6 +23,10 @@ export const ResponseMapper = {
|
||||
return { __mapped: 'single', data: item }
|
||||
},
|
||||
|
||||
delete<T>(item: T): MapperWrapper<T> {
|
||||
return { __mapped: 'delete', data: item }
|
||||
},
|
||||
|
||||
list<T>(items: T[]): MapperWrapper<T> {
|
||||
return { __mapped: 'list', items }
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user