@tomei/finance 0.1.13 → 0.2.0
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/account/entities/account.entity.d.ts +3 -1
- package/dist/account/entities/account.entity.js +6 -1
- package/dist/account/entities/account.entity.js.map +1 -1
- package/dist/account/interfaces/account.repository.interface.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/enum/index.d.ts +2 -1
- package/dist/enum/index.js +3 -1
- package/dist/enum/index.js.map +1 -1
- package/dist/enum/transaction-type.enum.d.ts +4 -0
- package/dist/enum/transaction-type.enum.js +9 -0
- package/dist/enum/transaction-type.enum.js.map +1 -0
- package/dist/finance-company/finance-company.d.ts +10 -0
- package/dist/finance-company/finance-company.js +63 -0
- package/dist/finance-company/finance-company.js.map +1 -0
- package/dist/finance-company/index.d.ts +2 -0
- package/dist/finance-company/index.js +6 -0
- package/dist/finance-company/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/account-system.interface.d.ts +1 -0
- package/dist/journal-entry/entities/journal-entry.entity.d.ts +12 -0
- package/dist/journal-entry/entities/journal-entry.entity.js +98 -0
- package/dist/journal-entry/entities/journal-entry.entity.js.map +1 -0
- package/dist/journal-entry/index.d.ts +6 -0
- package/dist/journal-entry/index.js +10 -0
- package/dist/journal-entry/index.js.map +1 -0
- package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts +9 -0
- package/dist/journal-entry/interfaces/journal-entry-attr.interface.js +3 -0
- package/dist/journal-entry/interfaces/journal-entry-attr.interface.js.map +1 -0
- package/dist/journal-entry/interfaces/journal-entry.repository.interface.d.ts +10 -0
- package/dist/journal-entry/interfaces/journal-entry.repository.interface.js +3 -0
- package/dist/journal-entry/interfaces/journal-entry.repository.interface.js.map +1 -0
- package/dist/journal-entry/journal-entry.d.ts +32 -0
- package/dist/journal-entry/journal-entry.js +97 -0
- package/dist/journal-entry/journal-entry.js.map +1 -0
- package/dist/journal-entry/journal-entry.repository.d.ts +15 -0
- package/dist/journal-entry/journal-entry.repository.js +43 -0
- package/dist/journal-entry/journal-entry.repository.js.map +1 -0
- package/dist/ledger-transaction/entities/ledger-transaction.entity.d.ts +19 -0
- package/dist/ledger-transaction/entities/ledger-transaction.entity.js +157 -0
- package/dist/ledger-transaction/entities/ledger-transaction.entity.js.map +1 -0
- package/dist/ledger-transaction/index.d.ts +6 -0
- package/dist/ledger-transaction/index.js +10 -0
- package/dist/ledger-transaction/index.js.map +1 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +18 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.js +3 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.js.map +1 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.d.ts +5 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.js +3 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.js.map +1 -0
- package/dist/ledger-transaction/ledger-transaction.d.ts +35 -0
- package/dist/ledger-transaction/ledger-transaction.js +71 -0
- package/dist/ledger-transaction/ledger-transaction.js.map +1 -0
- package/dist/ledger-transaction/ledger-transaction.repository.d.ts +10 -0
- package/dist/ledger-transaction/ledger-transaction.repository.js +37 -0
- package/dist/ledger-transaction/ledger-transaction.repository.js.map +1 -0
- package/dist/payment/interfaces/payment-item.repository.interface.d.ts +1 -1
- package/dist/payment/interfaces/payment.repository.interface.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/migrations/finance-journal-entry-migration.js +41 -0
- package/migrations/finance-ledger-transaction-migration.js +73 -0
- package/package.json +2 -2
- package/src/account/account.ts +189 -189
- package/src/account/entities/account.entity.ts +111 -107
- package/src/account/interfaces/account-attr.interface.ts +23 -23
- package/src/enum/index.ts +6 -5
- package/src/enum/transaction-type.enum.ts +4 -0
- package/src/finance-company/finance-company.ts +95 -0
- package/src/finance-company/index.ts +3 -0
- package/src/index.ts +9 -6
- package/src/interfaces/account-system.interface.ts +14 -13
- package/src/journal-entry/entities/journal-entry.entity.ts +74 -0
- package/src/journal-entry/index.ts +13 -0
- package/src/journal-entry/interfaces/journal-entry-attr.interface.ts +9 -0
- package/src/journal-entry/interfaces/journal-entry.repository.interface.ts +11 -0
- package/src/journal-entry/journal-entry.repository.ts +38 -0
- package/src/journal-entry/journal-entry.ts +136 -0
- package/src/ledger-transaction/entities/ledger-transaction.entity.ts +134 -0
- package/src/ledger-transaction/index.ts +13 -0
- package/src/ledger-transaction/interfaces/ledger-transaction-attr.interface.ts +20 -0
- package/src/ledger-transaction/interfaces/ledger-transaction.repository.interface.ts +7 -0
- package/src/ledger-transaction/ledger-transaction.repository.ts +28 -0
- package/src/ledger-transaction/ledger-transaction.ts +96 -0
- package/src/payment/payment.ts +209 -209
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { AccountModel } from 'src/account';
|
|
3
|
+
import { JournalEntryModel } from 'src/journal-entry/entities/journal-entry.entity';
|
|
4
|
+
export declare class LedgerTransactionModel extends Model {
|
|
5
|
+
TransactionId: string;
|
|
6
|
+
TransactionType: string;
|
|
7
|
+
JournalEntryId: string;
|
|
8
|
+
AccountNo: string;
|
|
9
|
+
Date: Date;
|
|
10
|
+
Name: string;
|
|
11
|
+
Description: string;
|
|
12
|
+
Currency: string;
|
|
13
|
+
DebitAmount: number;
|
|
14
|
+
CreditAmount: number;
|
|
15
|
+
RelatedObjectId: string;
|
|
16
|
+
RelatedObjectType: string;
|
|
17
|
+
Account: AccountModel;
|
|
18
|
+
JournalEntry: JournalEntryModel;
|
|
19
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
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.LedgerTransactionModel = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
15
|
+
const account_1 = require("src/account");
|
|
16
|
+
const journal_entry_entity_1 = require("src/journal-entry/entities/journal-entry.entity");
|
|
17
|
+
let LedgerTransactionModel = class LedgerTransactionModel extends sequelize_typescript_1.Model {
|
|
18
|
+
};
|
|
19
|
+
__decorate([
|
|
20
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'Transactionid' }),
|
|
21
|
+
(0, sequelize_typescript_1.Column)({
|
|
22
|
+
primaryKey: true,
|
|
23
|
+
allowNull: false,
|
|
24
|
+
type: sequelize_typescript_1.DataType.STRING(30),
|
|
25
|
+
}),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], LedgerTransactionModel.prototype, "TransactionId", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, swagger_1.ApiProperty)({
|
|
30
|
+
type: String,
|
|
31
|
+
description: 'Transaction Type eg. "Credit", "Debit"',
|
|
32
|
+
}),
|
|
33
|
+
(0, sequelize_typescript_1.Column)({
|
|
34
|
+
allowNull: false,
|
|
35
|
+
type: sequelize_typescript_1.DataType.STRING(20),
|
|
36
|
+
}),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], LedgerTransactionModel.prototype, "TransactionType", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'JournalEntryId' }),
|
|
41
|
+
(0, sequelize_typescript_1.ForeignKey)(() => journal_entry_entity_1.JournalEntryModel),
|
|
42
|
+
(0, sequelize_typescript_1.Column)({
|
|
43
|
+
allowNull: false,
|
|
44
|
+
type: sequelize_typescript_1.DataType.STRING(30),
|
|
45
|
+
}),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], LedgerTransactionModel.prototype, "JournalEntryId", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, swagger_1.ApiProperty)({ type: String, description: 'AccountNo' }),
|
|
50
|
+
(0, sequelize_typescript_1.ForeignKey)(() => account_1.AccountModel),
|
|
51
|
+
(0, sequelize_typescript_1.Column)({
|
|
52
|
+
allowNull: false,
|
|
53
|
+
type: sequelize_typescript_1.DataType.STRING(30),
|
|
54
|
+
}),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], LedgerTransactionModel.prototype, "AccountNo", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, swagger_1.ApiProperty)({ type: Date, description: 'Date' }),
|
|
59
|
+
(0, sequelize_typescript_1.Column)({
|
|
60
|
+
allowNull: false,
|
|
61
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
62
|
+
}),
|
|
63
|
+
__metadata("design:type", Date)
|
|
64
|
+
], LedgerTransactionModel.prototype, "Date", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, swagger_1.ApiProperty)({
|
|
67
|
+
type: String,
|
|
68
|
+
description: 'Name of the ledger transaction',
|
|
69
|
+
}),
|
|
70
|
+
(0, sequelize_typescript_1.Column)({
|
|
71
|
+
allowNull: false,
|
|
72
|
+
type: sequelize_typescript_1.DataType.STRING(200),
|
|
73
|
+
}),
|
|
74
|
+
__metadata("design:type", String)
|
|
75
|
+
], LedgerTransactionModel.prototype, "Name", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, swagger_1.ApiProperty)({
|
|
78
|
+
type: String,
|
|
79
|
+
description: 'Description of the ledger transaction',
|
|
80
|
+
}),
|
|
81
|
+
(0, sequelize_typescript_1.Column)({
|
|
82
|
+
allowNull: true,
|
|
83
|
+
type: sequelize_typescript_1.DataType.STRING(1000),
|
|
84
|
+
}),
|
|
85
|
+
__metadata("design:type", String)
|
|
86
|
+
], LedgerTransactionModel.prototype, "Description", void 0);
|
|
87
|
+
__decorate([
|
|
88
|
+
(0, swagger_1.ApiProperty)({
|
|
89
|
+
type: String,
|
|
90
|
+
description: 'Currency',
|
|
91
|
+
}),
|
|
92
|
+
(0, sequelize_typescript_1.Column)({
|
|
93
|
+
allowNull: false,
|
|
94
|
+
type: sequelize_typescript_1.DataType.CHAR(3),
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:type", String)
|
|
97
|
+
], LedgerTransactionModel.prototype, "Currency", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
(0, swagger_1.ApiProperty)({
|
|
100
|
+
type: Number,
|
|
101
|
+
description: 'Debit Amount of the ledger transaction',
|
|
102
|
+
}),
|
|
103
|
+
(0, sequelize_typescript_1.Column)({
|
|
104
|
+
allowNull: true,
|
|
105
|
+
type: sequelize_typescript_1.DataType.DECIMAL(10, 2),
|
|
106
|
+
}),
|
|
107
|
+
__metadata("design:type", Number)
|
|
108
|
+
], LedgerTransactionModel.prototype, "DebitAmount", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, swagger_1.ApiProperty)({
|
|
111
|
+
type: Number,
|
|
112
|
+
description: 'Credit Amount of the ledger transaction',
|
|
113
|
+
}),
|
|
114
|
+
(0, sequelize_typescript_1.Column)({
|
|
115
|
+
allowNull: true,
|
|
116
|
+
type: sequelize_typescript_1.DataType.DECIMAL(10, 2),
|
|
117
|
+
}),
|
|
118
|
+
__metadata("design:type", Number)
|
|
119
|
+
], LedgerTransactionModel.prototype, "CreditAmount", void 0);
|
|
120
|
+
__decorate([
|
|
121
|
+
(0, swagger_1.ApiProperty)({
|
|
122
|
+
type: String,
|
|
123
|
+
description: 'RelatedObjectId',
|
|
124
|
+
}),
|
|
125
|
+
(0, sequelize_typescript_1.Column)({
|
|
126
|
+
allowNull: false,
|
|
127
|
+
type: sequelize_typescript_1.DataType.STRING(30),
|
|
128
|
+
}),
|
|
129
|
+
__metadata("design:type", String)
|
|
130
|
+
], LedgerTransactionModel.prototype, "RelatedObjectId", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
(0, swagger_1.ApiProperty)({
|
|
133
|
+
type: String,
|
|
134
|
+
description: 'RelatedObjectType',
|
|
135
|
+
}),
|
|
136
|
+
(0, sequelize_typescript_1.Column)({
|
|
137
|
+
allowNull: false,
|
|
138
|
+
type: sequelize_typescript_1.DataType.STRING(200),
|
|
139
|
+
}),
|
|
140
|
+
__metadata("design:type", String)
|
|
141
|
+
], LedgerTransactionModel.prototype, "RelatedObjectType", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, sequelize_typescript_1.BelongsTo)(() => account_1.AccountModel),
|
|
144
|
+
__metadata("design:type", account_1.AccountModel)
|
|
145
|
+
], LedgerTransactionModel.prototype, "Account", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
(0, sequelize_typescript_1.BelongsTo)(() => journal_entry_entity_1.JournalEntryModel),
|
|
148
|
+
__metadata("design:type", journal_entry_entity_1.JournalEntryModel)
|
|
149
|
+
], LedgerTransactionModel.prototype, "JournalEntry", void 0);
|
|
150
|
+
LedgerTransactionModel = __decorate([
|
|
151
|
+
(0, sequelize_typescript_1.Table)({
|
|
152
|
+
tableName: 'finance_LedgerTransaction',
|
|
153
|
+
timestamps: false,
|
|
154
|
+
})
|
|
155
|
+
], LedgerTransactionModel);
|
|
156
|
+
exports.LedgerTransactionModel = LedgerTransactionModel;
|
|
157
|
+
//# sourceMappingURL=ledger-transaction.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger-transaction.entity.js","sourceRoot":"","sources":["../../../src/ledger-transaction/entities/ledger-transaction.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA8C;AAC9C,+DAO8B;AAC9B,yCAA2C;AAC3C,0FAAoF;AAM7E,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,4BAAK;CAqHhD,CAAA;AApHC;IAAC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;IAC3D,IAAA,6BAAM,EAAC;QACN,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,+BAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;KAC1B,CAAC;;6DACoB;AAEtB;IAAC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,wCAAwC;KACtD,CAAC;IACD,IAAA,6BAAM,EAAC;QACN,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,+BAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;KAC1B,CAAC;;+DACsB;AAExB;IAAC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,CAAC;IAC5D,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,wCAAiB,CAAC;IACnC,IAAA,6BAAM,EAAC;QACN,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,+BAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;KAC1B,CAAC;;8DACqB;AAEvB;IAAC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC;IACvD,IAAA,iCAAU,EAAC,GAAG,EAAE,CAAC,sBAAY,CAAC;IAC9B,IAAA,6BAAM,EAAC;QACN,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,+BAAQ,CAAC,MA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AA,6BAAM,EAAC;QACN,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,+BAAQ,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;KAC9B,CAAC;;4DACmB;AAErB;IAAC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,iBAAiB;KAC/B,CAAC;IACD,IAAA,6BAAM,EAAC;QACN,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,+BAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;KAC1B,CAAC;;+DACsB;AAExB;IAAC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,mBAAmB;KACjC,CAAC;IACD,IAAA,6BAAM,EAAC;QACN,SAAS,EAAE,KAAK;QAChB,IAAI,EAAE,+BAAQ,CAAC,MAAM,CAAC,GAAG,CAAC;KAC3B,CAAC;;iEACwB;AAE1B;IAAC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,sBAAY,CAAC;8BACrB,sBAAY;uDAAC;AAEtB;IAAC,IAAA,gCAAS,EAAC,GAAG,EAAE,CAAC,wCAAiB,CAAC;8BACrB,wCAAiB;4DAAC;AApHrB,sBAAsB;IAJlC,IAAA,4BAAK,EAAC;QACL,SAAS,EAAE,2BAA2B;QACtC,UAAU,EAAE,KAAK;KAClB,CAAC;GACW,sBAAsB,CAqHlC;AArHY,wDAAsB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { LedgerTransaction } from './ledger-transaction';
|
|
2
|
+
import { LedgerTransactionModel } from './entities/ledger-transaction.entity';
|
|
3
|
+
import { ILedgerTransactionAttr } from './interfaces/ledger-transaction-attr.interface';
|
|
4
|
+
import { ILedgerTransactionRepository } from './interfaces/ledger-transaction.repository.interface';
|
|
5
|
+
import { LedgerTransactionRepository } from './ledger-transaction.repository';
|
|
6
|
+
export { ILedgerTransactionRepository, LedgerTransaction, LedgerTransactionModel, ILedgerTransactionAttr, LedgerTransactionRepository, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LedgerTransactionRepository = exports.LedgerTransactionModel = exports.LedgerTransaction = void 0;
|
|
4
|
+
const ledger_transaction_1 = require("./ledger-transaction");
|
|
5
|
+
Object.defineProperty(exports, "LedgerTransaction", { enumerable: true, get: function () { return ledger_transaction_1.LedgerTransaction; } });
|
|
6
|
+
const ledger_transaction_entity_1 = require("./entities/ledger-transaction.entity");
|
|
7
|
+
Object.defineProperty(exports, "LedgerTransactionModel", { enumerable: true, get: function () { return ledger_transaction_entity_1.LedgerTransactionModel; } });
|
|
8
|
+
const ledger_transaction_repository_1 = require("./ledger-transaction.repository");
|
|
9
|
+
Object.defineProperty(exports, "LedgerTransactionRepository", { enumerable: true, get: function () { return ledger_transaction_repository_1.LedgerTransactionRepository; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ledger-transaction/index.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;AAQvD,kGARO,sCAAiB,OAQP;AAPnB,oFAA8E;AAQ5E,uGARO,kDAAsB,OAQP;AALxB,mFAA8E;AAO5E,4GAPO,2DAA2B,OAOP"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TransactionTypeOptions } from 'src/enum/transaction-type.enum';
|
|
2
|
+
export interface ILedgerTransactionAttr {
|
|
3
|
+
TransactionId: string;
|
|
4
|
+
TransactionType: string;
|
|
5
|
+
JournalEntryId: string;
|
|
6
|
+
AccountNo: string;
|
|
7
|
+
Date: Date;
|
|
8
|
+
Name: string;
|
|
9
|
+
Description: string;
|
|
10
|
+
Currency: string;
|
|
11
|
+
DebitAmount: number;
|
|
12
|
+
CreditAmount: number;
|
|
13
|
+
RelatedObjectId: string;
|
|
14
|
+
RelatedObjectType: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ILedgerTransactionTypeOptionsAttr {
|
|
17
|
+
transactionType: TransactionTypeOptions;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger-transaction-attr.interface.js","sourceRoot":"","sources":["../../../src/ledger-transaction/interfaces/ledger-transaction-attr.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger-transaction.repository.interface.js","sourceRoot":"","sources":["../../../src/ledger-transaction/interfaces/ledger-transaction.repository.interface.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ILedgerTransactionAttr, ILedgerTransactionTypeOptionsAttr } from './interfaces/ledger-transaction-attr.interface';
|
|
2
|
+
import { LedgerTransactionRepository } from './ledger-transaction.repository';
|
|
3
|
+
export declare class LedgerTransaction {
|
|
4
|
+
TransactionId: string;
|
|
5
|
+
JournalEntryId: string;
|
|
6
|
+
AccountNo: string;
|
|
7
|
+
Date: Date;
|
|
8
|
+
Name: string;
|
|
9
|
+
Description: string;
|
|
10
|
+
Currency: string;
|
|
11
|
+
DebitAmount: number;
|
|
12
|
+
CreditAmount: number;
|
|
13
|
+
RelatedObjectId: string;
|
|
14
|
+
RelatedObjectType: string;
|
|
15
|
+
TransactionType: string;
|
|
16
|
+
ledgerTransactionRepository: LedgerTransactionRepository;
|
|
17
|
+
constructor(ledgerTransactionRepository: LedgerTransactionRepository);
|
|
18
|
+
init(params?: ILedgerTransactionAttr): void;
|
|
19
|
+
getData(): {
|
|
20
|
+
TransactionId: string;
|
|
21
|
+
TransactionType: string;
|
|
22
|
+
JournalEntryId: string;
|
|
23
|
+
AccountNo: string;
|
|
24
|
+
Date: Date;
|
|
25
|
+
Name: string;
|
|
26
|
+
Description: string;
|
|
27
|
+
Currency: string;
|
|
28
|
+
DebitAmount: number;
|
|
29
|
+
CreditAmount: number;
|
|
30
|
+
RelatedObjectId: string;
|
|
31
|
+
RelatedObjectType: string;
|
|
32
|
+
};
|
|
33
|
+
create(): Promise<any>;
|
|
34
|
+
newLedgerTransaction({ transactionType }: ILedgerTransactionTypeOptionsAttr, journalEntryId?: string): Promise<any>;
|
|
35
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LedgerTransaction = void 0;
|
|
4
|
+
const transaction_type_enum_1 = require("src/enum/transaction-type.enum");
|
|
5
|
+
const uniqid = require("uniqid");
|
|
6
|
+
class LedgerTransaction {
|
|
7
|
+
constructor(ledgerTransactionRepository) {
|
|
8
|
+
this.ledgerTransactionRepository = ledgerTransactionRepository;
|
|
9
|
+
}
|
|
10
|
+
init(params) {
|
|
11
|
+
this.TransactionId = params.TransactionId;
|
|
12
|
+
this.TransactionType = params.TransactionType;
|
|
13
|
+
this.JournalEntryId = params.JournalEntryId;
|
|
14
|
+
this.AccountNo = params.AccountNo;
|
|
15
|
+
this.Date = params.Date;
|
|
16
|
+
this.Name = params.Name;
|
|
17
|
+
this.Description = params.Description;
|
|
18
|
+
this.Currency = params.Currency;
|
|
19
|
+
this.DebitAmount = params.DebitAmount;
|
|
20
|
+
this.CreditAmount = params.CreditAmount;
|
|
21
|
+
this.RelatedObjectId = params.RelatedObjectId;
|
|
22
|
+
this.RelatedObjectType = params.RelatedObjectType;
|
|
23
|
+
}
|
|
24
|
+
getData() {
|
|
25
|
+
return {
|
|
26
|
+
TransactionId: this.TransactionId,
|
|
27
|
+
TransactionType: this.TransactionType,
|
|
28
|
+
JournalEntryId: this.JournalEntryId,
|
|
29
|
+
AccountNo: this.AccountNo,
|
|
30
|
+
Date: this.Date,
|
|
31
|
+
Name: this.Name,
|
|
32
|
+
Description: this.Description,
|
|
33
|
+
Currency: this.Currency,
|
|
34
|
+
DebitAmount: this.DebitAmount,
|
|
35
|
+
CreditAmount: this.CreditAmount,
|
|
36
|
+
RelatedObjectId: this.RelatedObjectId,
|
|
37
|
+
RelatedObjectType: this.RelatedObjectType,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async create() {
|
|
41
|
+
return await this.ledgerTransactionRepository.create(this.getData);
|
|
42
|
+
}
|
|
43
|
+
async newLedgerTransaction({ transactionType }, journalEntryId) {
|
|
44
|
+
this.init({
|
|
45
|
+
TransactionId: uniqid(),
|
|
46
|
+
TransactionType: 'Debit',
|
|
47
|
+
JournalEntryId: '',
|
|
48
|
+
AccountNo: '',
|
|
49
|
+
Date: new Date(),
|
|
50
|
+
Name: '',
|
|
51
|
+
Description: '',
|
|
52
|
+
Currency: 'MYR',
|
|
53
|
+
DebitAmount: 0,
|
|
54
|
+
CreditAmount: 0,
|
|
55
|
+
RelatedObjectId: '',
|
|
56
|
+
RelatedObjectType: '',
|
|
57
|
+
});
|
|
58
|
+
if (transactionType === transaction_type_enum_1.TransactionTypeOptions.Debit) {
|
|
59
|
+
this.TransactionType = 'Debit';
|
|
60
|
+
}
|
|
61
|
+
else if (transactionType === transaction_type_enum_1.TransactionTypeOptions.Credit) {
|
|
62
|
+
this.TransactionType = 'Credit';
|
|
63
|
+
}
|
|
64
|
+
if (journalEntryId) {
|
|
65
|
+
this.JournalEntryId = journalEntryId;
|
|
66
|
+
}
|
|
67
|
+
return await this.create();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.LedgerTransaction = LedgerTransaction;
|
|
71
|
+
//# sourceMappingURL=ledger-transaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger-transaction.js","sourceRoot":"","sources":["../../src/ledger-transaction/ledger-transaction.ts"],"names":[],"mappings":";;;AAIA,0EAAwE;AAExE,iCAAiC;AAEjC,MAAa,iBAAiB;IAgB5B,YAAY,2BAAwD;QAClE,IAAI,CAAC,2BAA2B,GAAG,2BAA2B,CAAC;IACjE,CAAC;IAED,IAAI,CAAC,MAA+B;QAClC,IAAI,CAAC,aAAa,GAAG,MAAM,C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IACrE,CAAC;IAED,KAAK,CAAC,oBAAoB,CACxB,EAAE,eAAe,EAAqC,EACtD,cAAuB;QAEvB,IAAI,CAAC,IAAI,CAAC;YACR,aAAa,EAAE,MAAM,EAAE;YACvB,eAAe,EAAE,OAAO;YACxB,cAAc,EAAE,EAAE;YAClB,SAAS,EAAE,EAAE;YACb,IAAI,EAAE,IAAI,IAAI,EAAE;YAChB,IAAI,EAAE,EAAE;YACR,WAAW,EAAE,EAAE;YACf,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,CAAC;YACd,YAAY,EAAE,CAAC;YACf,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,EAAE;SACtB,CAAC,CAAC;QAEH,IAAI,eAAe,KAAK,8CAAsB,CAAC,KAAK,EAAE;YACpD,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC;SAChC;aAAM,IAAI,eAAe,KAAK,8CAAsB,CAAC,MAAM,EAAE;YAC5D,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;SACjC;QAED,IAAI,cAAc,EAAE;YAClB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;SACtC;QAED,OAAO,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;IAC7B,CAAC;CACF;AAvFD,8CAuFC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LedgerTransactionModel } from './entities/ledger-transaction.entity';
|
|
2
|
+
import { ILedgerTransactionAttr } from './interfaces/ledger-transaction-attr.interface';
|
|
3
|
+
import { ILedgerTransactionRepository } from './interfaces/ledger-transaction.repository.interface';
|
|
4
|
+
export declare class LedgerTransactionRepository implements ILedgerTransactionRepository<LedgerTransactionModel> {
|
|
5
|
+
private readonly ledgerTransactionModel;
|
|
6
|
+
constructor(ledgerTransactionModel: typeof LedgerTransactionModel);
|
|
7
|
+
create(data: ILedgerTransactionAttr | any, options?: any): Promise<LedgerTransactionModel> | any;
|
|
8
|
+
findAll(options?: any): Promise<LedgerTransactionModel[]>;
|
|
9
|
+
findOne(options: any): Promise<LedgerTransactionModel> | any;
|
|
10
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.LedgerTransactionRepository = void 0;
|
|
16
|
+
const sequelize_1 = require("@nestjs/sequelize");
|
|
17
|
+
const ledger_transaction_entity_1 = require("./entities/ledger-transaction.entity");
|
|
18
|
+
let LedgerTransactionRepository = class LedgerTransactionRepository {
|
|
19
|
+
constructor(ledgerTransactionModel) {
|
|
20
|
+
this.ledgerTransactionModel = ledgerTransactionModel;
|
|
21
|
+
}
|
|
22
|
+
create(data, options) {
|
|
23
|
+
return this.ledgerTransactionModel.create(data, options);
|
|
24
|
+
}
|
|
25
|
+
findAll(options) {
|
|
26
|
+
return this.ledgerTransactionModel.findAll(options);
|
|
27
|
+
}
|
|
28
|
+
findOne(options) {
|
|
29
|
+
return this.ledgerTransactionModel.findOne(options);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
LedgerTransactionRepository = __decorate([
|
|
33
|
+
__param(0, (0, sequelize_1.InjectModel)(ledger_transaction_entity_1.LedgerTransactionModel)),
|
|
34
|
+
__metadata("design:paramtypes", [Object])
|
|
35
|
+
], LedgerTransactionRepository);
|
|
36
|
+
exports.LedgerTransactionRepository = LedgerTransactionRepository;
|
|
37
|
+
//# sourceMappingURL=ledger-transaction.repository.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ledger-transaction.repository.js","sourceRoot":"","sources":["../../src/ledger-transaction/ledger-transaction.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,iDAAgD;AAChD,oFAA8E;AAIvE,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAGtC,YAEmB,sBAAqD;QAArD,2BAAsB,GAAtB,sBAAsB,CAA+B;IACrE,CAAC;IAEJ,MAAM,CACJ,IAAkC,EAClC,OAAa;QAEb,OAAO,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC3D,CAAC;IAED,OAAO,CAAC,OAAa;QACnB,OAAO,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,CAAC,OAAY;QAClB,OAAO,IAAI,CAAC,sBAAsB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACtD,CAAC;CACF,CAAA;AAtBY,2BAA2B;IAInC,WAAA,IAAA,uBAAW,EAAC,kDAAsB,CAAC,CAAA;;GAJ3B,2BAA2B,CAsBvC;AAtBY,kEAA2B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { IBaseRepository } from '@tomei/general';
|
|
2
2
|
import { PaymentItemModel } from '../entities/payment-item.entity';
|
|
3
|
-
export
|
|
3
|
+
export type IPaymentItemRepository = IBaseRepository<PaymentItemModel>;
|