@tomei/finance 0.5.0 → 0.5.2

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.
Files changed (171) hide show
  1. package/dist/account/account.d.ts +35 -35
  2. package/dist/account/account.js +233 -231
  3. package/dist/account/account.js.map +1 -1
  4. package/dist/account/account.repository.d.ts +5 -5
  5. package/dist/account/account.repository.js +11 -11
  6. package/dist/account/interfaces/account-attr.interface.d.ts +29 -29
  7. package/dist/account/interfaces/account-attr.interface.js +2 -2
  8. package/dist/account-system-entity/account-system-entity.d.ts +11 -11
  9. package/dist/account-system-entity/account-system-entity.js +66 -66
  10. package/dist/account-system-entity/post-history.repository.d.ts +5 -5
  11. package/dist/account-system-entity/post-history.repository.js +11 -11
  12. package/dist/config.d.ts +1888 -1888
  13. package/dist/config.js +331 -331
  14. package/dist/customer/customer.d.ts +43 -41
  15. package/dist/customer/customer.js +236 -214
  16. package/dist/customer/customer.js.map +1 -1
  17. package/dist/customer/finance-customer.repository.d.ts +5 -5
  18. package/dist/customer/finance-customer.repository.js +25 -25
  19. package/dist/customer/interfaces/customer.repository.interface.d.ts +3 -3
  20. package/dist/customer/interfaces/customer.repository.interface.js +2 -2
  21. package/dist/customer/interfaces/finance-customer-attr.interface.d.ts +10 -10
  22. package/dist/customer/interfaces/finance-customer-attr.interface.js +2 -2
  23. package/dist/customer/interfaces/finance-customer.repository.interface.d.ts +3 -3
  24. package/dist/customer/interfaces/finance-customer.repository.interface.js +2 -2
  25. package/dist/database.d.ts +4 -4
  26. package/dist/database.js +14 -14
  27. package/dist/document/document-item.d.ts +38 -38
  28. package/dist/document/document-item.js +83 -83
  29. package/dist/document/document-item.repository.d.ts +5 -5
  30. package/dist/document/document-item.repository.js +11 -11
  31. package/dist/document/document.d.ts +76 -76
  32. package/dist/document/document.js +566 -566
  33. package/dist/document/document.repository.d.ts +5 -5
  34. package/dist/document/document.repository.js +11 -11
  35. package/dist/document/interfaces/document-attr.interface.d.ts +27 -27
  36. package/dist/document/interfaces/document-attr.interface.js +6 -6
  37. package/dist/document/interfaces/document-item-attr.interface.d.ts +22 -22
  38. package/dist/document/interfaces/document-item-attr.interface.js +6 -6
  39. package/dist/document/interfaces/document-item.repository.interface.d.ts +3 -3
  40. package/dist/document/interfaces/document-item.repository.interface.js +2 -2
  41. package/dist/enum/doc-type.enum.d.ts +8 -8
  42. package/dist/enum/doc-type.enum.js +12 -12
  43. package/dist/enum/document-status.enum.d.ts +6 -6
  44. package/dist/enum/document-status.enum.js +10 -10
  45. package/dist/enum/index.d.ts +8 -8
  46. package/dist/enum/index.js +17 -17
  47. package/dist/enum/payment-method.enum.d.ts +3 -3
  48. package/dist/enum/payment-method.enum.js +7 -7
  49. package/dist/enum/payment-status.enum.d.ts +4 -4
  50. package/dist/enum/payment-status.enum.js +8 -8
  51. package/dist/enum/payment-type.enum.d.ts +4 -4
  52. package/dist/enum/payment-type.enum.js +8 -8
  53. package/dist/enum/quick-book-client-scopes.enum.d.ts +13 -13
  54. package/dist/enum/quick-book-client-scopes.enum.js +18 -18
  55. package/dist/enum/transaction-type.enum.d.ts +4 -4
  56. package/dist/enum/transaction-type.enum.js +8 -8
  57. package/dist/finance-company/finance-company.d.ts +57 -57
  58. package/dist/finance-company/finance-company.js +1192 -1192
  59. package/dist/finance-company/finance-company.repository.d.ts +5 -5
  60. package/dist/finance-company/finance-company.repository.js +11 -11
  61. package/dist/helpers/typeof.d.ts +1 -1
  62. package/dist/helpers/typeof.js +26 -26
  63. package/dist/index.d.ts +17 -17
  64. package/dist/index.js +32 -32
  65. package/dist/interfaces/account-system.interface.d.ts +13 -13
  66. package/dist/interfaces/account-system.interface.js +2 -2
  67. package/dist/interfaces/index.d.ts +2 -2
  68. package/dist/interfaces/index.js +2 -2
  69. package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts +11 -11
  70. package/dist/journal-entry/interfaces/journal-entry-attr.interface.js +2 -2
  71. package/dist/journal-entry/journal-entry.d.ts +39 -39
  72. package/dist/journal-entry/journal-entry.js +215 -215
  73. package/dist/journal-entry/journal-entry.repository.d.ts +5 -5
  74. package/dist/journal-entry/journal-entry.repository.js +11 -11
  75. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +17 -17
  76. package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.js +2 -2
  77. package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.d.ts +5 -5
  78. package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.js +2 -2
  79. package/dist/ledger-transaction/ledger-transaction.d.ts +48 -48
  80. package/dist/ledger-transaction/ledger-transaction.js +155 -155
  81. package/dist/ledger-transaction/ledger-transaction.repository.d.ts +5 -5
  82. package/dist/ledger-transaction/ledger-transaction.repository.js +11 -11
  83. package/dist/models/account.entity.d.ts +30 -30
  84. package/dist/models/account.entity.js +232 -232
  85. package/dist/models/account.entity.js.map +1 -1
  86. package/dist/models/customer.entity.d.ts +13 -13
  87. package/dist/models/customer.entity.js +109 -109
  88. package/dist/models/document-item.entity.d.ts +27 -27
  89. package/dist/models/document-item.entity.js +172 -172
  90. package/dist/models/document.entity.d.ts +36 -36
  91. package/dist/models/document.entity.js +242 -242
  92. package/dist/models/finance-company.entity.d.ts +9 -9
  93. package/dist/models/finance-company.entity.js +44 -44
  94. package/dist/models/journal-entry.entity.d.ts +16 -16
  95. package/dist/models/journal-entry.entity.js +127 -127
  96. package/dist/models/ledger-transaction.entity.d.ts +24 -24
  97. package/dist/models/ledger-transaction.entity.js +172 -172
  98. package/dist/models/payment-item.entity.d.ts +12 -12
  99. package/dist/models/payment-item.entity.js +75 -75
  100. package/dist/models/payment-method-type.entity.d.ts +13 -13
  101. package/dist/models/payment-method-type.entity.js +85 -85
  102. package/dist/models/payment-method.entity.d.ts +10 -10
  103. package/dist/models/payment-method.entity.js +62 -62
  104. package/dist/models/payment-paid-with.entity.d.ts +24 -24
  105. package/dist/models/payment-paid-with.entity.js +158 -158
  106. package/dist/models/payment.entity.d.ts +27 -27
  107. package/dist/models/payment.entity.js +188 -188
  108. package/dist/models/post-history.entity.d.ts +11 -11
  109. package/dist/models/post-history.entity.js +63 -63
  110. package/dist/payment/interfaces/payment-attr.interface.d.ts +22 -22
  111. package/dist/payment/interfaces/payment-attr.interface.js +6 -6
  112. package/dist/payment/interfaces/payment-params.interface.d.ts +7 -7
  113. package/dist/payment/interfaces/payment-params.interface.js +2 -2
  114. package/dist/payment/payment.d.ts +51 -51
  115. package/dist/payment/payment.js +179 -179
  116. package/dist/payment/payment.repository.d.ts +5 -5
  117. package/dist/payment/payment.repository.js +11 -11
  118. package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts +10 -10
  119. package/dist/payment-item/interfaces/payment-item-attr.interface.js +6 -6
  120. package/dist/payment-item/payment-item.d.ts +23 -23
  121. package/dist/payment-item/payment-item.js +115 -115
  122. package/dist/payment-item/payment-item.repository.d.ts +5 -5
  123. package/dist/payment-item/payment-item.repository.js +11 -11
  124. package/dist/payment-method/interfaces/payment-method-attr.interface.d.ts +5 -5
  125. package/dist/payment-method/interfaces/payment-method-attr.interface.js +2 -2
  126. package/dist/payment-method/payment-method.d.ts +18 -18
  127. package/dist/payment-method/payment-method.js +98 -98
  128. package/dist/payment-method/payment-method.repository.d.ts +5 -5
  129. package/dist/payment-method/payment-method.repository.js +11 -11
  130. package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.d.ts +8 -8
  131. package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.js +2 -2
  132. package/dist/payment-method-type/payment-method-type.d.ts +16 -16
  133. package/dist/payment-method-type/payment-method-type.js +70 -70
  134. package/dist/payment-method-type/payment-method-type.repository.d.ts +5 -5
  135. package/dist/payment-method-type/payment-method-type.repository.js +11 -11
  136. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.d.ts +19 -19
  137. package/dist/payment-paid-with/interfaces/payment-paid-with.interface.js +6 -6
  138. package/dist/payment-paid-with/payment-paid-with.d.ts +31 -31
  139. package/dist/payment-paid-with/payment-paid-with.js +52 -52
  140. package/dist/payment-paid-with/payment-paid-with.repository.d.ts +5 -5
  141. package/dist/payment-paid-with/payment-paid-with.repository.js +11 -11
  142. package/dist/test-document.d.ts +3 -3
  143. package/dist/test-document.js +18 -18
  144. package/dist/test.d.ts +1 -1
  145. package/dist/test.js +7 -7
  146. package/dist/tsconfig.tsbuildinfo +1 -1
  147. package/package.json +1 -1
  148. package/src/account/account.ts +3 -1
  149. package/src/customer/customer.ts +40 -0
  150. package/src/models/account.entity.ts +1 -1
  151. package/dist/account/interfaces/account.repository.interface.d.ts +0 -3
  152. package/dist/account/interfaces/account.repository.interface.js +0 -3
  153. package/dist/account/interfaces/account.repository.interface.js.map +0 -1
  154. package/dist/document/interfaces/document.repository.interface.d.ts +0 -3
  155. package/dist/document/interfaces/document.repository.interface.js +0 -3
  156. package/dist/document/interfaces/document.repository.interface.js.map +0 -1
  157. package/dist/journal-entry/interfaces/journal-entry.repository.interface.d.ts +0 -10
  158. package/dist/journal-entry/interfaces/journal-entry.repository.interface.js +0 -3
  159. package/dist/journal-entry/interfaces/journal-entry.repository.interface.js.map +0 -1
  160. package/dist/payment/interfaces/payment-item-attr.interface.d.ts +0 -7
  161. package/dist/payment/interfaces/payment-item-attr.interface.js +0 -7
  162. package/dist/payment/interfaces/payment-item-attr.interface.js.map +0 -1
  163. package/dist/payment/interfaces/payment-item.repository.interface.d.ts +0 -3
  164. package/dist/payment/interfaces/payment-item.repository.interface.js +0 -3
  165. package/dist/payment/interfaces/payment-item.repository.interface.js.map +0 -1
  166. package/dist/payment/interfaces/payment.repository.interface.d.ts +0 -3
  167. package/dist/payment/interfaces/payment.repository.interface.js +0 -3
  168. package/dist/payment/interfaces/payment.repository.interface.js.map +0 -1
  169. package/dist/payment/payment-item.repository.d.ts +0 -17
  170. package/dist/payment/payment-item.repository.js +0 -51
  171. package/dist/payment/payment-item.repository.js.map +0 -1
