@weiliang79/ubl-builder
Version:
Tool to create xml documents with UBL 2.1 standard
42 lines (40 loc) • 2.57 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.BuyerContact = exports.AccountingContact = exports.DeliveryContact = exports.Contact = void 0;
const GenericAggregateComponent_1 = __importDefault(require("./GenericAggregateComponent"));
const UnqualifiedDataTypes_1 = require("../types/UnqualifiedDataTypes");
/*
1 cbc:ID [0..1] An identifier for this contact.
2 cbc:Name [0..1] The name of this contact. It is recommended that this be used for a functional name and not a personal name.
3 cbc:Telephone [0..1] The primary telephone number of this contact.
4 cbc:Telefax [0..1] The primary fax number of this contact.
5 cbc:ElectronicMail [0..1] The primary email address of this contact.
6 cbc:Note [0..*] Free-form text conveying information that is not contained explicitly in other structures; in particular, a textual description of the circumstances under which this contact can be used (e.g., "emergency" or "after hours").
7 cac:OtherCommunication [0..*] Another means of communication with this contact.
*/
const ParamsMap = {
id: { order: 1, attributeName: 'cbc:ID', min: 0, max: 1, classRef: UnqualifiedDataTypes_1.UdtIdentifier },
name: { order: 2, attributeName: 'cbc:Name', min: 0, max: 1, classRef: UnqualifiedDataTypes_1.UdtName },
telephone: { order: 3, attributeName: 'cbc:Telephone', min: 0, max: 1, classRef: UnqualifiedDataTypes_1.UdtText },
telefax: { order: 4, attributeName: 'cbc:Telefax', min: 0, max: 1, classRef: UnqualifiedDataTypes_1.UdtText },
electronicMail: { order: 5, attributeName: 'cbc:ElectronicMail', min: 0, max: 1, classRef: UnqualifiedDataTypes_1.UdtText },
note: { order: 6, attributeName: 'cbc:Note', min: 0, max: undefined, classRef: UnqualifiedDataTypes_1.UdtText },
// otherCommunication: { order: 7, attributeName: 'cac:OtherCommunication', min: 0, max: undefined, classRef: UdtIdentifier },
// ################################## TODO CAC MISSING ################################################
};
/**
*
*/
class ContactType extends GenericAggregateComponent_1.default {
constructor(content) {
super(content, ParamsMap, 'cac:ContactType');
}
}
exports.Contact = ContactType;
exports.DeliveryContact = ContactType;
exports.AccountingContact = ContactType;
exports.BuyerContact = ContactType;
//# sourceMappingURL=ContactTypeGroup.js.map