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:
@@ -0,0 +1,35 @@
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { AdjustmentStatus, CountStatus, TransferStatus } from "@/types/stock"
|
||||
|
||||
// Same fixed-size, red/green/yellow convention as components/receiving/status-badges.tsx.
|
||||
const badgeSize = "h-6 w-28 justify-center px-2.5 py-1 text-sm"
|
||||
|
||||
const warning = "bg-warning/10 text-warning border-transparent"
|
||||
const success = "bg-success/10 text-success border-transparent"
|
||||
const destructive = "bg-destructive/10 text-destructive border-transparent"
|
||||
|
||||
export function TransferStatusBadge({ status }: { status: TransferStatus }) {
|
||||
const tone = status === "Received" ? success : status === "Closed" ? destructive : warning
|
||||
return (
|
||||
<Badge variant="outline" className={`${badgeSize} ${tone}`}>
|
||||
{status}
|
||||
</Badge>
|
||||
)
|
||||
}
|
||||
|
||||
export function CountStatusBadge({ status }: { status: CountStatus }) {
|
||||
const tone = status === "Posted" ? success : warning
|
||||
return (
|
||||
<Badge variant="outline" className={`${badgeSize} ${tone}`}>
|
||||
{status}
|
||||
</Badge>
|
||||
)
|
||||
}
|
||||
|
||||
export function AdjustmentStatusBadge({ status }: { status: AdjustmentStatus }) {
|
||||
return (
|
||||
<Badge variant="outline" className={`${badgeSize} ${success}`}>
|
||||
{status}
|
||||
</Badge>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user