103 lines
4.2 KiB
JavaScript
103 lines
4.2 KiB
JavaScript
"use strict";
|
|
/**
|
|
* ChecklistItem Entity
|
|
* Items de verificación en checklists
|
|
*
|
|
* @module Quality
|
|
* @table quality.checklist_items
|
|
*/
|
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
};
|
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.ChecklistItem = void 0;
|
|
const typeorm_1 = require("typeorm");
|
|
const tenant_entity_1 = require("../../core/entities/tenant.entity");
|
|
const checklist_entity_1 = require("./checklist.entity");
|
|
let ChecklistItem = class ChecklistItem {
|
|
id;
|
|
tenantId;
|
|
checklistId;
|
|
sequenceNumber;
|
|
category;
|
|
description;
|
|
isCritical;
|
|
requiresPhoto;
|
|
acceptanceCriteria;
|
|
isActive;
|
|
createdAt;
|
|
updatedAt;
|
|
// Relations
|
|
tenant;
|
|
checklist;
|
|
};
|
|
exports.ChecklistItem = ChecklistItem;
|
|
__decorate([
|
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
__metadata("design:type", String)
|
|
], ChecklistItem.prototype, "id", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'tenant_id', type: 'uuid' }),
|
|
__metadata("design:type", String)
|
|
], ChecklistItem.prototype, "tenantId", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'checklist_id', type: 'uuid' }),
|
|
__metadata("design:type", String)
|
|
], ChecklistItem.prototype, "checklistId", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'sequence_number', type: 'integer' }),
|
|
__metadata("design:type", Number)
|
|
], ChecklistItem.prototype, "sequenceNumber", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'varchar', length: 100 }),
|
|
__metadata("design:type", String)
|
|
], ChecklistItem.prototype, "category", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ type: 'text' }),
|
|
__metadata("design:type", String)
|
|
], ChecklistItem.prototype, "description", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'is_critical', type: 'boolean', default: false }),
|
|
__metadata("design:type", Boolean)
|
|
], ChecklistItem.prototype, "isCritical", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'requires_photo', type: 'boolean', default: false }),
|
|
__metadata("design:type", Boolean)
|
|
], ChecklistItem.prototype, "requiresPhoto", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'acceptance_criteria', type: 'text', nullable: true }),
|
|
__metadata("design:type", String)
|
|
], ChecklistItem.prototype, "acceptanceCriteria", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.Column)({ name: 'is_active', type: 'boolean', default: true }),
|
|
__metadata("design:type", Boolean)
|
|
], ChecklistItem.prototype, "isActive", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'timestamptz' }),
|
|
__metadata("design:type", Date)
|
|
], ChecklistItem.prototype, "createdAt", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at', type: 'timestamptz' }),
|
|
__metadata("design:type", Date)
|
|
], ChecklistItem.prototype, "updatedAt", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.ManyToOne)(() => tenant_entity_1.Tenant),
|
|
(0, typeorm_1.JoinColumn)({ name: 'tenant_id' }),
|
|
__metadata("design:type", tenant_entity_1.Tenant)
|
|
], ChecklistItem.prototype, "tenant", void 0);
|
|
__decorate([
|
|
(0, typeorm_1.ManyToOne)(() => checklist_entity_1.Checklist, (c) => c.items, { onDelete: 'CASCADE' }),
|
|
(0, typeorm_1.JoinColumn)({ name: 'checklist_id' }),
|
|
__metadata("design:type", checklist_entity_1.Checklist)
|
|
], ChecklistItem.prototype, "checklist", void 0);
|
|
exports.ChecklistItem = ChecklistItem = __decorate([
|
|
(0, typeorm_1.Entity)({ schema: 'quality', name: 'checklist_items' }),
|
|
(0, typeorm_1.Index)(['tenantId', 'checklistId', 'sequenceNumber'])
|
|
], ChecklistItem);
|
|
//# sourceMappingURL=checklist-item.entity.js.map
|