Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
fixed the partID for myParts and shared Parts
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelDietz committed Nov 20, 2023
1 parent c716213 commit c14d9a6
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 181 deletions.
231 changes: 115 additions & 116 deletions frontend/src/app/modules/page/parts/model/parts.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,162 +26,161 @@ import { MainAspectType } from '@page/parts/model/mainAspectType.enum';
import { Owner } from '@page/parts/model/owner.enum';

export interface Part {
id: string;
idShort: string;
name: string;
manufacturer: string;
manufacturerPartId: string;
nameAtManufacturer: string;
businessPartner: string
semanticModel?: SemanticModel;
semanticModelId: string;
qualityType: QualityType;
children: string[];
parents?: string[];
error?: boolean;
activeInvestigation?: boolean;
activeAlert: boolean;
van: string;
semanticDataModel: SemanticDataModel;
classification: string;

mainAspectType: MainAspectType;

// aspectmodel props are temporarely hardcoded here because Tables and Views only accept root level prop array
// as built
partId?: string;
customerPartId?: string;
nameAtCustomer?: string;
manufacturingDate?: string;
manufacturingCountry?: string;

// as planned
validityPeriodFrom?: string;
validityPeriodTo?: string;
//partSiteInformationAsPlanned
catenaXSiteId: string;
psFunction: string;
functionValidFrom?: string;
functionValidUntil?: string;

// count of notifications
activeAlerts: number;
activeInvestigations: number;
id: string;
idShort: string;
name: string;
manufacturer: string;
manufacturerPartId: string;
nameAtManufacturer: string;
businessPartner: string;
semanticModel?: SemanticModel;
semanticModelId: string;
qualityType: QualityType;
children: string[];
parents?: string[];
error?: boolean;
activeInvestigation?: boolean;
activeAlert: boolean;
van: string;
semanticDataModel: SemanticDataModel;
semanticDataModelInCamelCase?: SemanticDataModelInCamelCase;
classification: string;

mainAspectType: MainAspectType;

// aspectmodel props are temporarely hardcoded here because Tables and Views only accept root level prop array
// as built
partId?: string;
customerPartId?: string;
nameAtCustomer?: string;
manufacturingDate?: string;
manufacturingCountry?: string;

// as planned
validityPeriodFrom?: string;
validityPeriodTo?: string;
//partSiteInformationAsPlanned
catenaXSiteId: string;
psFunction: string;
functionValidFrom?: string;
functionValidUntil?: string;

// count of notifications
activeAlerts: number;
activeInvestigations: number;
}

export interface PartResponse {
id: string;
idShort: string;
semanticModelId: string;
manufacturerPartId: string;
businessPartner: string;
manufacturerName: string;
nameAtManufacturer: string;
owner: Owner;
childRelations: Relation[];
parentRelations: Relation[];
activeAlert: boolean;
underInvestigation: boolean;
qualityType: QualityType;
van: string;
semanticDataModel: SemanticDataModel;
classification: string;
detailAspectModels: DetailAspectModel[];

// TODO: Delete ? flag when AsPlanned Parts do not return the props anymore
qualityAlertsInStatusActive?: number;
qualityInvestigationsInStatusActive?: number;

id: string;
idShort: string;
semanticModelId: string;
manufacturerPartId: string;
businessPartner: string;
manufacturerName: string;
nameAtManufacturer: string;
owner: Owner;
childRelations: Relation[];
parentRelations: Relation[];
activeAlert: boolean;
underInvestigation: boolean;
qualityType: QualityType;
van: string;
semanticDataModel: SemanticDataModel;
classification: string;
detailAspectModels: DetailAspectModel[];

// TODO: Delete ? flag when AsPlanned Parts do not return the props anymore
qualityAlertsInStatusActive?: number;
qualityInvestigationsInStatusActive?: number;
}

export type PartsResponse = PaginationResponse<PartResponse>;

// TODO: needs to be aligned with Severity in the future in terms of coding standards and use
export enum QualityType {
Ok = 'Ok',
Minor = 'Minor',
Major = 'Major',
Critical = 'Critical',
LifeThreatening = 'LifeThreatening',
Ok = 'Ok',
Minor = 'Minor',
Major = 'Major',
Critical = 'Critical',
LifeThreatening = 'LifeThreatening',
}

export enum SemanticDataModel {
BATCH = 'BATCH',
SERIALPART = 'SERIALPART',
PARTASPLANNED = 'PARTASPLANNED',
JUSTINSEQUENCE = 'JUSTINSEQUENCE',
UNKNOWN = 'UNKNOWN'
BATCH = 'BATCH',
SERIALPART = 'SERIALPART',
PARTASPLANNED = 'PARTASPLANNED',
JUSTINSEQUENCE = 'JUSTINSEQUENCE',
UNKNOWN = 'UNKNOWN',
}

export enum SemanticDataModelInCamelCase {
BATCH = "Batch",
SERIALPART = 'SerialPart',
PARTASPLANNED = 'PartAsPlanned',
JUSTINSEQUENCE = 'JustInSequence',
UNKNOWN = 'Unknown'
BATCH = 'Batch',
SERIALPART = 'SerialPart',
PARTASPLANNED = 'PartAsPlanned',
JUSTINSEQUENCE = 'JustInSequence',
UNKNOWN = 'Unknown',
}

export interface Relation {
id: string;
idShort: string;
id: string;
idShort: string;
}