@@ -1,35 +1,35 @@
1
- import { AccountSystemEntity } from '../account-system-entity/account-system-entity';
2
- import AccountModel from '../models/account.entity';
3
- import { AccountRepository } from './account.repository';
4
- export default class Account extends AccountSystemEntity {
5
- AccountNo: string;
6
- ParentAccountNo?: string;
7
- Name: string;
8
- Description: string;
9
- AccountType: string;
10
- AccountSubtype: string;
11
- OwnerId: string;
12
- OwnerType: string;
13
- RelatedObjectId: string;
14
- RelatedObjectType: string;
15
- CreatedById: string;
16
- CreatedAt: Date;
17
- UpdatedById: string;
18
- UpdatedAt: Date;
19
- private static _RepositoryBase;
20
- private _DbTransaction;
21
- private _IsNewRecord;
22
- private get IsNewRecord();
23
- private set IsNewRecord(value);
24
- get RepositoryBase(): AccountRepository;
25
- get ObjectId(): string;
26
- get ObjectName(): string;
27
- get TableName(): string;
28
- constructor(dbTransaction?: any, accountNo?: string);
29
- private init;
30
- static initAccount(dbTransaction: any, accountNo: string): Promise<Account>;
31
- static initialize(): void;
32
- validateAccountValue(): void;
33
- isParentAccountExists(): boolean;
34
- save(CompanyId: string, AccSystemRefId: string, userId: string, dbTransaction?: any): Promise<AccountModel>;
35
- }
1
+ import { AccountSystemEntity } from '../account-system-entity/account-system-entity';
2
+ import AccountModel from '../models/account.entity';
3
+ import { AccountRepository } from './account.repository';
4
+ export default class Account extends AccountSystemEntity {
5
+ AccountNo: string;
6
+ ParentAccountNo?: string;
7
+ Name: string;
8
+ Description: string;
9
+ AccountType: string;
10
+ AccountSubtype: string;
11
+ OwnerId: string;
12
+ OwnerType: string;
13
+ RelatedObjectId: string;
14
+ RelatedObjectType: string;
15
+ CreatedById: string;
16
+ CreatedAt: Date;
17
+ UpdatedById: string;
18
+ UpdatedAt: Date;
19
+ private static _RepositoryBase;
20
+ private _DbTransaction;
21
+ private _IsNewRecord;
22
+ private get IsNewRecord();
23
+ private set IsNewRecord(value);
24
+ get RepositoryBase(): AccountRepository;
25
+ get ObjectId(): string;
26
+ get ObjectName(): string;
27
+ get TableName(): string;
28
+ constructor(dbTransaction?: any, accountNo?: string);
29
+ private init;
30
+ static initAccount(dbTransaction: any, accountNo: string): Promise<Account>;
31
+ static initialize(): void;
32
+ validateAccountValue(): void;
33
+ isParentAccountExists(): boolean;
34
+ save(CompanyId: string, AccSystemRefId: string, userId: string, dbTransaction?: any): Promise<AccountModel>;
35
+ }
@@ -1,232 +1,234 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- const general_1 = require("@tomei/general");
13
- const account_system_entity_1 = require("../account-system-entity/account-system-entity");
14
- const account_repository_1 = require("./account.repository");
15
- class Account extends account_system_entity_1.AccountSystemEntity {
16
- get IsNewRecord() {
17
- return this._IsNewRecord;
18
- }
19
- set IsNewRecord(record) {
20
- this._IsNewRecord = record;
21
- }
22
- get RepositoryBase() {
23
- return Account._RepositoryBase;
24
- }
25
- get ObjectId() {
26
- return this.AccountNo;
27
- }
28
- get ObjectName() {
29
- return this.Name;
30
- }
31
- get TableName() {
32
- return 'finance_Account';
33
- }
34
- constructor(dbTransaction, accountNo) {
35
- super();
36
- this.AccountNo = 'New';
37
- this.ParentAccountNo = '';
38
- this.Name = '';
39
- this.Description = '';
40
- this.AccountType = '';
41
- this.AccountSubtype = '';
42
- this.OwnerId = '';
43
- this.OwnerType = '';
44
- this.RelatedObjectId = '';
45
- this.RelatedObjectType = '';
46
- this.CreatedById = '';
47
- this.UpdatedById = '';
48
- this._IsNewRecord = true;
49
- if (dbTransaction) {
50
- this._DbTransaction = dbTransaction;
51
- }
52
- if (accountNo) {
53
- this.RepositoryBase.findOne({
54
- where: {
55
- AccountNo: accountNo,
56
- },
57
- transaction: dbTransaction,
58
- })
59
- .then((accountData) => {
60
- if (accountData) {
61
- this.IsNewRecord = false;
62
- this.CompanyId = accountData.CompanyId;
63
- this.ParentAccountNo = accountData.ParentAccountNo;
64
- this.Name = accountData.Name;
65
- this.Description = accountData.Description;
66
- this.AccountType = accountData.AccountType;
67
- this.AccountSubtype = accountData.AccountSubType;
68
- this.OwnerId = accountData.OwnerId;
69
- this.OwnerType = accountData.OwnerType;
70
- this.RelatedObjectId = accountData.RelatedObjectId;
71
- this.RelatedObjectType = accountData.RelatedObjectType;
72
- this.CreatedById = accountData.CreatedById;
73
- this.CreatedAt = accountData.CreatedAt;
74
- this.UpdatedById = accountData.UpdatedById;
75
- this.UpdatedAt = accountData.UpdatedAt;
76
- this.AccSystemRefId = accountData.AccSystemRefId;
77
- this.PostedToAccSystemYN = accountData.PostedToAccSystemYN;
78
- this.PostedById = accountData.PostedById;
79
- this.PostedDateTime = accountData.PostedDateTime;
80
- }
81
- else {
82
- const notFoundError = new general_1.RecordNotFoundError('No Record Found.');
83
- throw notFoundError;
84
- }
85
- })
86
- .catch((err) => {
87
- console.log('Account Class constructor err: ', err);
88
- });
89
- }
90
- }
91
- init(accountData) {
92
- this.IsNewRecord = false;
93
- this.CompanyId = accountData.CompanyId;
94
- this.ParentAccountNo = accountData.ParentAccountNo;
95
- this.Name = accountData.Name;
96
- this.Description = accountData.Description;
97
- this.AccountType = accountData.AccountType;
98
- this.AccountSubtype = accountData.AccountSubType;
99
- this.OwnerId = accountData.OwnerId;
100
- this.OwnerType = accountData.OwnerType;
101
- this.RelatedObjectId = accountData.RelatedObjectId;
102
- this.RelatedObjectType = accountData.RelatedObjectType;
103
- this.CreatedById = accountData.CreatedById;
104
- this.CreatedAt = accountData.CreatedAt;
105
- this.UpdatedById = accountData.UpdatedById;
106
- this.UpdatedAt = accountData.UpdatedAt;
107
- this.AccSystemRefId = accountData.AccSystemRefId;
108
- this.PostedToAccSystemYN = accountData.PostedToAccSystemYN;
109
- this.PostedById = accountData.PostedById;
110
- this.PostedDateTime = accountData.PostedDateTime;
111
- }
112
- static initAccount(dbTransaction, accountNo) {
113
- return __awaiter(this, void 0, void 0, function* () {
114
- try {
115
- const accountData = yield Account._RepositoryBase.findOne({
116
- where: {
117
- AccountNo: accountNo,
118
- },
119
- transaction: dbTransaction,
120
- });
121
- if (accountData) {
122
- const account = new Account(dbTransaction);
123
- account.init(accountData.get({ plain: true }));
124
- return account;
125
- }
126
- else {
127
- const notFoundError = new general_1.RecordNotFoundError('No Record Found.');
128
- throw notFoundError;
129
- }
130
- }
131
- catch (error) {
132
- console.log('Account Class constructor err: ', error);
133
- throw error;
134
- }
135
- });
136
- }
137
- static initialize() {
138
- const dbTransaction = null;
139
- let defaultAccountReceivable;
140
- let defaultAccountPayable;
141
- try {
142
- defaultAccountReceivable = new Account(dbTransaction, 'EZC-AR');
143
- }
144
- catch (err) {
145
- defaultAccountReceivable = new Account(dbTransaction);
146
- defaultAccountReceivable.AccountNo = null;
147
- defaultAccountReceivable.AccountType = 'Account Receivable';
148
- defaultAccountReceivable.OwnerId = 'System';
149
- defaultAccountReceivable.OwnerType = '';
150
- }
151
- try {
152
- defaultAccountPayable = new Account(dbTransaction, 'EZC-AP');
153
- }
154
- catch (err) {
155
- defaultAccountPayable = new Account(dbTransaction);
156
- defaultAccountPayable.AccountNo = null;
157
- defaultAccountPayable.AccountType = 'Account Payable';
158
- defaultAccountPayable.OwnerId = 'System';
159
- }
160
- }
161
- validateAccountValue() {
162
- if (!this.AccSystemRefId) {
163
- throw new Error('AccSystemAccountId is required.');
164
- }
165
- if (!this.AccountType) {
166
- throw new Error('AccountType is required.');
167
- }
168
- }
169
- isParentAccountExists() {
170
- if (this.ParentAccountNo)
171
- return true;
172
- return false;
173
- }
174
- save(CompanyId, AccSystemRefId, userId, dbTransaction) {
175
- return __awaiter(this, void 0, void 0, function* () {
176
- this.AccSystemRefId = AccSystemRefId;
177
- console.log('Account Save: Before AccountNo FindOne');
178
- let data = yield this.RepositoryBase.findOne({
179
- where: {
180
- AccountNo: this.AccountNo,
181
- },
182
- transaction: dbTransaction,
183
- });
184
- console.log('Account Save: After AccountNo FindOne');
185
- console.log(data, '<><><><><> Account Data Result <><><><><><>');
186
- if (data) {
187
- console.log('Account Save: THERE IS DATA FOUND');
188
- this.AccountNo = data.AccountNo;
189
- this.AccSystemRefId = data.AccSystemRefId;
190
- this.Name = data.Name;
191
- this.Description = data.Description;
192
- this.AccountType = data.AccountType;
193
- this.AccountSubtype = data.AccountSubType;
194
- this.CompanyId = data.CompanyId;
195
- this.OwnerId = data.OwnerId;
196
- this.OwnerType = data.OwnerType;
197
- this.RelatedObjectId = data.RelatedObjectId;
198
- this.RelatedObjectType = data.RelatedObjectType;
199
- this.PostedToAccSystemYN = data.PostedToAccSystemYN;
200
- this.CreatedAt = data.CreatedAt;
201
- this.CreatedById = data.CreatedById;
202
- }
203
- else {
204
- console.log('Account Save: THERE IS NO DATA FOUND');
205
- data = yield this.RepositoryBase.create({
206
- AccountNo: this.AccountNo,
207
- AccSystemRefId: this.AccSystemRefId,
208
- Name: this.Name,
209
- Description: this.Description,
210
- AccountType: this.AccountType,
211
- AccountSubtype: this.AccountSubtype,
212
- CompanyId: CompanyId,
213
- OwnerId: this.OwnerId,
214
- OwnerType: this.OwnerType,
215
- RelatedObjectId: this.RelatedObjectId,
216
- RelatedObjectType: this.RelatedObjectType,
217
- PostedToAccSystemYN: this.PostedToAccSystemYN,
218
- CreatedAt: new Date(),
219
- CreatedById: userId,
220
- }, {
221
- transaction: dbTransaction,
222
- });
223
- console.log(data, '<><><><><><><> DATA THAT GETS CREATED <><><><><><><>');
224
- }
225
- console.log(data, 'Account Save: Account details returned');
226
- return data;
227
- });
228
- }
229
- }
230
- exports.default = Account;
231
- Account._RepositoryBase = new account_repository_1.AccountRepository();
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const general_1 = require("@tomei/general");
13
+ const account_system_entity_1 = require("../account-system-entity/account-system-entity");
14
+ const account_repository_1 = require("./account.repository");
15
+ class Account extends account_system_entity_1.AccountSystemEntity {
16
+ get IsNewRecord() {
17
+ return this._IsNewRecord;
18
+ }
19
+ set IsNewRecord(record) {
20
+ this._IsNewRecord = record;
21
+ }
22
+ get RepositoryBase() {
23
+ return Account._RepositoryBase;
24
+ }
25
+ get ObjectId() {
26
+ return this.AccountNo;
27
+ }
28
+ get ObjectName() {
29
+ return this.Name;
30
+ }
31
+ get TableName() {
32
+ return 'finance_Account';
33
+ }
34
+ constructor(dbTransaction, accountNo) {
35
+ super();
36
+ this.AccountNo = 'New';
37
+ this.ParentAccountNo = '';
38
+ this.Name = '';
39
+ this.Description = '';
40
+ this.AccountType = '';
41
+ this.AccountSubtype = '';
42
+ this.OwnerId = '';
43
+ this.OwnerType = '';
44
+ this.RelatedObjectId = '';
45
+ this.RelatedObjectType = '';
46
+ this.CreatedById = '';
47
+ this.UpdatedById = '';
48
+ this._IsNewRecord = true;
49
+ if (dbTransaction) {
50
+ this._DbTransaction = dbTransaction;
51
+ }
52
+ if (accountNo) {
53
+ this.RepositoryBase.findOne({
54
+ where: {
55
+ AccountNo: accountNo,
56
+ },
57
+ transaction: dbTransaction,
58
+ })
59
+ .then((accountData) => {
60
+ if (accountData) {
61
+ this.IsNewRecord = false;
62
+ this.CompanyId = accountData.CompanyId;
63
+ this.ParentAccountNo = accountData.ParentAccountNo;
64
+ this.Name = accountData.Name;
65
+ this.Description = accountData.Description;
66
+ this.AccountType = accountData.AccountType;
67
+ this.AccountSubtype = accountData.AccountSubType;
68
+ this.OwnerId = accountData.OwnerId;
69
+ this.OwnerType = accountData.OwnerType;
70
+ this.RelatedObjectId = accountData.RelatedObjectId;
71
+ this.RelatedObjectType = accountData.RelatedObjectType;
72
+ this.CreatedById = accountData.CreatedById;
73
+ this.CreatedAt = accountData.CreatedAt;
74
+ this.UpdatedById = accountData.UpdatedById;
75
+ this.UpdatedAt = accountData.UpdatedAt;
76
+ this.AccSystemRefId = accountData.AccSystemRefId;
77
+ this.PostedToAccSystemYN = accountData.PostedToAccSystemYN;
78
+ this.PostedById = accountData.PostedById;
79
+ this.PostedDateTime = accountData.PostedDateTime;
80
+ }
81
+ else {
82
+ const notFoundError = new general_1.RecordNotFoundError('No Record Found.');
83
+ throw notFoundError;
84
+ }
85
+ })
86
+ .catch((err) => {
87
+ console.log('Account Class constructor err: ', err);
88
+ });
89
+ }
90
+ }
91
+ init(accountData) {
92
+ this.IsNewRecord = false;
93
+ this.CompanyId = accountData.CompanyId;
94
+ this.ParentAccountNo = accountData.ParentAccountNo;
95
+ this.Name = accountData.Name;
96
+ this.Description = accountData.Description;
97
+ this.AccountType = accountData.AccountType;
98
+ this.AccountSubtype = accountData.AccountSubType;
99
+ this.OwnerId = accountData.OwnerId;
100
+ this.OwnerType = accountData.OwnerType;
101
+ this.RelatedObjectId = accountData.RelatedObjectId;
102
+ this.RelatedObjectType = accountData.RelatedObjectType;
103
+ this.CreatedById = accountData.CreatedById;
104
+ this.CreatedAt = accountData.CreatedAt;
105
+ this.UpdatedById = accountData.UpdatedById;
106
+ this.UpdatedAt = accountData.UpdatedAt;
107
+ this.AccSystemRefId = accountData.AccSystemRefId;
108
+ this.PostedToAccSystemYN = accountData.PostedToAccSystemYN;
109
+ this.PostedById = accountData.PostedById;
110
+ this.PostedDateTime = accountData.PostedDateTime;
111
+ }
112
+ static initAccount(dbTransaction, accountNo) {
113
+ return __awaiter(this, void 0, void 0, function* () {
114
+ try {
115
+ const accountData = yield Account._RepositoryBase.findOne({
116
+ where: {
117
+ AccountNo: accountNo,
118
+ },
119
+ transaction: dbTransaction,
120
+ });
121
+ if (accountData) {
122
+ const account = new Account(dbTransaction);
123
+ account.init(accountData.get({ plain: true }));
124
+ return account;
125
+ }
126
+ else {
127
+ const notFoundError = new general_1.RecordNotFoundError('No Record Found.');
128
+ throw notFoundError;
129
+ }
130
+ }
131
+ catch (error) {
132
+ console.log('Account Class constructor err: ', error);
133
+ throw error;
134
+ }
135
+ });
136
+ }
137
+ static initialize() {
138
+ const dbTransaction = null;
139
+ let defaultAccountReceivable;
140
+ let defaultAccountPayable;
141
+ try {
142
+ defaultAccountReceivable = new Account(dbTransaction, 'EZC-AR');
143
+ }
144
+ catch (err) {
145
+ defaultAccountReceivable = new Account(dbTransaction);
146
+ defaultAccountReceivable.AccountNo = null;
147
+ defaultAccountReceivable.AccountType = 'Account Receivable';
148
+ defaultAccountReceivable.OwnerId = 'System';
149
+ defaultAccountReceivable.OwnerType = '';
150
+ }
151
+ try {
152
+ defaultAccountPayable = new Account(dbTransaction, 'EZC-AP');
153
+ }
154
+ catch (err) {
155
+ defaultAccountPayable = new Account(dbTransaction);
156
+ defaultAccountPayable.AccountNo = null;
157
+ defaultAccountPayable.AccountType = 'Account Payable';
158
+ defaultAccountPayable.OwnerId = 'System';
159
+ }
160
+ }
161
+ validateAccountValue() {
162
+ if (!this.AccSystemRefId) {
163
+ throw new Error('AccSystemAccountId is required.');
164
+ }
165
+ if (!this.AccountType) {
166
+ throw new Error('AccountType is required.');
167
+ }
168
+ }
169
+ isParentAccountExists() {
170
+ if (this.ParentAccountNo)
171
+ return true;
172
+ return false;
173
+ }
174
+ save(CompanyId, AccSystemRefId, userId, dbTransaction) {
175
+ return __awaiter(this, void 0, void 0, function* () {
176
+ this.AccSystemRefId = AccSystemRefId;
177
+ console.log('Account Save: Before AccountNo FindOne');
178
+ let data = yield this.RepositoryBase.findOne({
179
+ where: {
180
+ AccountNo: this.AccountNo,
181
+ },
182
+ transaction: dbTransaction,
183
+ });
184
+ console.log('Account Save: After AccountNo FindOne');
185
+ console.log(data, '<><><><><> Account Data Result <><><><><><>');
186
+ if (data) {
187
+ console.log('Account Save: THERE IS DATA FOUND');
188
+ this.AccountNo = data.AccountNo;
189
+ this.AccSystemRefId = data.AccSystemRefId;
190
+ this.Name = data.Name;
191
+ this.Description = data.Description;
192
+ this.AccountType = data.AccountType;
193
+ this.AccountSubtype = data.AccountSubType;
194
+ this.CompanyId = data.CompanyId;
195
+ this.OwnerId = data.OwnerId;
196
+ this.OwnerType = data.OwnerType;
197
+ this.RelatedObjectId = data.RelatedObjectId;
198
+ this.RelatedObjectType = data.RelatedObjectType;
199
+ this.PostedToAccSystemYN = data.PostedToAccSystemYN;
200
+ this.CreatedAt = data.CreatedAt;
201
+ this.CreatedById = data.CreatedById;
202
+ this.UpdatedAt = new Date();
203
+ }
204
+ else {
205
+ console.log('Account Save: THERE IS NO DATA FOUND');
206
+ data = yield this.RepositoryBase.create({
207
+ AccountNo: this.AccountNo,
208
+ AccSystemRefId: this.AccSystemRefId,
209
+ Name: this.Name,
210
+ Description: this.Description,
211
+ AccountType: this.AccountType,
212
+ AccountSubtype: this.AccountSubtype,
213
+ CompanyId: CompanyId,
214
+ OwnerId: this.OwnerId,
215
+ OwnerType: this.OwnerType,
216
+ RelatedObjectId: this.RelatedObjectId,
217
+ RelatedObjectType: this.RelatedObjectType,
218
+ PostedToAccSystemYN: this.PostedToAccSystemYN,
219
+ CreatedAt: new Date(),
220
+ UpdatedAt: new Date(),
221
+ CreatedById: userId,
222
+ }, {
223
+ transaction: dbTransaction,
224
+ });
225
+ console.log(data, '<><><><><><><> DATA THAT GETS CREATED <><><><><><><>');
226
+ }
227
+ console.log(data, 'Account Save: Account details returned');
228
+ return data;
229
+ });
230
+ }
231
+ }
232
+ exports.default = Account;
233
+ Account._RepositoryBase = new account_repository_1.AccountRepository();
232
234
  //# sourceMappingURL=account.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sourceRoot":"","sources":["../../src/account/account.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,4CAAqD;AACrD,0FAAqF;AAErF,6DAAyD;AAKzD,MAAqB,OAAQ,SAAQ,2CAAmB;IAqBtD,IAAY,WAAW;QACrB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAY,WAAW,CAAC,MAAe;QACrC,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC;IAC7B,CAAC;IAGD,IAAI,cAAc;QAChB,OAAO,OAAO,CAAC,eAAe,CAAC;IACjC,CAAC;IAGD,IAAI,QAAQ;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,SAAS;QACX,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAED,YAAY,aAAmB,EAAE,SAAkB;QACjD,KAAK,EAAE,CAAC;QA/CV,cAAS,GAAG,KAAK,CAAC;QAClB,oBAAe,GAAI,EAAE,CAAC;QACtB,SAAI,GAAG,EAAE,CAAC;QACV,gBAAW,GAAG,EAAE,CAAC;QACjB,gBAAW,GAAG,EAAE,CAAC;QACjB,mBAAc,GAAG,EAAE,CAAC;QACpB,YAAO,GAAG,EAAE,CAAC;QACb,cAAS,GAAG,EAAE,CAAC;QACf,oBAAe,GAAG,EAAE,CAAC;QACrB,sBAAiB,GAAG,EAAE,CAAC;QACvB,gBAAW,GAAG,EAAE,CAAC;QAEjB,gBAAW,GAAG,EAAE,CAAC;QAMT,iBAAY,GAAG,IAAI,CAAC;QA8B1B,IAAI,aAAa,EAAE;YACjB,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;SACrC;QACD,IAAI,SAAS,EAAE;YACb,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC;gBAC1B,KAAK,EA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EpD,IAAI,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,MAAM,CACrC;oBACE,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,cAAc,EAAE,IAAI,CAAC,cAAc;oBACnC,IAAI,EAAE,IAAI,CAAC,IAAI;oBACf,WAAW,EAAE,IAAI,CAAC,WAAW;oBAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;oBAC7B,cAAc,EAAE,IAAI,CAAC,cAAc;oBACnC,SAAS,EAAE,SAAS;oBACpB,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,SAAS,EAAE,IAAI,CAAC,SAAS;oBACzB,eAAe,EAAE,IAAI,CAAC,eAAe;oBACrC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;oBACzC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;oBAC7C,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,SAAS,EAAE,IAAI,IAAI,EAAE;oBACrB,WAAW,EAAE,MAAM;iBACpB,EACD;oBACE,WAAW,EAAE,aAAa;iBAC3B,CACF,CAAC;gBAEF,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,sDAAsD,CAAC,CAAC;aAC3E;YAED,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,wCAAwC,CAAC,CAAC;YAE5D,OAAO,IAAI,CAAC;QACd,CAAC;KAAA;;AAhQH,0BAiQC;AAjPgB,uBAAe,GAAG,IAAI,sCAAiB,EAAE,CAAC"}
