@caseparts-org/casecore 0.0.14 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,7 +11,7 @@ export interface Availability {
|
|
|
11
11
|
description: string;
|
|
12
12
|
id: string;
|
|
13
13
|
}
|
|
14
|
-
export default function calcPartAvailability(inventory: Inventory | undefined, discontinued: boolean): Availability
|
|
14
|
+
export default function calcPartAvailability(inventory: Inventory | undefined, discontinued: boolean): Availability;
|
|
15
15
|
export declare function calcDetailedPartAvailability(inventory: Inventory | undefined, discontinued: boolean): Availability;
|
|
16
16
|
export declare const CUSTOM_PART_LEAD_TIMES: Record<string, string>;
|
|
17
17
|
export declare function isDiscontinued(partStatus: number): boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
// export type SiteCode = "MPK" | "SEA" | "STL";
|
|
1
2
|
export default function calcPartAvailability(inventory, discontinued) {
|
|
2
3
|
if (!inventory || !inventory.MPK && !inventory.SEA && !inventory.STL) {
|
|
3
|
-
return
|
|
4
|
+
return { description: "Unavailable", id: "unavailable" };
|
|
4
5
|
}
|
|
5
6
|
const inStock = inventory.MPK.Unreserved > 5 || inventory.SEA.Unreserved > 5 || inventory.STL.Unreserved > 5;
|
|
6
7
|
const limited = inventory.MPK.Unreserved > 0 || inventory.SEA.Unreserved > 0 || inventory.STL.Unreserved > 0;
|