proflores-db-model 0.1.20 → 0.1.21
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/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/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/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/yarn
ADDED
|
File without changes
|