UNPKG

myinvois-sdk

Version:

TypeScript SDK for interacting with the Malaysia e-invoicing system (MyInvois) API

65 lines (64 loc) 1.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DocumentReference = void 0; const base_model_1 = require("./base-model"); /** * Represents a document reference */ class DocumentReference extends base_model_1.BaseModel { constructor() { super(...arguments); this._id = ''; this._documentType = ''; this._documentDescription = ''; } // Getter and Setter for id get id() { return this._id; } set id(value) { this._id = value; } // Getter and Setter for documentType get documentType() { return this._documentType; } set documentType(value) { this._documentType = value; } // Getter and Setter for documentDescription get documentDescription() { return this._documentDescription; } set documentDescription(value) { this._documentDescription = value; } /** * Converts the document reference to a JSON representation */ toJSON() { const reference = { "ID": [ { "_": this._id } ] }; if (this._documentType) { reference["DocumentType"] = [ { "_": this._documentType } ]; } if (this._documentDescription) { reference["DocumentDescription"] = [ { "_": this._documentDescription } ]; } return reference; } } exports.DocumentReference = DocumentReference;