proflores-db-model 0.2.31 → 0.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/ExpenseDetail.d.ts +2 -0
- package/dist/entities/ExpenseDetail.js +6 -0
- package/dist/entities/ExpenseTransaction.d.ts +0 -2
- package/dist/entities/ExpenseTransaction.js +0 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/models/apu/Apu.d.ts +14 -0
- package/dist/models/apu/Apu.js +62 -0
- package/dist/models/apu/ApuItem.d.ts +12 -0
- package/dist/models/apu/ApuItem.js +55 -0
- package/dist/models/apu/Budget.d.ts +15 -0
- package/dist/models/apu/Budget.js +64 -0
- package/dist/models/apu/BudgetItem.d.ts +14 -0
- package/dist/models/apu/BudgetItem.js +59 -0
- package/dist/models/apu/Client.d.ts +15 -0
- package/dist/models/apu/Client.js +68 -0
- package/dist/models/apu/Company.d.ts +16 -0
- package/dist/models/apu/Company.js +72 -0
- package/dist/models/apu/Concept.d.ts +15 -0
- package/dist/models/apu/Concept.js +61 -0
- package/dist/models/apu/PriceList.d.ts +12 -0
- package/dist/models/apu/PriceList.js +54 -0
- package/dist/models/apu/Project.d.ts +19 -0
- package/dist/models/apu/Project.js +82 -0
- package/dist/models/apu/Resource.d.ts +16 -0
- package/dist/models/apu/Resource.js +66 -0
- package/dist/models/apu/ResourcePrice.d.ts +13 -0
- package/dist/models/apu/ResourcePrice.js +56 -0
- package/dist/models/apu/enums/resource-type.enum.d.ts +9 -0
- package/dist/models/apu/enums/resource-type.enum.js +13 -0
- package/dist/models/apu/index.d.ts +12 -0
- package/dist/models/apu/index.js +27 -0
- package/package.json +1 -1
- package/src/entities/ExpenseDetail.ts +5 -0
- package/src/entities/ExpenseTransaction.ts +0 -5
- package/src/entities/ProjectOrder.ts +4 -1
- package/src/index.ts +2 -1
- package/src/models/apu/Apu.ts +40 -0
- package/src/models/apu/ApuItem.ts +35 -0
- package/src/models/apu/Budget.ts +41 -0
- package/src/models/apu/BudgetItem.ts +38 -0
- package/src/models/apu/Client.ts +41 -0
- package/src/models/apu/Company.ts +44 -0
- package/src/models/apu/Concept.ts +39 -0
- package/src/models/apu/PriceList.ts +34 -0
- package/src/models/apu/Project.ts +55 -0
- package/src/models/apu/Resource.ts +44 -0
- package/src/models/apu/ResourcePrice.ts +35 -0
- package/src/models/apu/enums/resource-type.enum.ts +9 -0
- package/src/models/apu/index.ts +12 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ObjectLiteral } from "typeorm";
|
|
2
2
|
import { ExpenseTransaction } from "./ExpenseTransaction";
|
|
3
3
|
import { Inventory } from "./Inventory";
|
|
4
|
+
import { ProjectOrder } from "./ProjectOrder";
|
|
4
5
|
export declare class ExpenseDetail implements ObjectLiteral {
|
|
5
6
|
expenseDetailId: number;
|
|
6
7
|
expenseTransaction: ExpenseTransaction;
|
|
@@ -10,4 +11,5 @@ export declare class ExpenseDetail implements ObjectLiteral {
|
|
|
10
11
|
unitPrice: number;
|
|
11
12
|
purchaseDate: Date;
|
|
12
13
|
isActive: boolean;
|
|
14
|
+
projectOrder?: ProjectOrder;
|
|
13
15
|
}
|
|
@@ -13,6 +13,7 @@ exports.ExpenseDetail = void 0;
|
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const ExpenseTransaction_1 = require("./ExpenseTransaction");
|
|
15
15
|
const Inventory_1 = require("./Inventory");
|
|
16
|
+
const ProjectOrder_1 = require("./ProjectOrder");
|
|
16
17
|
let ExpenseDetail = class ExpenseDetail {
|
|
17
18
|
};
|
|
18
19
|
exports.ExpenseDetail = ExpenseDetail;
|
|
@@ -53,6 +54,11 @@ __decorate([
|
|
|
53
54
|
(0, typeorm_1.Column)("boolean", { default: true }),
|
|
54
55
|
__metadata("design:type", Boolean)
|
|
55
56
|
], ExpenseDetail.prototype, "isActive", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.ManyToOne)(() => ProjectOrder_1.ProjectOrder, { nullable: false }),
|
|
59
|
+
(0, typeorm_1.JoinColumn)({ name: "projectId" }),
|
|
60
|
+
__metadata("design:type", ProjectOrder_1.ProjectOrder)
|
|
61
|
+
], ExpenseDetail.prototype, "projectOrder", void 0);
|
|
56
62
|
exports.ExpenseDetail = ExpenseDetail = __decorate([
|
|
57
63
|
(0, typeorm_1.Entity)()
|
|
58
64
|
], ExpenseDetail);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ObjectLiteral } from "typeorm";
|
|
2
|
-
import { ProjectOrder } from "./ProjectOrder";
|
|
3
2
|
import { ExpenseType } from "./ExpenseType";
|
|
4
3
|
import { ExpenseDetail } from "./ExpenseDetail";
|
|
5
4
|
import { TransactionBank } from "./Bank/TransactionBank";
|
|
@@ -11,7 +10,6 @@ export declare class ExpenseTransaction implements ObjectLiteral {
|
|
|
11
10
|
paymentMethod: string;
|
|
12
11
|
description: string;
|
|
13
12
|
mediaFile: string;
|
|
14
|
-
projectOrder: ProjectOrder;
|
|
15
13
|
expenseType: ExpenseType;
|
|
16
14
|
expenseDetails?: ExpenseDetail[];
|
|
17
15
|
transactionBank?: TransactionBank;
|
|
@@ -12,7 +12,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ExpenseTransaction = void 0;
|
|
13
13
|
// src/entities/ExpenseTransaction.ts
|
|
14
14
|
const typeorm_1 = require("typeorm");
|
|
15
|
-
const ProjectOrder_1 = require("./ProjectOrder");
|
|
16
15
|
const ExpenseType_1 = require("./ExpenseType");
|
|
17
16
|
const ExpenseDetail_1 = require("./ExpenseDetail");
|
|
18
17
|
const TransactionBank_1 = require("./Bank/TransactionBank");
|
|
@@ -47,11 +46,6 @@ __decorate([
|
|
|
47
46
|
(0, typeorm_1.Column)("varchar", { nullable: true }),
|
|
48
47
|
__metadata("design:type", String)
|
|
49
48
|
], ExpenseTransaction.prototype, "mediaFile", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, typeorm_1.ManyToOne)(() => ProjectOrder_1.ProjectOrder, { nullable: false }),
|
|
52
|
-
(0, typeorm_1.JoinColumn)({ name: "projectId" }),
|
|
53
|
-
__metadata("design:type", ProjectOrder_1.ProjectOrder)
|
|
54
|
-
], ExpenseTransaction.prototype, "projectOrder", void 0);
|
|
55
49
|
__decorate([
|
|
56
50
|
(0, typeorm_1.ManyToOne)(() => ExpenseType_1.ExpenseType, { nullable: false }),
|
|
57
51
|
(0, typeorm_1.JoinColumn)({ name: "expenseTypeId" }),
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -59,3 +59,4 @@ var InventoryImage_1 = require("./entities/InventoryImage");
|
|
|
59
59
|
Object.defineProperty(exports, "InventoryImage", { enumerable: true, get: function () { return InventoryImage_1.InventoryImage; } });
|
|
60
60
|
__exportStar(require("./types"), exports);
|
|
61
61
|
__exportStar(require("./models/technical-sheet"), exports);
|
|
62
|
+
__exportStar(require("./models/apu"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { Concept } from "./Concept";
|
|
3
|
+
import { ApuItem } from "./ApuItem";
|
|
4
|
+
export declare class Apu implements ObjectLiteral {
|
|
5
|
+
idApu: number;
|
|
6
|
+
concept: Concept;
|
|
7
|
+
version: number;
|
|
8
|
+
validFrom: string;
|
|
9
|
+
validTo?: string | null;
|
|
10
|
+
indirectPct: number;
|
|
11
|
+
profitPct: number;
|
|
12
|
+
notes?: string | null;
|
|
13
|
+
items?: ApuItem[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Apu = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const Concept_1 = require("./Concept");
|
|
15
|
+
const ApuItem_1 = require("./ApuItem");
|
|
16
|
+
let Apu = class Apu {
|
|
17
|
+
};
|
|
18
|
+
exports.Apu = Apu;
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
21
|
+
__metadata("design:type", Number)
|
|
22
|
+
], Apu.prototype, "idApu", void 0);
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.ManyToOne)(() => Concept_1.Concept, { nullable: false, onDelete: "CASCADE" }),
|
|
25
|
+
(0, typeorm_1.JoinColumn)({ name: "idConcept" }),
|
|
26
|
+
__metadata("design:type", Concept_1.Concept)
|
|
27
|
+
], Apu.prototype, "concept", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)("int"),
|
|
30
|
+
__metadata("design:type", Number)
|
|
31
|
+
], Apu.prototype, "version", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)("date"),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], Apu.prototype, "validFrom", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)("date", { nullable: true }),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], Apu.prototype, "validTo", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)("decimal", { precision: 5, scale: 4, default: 0 }),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], Apu.prototype, "indirectPct", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)("decimal", { precision: 5, scale: 4, default: 0 }),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], Apu.prototype, "profitPct", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], Apu.prototype, "notes", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.OneToMany)(() => ApuItem_1.ApuItem, (ai) => ai.apu, { cascade: true }),
|
|
54
|
+
__metadata("design:type", Array)
|
|
55
|
+
], Apu.prototype, "items", void 0);
|
|
56
|
+
exports.Apu = Apu = __decorate([
|
|
57
|
+
(0, typeorm_1.Entity)("apu"),
|
|
58
|
+
(0, typeorm_1.Unique)("uq_apu_concept_version", ["concept", "version"]),
|
|
59
|
+
(0, typeorm_1.Check)(`"indirectPct" >= 0 AND "indirectPct" <= 1`),
|
|
60
|
+
(0, typeorm_1.Check)(`"profitPct" >= 0 AND "profitPct" <= 1`),
|
|
61
|
+
(0, typeorm_1.Index)(["concept", "version"])
|
|
62
|
+
], Apu);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { Apu } from "./Apu";
|
|
3
|
+
import { Resource } from "./Resource";
|
|
4
|
+
export declare class ApuItem implements ObjectLiteral {
|
|
5
|
+
idApuItem: number;
|
|
6
|
+
apu: Apu;
|
|
7
|
+
resource: Resource;
|
|
8
|
+
quantity: number;
|
|
9
|
+
wastePct: number;
|
|
10
|
+
sortOrder: number;
|
|
11
|
+
notes?: string | null;
|
|
12
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ApuItem = void 0;
|
|
13
|
+
// apu/entities/ApuItem.ts
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const Apu_1 = require("./Apu");
|
|
16
|
+
const Resource_1 = require("./Resource");
|
|
17
|
+
let ApuItem = class ApuItem {
|
|
18
|
+
};
|
|
19
|
+
exports.ApuItem = ApuItem;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], ApuItem.prototype, "idApuItem", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.ManyToOne)(() => Apu_1.Apu, { nullable: false, onDelete: "CASCADE" }),
|
|
26
|
+
(0, typeorm_1.JoinColumn)({ name: "idApu" }),
|
|
27
|
+
__metadata("design:type", Apu_1.Apu)
|
|
28
|
+
], ApuItem.prototype, "apu", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.ManyToOne)(() => Resource_1.Resource, { nullable: false }),
|
|
31
|
+
(0, typeorm_1.JoinColumn)({ name: "idResource" }),
|
|
32
|
+
__metadata("design:type", Resource_1.Resource)
|
|
33
|
+
], ApuItem.prototype, "resource", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)("decimal", { precision: 18, scale: 6 }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], ApuItem.prototype, "quantity", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)("decimal", { precision: 5, scale: 4, default: 0 }),
|
|
40
|
+
__metadata("design:type", Number)
|
|
41
|
+
], ApuItem.prototype, "wastePct", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)("int", { default: 0 }),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], ApuItem.prototype, "sortOrder", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], ApuItem.prototype, "notes", void 0);
|
|
50
|
+
exports.ApuItem = ApuItem = __decorate([
|
|
51
|
+
(0, typeorm_1.Entity)("apu_items"),
|
|
52
|
+
(0, typeorm_1.Unique)("uq_apu_item_unique", ["apu", "resource"]),
|
|
53
|
+
(0, typeorm_1.Check)(`"wastePct" >= 0 AND "wastePct" <= 1`),
|
|
54
|
+
(0, typeorm_1.Index)(["apu"])
|
|
55
|
+
], ApuItem);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { Project } from "./Project";
|
|
3
|
+
import { BudgetItem } from "./BudgetItem";
|
|
4
|
+
export declare class Budget implements ObjectLiteral {
|
|
5
|
+
idBudget: number;
|
|
6
|
+
project: Project;
|
|
7
|
+
code?: string | null;
|
|
8
|
+
title: string;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
currency: string;
|
|
11
|
+
vatPct: number;
|
|
12
|
+
status: "DRAFT" | "SENT" | "APPROVED" | "REJECTED" | "BILLED" | string;
|
|
13
|
+
notes?: string | null;
|
|
14
|
+
items?: BudgetItem[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Budget = void 0;
|
|
13
|
+
// apu/entities/Budget.ts
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const Project_1 = require("./Project");
|
|
16
|
+
const BudgetItem_1 = require("./BudgetItem");
|
|
17
|
+
let Budget = class Budget {
|
|
18
|
+
};
|
|
19
|
+
exports.Budget = Budget;
|
|
20
|
+
__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
22
|
+
__metadata("design:type", Number)
|
|
23
|
+
], Budget.prototype, "idBudget", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, typeorm_1.ManyToOne)(() => Project_1.Project, { nullable: false, onDelete: "CASCADE" }),
|
|
26
|
+
(0, typeorm_1.JoinColumn)({ name: "idProject" }),
|
|
27
|
+
__metadata("design:type", Project_1.Project)
|
|
28
|
+
], Budget.prototype, "project", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)("varchar", { length: 64, nullable: true, unique: true }),
|
|
31
|
+
__metadata("design:type", Object)
|
|
32
|
+
], Budget.prototype, "code", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)("varchar", { length: 255 }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], Budget.prototype, "title", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.CreateDateColumn)({ type: "timestamp" }),
|
|
39
|
+
__metadata("design:type", Date)
|
|
40
|
+
], Budget.prototype, "createdAt", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)("varchar", { length: 3, default: "MXN" }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], Budget.prototype, "currency", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)("decimal", { precision: 5, scale: 4, default: 0.16 }),
|
|
47
|
+
__metadata("design:type", Number)
|
|
48
|
+
], Budget.prototype, "vatPct", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)("varchar", { length: 32, default: "DRAFT" }),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], Budget.prototype, "status", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], Budget.prototype, "notes", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.OneToMany)(() => BudgetItem_1.BudgetItem, (bi) => bi.budget, { cascade: true }),
|
|
59
|
+
__metadata("design:type", Array)
|
|
60
|
+
], Budget.prototype, "items", void 0);
|
|
61
|
+
exports.Budget = Budget = __decorate([
|
|
62
|
+
(0, typeorm_1.Entity)("budgets"),
|
|
63
|
+
(0, typeorm_1.Index)(["project"])
|
|
64
|
+
], Budget);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { Budget } from "./Budget";
|
|
3
|
+
import { Concept } from "./Concept";
|
|
4
|
+
import { Apu } from "./Apu";
|
|
5
|
+
export declare class BudgetItem implements ObjectLiteral {
|
|
6
|
+
idBudgetItem: number;
|
|
7
|
+
budget: Budget;
|
|
8
|
+
concept: Concept;
|
|
9
|
+
apu: Apu;
|
|
10
|
+
quantity: number;
|
|
11
|
+
unitPriceSnapshot?: number | null;
|
|
12
|
+
notes?: string | null;
|
|
13
|
+
sortOrder: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.BudgetItem = void 0;
|
|
13
|
+
// apu/entities/BudgetItem.ts
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const Budget_1 = require("./Budget");
|
|
16
|
+
const Concept_1 = require("./Concept");
|
|
17
|
+
const Apu_1 = require("./Apu");
|
|
18
|
+
let BudgetItem = class BudgetItem {
|
|
19
|
+
};
|
|
20
|
+
exports.BudgetItem = BudgetItem;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], BudgetItem.prototype, "idBudgetItem", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.ManyToOne)(() => Budget_1.Budget, { nullable: false, onDelete: "CASCADE" }),
|
|
27
|
+
(0, typeorm_1.JoinColumn)({ name: "idBudget" }),
|
|
28
|
+
__metadata("design:type", Budget_1.Budget)
|
|
29
|
+
], BudgetItem.prototype, "budget", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.ManyToOne)(() => Concept_1.Concept, { nullable: false, onDelete: "RESTRICT" }),
|
|
32
|
+
(0, typeorm_1.JoinColumn)({ name: "idConcept" }),
|
|
33
|
+
__metadata("design:type", Concept_1.Concept)
|
|
34
|
+
], BudgetItem.prototype, "concept", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, typeorm_1.ManyToOne)(() => Apu_1.Apu, { nullable: false, onDelete: "RESTRICT" }),
|
|
37
|
+
(0, typeorm_1.JoinColumn)({ name: "idApu" }),
|
|
38
|
+
__metadata("design:type", Apu_1.Apu)
|
|
39
|
+
], BudgetItem.prototype, "apu", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)("decimal", { precision: 18, scale: 6 }),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], BudgetItem.prototype, "quantity", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)("decimal", { precision: 14, scale: 4, nullable: true }),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], BudgetItem.prototype, "unitPriceSnapshot", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], BudgetItem.prototype, "notes", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)("int", { default: 0 }),
|
|
54
|
+
__metadata("design:type", Number)
|
|
55
|
+
], BudgetItem.prototype, "sortOrder", void 0);
|
|
56
|
+
exports.BudgetItem = BudgetItem = __decorate([
|
|
57
|
+
(0, typeorm_1.Entity)("budget_items"),
|
|
58
|
+
(0, typeorm_1.Index)(["budget"])
|
|
59
|
+
], BudgetItem);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
export declare class Client implements ObjectLiteral {
|
|
3
|
+
idClient: number;
|
|
4
|
+
displayName: string;
|
|
5
|
+
legalName?: string | null;
|
|
6
|
+
rfc?: string | null;
|
|
7
|
+
phone?: string | null;
|
|
8
|
+
email?: string | null;
|
|
9
|
+
addressLine1?: string | null;
|
|
10
|
+
addressLine2?: string | null;
|
|
11
|
+
city?: string | null;
|
|
12
|
+
state?: string | null;
|
|
13
|
+
country?: string | null;
|
|
14
|
+
postalCode?: string | null;
|
|
15
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Client = void 0;
|
|
13
|
+
// apu/entities/Client.ts
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
let Client = class Client {
|
|
16
|
+
};
|
|
17
|
+
exports.Client = Client;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], Client.prototype, "idClient", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)("varchar", { length: 255 }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], Client.prototype, "displayName", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: true }),
|
|
28
|
+
__metadata("design:type", Object)
|
|
29
|
+
], Client.prototype, "legalName", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)("varchar", { length: 32, nullable: true }),
|
|
32
|
+
__metadata("design:type", Object)
|
|
33
|
+
], Client.prototype, "rfc", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)("varchar", { length: 64, nullable: true }),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], Client.prototype, "phone", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: true }),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], Client.prototype, "email", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: true }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], Client.prototype, "addressLine1", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: true }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], Client.prototype, "addressLine2", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)("varchar", { length: 128, nullable: true }),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], Client.prototype, "city", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)("varchar", { length: 128, nullable: true }),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], Client.prototype, "state", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)("varchar", { length: 128, nullable: true }),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], Client.prototype, "country", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)("varchar", { length: 16, nullable: true }),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], Client.prototype, "postalCode", void 0);
|
|
66
|
+
exports.Client = Client = __decorate([
|
|
67
|
+
(0, typeorm_1.Entity)("clients")
|
|
68
|
+
], Client);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
export declare class Company implements ObjectLiteral {
|
|
3
|
+
idCompany: number;
|
|
4
|
+
displayName: string;
|
|
5
|
+
legalName?: string | null;
|
|
6
|
+
rfc?: string | null;
|
|
7
|
+
phone?: string | null;
|
|
8
|
+
email?: string | null;
|
|
9
|
+
website?: string | null;
|
|
10
|
+
addressLine1?: string | null;
|
|
11
|
+
addressLine2?: string | null;
|
|
12
|
+
city?: string | null;
|
|
13
|
+
state?: string | null;
|
|
14
|
+
country?: string | null;
|
|
15
|
+
postalCode?: string | null;
|
|
16
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Company = void 0;
|
|
13
|
+
// apu/entities/Company.ts
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
let Company = class Company {
|
|
16
|
+
};
|
|
17
|
+
exports.Company = Company;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], Company.prototype, "idCompany", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.Column)("varchar", { length: 255 }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], Company.prototype, "displayName", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: true }),
|
|
28
|
+
__metadata("design:type", Object)
|
|
29
|
+
], Company.prototype, "legalName", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)("varchar", { length: 32, nullable: true }),
|
|
32
|
+
__metadata("design:type", Object)
|
|
33
|
+
], Company.prototype, "rfc", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)("varchar", { length: 64, nullable: true }),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], Company.prototype, "phone", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: true }),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], Company.prototype, "email", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: true }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], Company.prototype, "website", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: true }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], Company.prototype, "addressLine1", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)("varchar", { length: 255, nullable: true }),
|
|
52
|
+
__metadata("design:type", Object)
|
|
53
|
+
], Company.prototype, "addressLine2", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)("varchar", { length: 128, nullable: true }),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], Company.prototype, "city", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)("varchar", { length: 128, nullable: true }),
|
|
60
|
+
__metadata("design:type", Object)
|
|
61
|
+
], Company.prototype, "state", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)("varchar", { length: 128, nullable: true }),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], Company.prototype, "country", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.Column)("varchar", { length: 16, nullable: true }),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], Company.prototype, "postalCode", void 0);
|
|
70
|
+
exports.Company = Company = __decorate([
|
|
71
|
+
(0, typeorm_1.Entity)("companies")
|
|
72
|
+
], Company);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { UnitOfMeasure } from "../../entities/UnitOfMesure";
|
|
3
|
+
import { Apu } from "./Apu";
|
|
4
|
+
import { BudgetItem } from "./BudgetItem";
|
|
5
|
+
export declare class Concept implements ObjectLiteral {
|
|
6
|
+
idConcept: number;
|
|
7
|
+
code?: string | null;
|
|
8
|
+
title: string;
|
|
9
|
+
description?: string | null;
|
|
10
|
+
unit: UnitOfMeasure;
|
|
11
|
+
category?: string | null;
|
|
12
|
+
isActive: boolean;
|
|
13
|
+
apus?: Apu[];
|
|
14
|
+
budgetItems?: BudgetItem[];
|
|
15
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Concept = void 0;
|
|
13
|
+
// apu/entities/Concept.ts
|
|
14
|
+
const typeorm_1 = require("typeorm");
|
|
15
|
+
const UnitOfMesure_1 = require("../../entities/UnitOfMesure"); // <-- ajusta tu ruta real
|
|
16
|
+
const Apu_1 = require("./Apu");
|
|
17
|
+
const BudgetItem_1 = require("./BudgetItem");
|
|
18
|
+
let Concept = class Concept {
|
|
19
|
+
};
|
|
20
|
+
exports.Concept = Concept;
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], Concept.prototype, "idConcept", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)("varchar", { length: 64, nullable: true, unique: true }),
|
|
27
|
+
__metadata("design:type", Object)
|
|
28
|
+
], Concept.prototype, "code", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)("varchar", { length: 255 }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], Concept.prototype, "title", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)("text", { nullable: true }),
|
|
35
|
+
__metadata("design:type", Object)
|
|
36
|
+
], Concept.prototype, "description", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.ManyToOne)(() => UnitOfMesure_1.UnitOfMeasure, { nullable: false }),
|
|
39
|
+
(0, typeorm_1.JoinColumn)({ name: "idUnitOfMeasure" }),
|
|
40
|
+
__metadata("design:type", UnitOfMesure_1.UnitOfMeasure)
|
|
41
|
+
], Concept.prototype, "unit", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)("varchar", { length: 64, nullable: true }),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], Concept.prototype, "category", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: "boolean", default: true }),
|
|
48
|
+
__metadata("design:type", Boolean)
|
|
49
|
+
], Concept.prototype, "isActive", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.OneToMany)(() => Apu_1.Apu, (a) => a.concept, { cascade: true }),
|
|
52
|
+
__metadata("design:type", Array)
|
|
53
|
+
], Concept.prototype, "apus", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.OneToMany)(() => BudgetItem_1.BudgetItem, (bi) => bi.concept),
|
|
56
|
+
__metadata("design:type", Array)
|
|
57
|
+
], Concept.prototype, "budgetItems", void 0);
|
|
58
|
+
exports.Concept = Concept = __decorate([
|
|
59
|
+
(0, typeorm_1.Entity)("concepts"),
|
|
60
|
+
(0, typeorm_1.Index)(["code"], { unique: true })
|
|
61
|
+
], Concept);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { ResourcePrice } from "./ResourcePrice";
|
|
3
|
+
export declare class PriceList implements ObjectLiteral {
|
|
4
|
+
idPriceList: number;
|
|
5
|
+
name: string;
|
|
6
|
+
region?: string | null;
|
|
7
|
+
currency: string;
|
|
8
|
+
validFrom: string;
|
|
9
|
+
validTo?: string | null;
|
|
10
|
+
isDefault: boolean;
|
|
11
|
+
resourcePrices?: ResourcePrice[];
|
|
12
|
+
}
|