@tomei/finance 0.6.114 → 0.8.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/account.d.ts +1 -0
- package/dist/account/account.d.ts.map +1 -0
- package/dist/account/account.js.map +1 -1
- package/dist/account/account.repository.d.ts +1 -0
- package/dist/account/account.repository.d.ts.map +1 -0
- package/dist/account/account.repository.js +4 -1
- package/dist/account/account.repository.js.map +1 -1
- package/dist/account/interfaces/account-attr.interface.d.ts +1 -0
- package/dist/account/interfaces/account-attr.interface.d.ts.map +1 -0
- package/dist/account-system-entity/account-system-entity.d.ts +1 -0
- package/dist/account-system-entity/account-system-entity.d.ts.map +1 -0
- package/dist/account-system-entity/account-system-entity.js +4 -1
- package/dist/account-system-entity/account-system-entity.js.map +1 -1
- package/dist/account-system-entity/post-history.repository.d.ts +1 -0
- package/dist/account-system-entity/post-history.repository.d.ts.map +1 -0
- package/dist/account-system-entity/post-history.repository.js +4 -1
- package/dist/account-system-entity/post-history.repository.js.map +1 -1
- package/dist/config.d.ts +1 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +17 -4
- package/dist/config.js.map +1 -1
- package/dist/customer/customer.d.ts +1 -0
- package/dist/customer/customer.d.ts.map +1 -0
- package/dist/customer/customer.js +38 -2
- package/dist/customer/customer.js.map +1 -1
- package/dist/customer/finance-customer.repository.d.ts +1 -0
- package/dist/customer/finance-customer.repository.d.ts.map +1 -0
- package/dist/customer/finance-customer.repository.js +4 -1
- package/dist/customer/finance-customer.repository.js.map +1 -1
- package/dist/customer/interfaces/customer.repository.interface.d.ts +1 -0
- package/dist/customer/interfaces/customer.repository.interface.d.ts.map +1 -0
- package/dist/customer/interfaces/finance-customer-attr.interface.d.ts +1 -0
- package/dist/customer/interfaces/finance-customer-attr.interface.d.ts.map +1 -0
- package/dist/customer/interfaces/finance-customer.repository.interface.d.ts +1 -0
- package/dist/customer/interfaces/finance-customer.repository.interface.d.ts.map +1 -0
- package/dist/database.d.ts +1 -0
- package/dist/database.d.ts.map +1 -0
- package/dist/database.js +18 -15
- package/dist/database.js.map +1 -1
- package/dist/document/document-item.d.ts +3 -2
- package/dist/document/document-item.d.ts.map +1 -0
- package/dist/document/document-item.js +1 -1
- package/dist/document/document-item.js.map +1 -1
- package/dist/document/document-item.repository.d.ts +1 -0
- package/dist/document/document-item.repository.d.ts.map +1 -0
- package/dist/document/document-item.repository.js +4 -1
- package/dist/document/document-item.repository.js.map +1 -1
- package/dist/document/document.d.ts +2 -1
- package/dist/document/document.d.ts.map +1 -0
- package/dist/document/document.js +242 -191
- package/dist/document/document.js.map +1 -1
- package/dist/document/document.repository.d.ts +1 -0
- package/dist/document/document.repository.d.ts.map +1 -0
- package/dist/document/document.repository.js +4 -1
- package/dist/document/document.repository.js.map +1 -1
- package/dist/document/interfaces/document-attr.interface.d.ts +1 -0
- package/dist/document/interfaces/document-attr.interface.d.ts.map +1 -0
- package/dist/document/interfaces/document-find-all.interface.d.ts +1 -0
- package/dist/document/interfaces/document-find-all.interface.d.ts.map +1 -0
- package/dist/document/interfaces/document-item-attr.interface.d.ts +1 -0
- package/dist/document/interfaces/document-item-attr.interface.d.ts.map +1 -0
- package/dist/document/interfaces/document-item.repository.interface.d.ts +1 -0
- package/dist/document/interfaces/document-item.repository.interface.d.ts.map +1 -0
- package/dist/document-tag/document-tag.d.ts +19 -0
- package/dist/document-tag/document-tag.d.ts.map +1 -0
- package/dist/document-tag/document-tag.js +68 -0
- package/dist/document-tag/document-tag.js.map +1 -0
- package/dist/document-tag/document-tag.repository.d.ts +6 -0
- package/dist/document-tag/document-tag.repository.d.ts.map +1 -0
- package/dist/document-tag/document-tag.repository.js +15 -0
- package/dist/document-tag/document-tag.repository.js.map +1 -0
- package/dist/document-tag/interfaces/document-tag-attr.interface.d.ts +8 -0
- package/dist/document-tag/interfaces/document-tag-attr.interface.d.ts.map +1 -0
- package/dist/document-tag/interfaces/document-tag-attr.interface.js +3 -0
- package/dist/document-tag/interfaces/document-tag-attr.interface.js.map +1 -0
- package/dist/enum/collect-payment-type.d.ts +1 -0
- package/dist/enum/collect-payment-type.d.ts.map +1 -0
- package/dist/enum/doc-type.enum.d.ts +1 -0
- package/dist/enum/doc-type.enum.d.ts.map +1 -0
- package/dist/enum/document-status.enum.d.ts +1 -0
- package/dist/enum/document-status.enum.d.ts.map +1 -0
- package/dist/enum/index.d.ts +2 -2
- package/dist/enum/index.d.ts.map +1 -0
- package/dist/enum/index.js +1 -3
- package/dist/enum/index.js.map +1 -1
- package/dist/enum/payment-method.enum.d.ts +1 -0
- package/dist/enum/payment-method.enum.d.ts.map +1 -0
- package/dist/enum/payment-status.enum.d.ts +1 -0
- package/dist/enum/payment-status.enum.d.ts.map +1 -0
- package/dist/enum/payment-type.enum.d.ts +1 -0
- package/dist/enum/payment-type.enum.d.ts.map +1 -0
- package/dist/enum/quick-book-client-scopes.enum.d.ts +1 -0
- package/dist/enum/quick-book-client-scopes.enum.d.ts.map +1 -0
- package/dist/enum/quick-book-client-scopes.enum.js +34 -1
- package/dist/enum/quick-book-client-scopes.enum.js.map +1 -1
- package/dist/enum/transaction-type.enum.d.ts +1 -0
- package/dist/enum/transaction-type.enum.d.ts.map +1 -0
- package/dist/finance-company/finance-company.d.ts +20 -17
- package/dist/finance-company/finance-company.d.ts.map +1 -0
- package/dist/finance-company/finance-company.js +89 -23
- package/dist/finance-company/finance-company.js.map +1 -1
- package/dist/finance-company/finance-company.repository.d.ts +1 -0
- package/dist/finance-company/finance-company.repository.d.ts.map +1 -0
- package/dist/finance-company/finance-company.repository.js +4 -1
- package/dist/finance-company/finance-company.repository.js.map +1 -1
- package/dist/helpers/login-user.d.ts +1 -0
- package/dist/helpers/login-user.d.ts.map +1 -0
- package/dist/helpers/typeof.d.ts +1 -0
- package/dist/helpers/typeof.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +51 -15
- package/dist/index.js.map +1 -1
- package/dist/interfaces/account-system.interface.d.ts +4 -0
- package/dist/interfaces/account-system.interface.d.ts.map +1 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.d.ts.map +1 -0
- package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts +1 -0
- package/dist/journal-entry/interfaces/journal-entry-attr.interface.d.ts.map +1 -0
- package/dist/journal-entry/journal-entry.d.ts +1 -0
- package/dist/journal-entry/journal-entry.d.ts.map +1 -0
- package/dist/journal-entry/journal-entry.js +4 -1
- package/dist/journal-entry/journal-entry.js.map +1 -1
- package/dist/journal-entry/journal-entry.repository.d.ts +1 -0
- package/dist/journal-entry/journal-entry.repository.d.ts.map +1 -0
- package/dist/journal-entry/journal-entry.repository.js +4 -1
- package/dist/journal-entry/journal-entry.repository.js.map +1 -1
- package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts +1 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction-attr.interface.d.ts.map +1 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.d.ts +1 -0
- package/dist/ledger-transaction/interfaces/ledger-transaction.repository.interface.d.ts.map +1 -0
- package/dist/ledger-transaction/ledger-transaction.d.ts +1 -0
- package/dist/ledger-transaction/ledger-transaction.d.ts.map +1 -0
- package/dist/ledger-transaction/ledger-transaction.repository.d.ts +1 -0
- package/dist/ledger-transaction/ledger-transaction.repository.d.ts.map +1 -0
- package/dist/ledger-transaction/ledger-transaction.repository.js +4 -1
- package/dist/ledger-transaction/ledger-transaction.repository.js.map +1 -1
- package/dist/models/account.entity.d.ts +1 -0
- package/dist/models/account.entity.d.ts.map +1 -0
- package/dist/models/account.entity.js +7 -4
- package/dist/models/account.entity.js.map +1 -1
- package/dist/models/customer.entity.d.ts +1 -0
- package/dist/models/customer.entity.d.ts.map +1 -0
- package/dist/models/customer.entity.js +4 -1
- package/dist/models/customer.entity.js.map +1 -1
- package/dist/models/document-item.entity.d.ts +1 -0
- package/dist/models/document-item.entity.d.ts.map +1 -0
- package/dist/models/document-item.entity.js +5 -2
- package/dist/models/document-item.entity.js.map +1 -1
- package/dist/models/document-tag.entity.d.ts +14 -0
- package/dist/models/document-tag.entity.d.ts.map +1 -0
- package/dist/models/document-tag.entity.js +64 -0
- package/dist/models/document-tag.entity.js.map +1 -0
- package/dist/models/document.entity.d.ts +3 -0
- package/dist/models/document.entity.d.ts.map +1 -0
- package/dist/models/document.entity.js +12 -4
- package/dist/models/document.entity.js.map +1 -1
- package/dist/models/finance-company.entity.d.ts +1 -0
- package/dist/models/finance-company.entity.d.ts.map +1 -0
- package/dist/models/finance-company.entity.js +5 -2
- package/dist/models/finance-company.entity.js.map +1 -1
- package/dist/models/journal-entry.entity.d.ts +1 -0
- package/dist/models/journal-entry.entity.d.ts.map +1 -0
- package/dist/models/journal-entry.entity.js +5 -2
- package/dist/models/journal-entry.entity.js.map +1 -1
- package/dist/models/ledger-transaction.entity.d.ts +1 -0
- package/dist/models/ledger-transaction.entity.d.ts.map +1 -0
- package/dist/models/ledger-transaction.entity.js +7 -4
- package/dist/models/ledger-transaction.entity.js.map +1 -1
- package/dist/models/payment-item.entity.d.ts +1 -0
- package/dist/models/payment-item.entity.d.ts.map +1 -0
- package/dist/models/payment-item.entity.js +4 -1
- package/dist/models/payment-item.entity.js.map +1 -1
- package/dist/models/payment-method-type.entity.d.ts +1 -0
- package/dist/models/payment-method-type.entity.d.ts.map +1 -0
- package/dist/models/payment-method-type.entity.js +5 -2
- package/dist/models/payment-method-type.entity.js.map +1 -1
- package/dist/models/payment-method.entity.d.ts +1 -0
- package/dist/models/payment-method.entity.d.ts.map +1 -0
- package/dist/models/payment-method.entity.js +5 -2
- package/dist/models/payment-method.entity.js.map +1 -1
- package/dist/models/payment-paid-with.entity.d.ts +1 -0
- package/dist/models/payment-paid-with.entity.d.ts.map +1 -0
- package/dist/models/payment-paid-with.entity.js +5 -2
- package/dist/models/payment-paid-with.entity.js.map +1 -1
- package/dist/models/payment.entity.d.ts +1 -0
- package/dist/models/payment.entity.d.ts.map +1 -0
- package/dist/models/payment.entity.js +6 -3
- package/dist/models/payment.entity.js.map +1 -1
- package/dist/models/post-history.entity.d.ts +1 -0
- package/dist/models/post-history.entity.d.ts.map +1 -0
- package/dist/models/tag-group.entity.d.ts +16 -0
- package/dist/models/tag-group.entity.d.ts.map +1 -0
- package/dist/models/tag-group.entity.js +95 -0
- package/dist/models/tag-group.entity.js.map +1 -0
- package/dist/models/tag.entity.d.ts +17 -0
- package/dist/models/tag.entity.d.ts.map +1 -0
- package/dist/models/tag.entity.js +100 -0
- package/dist/models/tag.entity.js.map +1 -0
- package/dist/models/tax.entity.d.ts +1 -0
- package/dist/models/tax.entity.d.ts.map +1 -0
- package/dist/models/tax.entity.js +4 -1
- package/dist/models/tax.entity.js.map +1 -1
- package/dist/payment/interfaces/payment-attr.interface.d.ts +1 -0
- package/dist/payment/interfaces/payment-attr.interface.d.ts.map +1 -0
- package/dist/payment/interfaces/payment-params.interface.d.ts +1 -0
- package/dist/payment/interfaces/payment-params.interface.d.ts.map +1 -0
- package/dist/payment/payment.d.ts +1 -0
- package/dist/payment/payment.d.ts.map +1 -0
- package/dist/payment/payment.js +5 -2
- package/dist/payment/payment.js.map +1 -1
- package/dist/payment/payment.repository.d.ts +1 -0
- package/dist/payment/payment.repository.d.ts.map +1 -0
- package/dist/payment/payment.repository.js +4 -1
- package/dist/payment/payment.repository.js.map +1 -1
- package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts +1 -0
- package/dist/payment-item/interfaces/payment-item-attr.interface.d.ts.map +1 -0
- package/dist/payment-item/payment-item.d.ts +1 -0
- package/dist/payment-item/payment-item.d.ts.map +1 -0
- package/dist/payment-item/payment-item.js +4 -4
- package/dist/payment-item/payment-item.repository.d.ts +1 -0
- package/dist/payment-item/payment-item.repository.d.ts.map +1 -0
- package/dist/payment-item/payment-item.repository.js +4 -1
- package/dist/payment-item/payment-item.repository.js.map +1 -1
- package/dist/payment-method/interfaces/payment-method-attr.interface.d.ts +1 -0
- package/dist/payment-method/interfaces/payment-method-attr.interface.d.ts.map +1 -0
- package/dist/payment-method/payment-method.d.ts +1 -0
- package/dist/payment-method/payment-method.d.ts.map +1 -0
- package/dist/payment-method/payment-method.js +4 -1
- package/dist/payment-method/payment-method.js.map +1 -1
- package/dist/payment-method/payment-method.repository.d.ts +1 -0
- package/dist/payment-method/payment-method.repository.d.ts.map +1 -0
- package/dist/payment-method/payment-method.repository.js +4 -1
- package/dist/payment-method/payment-method.repository.js.map +1 -1
- package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.d.ts +1 -0
- package/dist/payment-method-type/interfaces/payment-method-type-attr.interface.d.ts.map +1 -0
- package/dist/payment-method-type/payment-method-type.d.ts +1 -0
- package/dist/payment-method-type/payment-method-type.d.ts.map +1 -0
- package/dist/payment-method-type/payment-method-type.repository.d.ts +1 -0
- package/dist/payment-method-type/payment-method-type.repository.d.ts.map +1 -0
- package/dist/payment-method-type/payment-method-type.repository.js +4 -1
- package/dist/payment-method-type/payment-method-type.repository.js.map +1 -1
- package/dist/payment-paid-with/interfaces/payment-paid-with.interface.d.ts +1 -0
- package/dist/payment-paid-with/interfaces/payment-paid-with.interface.d.ts.map +1 -0
- package/dist/payment-paid-with/payment-paid-with.d.ts +1 -0
- package/dist/payment-paid-with/payment-paid-with.d.ts.map +1 -0
- package/dist/payment-paid-with/payment-paid-with.repository.d.ts +1 -0
- package/dist/payment-paid-with/payment-paid-with.repository.d.ts.map +1 -0
- package/dist/payment-paid-with/payment-paid-with.repository.js +4 -1
- package/dist/payment-paid-with/payment-paid-with.repository.js.map +1 -1
- package/dist/tag/interfaces/tag-attr.interface.d.ts +14 -0
- package/dist/tag/interfaces/tag-attr.interface.d.ts.map +1 -0
- package/dist/tag/interfaces/tag-attr.interface.js +3 -0
- package/dist/tag/interfaces/tag-attr.interface.js.map +1 -0
- package/dist/tag/tag.d.ts +26 -0
- package/dist/tag/tag.d.ts.map +1 -0
- package/dist/tag/tag.js +110 -0
- package/dist/tag/tag.js.map +1 -0
- package/dist/tag/tag.repository.d.ts +6 -0
- package/dist/tag/tag.repository.d.ts.map +1 -0
- package/dist/tag/tag.repository.js +15 -0
- package/dist/tag/tag.repository.js.map +1 -0
- package/dist/tag-group/interfaces/tag-group-attr.interface.d.ts +13 -0
- package/dist/tag-group/interfaces/tag-group-attr.interface.d.ts.map +1 -0
- package/dist/tag-group/interfaces/tag-group-attr.interface.js +3 -0
- package/dist/tag-group/interfaces/tag-group-attr.interface.js.map +1 -0
- package/dist/tag-group/tag-group.d.ts +24 -0
- package/dist/tag-group/tag-group.d.ts.map +1 -0
- package/dist/tag-group/tag-group.js +82 -0
- package/dist/tag-group/tag-group.js.map +1 -0
- package/dist/tag-group/tag-group.repository.d.ts +6 -0
- package/dist/tag-group/tag-group.repository.d.ts.map +1 -0
- package/dist/tag-group/tag-group.repository.js +15 -0
- package/dist/tag-group/tag-group.repository.js.map +1 -0
- package/dist/tax/interfaces/tax-attr.interface.d.ts +1 -0
- package/dist/tax/interfaces/tax-attr.interface.d.ts.map +1 -0
- package/dist/tax/tax.d.ts +1 -0
- package/dist/tax/tax.d.ts.map +1 -0
- package/dist/tax/tax.repository.d.ts +1 -0
- package/dist/tax/tax.repository.d.ts.map +1 -0
- package/dist/tax/tax.repository.js +4 -1
- package/dist/tax/tax.repository.js.map +1 -1
- package/dist/test-document.d.ts +1 -0
- package/dist/test-document.d.ts.map +1 -0
- package/dist/test.d.ts +1 -0
- package/dist/test.d.ts.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/migrations/finance-document-tag-migration.js +46 -0
- package/migrations/finance-tag-group-migration.js +53 -0
- package/migrations/finance-tag-migration.js +63 -0
- package/package.json +18 -18
- package/.gitlab-ci.yml +0 -16
- package/.husky/commit-msg +0 -13
- package/.husky/pre-commit +0 -4
- package/.prettierrc +0 -5
- package/CONTRIBUTING.md +0 -31
- package/README.md +0 -13
- package/eslint.config.mjs +0 -58
- package/nest-cli.json +0 -19
- package/sonar-project.properties +0 -13
- package/src/account/account.repository.ts +0 -11
- package/src/account/account.ts +0 -307
- package/src/account/interfaces/account-attr.interface.ts +0 -31
- package/src/account-system-entity/account-system-entity.ts +0 -66
- package/src/account-system-entity/post-history.repository.ts +0 -11
- package/src/config.ts +0 -382
- package/src/customer/customer.ts +0 -311
- package/src/customer/finance-customer.repository.ts +0 -13
- package/src/customer/interfaces/customer.repository.interface.ts +0 -3
- package/src/customer/interfaces/finance-customer-attr.interface.ts +0 -10
- package/src/customer/interfaces/finance-customer.repository.interface.ts +0 -4
- package/src/database.ts +0 -48
- package/src/document/document-item.repository.ts +0 -11
- package/src/document/document-item.ts +0 -146
- package/src/document/document.repository.ts +0 -11
- package/src/document/document.ts +0 -1328
- package/src/document/interfaces/document-attr.interface.ts +0 -28
- package/src/document/interfaces/document-find-all.interface.ts +0 -14
- package/src/document/interfaces/document-item-attr.interface.ts +0 -26
- package/src/document/interfaces/document-item.repository.interface.ts +0 -4
- package/src/enum/collect-payment-type.ts +0 -4
- package/src/enum/doc-type.enum.ts +0 -8
- package/src/enum/document-status.enum.ts +0 -6
- package/src/enum/index.ts +0 -19
- package/src/enum/payment-method.enum.ts +0 -3
- package/src/enum/payment-status.enum.ts +0 -11
- package/src/enum/payment-type.enum.ts +0 -4
- package/src/enum/quick-book-client-scopes.enum.ts +0 -14
- package/src/enum/transaction-type.enum.ts +0 -4
- package/src/finance-company/finance-company.repository.ts +0 -11
- package/src/finance-company/finance-company.ts +0 -2434
- package/src/helpers/login-user.ts +0 -38
- package/src/helpers/typeof.ts +0 -35
- package/src/index.ts +0 -32
- package/src/interfaces/account-system.interface.ts +0 -51
- package/src/interfaces/index.ts +0 -3
- package/src/journal-entry/interfaces/journal-entry-attr.interface.ts +0 -12
- package/src/journal-entry/journal-entry.repository.ts +0 -17
- package/src/journal-entry/journal-entry.ts +0 -264
- package/src/ledger-transaction/interfaces/ledger-transaction-attr.interface.ts +0 -18
- package/src/ledger-transaction/interfaces/ledger-transaction.repository.interface.ts +0 -7
- package/src/ledger-transaction/ledger-transaction.repository.ts +0 -17
- package/src/ledger-transaction/ledger-transaction.ts +0 -182
- package/src/models/account.entity.ts +0 -206
- package/src/models/customer.entity.ts +0 -93
- package/src/models/document-item.entity.ts +0 -167
- package/src/models/document.entity.ts +0 -211
- package/src/models/finance-company.entity.ts +0 -69
- package/src/models/journal-entry.entity.ts +0 -110
- package/src/models/ledger-transaction.entity.ts +0 -148
- package/src/models/payment-item.entity.ts +0 -60
- package/src/models/payment-method-type.entity.ts +0 -70
- package/src/models/payment-method.entity.ts +0 -51
- package/src/models/payment-paid-with.entity.ts +0 -133
- package/src/models/payment.entity.ts +0 -165
- package/src/models/post-history.entity.ts +0 -41
- package/src/models/tax.entity.ts +0 -75
- package/src/payment/interfaces/payment-attr.interface.ts +0 -23
- package/src/payment/interfaces/payment-params.interface.ts +0 -8
- package/src/payment/payment.repository.ts +0 -11
- package/src/payment/payment.ts +0 -236
- package/src/payment-item/interfaces/payment-item-attr.interface.ts +0 -10
- package/src/payment-item/payment-item.repository.ts +0 -11
- package/src/payment-item/payment-item.ts +0 -134
- package/src/payment-method/interfaces/payment-method-attr.interface.ts +0 -5
- package/src/payment-method/payment-method.repository.ts +0 -11
- package/src/payment-method/payment-method.ts +0 -146
- package/src/payment-method-type/interfaces/payment-method-type-attr.interface.ts +0 -8
- package/src/payment-method-type/payment-method-type.repository.ts +0 -11
- package/src/payment-method-type/payment-method-type.ts +0 -79
- package/src/payment-paid-with/interfaces/payment-paid-with.interface.ts +0 -20
- package/src/payment-paid-with/payment-paid-with.repository.ts +0 -11
- package/src/payment-paid-with/payment-paid-with.ts +0 -74
- package/src/tax/interfaces/tax-attr.interface.ts +0 -10
- package/src/tax/tax.repository.ts +0 -11
- package/src/tax/tax.ts +0 -68
- package/src/test-document.ts +0 -25
- package/src/test.ts +0 -3
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -23
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
-
import {
|
|
3
|
-
Column,
|
|
4
|
-
DataType,
|
|
5
|
-
HasMany,
|
|
6
|
-
Model,
|
|
7
|
-
Table,
|
|
8
|
-
UpdatedAt,
|
|
9
|
-
BelongsTo,
|
|
10
|
-
} from 'sequelize-typescript';
|
|
11
|
-
import { ForeignKey } from 'sequelize-typescript/dist/associations/foreign-key/foreign-key';
|
|
12
|
-
import { PaymentType, PaymentStatus } from '../enum';
|
|
13
|
-
import DocumentModel from './document.entity';
|
|
14
|
-
import PaymentItemModel from './payment-item.entity';
|
|
15
|
-
import PaymentPaidWithModel from './payment-paid-with.entity';
|
|
16
|
-
|
|
17
|
-
@Table({
|
|
18
|
-
tableName: 'finance_Payment',
|
|
19
|
-
timestamps: true,
|
|
20
|
-
createdAt: false,
|
|
21
|
-
})
|
|
22
|
-
export default class PaymentModel extends Model {
|
|
23
|
-
@Column({
|
|
24
|
-
primaryKey: true,
|
|
25
|
-
allowNull: false,
|
|
26
|
-
type: DataType.STRING(30),
|
|
27
|
-
})
|
|
28
|
-
PaymentId: string;
|
|
29
|
-
|
|
30
|
-
@Column({
|
|
31
|
-
allowNull: false,
|
|
32
|
-
type: DataType.ENUM('Payment Received', 'Payout'),
|
|
33
|
-
})
|
|
34
|
-
PaymentType: PaymentType;
|
|
35
|
-
|
|
36
|
-
@Column({
|
|
37
|
-
allowNull: false,
|
|
38
|
-
type: DataType.DATE,
|
|
39
|
-
})
|
|
40
|
-
PaymentDate: Date;
|
|
41
|
-
|
|
42
|
-
@Column({
|
|
43
|
-
allowNull: false,
|
|
44
|
-
type: DataType.STRING(1000),
|
|
45
|
-
})
|
|
46
|
-
Description: string;
|
|
47
|
-
|
|
48
|
-
@Column({
|
|
49
|
-
allowNull: false,
|
|
50
|
-
type: DataType.CHAR(3),
|
|
51
|
-
})
|
|
52
|
-
Currency: string;
|
|
53
|
-
|
|
54
|
-
@Column({
|
|
55
|
-
allowNull: false,
|
|
56
|
-
type: DataType.DECIMAL(10, 2),
|
|
57
|
-
})
|
|
58
|
-
Amount: number;
|
|
59
|
-
|
|
60
|
-
@Column({
|
|
61
|
-
allowNull: false,
|
|
62
|
-
type: DataType.STRING(30),
|
|
63
|
-
})
|
|
64
|
-
Status: PaymentStatus;
|
|
65
|
-
|
|
66
|
-
@Column({
|
|
67
|
-
allowNull: true,
|
|
68
|
-
type: DataType.STRING(30),
|
|
69
|
-
})
|
|
70
|
-
ReceivedBy: string;
|
|
71
|
-
|
|
72
|
-
@Column({
|
|
73
|
-
allowNull: true,
|
|
74
|
-
type: DataType.STRING(30),
|
|
75
|
-
})
|
|
76
|
-
IssuedBy: string;
|
|
77
|
-
|
|
78
|
-
@ApiProperty({
|
|
79
|
-
example: new Date(),
|
|
80
|
-
description: 'Timestamp for latest data modification',
|
|
81
|
-
})
|
|
82
|
-
@UpdatedAt
|
|
83
|
-
UpdatedAt: Date;
|
|
84
|
-
|
|
85
|
-
@Column({
|
|
86
|
-
allowNull: false,
|
|
87
|
-
type: DataType.STRING(30),
|
|
88
|
-
})
|
|
89
|
-
UpdatedBy: string;
|
|
90
|
-
|
|
91
|
-
@Column({
|
|
92
|
-
allowNull: true,
|
|
93
|
-
type: DataType.TEXT,
|
|
94
|
-
})
|
|
95
|
-
Remarks: string;
|
|
96
|
-
|
|
97
|
-
@Column({
|
|
98
|
-
allowNull: true,
|
|
99
|
-
type: DataType.STRING(30),
|
|
100
|
-
})
|
|
101
|
-
RelatedObjectId: string;
|
|
102
|
-
|
|
103
|
-
@Column({
|
|
104
|
-
allowNull: true,
|
|
105
|
-
type: DataType.STRING(200),
|
|
106
|
-
})
|
|
107
|
-
RelatedObjectType: string;
|
|
108
|
-
|
|
109
|
-
@ApiProperty({ type: String, description: 'DocNo' })
|
|
110
|
-
@ForeignKey(() => DocumentModel)
|
|
111
|
-
@Column({
|
|
112
|
-
allowNull: true,
|
|
113
|
-
type: DataType.STRING(30),
|
|
114
|
-
})
|
|
115
|
-
ReceiptDocNo: string;
|
|
116
|
-
|
|
117
|
-
@ApiProperty({
|
|
118
|
-
type: String,
|
|
119
|
-
description: 'Account Customer Id in API',
|
|
120
|
-
})
|
|
121
|
-
@Column({
|
|
122
|
-
allowNull: true,
|
|
123
|
-
type: DataType.STRING(30),
|
|
124
|
-
})
|
|
125
|
-
AccSystemRefId: string;
|
|
126
|
-
|
|
127
|
-
@ApiProperty({
|
|
128
|
-
example: 'N',
|
|
129
|
-
description: 'PostedToAccSystemYN',
|
|
130
|
-
})
|
|
131
|
-
@Column({
|
|
132
|
-
allowNull: false,
|
|
133
|
-
type: DataType.ENUM('Y', 'N'),
|
|
134
|
-
})
|
|
135
|
-
PostedToAccSystemYN: string;
|
|
136
|
-
|
|
137
|
-
@ApiProperty({
|
|
138
|
-
example: '138140891dd211b288',
|
|
139
|
-
description: 'PostedById',
|
|
140
|
-
})
|
|
141
|
-
@Column({
|
|
142
|
-
allowNull: true,
|
|
143
|
-
type: DataType.STRING(30),
|
|
144
|
-
})
|
|
145
|
-
PostedById: string;
|
|
146
|
-
|
|
147
|
-
@ApiProperty({
|
|
148
|
-
example: new Date(),
|
|
149
|
-
description: 'PostedToAccSystem Date',
|
|
150
|
-
})
|
|
151
|
-
@Column({
|
|
152
|
-
allowNull: true,
|
|
153
|
-
type: DataType.DATE,
|
|
154
|
-
})
|
|
155
|
-
PostedDateTime: Date;
|
|
156
|
-
|
|
157
|
-
@HasMany(() => PaymentItemModel)
|
|
158
|
-
PaymentItems: PaymentItemModel[];
|
|
159
|
-
|
|
160
|
-
@HasMany(() => PaymentPaidWithModel)
|
|
161
|
-
PaymentPaidWiths: PaymentPaidWithModel[];
|
|
162
|
-
|
|
163
|
-
@BelongsTo(() => DocumentModel)
|
|
164
|
-
Document: DocumentModel;
|
|
165
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
-
import { Column, DataType, Model, Table } from 'sequelize-typescript';
|
|
3
|
-
|
|
4
|
-
@Table({ tableName: 'finance_PostHistory', createdAt: false, updatedAt: false })
|
|
5
|
-
export default class FinancePostHistoryModel extends Model {
|
|
6
|
-
@ApiProperty({ type: String, description: 'PostId' })
|
|
7
|
-
@Column({
|
|
8
|
-
primaryKey: true,
|
|
9
|
-
allowNull: false,
|
|
10
|
-
type: DataType.STRING(30),
|
|
11
|
-
})
|
|
12
|
-
PostId: string;
|
|
13
|
-
|
|
14
|
-
@ApiProperty({ type: Date })
|
|
15
|
-
@Column({ allowNull: false, type: DataType.DATE })
|
|
16
|
-
DateTime: Date;
|
|
17
|
-
|
|
18
|
-
@ApiProperty({ type: String, description: 'ItemId' })
|
|
19
|
-
@Column({ allowNull: false, type: DataType.STRING(30) })
|
|
20
|
-
ItemId: string;
|
|
21
|
-
|
|
22
|
-
@ApiProperty({ type: String, description: 'ItemType' })
|
|
23
|
-
@Column({ allowNull: false, type: DataType.STRING(200) })
|
|
24
|
-
ItemType: string;
|
|
25
|
-
|
|
26
|
-
@ApiProperty({ type: String, description: 'ItemValue' })
|
|
27
|
-
@Column({ allowNull: false, type: DataType.JSON })
|
|
28
|
-
ItemValue: string;
|
|
29
|
-
|
|
30
|
-
@ApiProperty()
|
|
31
|
-
@Column({ allowNull: false, type: DataType.STRING(30) })
|
|
32
|
-
PostedById: string;
|
|
33
|
-
|
|
34
|
-
@ApiProperty()
|
|
35
|
-
@Column({ allowNull: false, type: DataType.STRING(10) })
|
|
36
|
-
AccSystemCode: string;
|
|
37
|
-
|
|
38
|
-
@ApiProperty()
|
|
39
|
-
@Column({ allowNull: false, type: DataType.STRING(30) })
|
|
40
|
-
AccSystemRefId: string;
|
|
41
|
-
}
|
package/src/models/tax.entity.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { ApiProperty } from '@nestjs/swagger';
|
|
2
|
-
import {
|
|
3
|
-
BelongsTo,
|
|
4
|
-
Column,
|
|
5
|
-
CreatedAt,
|
|
6
|
-
DataType,
|
|
7
|
-
ForeignKey,
|
|
8
|
-
Model,
|
|
9
|
-
Table,
|
|
10
|
-
UpdatedAt,
|
|
11
|
-
} from 'sequelize-typescript';
|
|
12
|
-
import FinanceCompanyModel from './finance-company.entity';
|
|
13
|
-
|
|
14
|
-
@Table({ tableName: 'finance_Tax' })
|
|
15
|
-
export default class FinanceTaxModel extends Model {
|
|
16
|
-
@ApiProperty({ type: String, description: 'TaxCode' })
|
|
17
|
-
@Column({
|
|
18
|
-
primaryKey: true,
|
|
19
|
-
allowNull: false,
|
|
20
|
-
type: DataType.STRING(30),
|
|
21
|
-
})
|
|
22
|
-
TaxCode: string;
|
|
23
|
-
|
|
24
|
-
@ApiProperty({ type: Number, description: 'TaxRate' })
|
|
25
|
-
@Column({ allowNull: false, type: DataType.DECIMAL(10, 2) })
|
|
26
|
-
TaxRate: number;
|
|
27
|
-
|
|
28
|
-
@ApiProperty({ type: String, description: 'Description' })
|
|
29
|
-
@Column({ allowNull: true, type: DataType.STRING(1000) })
|
|
30
|
-
Description: string;
|
|
31
|
-
|
|
32
|
-
@ForeignKey(() => FinanceCompanyModel)
|
|
33
|
-
@Column({
|
|
34
|
-
allowNull: false,
|
|
35
|
-
type: DataType.STRING(30),
|
|
36
|
-
})
|
|
37
|
-
CompanyId: string;
|
|
38
|
-
|
|
39
|
-
@ApiProperty({
|
|
40
|
-
example: '138140891dd211b288d34bc7b4312a49',
|
|
41
|
-
description: 'CreatedById.',
|
|
42
|
-
})
|
|
43
|
-
@Column({
|
|
44
|
-
allowNull: false,
|
|
45
|
-
type: DataType.STRING(30),
|
|
46
|
-
})
|
|
47
|
-
CreatedById: string;
|
|
48
|
-
|
|
49
|
-
@ApiProperty({
|
|
50
|
-
example: new Date(),
|
|
51
|
-
description: 'Timestamp for data creation.',
|
|
52
|
-
})
|
|
53
|
-
@CreatedAt
|
|
54
|
-
CreatedAt: Date;
|
|
55
|
-
|
|
56
|
-
@ApiProperty({
|
|
57
|
-
example: '138140891dd211b288d34bc7b4312a49',
|
|
58
|
-
description: 'UpdatedById.',
|
|
59
|
-
})
|
|
60
|
-
@Column({
|
|
61
|
-
allowNull: false,
|
|
62
|
-
type: DataType.STRING(30),
|
|
63
|
-
})
|
|
64
|
-
UpdatedById: string;
|
|
65
|
-
|
|
66
|
-
@ApiProperty({
|
|
67
|
-
example: new Date(),
|
|
68
|
-
description: 'Timestamp for latest data modification',
|
|
69
|
-
})
|
|
70
|
-
@UpdatedAt
|
|
71
|
-
UpdatedAt: Date;
|
|
72
|
-
|
|
73
|
-
@BelongsTo(() => FinanceCompanyModel)
|
|
74
|
-
FinanceCompany: FinanceCompanyModel;
|
|
75
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { PaymentType, PaymentStatus } from '../../enum';
|
|
2
|
-
|
|
3
|
-
export class IPaymentAttr {
|
|
4
|
-
PaymentId: string;
|
|
5
|
-
PaymentType: PaymentType;
|
|
6
|
-
PaymentDate: Date;
|
|
7
|
-
Description: string;
|
|
8
|
-
Currency: string;
|
|
9
|
-
Amount: number;
|
|
10
|
-
Status: PaymentStatus;
|
|
11
|
-
ReceivedBy?: string;
|
|
12
|
-
IssuedBy?: string;
|
|
13
|
-
RelatedObjectId?: string;
|
|
14
|
-
RelatedObjectType?: string;
|
|
15
|
-
ReceiptDocNo?: string;
|
|
16
|
-
Remarks?: string;
|
|
17
|
-
UpdatedAt: Date;
|
|
18
|
-
UpdatedBy: string;
|
|
19
|
-
AccSystemRefId?: string;
|
|
20
|
-
PostedToAccSystemYN: string;
|
|
21
|
-
PostedById?: string;
|
|
22
|
-
PostedDateTime?: Date;
|
|
23
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
-
import PaymentModel from '../models/payment.entity';
|
|
3
|
-
|
|
4
|
-
export class PaymentRepository
|
|
5
|
-
extends RepositoryBase<PaymentModel>
|
|
6
|
-
implements IRepositoryBase<PaymentModel>
|
|
7
|
-
{
|
|
8
|
-
constructor() {
|
|
9
|
-
super(PaymentModel);
|
|
10
|
-
}
|
|
11
|
-
}
|
package/src/payment/payment.ts
DELETED
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import { ObjectBase } from '@tomei/general';
|
|
2
|
-
import { RecordNotFoundError } from '@tomei/general/dist/class/exceptions/record-not-found.error';
|
|
3
|
-
import { PaymentType } from '../enum';
|
|
4
|
-
import { IPaymentParams } from './interfaces/payment-params.interface';
|
|
5
|
-
import { AccountSystemEntity } from '../account-system-entity/account-system-entity';
|
|
6
|
-
import { PaymentStatus } from '../enum/payment-status.enum';
|
|
7
|
-
import { PaymentRepository } from './payment.repository';
|
|
8
|
-
import { PaymentItemRepository } from '../payment-item/payment-item.repository';
|
|
9
|
-
// import PaymentItemModel from '../models/payment-item.entity';
|
|
10
|
-
import PaymentItem from '../payment-item/payment-item';
|
|
11
|
-
import PaymentPaidWith from '../payment-paid-with/payment-paid-with';
|
|
12
|
-
import { PaymentPaidWithRepository } from '../payment-paid-with/payment-paid-with.repository';
|
|
13
|
-
|
|
14
|
-
export default class Payment extends AccountSystemEntity {
|
|
15
|
-
private _PaymentId = 'New';
|
|
16
|
-
PaymentType: PaymentType;
|
|
17
|
-
PaymentDate: Date;
|
|
18
|
-
MethodTypeId: string;
|
|
19
|
-
Description = '';
|
|
20
|
-
Currency = 'MYR';
|
|
21
|
-
Amount = 0;
|
|
22
|
-
Status: PaymentStatus;
|
|
23
|
-
TransactionId: string;
|
|
24
|
-
TransactionApprovalCode: string;
|
|
25
|
-
TransactionAccountName: string;
|
|
26
|
-
TransactionAccountNo: string;
|
|
27
|
-
ReceivedBy = '';
|
|
28
|
-
IssuedBy = '';
|
|
29
|
-
UpdatedBy = '';
|
|
30
|
-
UpdatedAt: Date;
|
|
31
|
-
Remarks = '';
|
|
32
|
-
RelatedObjectId = '';
|
|
33
|
-
RelatedObjectType = '';
|
|
34
|
-
ReceiptDocNo = '';
|
|
35
|
-
protected _ObjectType: 'Payment';
|
|
36
|
-
|
|
37
|
-
private static _RepositoryBase = new PaymentRepository();
|
|
38
|
-
private static _PaymentItemRepository = new PaymentItemRepository();
|
|
39
|
-
private static _PaymentPaidWithRepository = new PaymentPaidWithRepository();
|
|
40
|
-
|
|
41
|
-
private _DbTransaction: any;
|
|
42
|
-
private _PaymentItems = [];
|
|
43
|
-
private _PaymentPaidWith = [];
|
|
44
|
-
|
|
45
|
-
paymentItemRepository: PaymentItemRepository;
|
|
46
|
-
|
|
47
|
-
public get PaymentId() {
|
|
48
|
-
return this._PaymentId;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
get ObjectType() {
|
|
52
|
-
return this._ObjectType;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
public set PaymentId(id: string) {
|
|
56
|
-
this._PaymentId = id;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/* AccountSystemEntity Implementation */
|
|
60
|
-
get RepositoryBase() {
|
|
61
|
-
return Payment._RepositoryBase;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* ObjectBase Implementation */
|
|
65
|
-
get ObjectId() {
|
|
66
|
-
return this.PaymentId;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
get ObjectName() {
|
|
70
|
-
return this.PaymentId;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
get TableName() {
|
|
74
|
-
return 'finance_Payment';
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
constructor(dbTransaction?: any, paymentId?: string) {
|
|
78
|
-
super();
|
|
79
|
-
if (dbTransaction) {
|
|
80
|
-
this._DbTransaction = dbTransaction;
|
|
81
|
-
}
|
|
82
|
-
if (paymentId) {
|
|
83
|
-
this.PaymentId = paymentId;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
static async initPayment(
|
|
88
|
-
dbTransaction: any,
|
|
89
|
-
paymentId: string,
|
|
90
|
-
): Promise<Payment> {
|
|
91
|
-
try {
|
|
92
|
-
const paymentData = await this._RepositoryBase.findOne({
|
|
93
|
-
where: {
|
|
94
|
-
PaymentId: paymentId,
|
|
95
|
-
},
|
|
96
|
-
transaction: dbTransaction,
|
|
97
|
-
});
|
|
98
|
-
if (paymentData) {
|
|
99
|
-
const payment = new Payment(dbTransaction, paymentId);
|
|
100
|
-
payment.PaymentType = paymentData.PaymentType;
|
|
101
|
-
payment.PaymentDate = paymentData.PaymentDate;
|
|
102
|
-
payment.Description = paymentData.Description;
|
|
103
|
-
payment.Currency = paymentData.Currency;
|
|
104
|
-
payment.Amount = paymentData.Amount;
|
|
105
|
-
payment.Status = paymentData.Status;
|
|
106
|
-
payment.ReceivedBy = paymentData.ReceivedBy;
|
|
107
|
-
payment.IssuedBy = paymentData.IssuedBy;
|
|
108
|
-
payment.UpdatedAt = paymentData.UpdatedAt;
|
|
109
|
-
payment.UpdatedBy = paymentData.UpdatedBy;
|
|
110
|
-
payment.Remarks = paymentData.Remarks;
|
|
111
|
-
payment.RelatedObjectId = paymentData.RelatedObjectId;
|
|
112
|
-
payment.RelatedObjectType = paymentData.RelatedObjectType;
|
|
113
|
-
payment.ReceiptDocNo = paymentData.ReceiptDocNo;
|
|
114
|
-
payment.AccSystemRefId = paymentData.AccSystemRefId;
|
|
115
|
-
payment.PostedToAccSystemYN = paymentData.PostedToAccSystemYN;
|
|
116
|
-
payment.PostedById = paymentData.PostedById;
|
|
117
|
-
payment.PostedDateTime = paymentData.PostedDateTime;
|
|
118
|
-
return payment;
|
|
119
|
-
} else {
|
|
120
|
-
const notFoundError = new RecordNotFoundError(
|
|
121
|
-
'PaymentErrMsg',
|
|
122
|
-
'No Record Found.',
|
|
123
|
-
);
|
|
124
|
-
throw notFoundError;
|
|
125
|
-
}
|
|
126
|
-
} catch (error) {
|
|
127
|
-
console.log('Payment Class constructor err: ', error);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
async getPaymentItems(dbTransaction?: any): Promise<PaymentItem[]> {
|
|
132
|
-
try {
|
|
133
|
-
if (this.PaymentId !== 'New') {
|
|
134
|
-
const paymentItems = await Payment._PaymentItemRepository.findAll({
|
|
135
|
-
where: {
|
|
136
|
-
PaymentId: this.PaymentId,
|
|
137
|
-
},
|
|
138
|
-
transaction: dbTransaction || this._DbTransaction,
|
|
139
|
-
});
|
|
140
|
-
const paymentItemObjects = paymentItems.map((paymentItem) => {
|
|
141
|
-
const pi = new PaymentItem(
|
|
142
|
-
new Payment(this._DbTransaction, paymentItem.PaymentId),
|
|
143
|
-
{
|
|
144
|
-
ObjectId: this.ObjectId,
|
|
145
|
-
ObjectName: this.ObjectName,
|
|
146
|
-
TableName: this.TableName,
|
|
147
|
-
ObjectType: this.ObjectType,
|
|
148
|
-
} as ObjectBase,
|
|
149
|
-
);
|
|
150
|
-
pi.PayForObjectType = paymentItem.PayForObjectType;
|
|
151
|
-
pi.PayForObjectId = paymentItem.PayForObjectId;
|
|
152
|
-
pi.Currency = paymentItem.Currency;
|
|
153
|
-
pi.Amount = paymentItem.Amount;
|
|
154
|
-
pi.Name = paymentItem.Name;
|
|
155
|
-
pi.Description = paymentItem.Description;
|
|
156
|
-
|
|
157
|
-
return pi;
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
this._PaymentItems = paymentItemObjects;
|
|
161
|
-
return this._PaymentItems;
|
|
162
|
-
} else {
|
|
163
|
-
return this._PaymentItems;
|
|
164
|
-
}
|
|
165
|
-
} catch (error) {
|
|
166
|
-
throw error;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
async getPaymentPaidWith(dbTransaction?: any): Promise<PaymentPaidWith[]> {
|
|
171
|
-
try {
|
|
172
|
-
if (this.PaymentId !== 'New') {
|
|
173
|
-
const paymentPaidWithItems =
|
|
174
|
-
await Payment._PaymentPaidWithRepository.findAll({
|
|
175
|
-
where: {
|
|
176
|
-
PaymentId: this.PaymentId,
|
|
177
|
-
},
|
|
178
|
-
transaction: dbTransaction || this._DbTransaction,
|
|
179
|
-
});
|
|
180
|
-
const paymentPaidWithObjects = paymentPaidWithItems.map(
|
|
181
|
-
(paymentPaidWithItem) => {
|
|
182
|
-
const ppw = new PaymentPaidWith(
|
|
183
|
-
new Payment(this._DbTransaction, paymentPaidWithItem.PaymentId),
|
|
184
|
-
paymentPaidWithItem.MethodTypeId,
|
|
185
|
-
);
|
|
186
|
-
|
|
187
|
-
ppw.Currency = paymentPaidWithItem.Currency;
|
|
188
|
-
ppw.Amount = paymentPaidWithItem.Amount;
|
|
189
|
-
ppw.Status = paymentPaidWithItem.Status;
|
|
190
|
-
ppw.TransactionId = paymentPaidWithItem.TransactionId;
|
|
191
|
-
ppw.RefBank = paymentPaidWithItem.RefBank;
|
|
192
|
-
ppw.RefName = paymentPaidWithItem.RefName;
|
|
193
|
-
ppw.RefNo = paymentPaidWithItem.RefNo;
|
|
194
|
-
ppw.RefOther1 = paymentPaidWithItem.RefOther1;
|
|
195
|
-
ppw.RefOther2 = paymentPaidWithItem.RefOther2;
|
|
196
|
-
ppw.RefOther3 = paymentPaidWithItem.RefOther3;
|
|
197
|
-
ppw.RefOther4 = paymentPaidWithItem.RefOther4;
|
|
198
|
-
ppw.RefOther5 = paymentPaidWithItem.RefOther5;
|
|
199
|
-
ppw.Remarks = paymentPaidWithItem.Remarks;
|
|
200
|
-
ppw.PaymentMediaId = paymentPaidWithItem.PaymentMediaId;
|
|
201
|
-
|
|
202
|
-
return ppw;
|
|
203
|
-
},
|
|
204
|
-
);
|
|
205
|
-
|
|
206
|
-
this._PaymentPaidWith = paymentPaidWithObjects;
|
|
207
|
-
return this._PaymentPaidWith;
|
|
208
|
-
} else {
|
|
209
|
-
return this._PaymentPaidWith;
|
|
210
|
-
}
|
|
211
|
-
} catch (error) {
|
|
212
|
-
throw error;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
newPaymentItem(objectBeingPaidFor: ObjectBase): PaymentItem {
|
|
217
|
-
const paymentItem = new PaymentItem(this, objectBeingPaidFor);
|
|
218
|
-
this._PaymentItems.push(paymentItem);
|
|
219
|
-
return paymentItem;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
newPaymentPaidWith(paymentMethodTypeId: string) {
|
|
223
|
-
const paymentPaidWith = new PaymentPaidWith(
|
|
224
|
-
this,
|
|
225
|
-
paymentMethodTypeId,
|
|
226
|
-
this._DbTransaction,
|
|
227
|
-
);
|
|
228
|
-
this._PaymentPaidWith.push(paymentPaidWith);
|
|
229
|
-
return paymentPaidWith;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
init(Params: IPaymentParams): void {
|
|
233
|
-
if (Params.Currency) this.Currency = Params.Currency;
|
|
234
|
-
if (Params.PaymentType) this.PaymentType = Params.PaymentType;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { RepositoryBase, IRepositoryBase } from '@tomei/general';
|
|
2
|
-
import PaymentItemModel from '../models/payment-item.entity';
|
|
3
|
-
|
|
4
|
-
export class PaymentItemRepository
|
|
5
|
-
extends RepositoryBase<PaymentItemModel>
|
|
6
|
-
implements IRepositoryBase<PaymentItemModel>
|
|
7
|
-
{
|
|
8
|
-
constructor() {
|
|
9
|
-
super(PaymentItemModel);
|
|
10
|
-
}
|
|
11
|
-
}
|