UNPKG

@sourceloop/ctrl-plane-tenant-management-service

Version:

Tenant Management microservice for SaaS control plane

103 lines 3.48 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Invoice = void 0; const tslib_1 = require("tslib"); const repository_1 = require("@loopback/repository"); const core_1 = require("@sourceloop/core"); const tenant_model_1 = require("./tenant.model"); const enums_1 = require("../enums"); let Invoice = class Invoice extends core_1.UserModifiableEntity { constructor(data) { super(data); } }; exports.Invoice = Invoice; tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', id: true, generated: true, }), tslib_1.__metadata("design:type", String) ], Invoice.prototype, "id", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', required: true, name: 'start_date', description: 'start date for the period this invoice is generated for', }), tslib_1.__metadata("design:type", String) ], Invoice.prototype, "startDate", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: 'string', required: true, name: 'end_date', description: 'end date for the period this invoice is generated for', }), tslib_1.__metadata("design:type", String) ], Invoice.prototype, "endDate", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: 'number', required: true, description: 'total amount for the invoice', }), tslib_1.__metadata("design:type", Number) ], Invoice.prototype, "amount", void 0); tslib_1.__decorate([ (0, repository_1.property)({ name: 'currency_code', type: 'string', required: true, description: 'currency for the invoice', }), tslib_1.__metadata("design:type", String) ], Invoice.prototype, "currencyCode", void 0); tslib_1.__decorate([ (0, repository_1.property)({ name: 'invoice_file', type: 'string', description: 'option reference to the generated file of the invoice', }), tslib_1.__metadata("design:type", String) ], Invoice.prototype, "invoiceFile", void 0); tslib_1.__decorate([ (0, repository_1.property)({ name: 'due_date', type: 'string', required: true, description: 'due date for the invoice', }), tslib_1.__metadata("design:type", String) ], Invoice.prototype, "dueDate", void 0); tslib_1.__decorate([ (0, repository_1.property)({ type: 'number', description: 'status of the invoice - 0(PENDING), 1(PAID), 2(CANCELLED)', required: true, default: enums_1.InvoiceStatus.PENDING, jsonSchema: { enum: Object.values(enums_1.InvoiceStatus), }, }), tslib_1.__metadata("design:type", Number) ], Invoice.prototype, "status", void 0); tslib_1.__decorate([ (0, repository_1.belongsTo)(() => tenant_model_1.Tenant, { keyTo: 'id' }, { type: 'string', name: 'tenant_id', description: 'id of the tenant this invoice is generated for', required: true, }), tslib_1.__metadata("design:type", String) ], Invoice.prototype, "tenantId", void 0); exports.Invoice = Invoice = tslib_1.__decorate([ (0, repository_1.model)({ name: 'invoices', description: 'this model represents an invoice with the amount and period generated for a tenant in the system', }), tslib_1.__metadata("design:paramtypes", [Object]) ], Invoice); //# sourceMappingURL=invoice.model.js.map