Kind: Class
Source: Pams/Web/Pams.Web/Client/app/services/sales/new-job/new-job.service.ts (line 16)
Part of: Pams
NewJobService coordinates data and actions for sales new-job workflows. It retrieves branch, sales responsible, product type, time-frame, and status data sources, then handles job save, update, and inquiry deletion operations.
Methods
| Method | Signature | Returns |
|---|---|---|
getCurrentBranch | getCurrentBranch() | void |
getSalesResponsiblesDataSource | getSalesResponsiblesDataSource(companyBranchForData: number) | void |
getSalesResponsiblesDataSourceWithEnum | getSalesResponsiblesDataSourceWithEnum(departmentIdEnum: number, companyBranchForData: number) | void |
getProductTypesDataSource | getProductTypesDataSource() | void |
getPurchasingProductTypesDataSource | getPurchasingProductTypesDataSource() | void |
getTimeFramePeriodsDataSource | getTimeFramePeriodsDataSource() | void |
getStatusDataSource | getStatusDataSource(stage: undefined) | void |
saveJob | saveJob(job: undefined) | void |
updateJob | updateJob(job: undefined) | void |
deleteInquiry | deleteInquiry(id: undefined) | void |
getsalesjobbyid | getsalesjobbyid(id: undefined) | void |
getDeliveriesForInstandSalesJob | getDeliveriesForInstandSalesJob(Jobid: undefined) | void |
createInquiry | createInquiry(inquiry: undefined) | void |
updateInquiry | updateInquiry(inquiry: undefined) | void |
deleteJob | deleteJob(id: undefined) | void |
changeJobStatus | changeJobStatus(job: undefined) | void |
regretJob | regretJob(id: undefined, regretDetails: undefined) | void |
unRegretPotentialJob | unRegretPotentialJob(id: undefined) | void |
cancelJob | cancelJob(id: undefined, cancelDetails: undefined) | void |
unCancelPotentialJob | unCancelPotentialJob(id: undefined) | void |
convertJobToOffer | convertJobToOffer(id: undefined) | void |
regretOfferedJob | regretOfferedJob(id: undefined, regretDetails: undefined) | void |
unRegretOfferedJob | unRegretOfferedJob(id: undefined) | void |
cancelOfferedJob | cancelOfferedJob(id: undefined, cancelDetails: undefined) | void |
unCancelOfferedJob | unCancelOfferedJob(id: undefined) | void |
convertJobToPotential | convertJobToPotential(id: undefined) | void |
LostOfferedJob | LostOfferedJob(id: number, LossDetails: undefined) | void |
unLossOfferedJob | unLossOfferedJob(id: number) | void |
unRejectOrderedJob | unRejectOrderedJob(id: number) | void |
createSingleOffer | createSingleOffer(offer: SalesOffers) | void |
approveOfferArchiveRequest | approveOfferArchiveRequest(offerId: number) | void |
disapproveOfferArchiveRequest | disapproveOfferArchiveRequest(offerId: number) | void |
changeStageSingleOffer | changeStageSingleOffer(offer: SalesOffers) | void |
updateSingleOffer | updateSingleOffer(offer: SalesOffers) | void |
regretSingleOffer | regretSingleOffer(id: number, regretDetails: undefined) | void |
getregrettedOfferReason | getregrettedOfferReason(archivedId: number) | void |
updateRegrettedOfferReason | updateRegrettedOfferReason(Id: number, regretDetails: RegretReasonModel) | void |
unRegretSingleOffer | unRegretSingleOffer(id: number) | void |
cancelSingleOffer | cancelSingleOffer(id: number, cancelDetails: undefined) | void |
getCancelledOfferReason | getCancelledOfferReason(archivedId: number) | void |
updateCancelledOfferReason | updateCancelledOfferReason(Id: number, cancelDetails: CancelReasonModel) | void |
unCancelSingleOffer | unCancelSingleOffer(id: number) | void |
lostSingleOffer | lostSingleOffer(id: number, lostDetails: undefined) | void |
getLostOfferReason | getLostOfferReason(archivedId: number) | void |
updateLostOfferReason | updateLostOfferReason(Id: number, lostDetails: LostReasonModel) | void |
unLostSingleOffer | unLostSingleOffer(id: number) | void |
deleteSingleOffer | deleteSingleOffer(id: number) | void |
getContructualCommissionByPrincipalId | getContructualCommissionByPrincipalId(id: number) | void |
extendSingleOfferValidatiy | extendSingleOfferValidatiy(offer: SalesOffers) | void |
convertJobToOrder | convertJobToOrder(id: number) | void |
Properties
| Property | Type |
|---|---|
datasourceBySearchEnum | any |
Where it refuses work
NewJobServicestops the work with an early return whenurl !== "".
Diagram
mermaidgraph LR SalesScreen[Sales New-Job Screen] --> Service[NewJobService] Service --> Branch[getCurrentBranch] Service --> SalesResponsibles[getSalesResponsiblesDataSource] Service --> SalesResponsiblesEnum[getSalesResponsiblesDataSourceWithEnum] Service --> ProductTypes[getProductTypesDataSource] Service --> PurchasingTypes[getPurchasingProductTypesDataSource] Service --> TimeFrames[getTimeFramePeriodsDataSource] Service --> Statuses[getStatusDataSource] Service --> Save[saveJob] Service --> Update[updateJob] Service --> Delete[deleteInquiry]
Usage
tsexport class NewJobComponent {
constructor(private readonly newJobService: NewJobService) {}
loadFormData() {
const branch = this.newJobService.getCurrentBranch();
const salesResponsibles = this.newJobService.getSalesResponsiblesDataSource();
const productTypes = this.newJobService.getProductTypesDataSource();
const timeFrames = this.newJobService.getTimeFramePeriodsDataSource();
const statuses = this.newJobService.getStatusDataSource();
return {
branch,
salesResponsibles,
productTypes,
timeFrames,
statuses,
};
}
save() {
return this.newJobService.saveJob();
}
update() {
return this.newJobService.updateJob();
}
removeInquiry() {
return this.newJobService.deleteInquiry();
}
}
AI Coding Instructions
- Use
NewJobServiceas the integration point for new-job form data and job-related actions. - Select the sales responsible source that matches the consuming control: use
getSalesResponsiblesDataSourceWithEnum()only where enum-backed values are expected. - Keep branch, product type, purchasing product type, time-frame, and status loading in the screen or state layer; avoid duplicating those sources locally.
- Route save, update, and inquiry deletion through
saveJob(),updateJob(), anddeleteInquiry()rather than adding direct request logic in UI components.
Used by
6 references from 6 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Imported by (6)
ReportsSettingsComponent—Pams/Web/Pams.Web/Client/app/components/configuration/reports-settings/reports-settings/reports-settings.component.ts:1TopicComponent—Pams/Web/Pams.Web/Client/app/components/dashboard/my-desk/activities/topic/topic.component.ts:1InvoiceDetailsComponent—Pams/Web/Pams.Web/Client/app/components/invoices/invoice-details/invoice-details.component.ts:1SampleSelectBoxComponent—Pams/Web/Pams.Web/Client/app/components/shared/dropdown/sample-select-box/sample-select-box.component.ts:1TagComponent—Pams/Web/Pams.Web/Client/app/components/shared/tag/tag.component.ts:1PamsServicesModule—Pams/Web/Pams.Web/Client/app/services/pams-services.module.ts:1
Was this page helpful?