167 lines
3.5 KiB
TypeScript
167 lines
3.5 KiB
TypeScript
// Database Helper - PostgreSQL
|
|
// Main entry point for the package
|
|
|
|
// Re-export database connection
|
|
export { db } from './src/db/db_index';
|
|
|
|
// Re-export schema
|
|
export * from './src/db/schema';
|
|
|
|
// Admin API helpers - explicitly namespaced exports to avoid duplicates
|
|
export {
|
|
// Banner
|
|
getBanners,
|
|
getBannerById,
|
|
createBanner,
|
|
updateBanner,
|
|
deleteBanner,
|
|
} from './src/admin-apis/banner';
|
|
|
|
export {
|
|
// Complaint
|
|
getComplaints,
|
|
resolveComplaint,
|
|
} from './src/admin-apis/complaint';
|
|
|
|
export {
|
|
// Constants
|
|
getAllConstants,
|
|
upsertConstants,
|
|
} from './src/admin-apis/const';
|
|
|
|
export {
|
|
// Coupon
|
|
getAllCoupons,
|
|
getCouponById,
|
|
invalidateCoupon,
|
|
validateCoupon,
|
|
getReservedCoupons,
|
|
getUsersForCoupon,
|
|
createCouponWithRelations,
|
|
updateCouponWithRelations,
|
|
generateCancellationCoupon,
|
|
createReservedCouponWithProducts,
|
|
createCouponForUser,
|
|
checkUsersExist,
|
|
checkCouponExists,
|
|
checkReservedCouponExists,
|
|
getOrderWithUser,
|
|
} from './src/admin-apis/coupon';
|
|
|
|
export {
|
|
// Order
|
|
updateOrderNotes,
|
|
getOrderDetails,
|
|
updateOrderPackaged,
|
|
updateOrderDelivered,
|
|
updateOrderItemPackaging,
|
|
removeDeliveryCharge,
|
|
getSlotOrders,
|
|
updateAddressCoords,
|
|
getAllOrders,
|
|
rebalanceSlots,
|
|
cancelOrder,
|
|
deleteOrderById,
|
|
} from './src/admin-apis/order';
|
|
|
|
export {
|
|
// Product
|
|
getAllProducts,
|
|
getProductById,
|
|
createProduct,
|
|
updateProduct,
|
|
toggleProductOutOfStock,
|
|
getAllUnits,
|
|
getAllProductTags,
|
|
getProductReviews,
|
|
respondToReview,
|
|
getAllProductGroups,
|
|
createProductGroup,
|
|
updateProductGroup,
|
|
deleteProductGroup,
|
|
addProductToGroup,
|
|
removeProductFromGroup,
|
|
} from './src/admin-apis/product';
|
|
|
|
export {
|
|
// Slots
|
|
getAllSlots,
|
|
getSlotById,
|
|
createSlot,
|
|
updateSlot,
|
|
deleteSlot,
|
|
getSlotProducts,
|
|
addProductToSlot,
|
|
removeProductFromSlot,
|
|
clearSlotProducts,
|
|
updateSlotCapacity,
|
|
getSlotDeliverySequence,
|
|
updateSlotDeliverySequence,
|
|
} from './src/admin-apis/slots';
|
|
|
|
export {
|
|
// Staff User
|
|
getStaffUserByName,
|
|
getAllStaff,
|
|
getAllUsers,
|
|
getUserWithDetails,
|
|
updateUserSuspensionStatus,
|
|
checkStaffUserExists,
|
|
checkStaffRoleExists,
|
|
createStaffUser,
|
|
getAllRoles,
|
|
} from './src/admin-apis/staff-user';
|
|
|
|
export {
|
|
// Store
|
|
getAllStores,
|
|
getStoreById,
|
|
createStore,
|
|
updateStore,
|
|
deleteStore,
|
|
} from './src/admin-apis/store';
|
|
|
|
export {
|
|
// User
|
|
createUserByMobile,
|
|
getUserByMobile,
|
|
getUnresolvedComplaintsCount,
|
|
getAllUsersWithFilters,
|
|
getOrderCountsByUserIds,
|
|
getLastOrdersByUserIds,
|
|
getSuspensionStatusesByUserIds,
|
|
getUserBasicInfo,
|
|
getUserSuspensionStatus,
|
|
getUserOrders,
|
|
getOrderStatusesByOrderIds,
|
|
getItemCountsByOrderIds,
|
|
upsertUserSuspension,
|
|
searchUsers,
|
|
getAllNotifCreds,
|
|
getAllUnloggedTokens,
|
|
getNotifTokensByUserIds,
|
|
getUserIncidentsWithRelations,
|
|
createUserIncident,
|
|
} from './src/admin-apis/user';
|
|
|
|
export {
|
|
// Vendor Snippets
|
|
checkVendorSnippetExists,
|
|
getVendorSnippetById,
|
|
getVendorSnippetByCode,
|
|
getAllVendorSnippets,
|
|
createVendorSnippet,
|
|
updateVendorSnippet,
|
|
deleteVendorSnippet,
|
|
getProductsByIds,
|
|
getVendorSlotById,
|
|
getVendorOrdersBySlotId,
|
|
getOrderItemsByOrderIds,
|
|
getOrderStatusByOrderIds,
|
|
updateVendorOrderItemPackaging,
|
|
} from './src/admin-apis/vendor-snippets';
|
|
|
|
// Note: User API helpers are available in their respective files
|
|
// but not exported from main index to avoid naming conflicts
|
|
// Import them directly from the file paths if needed:
|
|
// import { getAllProducts } from '@packages/db_helper_postgres/src/user-apis/product'
|