Skip to content

JobVersion

reference
2 min readUpdated

Kind: Class

Source: Frontend/src/app/models/sales/job-version.model.ts (line 10)

Part of: Frontend

JobVersion represents a version of a sales job in the application model layer. It manages version-specific item state through addUnitizedItem() and supports expiration-related test state through resetExpirationTest().

Methods

MethodSignatureReturns
addUnitizedItemaddUnitizedItem()void
resetExpirationTestresetExpirationTest()void

Properties

PropertyType
VersionIDnumber
VersionDateDate
IsSelectedboolean
TypeSelectedboolean
UserDisplayNamestring
AutoGeneratedSerialboolean
DeliveryTermDeliveryTerm
PaymentMethodPaymentMethod
SupplierSupplier
VersionSerialnumber
JobProcessIDnumber
JobVersionPricenumber
CurrencyIDnumber
RateToBaseCurrencynumber
JobVersionPriceInBaseCurrencynumber
PaymentMethodIDnumber
DeliveryTermIDnumber
JobVersionStatusIDnumber
StatusDateDate
CreatedByUserIDnumber
ModifiedByUserIDnumber
ModificationDateDate
CurrentJobVersionStatusLogIDnumber
DeliveryTimePeriodIDnumber
DeliveryTimePeriodCountnumber
IsPartialShipmentboolean
CurrencyCodestring
CurrencySymbolstring
ClientOrderNumberstring
SupplierOfferNumberstring
OfferValidationTimePeriodIDnumber
OfferValidationTimePeriodCountnumber
IsCurrentboolean
SupplierOrderNumberstring
OrderActivationDateDate
OrderDeliveryDateDate
OrderDateDate
OrderBacklognumber
ItemsJobItem[]
MileStonesOfferMileStone[]
JobStatusnumber
CreatedByUserNamestring
JobVersionStatusLabelstring
commissionBasestring
JobVersionParentIDnumber
CommissionPercentagenumber
AgreedCommissionPercentagenumber
ContractualCommissionPercentagenumber
commissionValidationnumber
SupplierIDnumber

Where it refuses work

  • JobVersion stops the work with an early return when this.JobVersionPrice <= 0.
  • JobVersion stops the work with an early return when this.Items[0].Description.
  • JobVersion stops the work with an early return when this.OrderActivationDate == null || this.DeliveryTimePeriodCount == null || this.Delivery….
  • JobVersion stops the work with an early return when this.OrderDeliveryDateCalculated == "".
  • JobVersion stops the work with an early return when diff < 0.
  • JobVersion stops the work with an early return when this.ContractualCommissionPercentage == -1.

Diagram

mermaid
graph LR
  JobVersion[JobVersion]
  AddItem[addUnitizedItem()]
  ResetExpiration[resetExpirationTest()]

  JobVersion --> AddItem
  JobVersion --> ResetExpiration

Usage

ts
import { JobVersion } from './models/sales/job-version.model';

const jobVersion = new JobVersion();

jobVersion.addUnitizedItem();

// Reset expiration test state before running expiration-related logic.
jobVersion.resetExpirationTest();

AI Coding Instructions

  • Keep job-version item changes inside addUnitizedItem() rather than duplicating item setup logic in callers.
  • Call resetExpirationTest() when expiration-related state must be cleared before a new test or workflow step.
  • Check the model's existing properties and constructor requirements before creating JobVersion instances in new code.
  • Keep sales workflow code dependent on the model methods instead of directly changing version state where possible.

Relationships

  • IMPORTS → JobItem
  • IMPORTS → OfferMileStone
  • IMPORTS → AppSettings
  • IMPORTS → JobVersionStatusE
  • IMPORTS → JobStatusE
  • IMPORTS → JobItemStatusE
  • IMPORTS → PaymentMethod
  • IMPORTS → DeliveryTerm
  • IMPORTS → Supplier

Used by

3 references from 3 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

Imported by (3)

  • NewJobComponentFrontend/src/app/components/sales/new-job/new-job.component.ts:1
  • InquiryServiceFrontend/src/app/services/sales/inquiry.service.ts:1
  • TempInqFrontend/src/app/models/sales/inquiry.model.ts:17

Was this page helpful?

Download as PDF