proflores-db-model 0.0.9 → 0.1.10
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.js +4 -12
- package/dist/entities/ExpenseTransaction.js +10 -8
- package/dist/entities/ProjectOrder.js +1 -1
- package/dist/entities/Transaction.js +0 -59
- package/dist/entities/User.js +3 -3
- package/dist/index.js +1 -3
- package/dist/types/ExpenseDetailType.js +2 -0
- package/dist/types/ExpenseTransactionType.js +2 -0
- package/dist/types/ExpenseTypeType.js +2 -0
- package/dist/types/ProjectOrderType.js +2 -0
- package/package.json +1 -1
- package/src/entities/ExpenseDetail.ts +4 -10
- package/src/entities/ExpenseTransaction.ts +20 -10
- package/src/entities/ProjectOrder.ts +1 -1
- package/src/entities/Transaction.ts +0 -36
- package/src/entities/User.ts +3 -3
- package/src/index.ts +0 -1
- package/src/types/ExpenseDetailType.ts +11 -0
- package/src/types/ExpenseTransactionType.ts +17 -0
- package/src/types/ExpenseTypeType.ts +6 -0
- package/src/types/ProjectOrderType.ts +11 -0
|
@@ -24,29 +24,21 @@ __decorate([
|
|
|
24
24
|
__metadata("design:type", ExpenseTransaction_1.ExpenseTransaction)
|
|
25
25
|
], ExpenseDetail.prototype, "expenseTransaction", void 0);
|
|
26
26
|
__decorate([
|
|
27
|
-
(0, typeorm_1.Column)("varchar"),
|
|
27
|
+
(0, typeorm_1.Column)("varchar", { nullable: false }),
|
|
28
28
|
__metadata("design:type", String)
|
|
29
29
|
], ExpenseDetail.prototype, "concept", void 0);
|
|
30
30
|
__decorate([
|
|
31
|
-
(0, typeorm_1.Column)("decimal"),
|
|
31
|
+
(0, typeorm_1.Column)("decimal", { nullable: false }),
|
|
32
32
|
__metadata("design:type", Number)
|
|
33
33
|
], ExpenseDetail.prototype, "quantity", void 0);
|
|
34
34
|
__decorate([
|
|
35
|
-
(0, typeorm_1.Column)("decimal"),
|
|
35
|
+
(0, typeorm_1.Column)("decimal", { nullable: false }),
|
|
36
36
|
__metadata("design:type", Number)
|
|
37
37
|
], ExpenseDetail.prototype, "unitPrice", void 0);
|
|
38
38
|
__decorate([
|
|
39
|
-
(0, typeorm_1.Column)("
|
|
40
|
-
__metadata("design:type", Number)
|
|
41
|
-
], ExpenseDetail.prototype, "subtotal", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, typeorm_1.Column)("date"),
|
|
39
|
+
(0, typeorm_1.Column)("date", { nullable: false }),
|
|
44
40
|
__metadata("design:type", Date)
|
|
45
41
|
], ExpenseDetail.prototype, "purchaseDate", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, typeorm_1.Column)("varchar"),
|
|
48
|
-
__metadata("design:type", String)
|
|
49
|
-
], ExpenseDetail.prototype, "expenseCategory", void 0);
|
|
50
42
|
ExpenseDetail = __decorate([
|
|
51
43
|
(0, typeorm_1.Entity)()
|
|
52
44
|
], ExpenseDetail);
|
|
@@ -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([
|
|
@@ -19,7 +19,7 @@ __decorate([
|
|
|
19
19
|
__metadata("design:type", Number)
|
|
20
20
|
], ProjectOrder.prototype, "projectId", void 0);
|
|
21
21
|
__decorate([
|
|
22
|
-
(0, typeorm_1.Column)("varchar"),
|
|
22
|
+
(0, typeorm_1.Column)("varchar", { nullable: false }),
|
|
23
23
|
__metadata("design:type", String)
|
|
24
24
|
], ProjectOrder.prototype, "name", void 0);
|
|
25
25
|
__decorate([
|
|
@@ -1,60 +1 @@
|
|
|
1
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.Transaction = void 0;
|
|
13
|
-
// src/entities/Transaction.ts
|
|
14
|
-
const typeorm_1 = require("typeorm");
|
|
15
|
-
const ProjectOrder_1 = require("./ProjectOrder");
|
|
16
|
-
const ExpenseType_1 = require("./ExpenseType");
|
|
17
|
-
let Transaction = class Transaction {
|
|
18
|
-
};
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
21
|
-
__metadata("design:type", Number)
|
|
22
|
-
], Transaction.prototype, "transactionId", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, typeorm_1.Column)("varchar"),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], Transaction.prototype, "bankId", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
(0, typeorm_1.Column)("decimal"),
|
|
29
|
-
__metadata("design:type", Number)
|
|
30
|
-
], Transaction.prototype, "amount", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, typeorm_1.Column)("date"),
|
|
33
|
-
__metadata("design:type", Date)
|
|
34
|
-
], Transaction.prototype, "transactionDate", void 0);
|
|
35
|
-
__decorate([
|
|
36
|
-
(0, typeorm_1.Column)("varchar"),
|
|
37
|
-
__metadata("design:type", String)
|
|
38
|
-
], Transaction.prototype, "paymentMethod", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
(0, typeorm_1.Column)("text"),
|
|
41
|
-
__metadata("design:type", String)
|
|
42
|
-
], Transaction.prototype, "description", void 0);
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, typeorm_1.Column)("varchar", { nullable: true }),
|
|
45
|
-
__metadata("design:type", String)
|
|
46
|
-
], Transaction.prototype, "mediaFile", void 0);
|
|
47
|
-
__decorate([
|
|
48
|
-
(0, typeorm_1.ManyToOne)(() => ProjectOrder_1.ProjectOrder),
|
|
49
|
-
(0, typeorm_1.JoinColumn)({ name: "projectId" }),
|
|
50
|
-
__metadata("design:type", ProjectOrder_1.ProjectOrder)
|
|
51
|
-
], Transaction.prototype, "projectOrder", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, typeorm_1.ManyToOne)(() => ExpenseType_1.ExpenseType),
|
|
54
|
-
(0, typeorm_1.JoinColumn)({ name: "expenseTypeId" }),
|
|
55
|
-
__metadata("design:type", ExpenseType_1.ExpenseType)
|
|
56
|
-
], Transaction.prototype, "expenseType", void 0);
|
|
57
|
-
Transaction = __decorate([
|
|
58
|
-
(0, typeorm_1.Entity)()
|
|
59
|
-
], Transaction);
|
|
60
|
-
exports.Transaction = Transaction;
|
package/dist/entities/User.js
CHANGED
|
@@ -31,15 +31,15 @@ __decorate([
|
|
|
31
31
|
__metadata("design:type", Object)
|
|
32
32
|
], User.prototype, "lastName", void 0);
|
|
33
33
|
__decorate([
|
|
34
|
-
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'varchar', unique: true, nullable: true }),
|
|
35
35
|
__metadata("design:type", Object)
|
|
36
36
|
], User.prototype, "googleId", void 0);
|
|
37
37
|
__decorate([
|
|
38
|
-
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'varchar', unique: true, nullable: true }),
|
|
39
39
|
__metadata("design:type", Object)
|
|
40
40
|
], User.prototype, "facebookId", void 0);
|
|
41
41
|
__decorate([
|
|
42
|
-
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'varchar', unique: true, nullable: true }),
|
|
43
43
|
__metadata("design:type", Object)
|
|
44
44
|
], User.prototype, "appleId", void 0);
|
|
45
45
|
__decorate([
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ExpenseTransaction = exports.User = exports.ProjectOrder = exports.ExpenseType = exports.ExpenseDetail =
|
|
4
|
-
var Transaction_1 = require("./entities/Transaction");
|
|
5
|
-
Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return Transaction_1.Transaction; } });
|
|
3
|
+
exports.ExpenseTransaction = exports.User = exports.ProjectOrder = exports.ExpenseType = exports.ExpenseDetail = void 0;
|
|
6
4
|
var ExpenseDetail_1 = require("./entities/ExpenseDetail");
|
|
7
5
|
Object.defineProperty(exports, "ExpenseDetail", { enumerable: true, get: function () { return ExpenseDetail_1.ExpenseDetail; } });
|
|
8
6
|
var ExpenseType_1 = require("./entities/ExpenseType");
|
package/package.json
CHANGED
|
@@ -10,21 +10,15 @@ export class ExpenseDetail implements ObjectLiteral {
|
|
|
10
10
|
@JoinColumn({ name: "expenseTransactionId" })
|
|
11
11
|
expenseTransaction!: ExpenseTransaction;
|
|
12
12
|
|
|
13
|
-
@Column("varchar")
|
|
13
|
+
@Column("varchar", { nullable: false })
|
|
14
14
|
concept!: string;
|
|
15
15
|
|
|
16
|
-
@Column("decimal")
|
|
16
|
+
@Column("decimal", { nullable: false })
|
|
17
17
|
quantity!: number;
|
|
18
18
|
|
|
19
|
-
@Column("decimal")
|
|
19
|
+
@Column("decimal", { nullable: false })
|
|
20
20
|
unitPrice!: number;
|
|
21
21
|
|
|
22
|
-
@Column("
|
|
23
|
-
subtotal!: number;
|
|
24
|
-
|
|
25
|
-
@Column("date")
|
|
22
|
+
@Column("date", { nullable: false })
|
|
26
23
|
purchaseDate!: Date;
|
|
27
|
-
|
|
28
|
-
@Column("varchar")
|
|
29
|
-
expenseCategory!: string;
|
|
30
24
|
}
|
|
@@ -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
|
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// src/entities/Transaction.ts
|
|
2
|
-
import { Entity, PrimaryGeneratedColumn, Column, ManyToOne, JoinColumn } from "typeorm";
|
|
3
|
-
import { ProjectOrder } from "./ProjectOrder";
|
|
4
|
-
import { ExpenseType } from "./ExpenseType";
|
|
5
|
-
|
|
6
|
-
@Entity()
|
|
7
|
-
export class Transaction {
|
|
8
|
-
@PrimaryGeneratedColumn("increment")
|
|
9
|
-
transactionId!: number;
|
|
10
|
-
|
|
11
|
-
@Column("varchar")
|
|
12
|
-
bankId!: string;
|
|
13
|
-
|
|
14
|
-
@Column("decimal")
|
|
15
|
-
amount!: number;
|
|
16
|
-
|
|
17
|
-
@Column("date")
|
|
18
|
-
transactionDate!: Date;
|
|
19
|
-
|
|
20
|
-
@Column("varchar")
|
|
21
|
-
paymentMethod!: string;
|
|
22
|
-
|
|
23
|
-
@Column("text")
|
|
24
|
-
description!: string;
|
|
25
|
-
|
|
26
|
-
@Column("varchar", { nullable: true })
|
|
27
|
-
mediaFile!: string;
|
|
28
|
-
|
|
29
|
-
@ManyToOne(() => ProjectOrder)
|
|
30
|
-
@JoinColumn({ name: "projectId" })
|
|
31
|
-
projectOrder!: ProjectOrder;
|
|
32
|
-
|
|
33
|
-
@ManyToOne(() => ExpenseType)
|
|
34
|
-
@JoinColumn({ name: "expenseTypeId" })
|
|
35
|
-
expenseType!: ExpenseType;
|
|
36
|
-
}
|
package/src/entities/User.ts
CHANGED
|
@@ -15,13 +15,13 @@ export class User implements ObjectLiteral {
|
|
|
15
15
|
@Column({ type: 'varchar', nullable: true })
|
|
16
16
|
lastName!: string | null;
|
|
17
17
|
|
|
18
|
-
@Column({ type: 'varchar', nullable: true })
|
|
18
|
+
@Column({ type: 'varchar', unique: true, nullable: true })
|
|
19
19
|
googleId!: string | null;
|
|
20
20
|
|
|
21
|
-
@Column({ type: 'varchar', nullable: true })
|
|
21
|
+
@Column({ type: 'varchar', unique: true, nullable: true })
|
|
22
22
|
facebookId!: string | null;
|
|
23
23
|
|
|
24
|
-
@Column({ type: 'varchar', nullable: true })
|
|
24
|
+
@Column({ type: 'varchar', unique: true, nullable: true })
|
|
25
25
|
appleId!: string | null;
|
|
26
26
|
|
|
27
27
|
@Column({ type: 'varchar', nullable: true })
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// types/ExpenseDetailType.ts
|
|
2
|
+
import { ExpenseTransactionType } from "./ExpenseTransactionType";
|
|
3
|
+
|
|
4
|
+
export interface ExpenseDetailType {
|
|
5
|
+
expenseDetailId: number;
|
|
6
|
+
expenseTransaction?: ExpenseTransactionType;
|
|
7
|
+
concept: string;
|
|
8
|
+
quantity: number;
|
|
9
|
+
unitPrice: number;
|
|
10
|
+
purchaseDate: Date;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ProjectOrderType } from "./ProjectOrderType";
|
|
2
|
+
import { ExpenseTypeType } from "./ExpenseTypeType";
|
|
3
|
+
import { ExpenseDetailType } from "./ExpenseDetailType";
|
|
4
|
+
|
|
5
|
+
export interface ExpenseTransactionType {
|
|
6
|
+
expenseTransactionId: number;
|
|
7
|
+
bankId: string;
|
|
8
|
+
amount: number;
|
|
9
|
+
transactionDate: Date;
|
|
10
|
+
paymentMethod: string;
|
|
11
|
+
description: string;
|
|
12
|
+
mediaFile?: string;
|
|
13
|
+
projectOrder?: ProjectOrderType;
|
|
14
|
+
expenseType?: ExpenseTypeType;
|
|
15
|
+
expenseDetails?: ExpenseDetailType[];
|
|
16
|
+
}
|
|
17
|
+
|