All list endpoints now return paginated responses:
{ data: [...], pagination: { page, limit, total, totalPages } }
Query params: ?page=1&limit=25&q=search&sort=name&order=asc
Changes:
- Added PaginationSchema in @forte/shared for consistent param parsing
- Added pagination utils (withPagination, withSort, buildSearchCondition,
paginatedResponse) in backend
- Refactored all services: AccountService, MemberService, CategoryService,
SupplierService, ProductService, InventoryUnitService
- Merged separate /search endpoints into list endpoints via ?q= param
- Removed AccountSearchSchema and ProductSearchSchema (replaced by
PaginationSchema)
- Added pagination test (5 items, page 1 limit 2, expect totalPages=3)
- Updated CLAUDE.md with API conventions
- 34 tests passing
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
export { PaginationSchema } from './pagination.schema.js'
|
|
export type { PaginationInput, PaginatedResponse } from './pagination.schema.js'
|
|
|
|
export { UserRole, RegisterSchema, LoginSchema } from './auth.schema.js'
|
|
export type { RegisterInput, LoginInput } from './auth.schema.js'
|
|
|
|
export {
|
|
BillingMode,
|
|
AccountCreateSchema,
|
|
AccountUpdateSchema,
|
|
MemberCreateSchema,
|
|
MemberUpdateSchema,
|
|
AccountSearchSchema,
|
|
} from './account.schema.js'
|
|
export type {
|
|
AccountCreateInput,
|
|
AccountUpdateInput,
|
|
MemberCreateInput,
|
|
MemberUpdateInput,
|
|
} from './account.schema.js'
|
|
|
|
export {
|
|
CategoryCreateSchema,
|
|
CategoryUpdateSchema,
|
|
SupplierCreateSchema,
|
|
SupplierUpdateSchema,
|
|
ItemCondition,
|
|
UnitStatus,
|
|
ProductCreateSchema,
|
|
ProductUpdateSchema,
|
|
ProductSearchSchema,
|
|
InventoryUnitCreateSchema,
|
|
InventoryUnitUpdateSchema,
|
|
} from './inventory.schema.js'
|
|
export type {
|
|
CategoryCreateInput,
|
|
CategoryUpdateInput,
|
|
SupplierCreateInput,
|
|
SupplierUpdateInput,
|
|
ProductCreateInput,
|
|
ProductUpdateInput,
|
|
InventoryUnitCreateInput,
|
|
InventoryUnitUpdateInput,
|
|
} from './inventory.schema.js'
|