Skip to content

Commit

Permalink
DDT-1496: fix voyageNumber on TC creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdiiir committed Jan 23, 2023
1 parent 6771099 commit eb78475
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 27 deletions.
17 changes: 7 additions & 10 deletions src/app/model/jit/transport-call.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { PortCallServiceTypeCode } from "../enums/portCallServiceTypeCode";
import { FacilityTypeCode } from "../enums/facilityTypeCodeOPR";
import { FacilityCodeListProvider } from "../enums/facilityCodeListProvider";
import { Vessel } from "../portCall/vessel";
Expand All @@ -12,30 +11,28 @@ export interface TransportCall {
carrierExportVoyageNumber?: string;
carrierImportVoyageNumber?: string;
portOfCall?: Port;
transportCallReference: string;
transportCallReference?: string;
modeOfTransport: string;
UNLocationCode: string;
transportCallSequenceNumber: number;
facilityTypeCode: FacilityTypeCode;
facilityCodeListProvider: FacilityCodeListProvider;
facilityCode: string;
otherFacility: string;
facilityCodeListProvider?: FacilityCodeListProvider;
facilityCode?: string;
otherFacility?: string;
sequenceColor?: string;
vessel?: Vessel;
location: EventLocation;
bestBerthArrivalEstimateDateTime?: Date;
atdBerthDateTime?: Date;
omitCreatedDateTime?: Date;
latestEventCreatedDateTime?: Date;
transportCallID: string | null;
/**
transportCallID?: string | null;
/**
* @deprecated
Although deprecated, the UI JIT 1.1 combo - newer fields are converted to this
*/
exportVoyageNumber?: string;
/**
/**
* @deprecated
Although deprecated, the UI uses JIT 1.1 combo - newer fields are convereted to this
*/
importVoyageNumber?: string;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {Component, OnInit} from '@angular/core';
import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
import {Globals} from '../../model/portCall/globals';
import {MessageService} from 'primeng/api';
import {TranslateService} from '@ngx-translate/core';
import {Port} from '../../model/portCall/port';
Expand All @@ -10,15 +9,11 @@ import {TransportCallService} from '../../controller/services/jit/transport-call
import {DialogService, DynamicDialogRef} from 'primeng/dynamicdialog';
import {VesselService} from '../../controller/services/base/vessel.service';
import {Vessel} from '../../model/portCall/vessel';
import {DelayCodeService} from '../../controller/services/base/delay-code.service';
import {TimestampMappingService} from '../../controller/services/mapping/timestamp-mapping.service';
import {EventLocation} from '../../model/eventLocation';
import {PortService} from 'src/app/controller/services/base/port.service';
import {TimestampDefinitionService} from '../../controller/services/base/timestamp-definition.service';
import {ErrorHandler} from 'src/app/controller/services/util/errorHandler';
import {Observable, take} from 'rxjs';
import {tap} from 'rxjs/operators';
import {PublisherRoleService} from '../../controller/services/base/publisher-role.service';
import {TimestampEditorComponent} from '../timestamp-editor/timestamp-editor.component';
import {TimestampResponseStatus} from '../../model/enums/timestamp-response-status';

Expand All @@ -38,16 +33,11 @@ export class TransportCallCreatorComponent implements OnInit {

constructor(private formBuilder: FormBuilder,
private translate: TranslateService,
private globals: Globals,
private dialogService: DialogService,
public ref: DynamicDialogRef,
private messageService: MessageService,
private delayCodeService: DelayCodeService,
private transportCallService: TransportCallService,
private vesselService: VesselService,
private timestampDefinitionService: TimestampDefinitionService,
private timestampMappingService: TimestampMappingService,
private publisherRoleService: PublisherRoleService,
private portService: PortService,
) {
}
Expand Down Expand Up @@ -107,21 +97,17 @@ export class TransportCallCreatorComponent implements OnInit {
facilityCodeListProvider: null
};
const transportCall: TransportCall = {
transportCallReference: null,
UNLocationCode: port.UNLocationCode,
carrierServiceCode: carrierServiceCode,
carrierVoyageNumber: exportVoyageNumber,
exportVoyageNumber: exportVoyageNumber,
importVoyageNumber: importVoyageNumber ?? exportVoyageNumber,
facilityCode: null,
carrierExportVoyageNumber: exportVoyageNumber,
carrierImportVoyageNumber: importVoyageNumber ?? exportVoyageNumber,
facilityTypeCode: FacilityTypeCode.POTE,
otherFacility: null,
transportCallID: null,
transportCallSequenceNumber: 1,
modeOfTransport: 'VESSEL',
facilityCodeListProvider: null,
location: location,
vessel: vessel,
vessel: vessel
};

if (this.createTimestampChecked) {
Expand Down

0 comments on commit eb78475

Please sign in to comment.