proflores-db-model 0.0.9 → 0.1.9
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.
|
@@ -22,23 +22,23 @@ __decorate([
|
|
|
22
22
|
__metadata("design:type", Number)
|
|
23
23
|
], ExpenseTransaction.prototype, "expenseTransactionId", void 0);
|
|
24
24
|
__decorate([
|
|
25
|
-
(0, typeorm_1.Column)("varchar"),
|
|
25
|
+
(0, typeorm_1.Column)("varchar", { nullable: false }),
|
|
26
26
|
__metadata("design:type", String)
|
|
27
27
|
], ExpenseTransaction.prototype, "bankId", void 0);
|
|
28
28
|
__decorate([
|
|
29
|
-
(0, typeorm_1.Column)("decimal"),
|
|
29
|
+
(0, typeorm_1.Column)("decimal", { nullable: false }),
|
|
30
30
|
__metadata("design:type", Number)
|
|
31
31
|
], ExpenseTransaction.prototype, "amount", void 0);
|
|
32
32
|
__decorate([
|
|
33
|
-
(0, typeorm_1.Column)("date"),
|
|
33
|
+
(0, typeorm_1.Column)("date", { nullable: false }),
|
|
34
34
|
__metadata("design:type", Date)
|
|
35
35
|
], ExpenseTransaction.prototype, "transactionDate", void 0);
|
|
36
36
|
__decorate([
|
|
37
|
-
(0, typeorm_1.Column)("varchar"),
|
|
37
|
+
(0, typeorm_1.Column)("varchar", { nullable: false }),
|
|
38
38
|
__metadata("design:type", String)
|
|
39
39
|
], ExpenseTransaction.prototype, "paymentMethod", void 0);
|
|
40
40
|
__decorate([
|
|
41
|
-
(0, typeorm_1.Column)("text"),
|
|
41
|
+
(0, typeorm_1.Column)("text", { nullable: false }),
|
|
42
42
|
__metadata("design:type", String)
|
|
43
43
|
], ExpenseTransaction.prototype, "description", void 0);
|
|
44
44
|
__decorate([
|
|
@@ -46,17 +46,19 @@ __decorate([
|
|
|
46
46
|
__metadata("design:type", String)
|
|
47
47
|
], ExpenseTransaction.prototype, "mediaFile", void 0);
|
|
48
48
|
__decorate([
|
|
49
|
-
(0, typeorm_1.ManyToOne)(() => ProjectOrder_1.ProjectOrder),
|
|
49
|
+
(0, typeorm_1.ManyToOne)(() => ProjectOrder_1.ProjectOrder, { nullable: false }),
|
|
50
50
|
(0, typeorm_1.JoinColumn)({ name: "projectId" }),
|
|
51
51
|
__metadata("design:type", ProjectOrder_1.ProjectOrder)
|
|
52
52
|
], ExpenseTransaction.prototype, "projectOrder", void 0);
|
|
53
53
|
__decorate([
|
|
54
|
-
(0, typeorm_1.ManyToOne)(() => ExpenseType_1.ExpenseType),
|
|
54
|
+
(0, typeorm_1.ManyToOne)(() => ExpenseType_1.ExpenseType, { nullable: false }),
|
|
55
55
|
(0, typeorm_1.JoinColumn)({ name: "expenseTypeId" }),
|
|
56
56
|
__metadata("design:type", ExpenseType_1.ExpenseType)
|
|
57
57
|
], ExpenseTransaction.prototype, "expenseType", void 0);
|
|
58
58
|
__decorate([
|
|
59
|
-
(0, typeorm_1.OneToMany)(() => ExpenseDetail_1.ExpenseDetail, detail => detail.expenseTransaction, {
|
|
59
|
+
(0, typeorm_1.OneToMany)(() => ExpenseDetail_1.ExpenseDetail, (detail) => detail.expenseTransaction, {
|
|
60
|
+
cascade: true,
|
|
61
|
+
}),
|
|
60
62
|
__metadata("design:type", Array)
|
|
61
63
|
], ExpenseTransaction.prototype, "expenseDetails", void 0);
|
|
62
64
|
ExpenseTransaction = __decorate([
|
package/package.json
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
// src/entities/ExpenseTransaction.ts
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
Entity,
|
|
4
|
+
PrimaryGeneratedColumn,
|
|
5
|
+
Column,
|
|
6
|
+
ManyToOne,
|
|
7
|
+
JoinColumn,
|
|
8
|
+
OneToMany,
|
|
9
|
+
ObjectLiteral,
|
|
10
|
+
} from "typeorm";
|
|
3
11
|
import { ProjectOrder } from "./ProjectOrder";
|
|
4
12
|
import { ExpenseType } from "./ExpenseType";
|
|
5
13
|
import { ExpenseDetail } from "./ExpenseDetail";
|
|
@@ -9,32 +17,34 @@ export class ExpenseTransaction implements ObjectLiteral {
|
|
|
9
17
|
@PrimaryGeneratedColumn("increment")
|
|
10
18
|
expenseTransactionId!: number;
|
|
11
19
|
|
|
12
|
-
@Column("varchar")
|
|
20
|
+
@Column("varchar", { nullable: false })
|
|
13
21
|
bankId!: string;
|
|
14
22
|
|
|
15
|
-
@Column("decimal")
|
|
23
|
+
@Column("decimal", { nullable: false })
|
|
16
24
|
amount!: number;
|
|
17
25
|
|
|
18
|
-
@Column("date")
|
|
26
|
+
@Column("date", { nullable: false })
|
|
19
27
|
transactionDate!: Date;
|
|
20
28
|
|
|
21
|
-
@Column("varchar")
|
|
29
|
+
@Column("varchar", { nullable: false })
|
|
22
30
|
paymentMethod!: string;
|
|
23
31
|
|
|
24
|
-
@Column("text")
|
|
32
|
+
@Column("text", { nullable: false })
|
|
25
33
|
description!: string;
|
|
26
34
|
|
|
27
|
-
@Column("varchar", { nullable: true })
|
|
35
|
+
@Column("varchar", { nullable: true })
|
|
28
36
|
mediaFile!: string;
|
|
29
37
|
|
|
30
|
-
@ManyToOne(() => ProjectOrder)
|
|
38
|
+
@ManyToOne(() => ProjectOrder, { nullable: false })
|
|
31
39
|
@JoinColumn({ name: "projectId" })
|
|
32
40
|
projectOrder!: ProjectOrder;
|
|
33
41
|
|
|
34
|
-
@ManyToOne(() => ExpenseType)
|
|
42
|
+
@ManyToOne(() => ExpenseType, { nullable: false })
|
|
35
43
|
@JoinColumn({ name: "expenseTypeId" })
|
|
36
44
|
expenseType!: ExpenseType;
|
|
37
45
|
|
|
38
|
-
@OneToMany(() => ExpenseDetail, detail => detail.expenseTransaction, {
|
|
46
|
+
@OneToMany(() => ExpenseDetail, (detail) => detail.expenseTransaction, {
|
|
47
|
+
cascade: true,
|
|
48
|
+
})
|
|
39
49
|
expenseDetails!: ExpenseDetail[];
|
|
40
50
|
}
|