Services¶
Source: pharmanet-web/src/services/
Auth Service¶
Source: services/auth.js
| Function | Description |
|---|---|
login(credentials) |
Sign in, validate seller role, fetch pharmacy ID |
logout() |
Sign out |
forgotPassword(email) |
Send reset email |
resetPassword(token, password) |
Update password |
verifyToken() |
Get session, validate seller role |
Product Service¶
Source: services/products.js
| Function | Description |
|---|---|
getProducts(params) |
List with subscription filter for mobile mode |
createProduct(payload) |
Create with images |
updateProduct(id, payload) |
Update with images |
deleteProduct(id) |
Delete |
uploadProductImages(files) |
Upload to Storage |
getBrands() / CRUD |
Brand management |
getAttributes() / CRUD |
Variant option management |
Order Service¶
Source: services/orders.js
| Function | Description |
|---|---|
getOrders({page, limit, search, status}) |
Seller's incoming orders |
getOrderById(id) |
Full detail |
updateOrderStatus(id, status, trackingData) |
Change status + log + notify |
updatePrescriptionStatus(id, status) |
Verify Rx |
Dashboard Service¶
Source: services/dashboard.js
| Function | Description |
|---|---|
getStats() |
Seller KPI data |
getOverview() |
Recent orders, latest products |
Category Service¶
Source: services/categories.js
| Function | Description |
|---|---|
getCategories() |
All categories sorted |
createCategory(payload) |
Create with image |
updateCategory(id, payload) |
Update with image |
deleteCategory(id) |
Delete |
reorderCategories(order) |
Bulk sort order |
Notification Service¶
Source: services/notifications.js
| Function | Description |
|---|---|
getNotifications({limit, unreadOnly}) |
User notifications |
getUnreadCount() |
Unread count |
markAsRead(id) / markAllAsRead() |
Read status |
createNotification(data) |
Insert notification |
subscribeToNotifications(userId, callback) |
Realtime subscription |
Payment Service¶
Source: services/payments.js
| Function | Description |
|---|---|
getTransactions({page, limit, search, status}) |
Payment list |
getTransactionById(id) |
Single |
getPaymentLogs({page, limit}) |
Payment logs |
updateChapaSettings(settings) |
Save Chapa keys |
Promotion Service¶
Source: services/promotions.js
| Function | Description |
|---|---|
getActivePromotions() |
Currently active |
getUpcomingPromotions() |
Future promotions |
getPromotionById(id) |
Single promotion |
Offer Service¶
Source: services/offers.js
| Function | Description |
|---|---|
getMyOffers(pharmacyId) |
Seller's offers |
getOffersByPromotion(promotionId, pharmacyId) |
Offers for a promo |
createOffer(payload) |
Create + notify admins |
updateOffer(id, payload) |
Edit |
deleteOffer(id) |
Delete |
toggleOfferActive(id, isActive) |
Toggle active |
Seller Settings Service¶
Source: services/sellerSettings.js
| Function | Description |
|---|---|
getStoreProfile() |
Pharmacy + user info |
updateStoreProfile(data) |
Update store details |
getPaymentInfo() |
Bank account info |
updatePaymentInfo(data) |
Update bank details |
Featured Products Service¶
Source: services/featuredProducts.js
| Function | Description |
|---|---|
getSellerFeaturedProducts(sellerId) |
Seller's boosts |
createFeaturedProduct(payload) |
Create pending |
activateFeaturedProduct(id, start, end) |
Activate |
deleteFeaturedProduct(id) |
Remove |
extendFeaturedProduct(id, days) |
Extend |
initializeFeaturedProductPayment(fp, ...) |
Chapa init |
Subscription Service¶
Source: services/pharmacySubscription.js
| Function | Description |
|---|---|
getActiveSubscription(pharmacyId) |
Current active |
getMySubscription(pharmacyId) |
Most recent |
createSubscription(payload) |
Create pending |
activateSubscription(id, start, end) |
Activate |
renewSubscription(pharmacyId) |
Renew |
cancelSubscription(pharmacyId) |
Cancel auto-renew |
updateAutoRenew(pharmacyId, autoRenew) |
Toggle |
Report Service¶
Source: services/reports.js
| Function | Description |
|---|---|
getSalesReport({startDate, endDate}) |
Sales analytics |
getProductPerformance({limit, sortBy}) |
Product metrics |
getProductAnalytics(id) |
Single product |
exportReport(type, params) |
Export |
Chapa Service¶
Source: services/chapa.js
| Function | Description |
|---|---|
setChapaKeys(publicKey, secretKey) |
Set API keys |
generateTxRef(prefix) |
Generate reference |
openChapaPaymentInNewTab(paymentData) |
Hosted checkout |
verifyPayment(txRef) |
Verify payment |
isPaymentSuccessful(data) |
Check response |
CMS Service¶
Source: services/cms.js
| Function | Description |
|---|---|
getBanners() |
All banners |
getPages() |
Static pages |
uploadImage(file, bucket) |
Upload to Storage |