Skip to content

Commit

Permalink
fix: Update material status codes to display correct status in garden (
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwardBrunton authored Sep 20, 2024
1 parent cc99e18 commit c2724f1
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 28 deletions.
10 changes: 5 additions & 5 deletions libs/shared/src/packages/mapping/src/lib/materialStatusMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import { MaterialStatus } from '../../../types/src/lib/materialStatus';
export const materialStatusMap: Partial<Record<MaterialStatus, string>> = {
M10: 'Material requested to job site',
M12: 'Material received on job site',
M2: 'Materials linked to Smartpack/Jobcard',
M6: 'Material partly delivered',
M7: 'Materials fully delivered',
M9: 'Material returned',
M02: 'Materials linked to Smartpack/Jobcard',
M06: 'Material partly delivered',
M07: 'Materials fully delivered',
M09: 'Material returned',
MN: 'No Material required',
MN1: 'Additional material to be issued Offshore from Min/Max Stock',
MN01: 'Additional material to be issued Offshore from Min/Max Stock',
MNX1: 'Materials not linked to Smartpack/Jobcard',
MNX2: 'Materials partially linked to Smartpack/Jobcard',
};
18 changes: 9 additions & 9 deletions libs/shared/src/packages/types/src/lib/materialStatus.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
export type MaterialStatus =
| 'MN'
| 'MN1'
| 'MN01'
| 'MNX1'
| 'MNX2'
| 'M13'
| 'M12'
| 'M11'
| 'M10'
| 'M9'
| 'M8'
| 'M7'
| 'M6'
| 'M5'
| 'M4'
| 'M3'
| 'M2';
| 'M09'
| 'M08'
| 'M07'
| 'M06'
| 'M05'
| 'M04'
| 'M03'
| 'M02';
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const materialOk = (workOrder: WorkOrder): number =>
woHasMaterialStatus(workOrder, 'M12', 'M13', 'MN');

const materialAvailable = (workOrder: WorkOrder): number =>
woHasMaterialStatus(workOrder, 'M7', 'M9', 'M10', 'M11', 'M12', 'MN');
woHasMaterialStatus(workOrder, 'M07', 'M09', 'M10', 'M11', 'M12', 'MN');

/**
* Function to retrieve "follow up" status of a package based on the package's projectProgress
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { hasProperty } from '@cc-components/shared';
import { WorkOrder, materialPackageStatusMap } from '@cc-components/workordershared';
import { MappedMaterialStatus } from '@cc-components/workordershared';

const DEFAULT_MAT_STATUS = materialPackageStatusMap.M4 as MappedMaterialStatus;
const DEFAULT_MAT_STATUS = materialPackageStatusMap.M04 as MappedMaterialStatus;
export const getMatStatus = (workOrder: WorkOrder): MappedMaterialStatus => {
if (!workOrder.materialStatus) {
return DEFAULT_MAT_STATUS;
Expand Down
24 changes: 12 additions & 12 deletions libs/workordershared/src/lib/utils-statuses/material/material.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ export const materialColorMap: Record<MappedMaterialStatus, string> = {
};
export const materialPackageStatusMap: Partial<
Record<MaterialStatus, MappedMaterialStatus>
> = {
MN: 'OK',
M10: 'OK',
M11: 'OK',
M12: 'OK',
M5: 'AVAILABLE',
M6: 'AVAILABLE',
M7: 'AVAILABLE',
M9: 'AVAILABLE',
M2: 'NOT_AVAILABLE',
M3: 'NOT_AVAILABLE',
M4: 'NOT_AVAILABLE',
> = {
M02: 'NOT_AVAILABLE',
M03: 'NOT_AVAILABLE',
M04: 'NOT_AVAILABLE',
M05: 'AVAILABLE',
M06: 'AVAILABLE',
M07: 'AVAILABLE',
M09: 'AVAILABLE',
M10: 'OK',
M11: 'OK',
M12: 'OK',
MN: 'OK',
};

0 comments on commit c2724f1

Please sign in to comment.