Posts

Showing posts from March, 2026

Implementing Row-Level Inventory Overrides in PharmaStock

Image
 I focused on improving how inventory data is edited in PharmaStock by implementing row-level override functionality. Previously, updating medication details such as generic name or strength would affect all inventory records tied to that medication. To solve this, I introduced override fields directly on the InventoryStock entity. This allows each inventory row to store its own version of medication data without modifying the shared medication record. On the backend, I created dedicated PATCH endpoints for each override field, including generic name, medication name, NDC, strength, and dosage form. These endpoints update only the targeted inventory record. I also updated the mapping layer to prioritize override values when present, falling back to the base medication data when they are not. On the frontend, I refactored the Angular save logic to detect which fields were changed and dynamically call the appropriate PATCH endpoints. The save operations are executed sequentially ...

Implementing PATCH Endpoints and Validation in PharmaStock

Image
 This week, I focused on expanding the backend functionality of PharmaStock by implementing PATCH endpoints for both medication and inventory records. The goal was to allow partial updates while maintaining strong validation and data integrity. On the medication side, I created a PATCH endpoint that supports updating fields such as name, description, National Drug Code (NDC), generic name, form, strength, and manufacturer. Each field is validated to prevent empty or invalid values, and duplicate NDC entries are blocked to ensure data consistency. For inventory management, I implemented multiple PATCH endpoints to handle updates to expiration dates, beyond-use dates (BUD), and package-level details such as package NDC and descriptions. Special attention was given to date validation rules. Expiration dates cannot be set in the past, and beyond-use dates cannot exceed the expiration date. These validations help maintain safe and realistic inventory tracking. I also kept the quantit...

Improving Dashboard Refresh and Resolving AI Service Integration Issues

Image
 During this development cycle, I focused on improving the PharmaStock dashboard experience and troubleshooting several critical issues with the AI prediction service. On the frontend, I implemented both automatic and manual refresh functionality for the dashboard. The auto-refresh uses an interval set to 60 seconds, ensuring that inventory statistics and AI predictions stay up to date without requiring user interaction. In addition, I added a manual refresh option that triggers the same centralized refresh logic. This logic consolidates all dashboard updates into a single function, making it easier to maintain and extend. While integrating AI predictions into the dashboard, I encountered several issues with the AI service. Initially, the environment was using Python 3.14, which caused dependency installation failures, specifically with pydantic-core . The error required Rust for compilation, which was not intended for this setup. I resolved this by installing Python 3.11, recrea...

PharmaStock Authentication and AI Testing

Image
 This week I focused on completing the authentication workflow for PharmaStock and testing the new AI integration that was recently added to the project. The main task I worked on was connecting the Angular login screen to the ASP.NET Core backend authentication endpoint. I implemented the login flow so that when a user enters their email and password, the frontend sends a request to the API login endpoint. When the credentials are valid, the backend returns a JWT token that is stored locally so it can be used for future authenticated requests. After implementing the login functionality, I tested the system using both the seeded admin account and a newly created test user. I verified that the login request returned the correct token and that user roles were stored properly in the database. I also spent time testing the AI prediction pipeline that was recently integrated into the project. Initially, some prediction endpoints were returning server errors, but I discovered the issu...

Inventory Integration

Image
 This week focused on connecting the Inventory backend to the Angular frontend and stabilizing the feature for the core MVP. On the backend, the inventory endpoints are fully functional. The PATCH endpoint successfully adjusts stock quantities while preventing negative values, and the GET-all endpoint returns all inventory records correctly. DTO mappings are now cleanly structured to separate database entities from response models. On the frontend, I replaced placeholder data in the Angular Material table with live API data. I implemented a dedicated InventoryService and a mapping layer to transform API responses into display-ready rows. After wiring everything together, I resolved several integration issues including CORS configuration, Angular change detection behavior, and a runtime rendering error related to asynchronous data updates. At this point, inventory data loads and displays correctly, reorder and expiration indicators function as expected, and backend quantity adjus...