export interface AssetAsBuiltFilter {
id?: string,
idShort?: string,
name?: string,
manufacturer?: string,
partId?: string,
manufacturerPartId?: string,
customerPartId?: string,
classification?: string,
nameAtCustomer?: string,
semanticModelId?: string,
semanticDataModel?: string[],
manufacturingDate?: string,
manufacturingCountry?: string
id?: string;
idShort?: string;
name?: string;
manufacturer?: string;
partId?: string;
manufacturerPartId?: string;
customerPartId?: string;
classification?: string;
nameAtCustomer?: string;
semanticModelId?: string;
semanticDataModel?: string[];
manufacturingDate?: string;
manufacturingCountry?: string;
}

export interface AssetAsPlannedFilter {
id?: string,
idShort?: string,
name?: string,
manufacturer?: string,
manufacturerPartId?: string,
classification?: string,
semanticDataModel?: string[],
semanticModelId?: string,
validityPeriodFrom?: string,
validityPeriodTo?: string,
psFunction?: string,
catenaXSiteId?: string,
functionValidFrom?: string,
functionValidUntil?: string,
id?: string;
idShort?: string;
name?: string;
manufacturer?: string;
manufacturerPartId?: string;
classification?: string;
semanticDataModel?: string[];
semanticModelId?: string;
validityPeriodFrom?: string;
validityPeriodTo?: string;
psFunction?: string;
catenaXSiteId?: string;
functionValidFrom?: string;
functionValidUntil?: string;
}

export interface AssetAsDesignedFilter {
id?: string,
id?: string;
}

export interface AssetAsSupportedFilter {
id?: string,
id?: string;
}

export interface AssetAsOrderedFilter {
id?: string,
id?: string;
}

export interface AssetAsRecycledFilter {
id?: string,
id?: string;
}


export enum FilterOperator {
EQUAL = 'EQUAL',
AT_LOCAL_DATE = 'AT_LOCAL_DATE',
STARTS_WITH = 'STARTS_WITH'
EQUAL = 'EQUAL',
AT_LOCAL_DATE = 'AT_LOCAL_DATE',
STARTS_WITH = 'STARTS_WITH',
}

export function getFilterOperatorValue(operator: FilterOperator) {
return operator as string;
return operator as string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ describe('PartsTableComponent', () => {
idShort: [],
nameAtManufacturer: [],
manufacturerName: [],
partId: [],
manufacturerPartId: [],
customerPartId: [],
classification: [],
Expand All @@ -422,7 +421,6 @@ describe('PartsTableComponent', () => {
idShort: [],
nameAtManufacturer: [],
manufacturerName: [],
partId: [],
manufacturerPartId: [],
customerPartId: [],
classification: [],
Expand All @@ -439,7 +437,6 @@ describe('PartsTableComponent', () => {
idShort: [],
nameAtManufacturer: [],
manufacturerName: [],
partId: [],
manufacturerPartId: [],
customerPartId: [],
classification: [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ export class PartsTableComponent implements OnInit {
option: this.optionTextSearch,
column: 'manufacturer',
},
partId: { filterKey: 'partId', headerKey: 'filterPartId', isTextSearch: true, option: this.optionTextSearch }, // Part number / Batch Number / JIS Number
manufacturerPartId: {
filterKey: 'manufacturerPartId',
headerKey: 'filterManufacturerPartId',
Expand Down Expand Up @@ -344,7 +343,6 @@ export class PartsTableComponent implements OnInit {
'idShort',
'name',
'manufacturer',
'partId',
'manufacturerPartId',
'customerPartId',
'classification',
Expand Down Expand Up @@ -380,7 +378,6 @@ export class PartsTableComponent implements OnInit {
idShort: true,
name: true,
manufacturer: true,
partId: true,
manufacturerPartId: true,
customerPartId: true,
classification: true,
Expand Down Expand Up @@ -457,7 +454,7 @@ export class PartsTableComponent implements OnInit {
'semanticDataModel',
'name',
'manufacturer',
'partId',
'manufacturerPartId',
'semanticModelId',
'manufacturingDate',
'activeAlerts',
Expand All @@ -468,7 +465,7 @@ export class PartsTableComponent implements OnInit {
semanticDataModel: true,
name: true,
manufacturer: true,
partId: true,
manufacturerPartId: true,
semanticModelId: true,
manufacturingDate: true,
activeAlerts: true,
Expand Down Expand Up @@ -498,7 +495,7 @@ export class PartsTableComponent implements OnInit {
'semanticDataModel',
'name',
'manufacturer',
'partId',
'manufacturerPartId',
'semanticModelId',
'manufacturingDate',
'activeAlerts',
Expand All @@ -509,7 +506,7 @@ export class PartsTableComponent implements OnInit {
semanticDataModel: true,
name: true,
manufacturer: true,
partId: true,
manufacturerPartId: true,
semanticModelId: true,
manufacturingDate: true,
activeAlerts: true,
Expand Down Expand Up @@ -795,7 +792,6 @@ export class PartsTableComponent implements OnInit {
this.filterKeyOptions.idShort,
this.filterKeyOptions.nameAtManufacturer,
this.filterKeyOptions.manufacturerName,
this.filterKeyOptions.partId,
this.filterKeyOptions.manufacturerPartId,
this.filterKeyOptions.customerPartId,
this.filterKeyOptions.classification,
Expand All @@ -813,7 +809,6 @@ export class PartsTableComponent implements OnInit {
idShort: new FormControl([]),
nameAtManufacturer: new FormControl([]),
manufacturerName: new FormControl([]),
partId: new FormControl([]),
manufacturerPartId: new FormControl([]),
customerPartId: new FormControl([]),
classification: new FormControl([]),
Expand Down
Loading

0 comments on commit c14d9a6

Please sign in to comment.