projects/congarevenuecloud/ecommerce/src/lib/modules/catalog/services/attachment.service.ts
The attachment represents a file that can be associated with an order, quote, etc as an attachment.
AObjectService
Properties |
|
Methods |
checkSupportedFileType | ||||||||||||
checkSupportedFileType(fileList: FileList, supportedFileTypes: string)
|
||||||||||||
This method is used to check supported file type
Parameters :
Returns :
boolean
true if at least one file in the filelist is of a supported file type. |
deleteAttachment | ||||||||
deleteAttachment(documentId: string)
|
||||||||
Method to delete the attachment for quote, order, etc using the Id of the document. Example:Example :
Parameters :
Returns :
Observable<boolean>
an observable of the boolean on successful delete. |
generateDocument | ||||||||||||||||||||||||||||||
generateDocument(templateId: string, object: AObject, type: "Order" | "Proposal", format: "PDF" | "PDF/A" | "DOCX", watermark: boolean)
|
||||||||||||||||||||||||||||||
Method generates a document for a given quote record based on a template. Example:Example :
Parameters :
Returns :
Observable<Job>
observable object of the generated document with job details. |
getAttachments | |||||||||||||||||||||||||
getAttachments(parentId: string, parentObjectName: string, sortBy: string, sortDirection: "asc" | "desc")
|
|||||||||||||||||||||||||
Retrieves attachments associated with a object. Example:Example :
@param parentObjectName string representing parent object name @param sortBy string representing the field on the attachment record to sort attachments by. By default the attachments will be sorted based on the creation date. @param sortDirection fetch the records based on asc | desc directions.By default it is descending. @returns An Observable emitting an array of Attachment objects.
Parameters :
Returns :
Observable<Array<AttachmentDetails>>
An Observable emitting an array of Attachment objects. |
getDocumentStatus | ||||||||
getDocumentStatus(jobId: string)
|
||||||||
Method fetches the status of the document. Example:Example :
Parameters :
Returns :
Observable<any>
observable of object with success or failure status of the attachment. |
uploadAttachment | |||||||||||||||||||||||||
uploadAttachment(file: File, isPrivate: boolean, parentId: string, parentObjectName: string)
|
|||||||||||||||||||||||||
Method to upload the attachment for quote, order, etc and associate with given parent id Example:Example :
Parameters :
Returns :
Observable<DocumentMetadata>
an observable of the uploaded attached with id, errors and status |
type |
Default value : DocumentMetadata
|
Protected userService |
Type : UserService
|
Default value : this.injector.get(UserService)
|