@@ -1,5 +1,5 @@
1
- import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
- import AccountModel from '../models/account.entity';
3
- export declare class AccountRepository extends RepositoryBase<AccountModel> implements IRepositoryBase<AccountModel> {
4
- constructor();
5
- }
1
+ import { RepositoryBase, IRepositoryBase } from '@tomei/general';
2
+ import AccountModel from '../models/account.entity';
3
+ export declare class AccountRepository extends RepositoryBase<AccountModel> implements IRepositoryBase<AccountModel> {
4
+ constructor();
5
+ }
@@ -1,12 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AccountRepository = void 0;
4
- const general_1 = require("@tomei/general");
5
- const account_entity_1 = require("../models/account.entity");
6
- class AccountRepository extends general_1.RepositoryBase {
7
- constructor() {
8
- super(account_entity_1.default);
9
- }
10
- }
11
- exports.AccountRepository = AccountRepository;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AccountRepository = void 0;
4
+ const general_1 = require("@tomei/general");
5
+ const account_entity_1 = require("../models/account.entity");
6
+ class AccountRepository extends general_1.RepositoryBase {
7
+ constructor() {
8
+ super(account_entity_1.default);
9
+ }
10
+ }
11
+ exports.AccountRepository = AccountRepository;
12
12
  //# sourceMappingURL=account.repository.js.map