feat: add warehouse and bin management API with mock data implementation

- Implemented warehouses API with methods for listing, creating, and managing bins.
- Added wastage API to handle stock write-offs and integrate with stock adjustments.
- Created auth token management for storing and retrieving access tokens.
- Developed error mapping for consistent user-facing error messages.
- Introduced client-side validations for GRN, master data, and procurement processes.
- Defined common types for pagination, problem details, and various master data entities.
- Established procurement and stock management types to support frontend functionality.
This commit is contained in:
2026-07-13 17:11:40 +05:30
parent 4e84a15db7
commit 7ac30bb454
79 changed files with 14042 additions and 44 deletions
+16
View File
@@ -0,0 +1,16 @@
// Bearer-token storage for the ERPCore API client (docs/20-FRONTEND.md §1).
// Login (POST /auth/login) is not wired yet — reads simply return null until it is,
// and the API client omits the Authorization header in that case.
const STORAGE_KEY = "erpcore.accessToken"
export function getAccessToken(): string | null {
if (typeof window === "undefined") return null
return window.localStorage.getItem(STORAGE_KEY)
}
export function setAccessToken(token: string | null) {
if (typeof window === "undefined") return
if (token) window.localStorage.setItem(STORAGE_KEY, token)
else window.localStorage.removeItem(STORAGE_KEY)
}