erp-construccion-backend/dist/modules/quality/entities/post-sale-ticket.entity.js

184 lines
7.5 KiB
JavaScript

"use strict";
/**
* PostSaleTicket Entity
* Tickets de garantía postventa
*
* @module Quality
* @table quality.post_sale_tickets
*/
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.PostSaleTicket = void 0;
const typeorm_1 = require("typeorm");
const tenant_entity_1 = require("../../core/entities/tenant.entity");
const user_entity_1 = require("../../core/entities/user.entity");
const ticket_assignment_entity_1 = require("./ticket-assignment.entity");
let PostSaleTicket = class PostSaleTicket {
id;
tenantId;
loteId;
derechohabienteId;
ticketNumber;
category;
priority;
title;
description;
photoUrl;
status;
slaHours;
slaDueAt;
slaBreached;
assignedAt;
resolvedAt;
closedAt;
resolutionNotes;
resolutionPhotoUrl;
satisfactionRating;
satisfactionComment;
contactName;
contactPhone;
createdAt;
createdById;
updatedAt;
updatedById;
// Relations
tenant;
createdBy;
assignments;
};
exports.PostSaleTicket = PostSaleTicket;
__decorate([
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
__metadata("design:type", String)
], PostSaleTicket.prototype, "id", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'tenant_id', type: 'uuid' }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "tenantId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'lote_id', type: 'uuid' }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "loteId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'derechohabiente_id', type: 'uuid', nullable: true }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "derechohabienteId", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'ticket_number', type: 'varchar', length: 50 }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "ticketNumber", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'varchar', length: 30 }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "category", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'varchar', length: 20 }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "priority", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'varchar', length: 255 }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "title", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'text' }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "description", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'photo_url', type: 'varchar', length: 500, nullable: true }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "photoUrl", void 0);
__decorate([
(0, typeorm_1.Column)({ type: 'varchar', length: 20, default: 'created' }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "status", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'sla_hours', type: 'integer' }),
__metadata("design:type", Number)
], PostSaleTicket.prototype, "slaHours", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'sla_due_at', type: 'timestamptz' }),
__metadata("design:type", Date)
], PostSaleTicket.prototype, "slaDueAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'sla_breached', type: 'boolean', default: false }),
__metadata("design:type", Boolean)
], PostSaleTicket.prototype, "slaBreached", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'assigned_at', type: 'timestamptz', nullable: true }),
__metadata("design:type", Date)
], PostSaleTicket.prototype, "assignedAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'resolved_at', type: 'timestamptz', nullable: true }),
__metadata("design:type", Date)
], PostSaleTicket.prototype, "resolvedAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'closed_at', type: 'timestamptz', nullable: true }),
__metadata("design:type", Date)
], PostSaleTicket.prototype, "closedAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'resolution_notes', type: 'text', nullable: true }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "resolutionNotes", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'resolution_photo_url', type: 'varchar', length: 500, nullable: true }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "resolutionPhotoUrl", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'satisfaction_rating', type: 'integer', nullable: true }),
__metadata("design:type", Number)
], PostSaleTicket.prototype, "satisfactionRating", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'satisfaction_comment', type: 'text', nullable: true }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "satisfactionComment", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'contact_name', type: 'varchar', length: 200, nullable: true }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "contactName", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'contact_phone', type: 'varchar', length: 20, nullable: true }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "contactPhone", void 0);
__decorate([
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'timestamptz' }),
__metadata("design:type", Date)
], PostSaleTicket.prototype, "createdAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'created_by', type: 'uuid', nullable: true }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "createdById", void 0);
__decorate([
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at', type: 'timestamptz' }),
__metadata("design:type", Date)
], PostSaleTicket.prototype, "updatedAt", void 0);
__decorate([
(0, typeorm_1.Column)({ name: 'updated_by', type: 'uuid', nullable: true }),
__metadata("design:type", String)
], PostSaleTicket.prototype, "updatedById", 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)
], PostSaleTicket.prototype, "tenant", void 0);
__decorate([
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
(0, typeorm_1.JoinColumn)({ name: 'created_by' }),
__metadata("design:type", user_entity_1.User)
], PostSaleTicket.prototype, "createdBy", void 0);
__decorate([
(0, typeorm_1.OneToMany)(() => ticket_assignment_entity_1.TicketAssignment, (ta) => ta.ticket),
__metadata("design:type", Array)
], PostSaleTicket.prototype, "assignments", void 0);
exports.PostSaleTicket = PostSaleTicket = __decorate([
(0, typeorm_1.Entity)({ schema: 'quality', name: 'post_sale_tickets' }),
(0, typeorm_1.Index)(['tenantId', 'ticketNumber'], { unique: true })
], PostSaleTicket);
//# sourceMappingURL=post-sale-ticket.entity.js.map