Posts

Profile + UI Fixes

Image
 This week I worked on improving the profile system and cleaning up some UI issues. I finished wiring up the profile to the backend so users can update their display name, bio, and profile image. I also combined everything into a single save button to make it easier to use. I ran into an issue with image uploads failing, which ended up being a FormData binding problem and file size limits. I fixed that and added validation so users get feedback before uploading. I also implemented dark mode persistence using localStorage. At first it wasn’t sticking after logout, but I tracked it down to multiple localStorage.clear() calls across the app. After fixing those, the theme now saves correctly. Finally, I fixed a layout issue where tables would slide under the sidebar when zooming. I standardized the layout across Orders, Inventory, and Reports so everything behaves consistently. Overall, this cleaned up a lot of small issues and made the app feel more stable and polished.

Profile Management Feature with Backend and Frontend Integration

Image
This week I worked on adding a Profile Management featur e to PharmaStock so users can manage their own account info. On the backend, I set up a new ProfileController with endpoints to: view their profile update their name and bio change their password upload, view, and delete a profile image I also created the DTOs needed to keep the data clean between the frontend and backend. I ran into a few issues along the way, mostly with image usage, which caused some errors in the controller. Once those were fixed, everything started working as expected. On the frontend, I added a new Angular service to handle all the profile calls. It follows the same pattern as the rest of the app and includes handling file uploads for profile images. Overall, this gets the profile system fully working behind the scenes and ready to hook up to the UI next.

Implementing CSV Export for Reports

Image
 Last week I implemented CSV export functionality for the reports feature in PharmaStock, but I forgot to post an update on it. I added an Export button that opens a popup modal, allowing users to optionally select a date range before downloading the report. The export uses the currently loaded report data, ensuring that what gets downloaded matches what the user is working with. The CSV is generated on the frontend, with proper formatting and headers, and downloads automatically with a timestamped file name. I also included validation for invalid date ranges to prevent errors during export.

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...