proflores-db-model 0.1.20 → 0.1.22
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/Bank/BankAccount.d.ts +9 -0
- package/dist/entities/Bank/BankAccount.js +40 -0
- package/dist/entities/Bank/TransactionBank.d.ts +9 -0
- package/dist/entities/Bank/TransactionBank.js +42 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -1
- package/package.json +1 -1
- package/proflores-db-model@0.1.21 +0 -0
- package/src/entities/Bank/BankAccount.ts +20 -0
- package/src/entities/Bank/TransactionBank.ts +29 -0
- package/src/index.ts +2 -0
- package/yarn +0 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { TransactionBank } from "./TransactionBank";
|
|
3
|
+
export declare class BankAccount implements ObjectLiteral {
|
|
4
|
+
idBankAccount: number;
|
|
5
|
+
name: string;
|
|
6
|
+
accountNumber: string;
|
|
7
|
+
initialBalance: number;
|
|
8
|
+
transactions: TransactionBank[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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.BankAccount = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const TransactionBank_1 = require("./TransactionBank");
|
|
15
|
+
let BankAccount = class BankAccount {
|
|
16
|
+
};
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
19
|
+
__metadata("design:type", Number)
|
|
20
|
+
], BankAccount.prototype, "idBankAccount", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)("varchar", { nullable: false }),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], BankAccount.prototype, "name", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)("varchar", { nullable: false, unique: true }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], BankAccount.prototype, "accountNumber", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)("decimal", { nullable: false }),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], BankAccount.prototype, "initialBalance", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.OneToMany)(() => TransactionBank_1.TransactionBank, (transaction) => transaction.bankAccount),
|
|
35
|
+
__metadata("design:type", Array)
|
|
36
|
+
], BankAccount.prototype, "transactions", void 0);
|
|
37
|
+
BankAccount = __decorate([
|
|
38
|
+
(0, typeorm_1.Entity)("bank_accounts")
|
|
39
|
+
], BankAccount);
|
|
40
|
+
exports.BankAccount = BankAccount;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ObjectLiteral } from "typeorm";
|
|
2
|
+
import { BankAccount } from "./BankAccount";
|
|
3
|
+
export declare class TransactionBank implements ObjectLiteral {
|
|
4
|
+
idTransactionBank: number;
|
|
5
|
+
amount: number;
|
|
6
|
+
type: "INCOME" | "EXPENSE";
|
|
7
|
+
transactionDate: Date;
|
|
8
|
+
bankAccount: BankAccount;
|
|
9
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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.TransactionBank = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BankAccount_1 = require("./BankAccount");
|
|
15
|
+
let TransactionBank = class TransactionBank {
|
|
16
|
+
};
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryGeneratedColumn)("increment"),
|
|
19
|
+
__metadata("design:type", Number)
|
|
20
|
+
], TransactionBank.prototype, "idTransactionBank", void 0);
|
|
21
|
+
__decorate([
|
|
22
|
+
(0, typeorm_1.Column)("decimal", { nullable: false }),
|
|
23
|
+
__metadata("design:type", Number)
|
|
24
|
+
], TransactionBank.prototype, "amount", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)("enum", { nullable: false, enum: ["INCOME", "EXPENSE"] }),
|
|
27
|
+
__metadata("design:type", String)
|
|
28
|
+
], TransactionBank.prototype, "type", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)("date", { nullable: false }),
|
|
31
|
+
__metadata("design:type", Date)
|
|
32
|
+
], TransactionBank.prototype, "transactionDate", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.ManyToOne)(() => BankAccount_1.BankAccount, (bankAccount) => bankAccount.transactions, {
|
|
35
|
+
onDelete: "CASCADE",
|
|
36
|
+
}),
|
|
37
|
+
__metadata("design:type", BankAccount_1.BankAccount)
|
|
38
|
+
], TransactionBank.prototype, "bankAccount", void 0);
|
|
39
|
+
TransactionBank = __decorate([
|
|
40
|
+
(0, typeorm_1.Entity)("transactions_bank")
|
|
41
|
+
], TransactionBank);
|
|
42
|
+
exports.TransactionBank = TransactionBank;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,4 +9,6 @@ export { Supplier } from "./entities/Suppliers";
|
|
|
9
9
|
export { CategoryForCosting } from "./entities/CategoryForCosting";
|
|
10
10
|
export { CategoryForPlantType } from "./entities/CategoryForPlantType";
|
|
11
11
|
export { UnitOfMeasure } from "./entities/UnitOfMesure";
|
|
12
|
+
export { BankAccount } from "./entities/Bank/BankAccount";
|
|
13
|
+
export { TransactionBank } from "./entities/Bank/TransactionBank";
|
|
12
14
|
export * from "./types";
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.UnitOfMeasure = exports.CategoryForPlantType = exports.CategoryForCosting = exports.Supplier = exports.ContainerType = exports.InventoryItem = exports.ExpenseTransaction = exports.User = exports.ProjectOrder = exports.ExpenseType = exports.ExpenseDetail = void 0;
|
|
17
|
+
exports.TransactionBank = exports.BankAccount = exports.UnitOfMeasure = exports.CategoryForPlantType = exports.CategoryForCosting = exports.Supplier = exports.ContainerType = exports.InventoryItem = exports.ExpenseTransaction = exports.User = exports.ProjectOrder = exports.ExpenseType = exports.ExpenseDetail = void 0;
|
|
18
18
|
var ExpenseDetail_1 = require("./entities/ExpenseDetail");
|
|
19
19
|
Object.defineProperty(exports, "ExpenseDetail", { enumerable: true, get: function () { return ExpenseDetail_1.ExpenseDetail; } });
|
|
20
20
|
var ExpenseType_1 = require("./entities/ExpenseType");
|
|
@@ -37,4 +37,8 @@ var CategoryForPlantType_1 = require("./entities/CategoryForPlantType");
|
|
|
37
37
|
Object.defineProperty(exports, "CategoryForPlantType", { enumerable: true, get: function () { return CategoryForPlantType_1.CategoryForPlantType; } });
|
|
38
38
|
var UnitOfMesure_1 = require("./entities/UnitOfMesure");
|
|
39
39
|
Object.defineProperty(exports, "UnitOfMeasure", { enumerable: true, get: function () { return UnitOfMesure_1.UnitOfMeasure; } });
|
|
40
|
+
var BankAccount_1 = require("./entities/Bank/BankAccount");
|
|
41
|
+
Object.defineProperty(exports, "BankAccount", { enumerable: true, get: function () { return BankAccount_1.BankAccount; } });
|
|
42
|
+
var TransactionBank_1 = require("./entities/Bank/TransactionBank");
|
|
43
|
+
Object.defineProperty(exports, "TransactionBank", { enumerable: true, get: function () { return TransactionBank_1.TransactionBank; } });
|
|
40
44
|
__exportStar(require("./types"), exports);
|
package/package.json
CHANGED
|
File without changes
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Entity, PrimaryGeneratedColumn, Column, OneToMany, ObjectLiteral } from "typeorm";
|
|
2
|
+
import { TransactionBank } from "./TransactionBank";
|
|
3
|
+
|
|
4
|
+
@Entity("bank_accounts")
|
|
5
|
+
export class BankAccount implements ObjectLiteral {
|
|
6
|
+
@PrimaryGeneratedColumn("increment")
|
|
7
|
+
idBankAccount!: number;
|
|
8
|
+
|
|
9
|
+
@Column("varchar", { nullable: false })
|
|
10
|
+
name!: string;
|
|
11
|
+
|
|
12
|
+
@Column("varchar", { nullable: false, unique: true })
|
|
13
|
+
accountNumber!: string;
|
|
14
|
+
|
|
15
|
+
@Column("decimal", { nullable: false })
|
|
16
|
+
initialBalance!: number;
|
|
17
|
+
|
|
18
|
+
@OneToMany(() => TransactionBank, (transaction) => transaction.bankAccount)
|
|
19
|
+
transactions!: TransactionBank[];
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Entity,
|
|
3
|
+
PrimaryGeneratedColumn,
|
|
4
|
+
Column,
|
|
5
|
+
ManyToOne,
|
|
6
|
+
ObjectLiteral
|
|
7
|
+
} from "typeorm";
|
|
8
|
+
import { BankAccount } from "./BankAccount";
|
|
9
|
+
|
|
10
|
+
@Entity("transactions_bank")
|
|
11
|
+
export class TransactionBank implements ObjectLiteral {
|
|
12
|
+
@PrimaryGeneratedColumn("increment")
|
|
13
|
+
idTransactionBank!: number;
|
|
14
|
+
|
|
15
|
+
@Column("decimal", { nullable: false })
|
|
16
|
+
amount!: number;
|
|
17
|
+
|
|
18
|
+
@Column("enum", { nullable: false, enum: ["INCOME", "EXPENSE"] })
|
|
19
|
+
type!: "INCOME" | "EXPENSE";
|
|
20
|
+
|
|
21
|
+
@Column("date", { nullable: false })
|
|
22
|
+
transactionDate!: Date;
|
|
23
|
+
|
|
24
|
+
@ManyToOne(() => BankAccount, (bankAccount) => bankAccount.transactions, {
|
|
25
|
+
onDelete: "CASCADE",
|
|
26
|
+
})
|
|
27
|
+
bankAccount!: BankAccount;
|
|
28
|
+
}
|
|
29
|
+
|
package/src/index.ts
CHANGED
|
@@ -9,6 +9,8 @@ export { Supplier } from "./entities/Suppliers";
|
|
|
9
9
|
export { CategoryForCosting } from "./entities/CategoryForCosting";
|
|
10
10
|
export { CategoryForPlantType } from "./entities/CategoryForPlantType";
|
|
11
11
|
export { UnitOfMeasure } from "./entities/UnitOfMesure";
|
|
12
|
+
export { BankAccount } from "./entities/Bank/BankAccount";
|
|
13
|
+
export { TransactionBank } from "./entities/Bank/TransactionBank";
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
export * from "./types";
|
package/yarn
ADDED
|
File without changes
|