Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/bizproc/automation/src/ |
Upload File : |
import { Type } from 'main.core'; import { DocumentType, DocumentCategory, DocumentStatus } from './document/types'; export class TemplateScope { #documentType: DocumentType; #category: DocumentCategory | null; #status: DocumentStatus; constructor(rawTemplateScope: { DocumentType: { Type: string, Name: string, }, Category: { Id: string | null, Name: string | null, }, Status: { Id: string, Name: string, Color: string, } }) { this.#documentType = rawTemplateScope.DocumentType; this.#category = !Type.isNil(rawTemplateScope.Category.Id) ? rawTemplateScope.Category : null; this.#status = rawTemplateScope.Status; } getId() { if (this.hasCategory()) { return `${this.#documentType.Type}_${this.#category.Id}_${this.#status.Id}`; } return `${this.#documentType.Type}_${this.#status.Id}`; } getDocumentType(): DocumentType { return this.#documentType; } getDocumentCategory(): DocumentCategory { return this.#category; } getDocumentStatus(): DocumentStatus { return this.#status; } hasCategory(): boolean { return !Type.isNull(this.#category); } }