@things-factory/accounting 7.1.13 → 8.0.0-alpha.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. package/client/pages/bank/bank-importer.ts +90 -0
  2. package/client/pages/bank/bank-list-page.ts +398 -0
  3. package/client/pages/bank-account/bank-account-importer.ts +90 -0
  4. package/client/pages/bank-account/bank-account-list-page.ts +398 -0
  5. package/client/pages/financial-institution/financial-institution-importer.ts +90 -0
  6. package/client/pages/financial-institution/financial-institution-list-page.ts +398 -0
  7. package/dist-client/pages/bank/bank-importer.d.ts +23 -0
  8. package/dist-client/pages/bank/bank-importer.js +93 -0
  9. package/dist-client/pages/bank/bank-importer.js.map +1 -0
  10. package/dist-client/pages/bank/bank-list-page.d.ts +66 -0
  11. package/dist-client/pages/bank/bank-list-page.js +370 -0
  12. package/dist-client/pages/bank/bank-list-page.js.map +1 -0
  13. package/dist-client/pages/bank-account/bank-account-importer.d.ts +23 -0
  14. package/dist-client/pages/bank-account/bank-account-importer.js +93 -0
  15. package/dist-client/pages/bank-account/bank-account-importer.js.map +1 -0
  16. package/dist-client/pages/bank-account/bank-account-list-page.d.ts +66 -0
  17. package/dist-client/pages/bank-account/bank-account-list-page.js +370 -0
  18. package/dist-client/pages/bank-account/bank-account-list-page.js.map +1 -0
  19. package/dist-client/pages/financial-institution/financial-institution-importer.d.ts +23 -0
  20. package/dist-client/pages/financial-institution/financial-institution-importer.js +93 -0
  21. package/dist-client/pages/financial-institution/financial-institution-importer.js.map +1 -0
  22. package/dist-client/pages/financial-institution/financial-institution-list-page.d.ts +66 -0
  23. package/dist-client/pages/financial-institution/financial-institution-list-page.js +370 -0
  24. package/dist-client/pages/financial-institution/financial-institution-list-page.js.map +1 -0
  25. package/dist-client/tsconfig.tsbuildinfo +1 -1
  26. package/dist-server/migrations/1725201567284-seed-country-codes.d.ts +5 -0
  27. package/dist-server/migrations/1725201567284-seed-country-codes.js +248 -0
  28. package/dist-server/migrations/1725201567284-seed-country-codes.js.map +1 -0
  29. package/dist-server/migrations/1725201667385-seed-financial-institutions.d.ts +5 -0
  30. package/dist-server/migrations/1725201667385-seed-financial-institutions.js +348 -0
  31. package/dist-server/migrations/1725201667385-seed-financial-institutions.js.map +1 -0
  32. package/dist-server/service/bank-account/bank-account-history.d.ts +34 -0
  33. package/dist-server/service/bank-account/bank-account-history.js +172 -0
  34. package/dist-server/service/bank-account/bank-account-history.js.map +1 -0
  35. package/dist-server/service/bank-account/bank-account-mutation.d.ts +10 -0
  36. package/dist-server/service/bank-account/bank-account-mutation.js +128 -0
  37. package/dist-server/service/bank-account/bank-account-mutation.js.map +1 -0
  38. package/dist-server/service/bank-account/bank-account-query.d.ts +11 -0
  39. package/dist-server/service/bank-account/bank-account-query.js +79 -0
  40. package/dist-server/service/bank-account/bank-account-query.js.map +1 -0
  41. package/dist-server/service/bank-account/bank-account-type.d.ts +39 -0
  42. package/dist-server/service/bank-account/bank-account-type.js +153 -0
  43. package/dist-server/service/bank-account/bank-account-type.js.map +1 -0
  44. package/dist-server/service/bank-account/bank-account.d.ts +38 -0
  45. package/dist-server/service/bank-account/bank-account.js +164 -0
  46. package/dist-server/service/bank-account/bank-account.js.map +1 -0
  47. package/dist-server/service/bank-account/event-subscriber.d.ts +7 -0
  48. package/dist-server/service/bank-account/event-subscriber.js +21 -0
  49. package/dist-server/service/bank-account/event-subscriber.js.map +1 -0
  50. package/dist-server/service/bank-account/index.d.ts +7 -0
  51. package/dist-server/service/bank-account/index.js +12 -0
  52. package/dist-server/service/bank-account/index.js.map +1 -0
  53. package/dist-server/service/financial-institution/financial-institution-mutation.d.ts +10 -0
  54. package/dist-server/service/financial-institution/financial-institution-mutation.js +169 -0
  55. package/dist-server/service/financial-institution/financial-institution-mutation.js.map +1 -0
  56. package/dist-server/service/financial-institution/financial-institution-query.d.ts +12 -0
  57. package/dist-server/service/financial-institution/financial-institution-query.js +97 -0
  58. package/dist-server/service/financial-institution/financial-institution-query.js.map +1 -0
  59. package/dist-server/service/financial-institution/financial-institution-type.d.ts +32 -0
  60. package/dist-server/service/financial-institution/financial-institution-type.js +126 -0
  61. package/dist-server/service/financial-institution/financial-institution-type.js.map +1 -0
  62. package/dist-server/service/financial-institution/financial-institution.d.ts +34 -0
  63. package/dist-server/service/financial-institution/financial-institution.js +137 -0
  64. package/dist-server/service/financial-institution/financial-institution.js.map +1 -0
  65. package/dist-server/service/financial-institution/index.d.ts +6 -0
  66. package/dist-server/service/financial-institution/index.js +10 -0
  67. package/dist-server/service/financial-institution/index.js.map +1 -0
  68. package/dist-server/service/index.d.ts +1 -1
  69. package/dist-server/service/payment/index.d.ts +1 -2
  70. package/dist-server/service/payment/payment-history.d.ts +8 -1
  71. package/dist-server/service/payment/payment-history.js +41 -10
  72. package/dist-server/service/payment/payment-history.js.map +1 -1
  73. package/dist-server/service/payment/payment-type.d.ts +7 -1
  74. package/dist-server/service/payment/payment-type.js +24 -0
  75. package/dist-server/service/payment/payment-type.js.map +1 -1
  76. package/dist-server/service/payment/payment.d.ts +12 -0
  77. package/dist-server/service/payment/payment.js +36 -1
  78. package/dist-server/service/payment/payment.js.map +1 -1
  79. package/dist-server/tsconfig.tsbuildinfo +1 -1
  80. package/helps/accounting/bank-account.md +160 -0
  81. package/helps/accounting/bank.md +160 -0
  82. package/helps/accounting/financial-institution.md +160 -0
  83. package/package.json +7 -7
  84. package/server/migrations/1725201567284-seed-country-codes.ts +261 -0
  85. package/server/migrations/1725201667385-seed-financial-institutions.ts +348 -0
  86. package/server/service/bank-account/bank-account-history.ts +149 -0
  87. package/server/service/bank-account/bank-account-mutation.ts +137 -0
  88. package/server/service/bank-account/bank-account-query.ts +48 -0
  89. package/server/service/bank-account/bank-account-type.ts +112 -0
  90. package/server/service/bank-account/bank-account.ts +142 -0
  91. package/server/service/bank-account/event-subscriber.ts +17 -0
  92. package/server/service/bank-account/index.ts +9 -0
  93. package/server/service/financial-institution/financial-institution-mutation.ts +198 -0
  94. package/server/service/financial-institution/financial-institution-query.ts +62 -0
  95. package/server/service/financial-institution/financial-institution-type.ts +91 -0
  96. package/server/service/financial-institution/financial-institution.ts +122 -0
  97. package/server/service/financial-institution/index.ts +7 -0
  98. package/server/service/payment/payment-history.ts +41 -18
  99. package/server/service/payment/payment-type.ts +19 -1
  100. package/server/service/payment/payment.ts +31 -0
@@ -1 +1 @@
1
- {"version":3,"file":"payment-type.js","sourceRoot":"","sources":["../../../server/service/payment/payment-type.ts"],"names":[],"mappings":";;;;AAEA,+CAAsF;AAEtF,iDAA+D;AAE/D,uCAAqD;AAG9C,IAAM,UAAU,GAAhB,MAAM,UAAU;CAkBtB,CAAA;AAlBY,gCAAU;AAErB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC;sCACZ,iBAAS;+CAAA;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;0CACb;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;sCACnB,IAAI;0CAAA;AAGZ;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAgB,CAAC;;6CACL;AAG3B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCACb;qBAjBF,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAkBtB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAwBxB,CAAA;AAxBY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC;sCACZ,iBAAS;iDAAA;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;4CACb;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;sCACnB,IAAI;4CAAA;AAGZ;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAgB,CAAC;;+CACL;AAG3B;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACX;uBAvBJ,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAwBxB;AAGM,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AANY,kCAAW;AAEtB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,iBAAO,CAAC,CAAC;;0CACT;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;0CACN;sBALF,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { Payment, PaymentDirection } from './payment'\n\n@InputType()\nexport class NewPayment {\n @Field(type => ObjectRef)\n transaction: ObjectRef\n\n @Field({ nullable: true })\n currency?: string\n\n @Field({ nullable: false })\n amount: number\n\n @Field({ nullable: false })\n paidAt: Date\n\n @Field(type => PaymentDirection)\n direction: PaymentDirection\n\n @Field({ nullable: true })\n note?: string\n}\n\n@InputType()\nexport class PaymentPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field(type => ObjectRef)\n transaction: ObjectRef\n\n @Field({ nullable: true })\n currency?: string\n\n @Field({ nullable: false })\n amount: number\n\n @Field({ nullable: false })\n paidAt: Date\n\n @Field(type => PaymentDirection)\n direction: PaymentDirection\n\n @Field({ nullable: true })\n note?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class PaymentList {\n @Field(type => [Payment])\n items: Payment[]\n\n @Field(type => Int)\n total: number\n}\n"]}
1
+ {"version":3,"file":"payment-type.js","sourceRoot":"","sources":["../../../server/service/payment/payment-type.ts"],"names":[],"mappings":";;;;AAEA,+CAAsF;AAEtF,iDAA+D;AAE/D,uCAAkE;AAG3D,IAAM,UAAU,GAAhB,MAAM,UAAU;CA2BtB,CAAA;AA3BY,gCAAU;AAErB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,CAAC;sCACZ,iBAAS;+CAAA;AAGtB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACT;AAGjB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;0CACb;AAGd;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;sCACnB,IAAI;0CAAA;AAGZ;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,0BAAgB,CAAC;;6CACL;AAG3B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,qBAAW,EAAE,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC;;+CAC3C;AAGxB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,qCAAqC,EAAE,CAAC;sCAC7E,iBAAS;qDAAA;AAG7B;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAS,EAAE,EAAE,QAAQ,EA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IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACX;uBAhCJ,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAiCxB;AAGM,IAAM,WAAW,GAAjB,MAAM,WAAW;CAMvB,CAAA;AANY,kCAAW;AAEtB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,iBAAO,CAAC,CAAC;;0CACT;AAGhB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,CAAC;;0CACN;sBALF,WAAW;IADvB,IAAA,yBAAU,GAAE;GACA,WAAW,CAMvB","sourcesContent":["import type { FileUpload } from 'graphql-upload/GraphQLUpload.js'\nimport GraphQLUpload from 'graphql-upload/GraphQLUpload.js'\nimport { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { Payment, PaymentDirection, PaymentType } from './payment'\n\n@InputType()\nexport class NewPayment {\n @Field(type => ObjectRef)\n transaction: ObjectRef\n\n @Field({ nullable: true })\n currency?: string\n\n @Field({ nullable: false })\n amount: number\n\n @Field({ nullable: false })\n paidAt: Date\n\n @Field(type => PaymentDirection)\n direction: PaymentDirection\n\n @Field(type => PaymentType, { description: 'Type of the payment' })\n paymentType: PaymentType // 결제 유형\n\n @Field(type => ObjectRef, { nullable: true, description: 'Source bank account for the payment' })\n sourceBankAccount?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true, description: 'Destination bank account for the payment' })\n destinationBankAccount?: ObjectRef\n\n @Field({ nullable: true })\n note?: string\n}\n\n@InputType()\nexport class PaymentPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field(type => ObjectRef)\n transaction: ObjectRef\n\n @Field({ nullable: true })\n currency?: string\n\n @Field({ nullable: false })\n amount: number\n\n @Field({ nullable: false })\n paidAt: Date\n\n @Field(type => PaymentDirection)\n direction: PaymentDirection\n\n @Field(type => PaymentType, { description: 'Type of the payment' })\n paymentType: PaymentType // 결제 유형\n\n @Field(type => ObjectRef, { nullable: true, description: 'Source bank account for the payment' })\n sourceBankAccount?: ObjectRef\n\n @Field(type => ObjectRef, { nullable: true, description: 'Destination bank account for the payment' })\n destinationBankAccount?: ObjectRef\n\n @Field({ nullable: true })\n note?: string\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class PaymentList {\n @Field(type => [Payment])\n items: Payment[]\n\n @Field(type => Int)\n total: number\n}\n"]}
@@ -1,10 +1,17 @@
1
1
  import { Domain } from '@things-factory/shell';
2
2
  import { User } from '@things-factory/auth-base';
3
3
  import { Transaction } from '../transaction/transaction';
4
+ import { BankAccount } from 'service/bank-account/bank-account';
4
5
  export declare enum PaymentDirection {
5
6
  Incoming = "Incoming",// 수금
6
7
  Outgoing = "Outgoing"
7
8
  }
9
+ export declare enum PaymentType {
10
+ Transfer = "Transfer",// 계좌 이체
11
+ Cash = "Cash",// 현금
12
+ CreditCard = "CreditCard",// 신용카드
13
+ DebitCard = "DebitCard"
14
+ }
8
15
  export declare class Payment {
9
16
  readonly id: string;
10
17
  version?: number;
@@ -14,6 +21,11 @@ export declare class Payment {
14
21
  transactionId: string;
15
22
  currency?: string;
16
23
  amount: number;
24
+ paymentType: PaymentType;
25
+ sourceBankAccount?: BankAccount;
26
+ sourceBankAccountId?: string;
27
+ destinationBankAccount?: BankAccount;
28
+ destinationBankAccountId?: string;
17
29
  year?: number;
18
30
  quarter?: number;
19
31
  month?: number;
@@ -1,12 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Payment = exports.PaymentDirection = void 0;
3
+ exports.Payment = exports.PaymentType = exports.PaymentDirection = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const typeorm_1 = require("typeorm");
6
6
  const type_graphql_1 = require("type-graphql");
7
7
  const shell_1 = require("@things-factory/shell");
8
8
  const auth_base_1 = require("@things-factory/auth-base");
9
9
  const transaction_1 = require("../transaction/transaction");
10
+ const bank_account_1 = require("service/bank-account/bank-account");
10
11
  var PaymentDirection;
11
12
  (function (PaymentDirection) {
12
13
  PaymentDirection["Incoming"] = "Incoming";
@@ -16,6 +17,17 @@ var PaymentDirection;
16
17
  name: 'PaymentDirection',
17
18
  description: 'Indicates whether the payment is incoming (received) or outgoing (paid)' // 결제 방향을 나타냅니다 (수금 또는 지출)
18
19
  });
20
+ var PaymentType;
21
+ (function (PaymentType) {
22
+ PaymentType["Transfer"] = "Transfer";
23
+ PaymentType["Cash"] = "Cash";
24
+ PaymentType["CreditCard"] = "CreditCard";
25
+ PaymentType["DebitCard"] = "DebitCard"; // 직불카드
26
+ })(PaymentType || (exports.PaymentType = PaymentType = {}));
27
+ (0, type_graphql_1.registerEnumType)(PaymentType, {
28
+ name: 'PaymentType',
29
+ description: 'Type of the payment (e.g., Transfer, Cash, CreditCard, DebitCard)' // 결제 유형을 나타냅니다
30
+ });
19
31
  let Payment = class Payment {
20
32
  constructor() {
21
33
  this.version = 1; // 낙관적 잠금을 위한 버전 관리 필드
@@ -62,6 +74,29 @@ tslib_1.__decorate([
62
74
  (0, type_graphql_1.Field)({ nullable: false, description: 'The amount of money involved in the payment' }),
63
75
  tslib_1.__metadata("design:type", Number)
64
76
  ], Payment.prototype, "amount", void 0);
77
+ tslib_1.__decorate([
78
+ (0, typeorm_1.Column)({ type: 'enum', enum: PaymentType, nullable: false }),
79
+ (0, type_graphql_1.Field)(type => PaymentType, { description: 'Type of the payment' }),
80
+ tslib_1.__metadata("design:type", String)
81
+ ], Payment.prototype, "paymentType", void 0);
82
+ tslib_1.__decorate([
83
+ (0, typeorm_1.ManyToOne)(type => bank_account_1.BankAccount, { nullable: true }),
84
+ (0, type_graphql_1.Field)(type => bank_account_1.BankAccount, { nullable: true, description: 'Source bank account for the payment' }),
85
+ tslib_1.__metadata("design:type", bank_account_1.BankAccount)
86
+ ], Payment.prototype, "sourceBankAccount", void 0);
87
+ tslib_1.__decorate([
88
+ (0, typeorm_1.RelationId)((payment) => payment.sourceBankAccount),
89
+ tslib_1.__metadata("design:type", String)
90
+ ], Payment.prototype, "sourceBankAccountId", void 0);
91
+ tslib_1.__decorate([
92
+ (0, typeorm_1.ManyToOne)(type => bank_account_1.BankAccount, { nullable: true }),
93
+ (0, type_graphql_1.Field)(type => bank_account_1.BankAccount, { nullable: true, description: 'Destination bank account for the payment' }),
94
+ tslib_1.__metadata("design:type", bank_account_1.BankAccount)
95
+ ], Payment.prototype, "destinationBankAccount", void 0);
96
+ tslib_1.__decorate([
97
+ (0, typeorm_1.RelationId)((payment) => payment.destinationBankAccount),
98
+ tslib_1.__metadata("design:type", String)
99
+ ], Payment.prototype, "destinationBankAccountId", void 0);
65
100
  tslib_1.__decorate([
66
101
  (0, typeorm_1.Column)({ nullable: true }),
67
102
  (0, type_graphql_1.Field)({ nullable: true, description: 'Fiscal year in which the payment was made' }),
@@ -1 +1 @@
1
- {"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../server/service/payment/payment.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAAsE;AAEtE,iDAA8C;AAC9C,yDAAgD;AAChD,4DAAwD;AAExD,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,yCAAqB,CAAA;IACrB,yCAAqB,CAAA,CAAC,KAAK;AAC7B,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAA,+BAAgB,EAAC,gBAAgB,EAAE;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,yEAAyE,CAAC,0BAA0B;CAClH,CAAC,CAAA;AAgBK,IAAM,OAAO,GAAb,MAAM,OAAO;IAAb;QAOL,YAAO,GAAY,CAAC,CAAA,CAAC,sBAAsB;IAyE7C,CAAC;CAAA,CAAA;AAhFY,0BAAO;AAGT;IAFR,IAAA,gCAAs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KAAK,EAAE,sBAAsB;QAC7B,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,eAAK,EACJ,cAAc,EACd,CAAC,OAAgB,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,EACpG;QACE,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB;KAC9B,CACF;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC,CAAC,0BAA0B;GAChG,OAAO,CAgFnB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n VersionColumn,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Transaction } from '../transaction/transaction'\n\nexport enum PaymentDirection {\n Incoming = 'Incoming', // 수금\n Outgoing = 'Outgoing' // 지출\n}\n\nregisterEnumType(PaymentDirection, {\n name: 'PaymentDirection',\n description: 'Indicates whether the payment is incoming (received) or outgoing (paid)' // 결제 방향을 나타냅니다 (수금 또는 지출)\n})\n\n@Entity()\n@Index('ix_payment_0', (payment: Payment) => [payment.domain, payment.transaction, payment.paidAt], {\n where: '\"deleted_at\" IS NULL',\n unique: true\n})\n@Index(\n 'ix_payment_1',\n (payment: Payment) => [payment.domain, payment.year, payment.quarter, payment.month, payment.paidAt],\n {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n }\n)\n@ObjectType({ description: 'Entity representing a Payment record in the system' }) // 시스템 내에서 결제 기록을 나타내는 엔티티\nexport class Payment {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the payment record' })\n readonly id: string // 고유 식별자 (UUID)\n\n @VersionColumn()\n @Field({ nullable: true, description: 'Version number used for optimistic locking' })\n version?: number = 1 // 낙관적 잠금을 위한 버전 관리 필드\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true, description: 'The domain to which this payment belongs' })\n domain?: Domain // 결제가 속한 도메인\n\n @RelationId((payment: Payment) => payment.domain)\n domainId?: string // 도메인의 ID\n\n @ManyToOne(type => Transaction, transaction => transaction.payments)\n @Field(type => Transaction, { description: 'The transaction associated with this payment' })\n transaction: Transaction // 결제와 연결된 트랜잭션\n\n @RelationId((payment: Payment) => payment.transaction)\n transactionId: string // 연결된 트랜잭션의 ID\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The currency used in the payment' })\n currency?: string // 결제에 사용된 통화\n\n @Column({ nullable: false })\n @Field({ nullable: false, description: 'The amount of money involved in the payment' })\n amount: number // 결제된 금액\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal year in which the payment was made' })\n year?: number // 결제가 발생한 회계 연도\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal quarter in which the payment was made' })\n quarter?: number // 결제가 발생한 회계 분기\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal month in which the payment was made' })\n month?: number // 결제가 발생한 회계 월\n\n @Column({ nullable: false })\n @Field({ nullable: false, description: 'The date and time when the payment was made' })\n paidAt: Date // 결제가 이루어진 날짜 및 시간\n\n @Column({ nullable: false })\n @Field(type => PaymentDirection, { description: 'Direction of the payment (Incoming or Outgoing)' })\n direction: PaymentDirection // 결제 방향 (수금 또는 지출)\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Additional notes or comments about the payment' })\n note?: string // 결제에 대한 추가 설명 또는 메모\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'The date and time when the payment record was created' })\n createdAt?: Date // 결제 레코드가 생성된 날짜 및 시간\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'The date and time when the payment record was last updated' })\n updatedAt?: Date // 결제 레코드가 마지막으로 업데이트된 날짜 및 시간\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'The date and time when the payment record was deleted' })\n deletedAt?: Date // 결제 레코드가 삭제된 날짜 및 시간\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who created the payment record' })\n creator?: User // 결제 레코드를 생성한 사용자\n\n @RelationId((payment: Payment) => payment.creator)\n creatorId?: string // 결제 레코드를 생성한 사용자의 ID\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who last updated the payment record' })\n updater?: User // 결제 레코드를 마지막으로 업데이트한 사용자\n\n @RelationId((payment: Payment) => payment.updater)\n updaterId?: string // 결제 레코드를 업데이트한 사용자의 ID\n}\n"]}
1
+ {"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../server/service/payment/payment.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAAsE;AAEtE,iDAA8C;AAC9C,yDAAgD;AAChD,4DAAwD;AACxD,oEAA+D;AAE/D,IAAY,gBAGX;AAHD,WAAY,gBAAgB;IAC1B,yCAAqB,CAAA;IACrB,yCAAqB,CAAA,CAAC,KAAK;AAC7B,CAAC,EAHW,gBAAgB,gCAAhB,gBAAgB,QAG3B;AAED,IAAA,+BAAgB,EAAC,gBAAgB,EAAE;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,yEAAyE,CAAC,0BAA0B;CAClH,CAAC,CAAA;AAEF,IAAY,WAKX;AALD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IACb,wCAAyB,CAAA;IACzB,sCAAuB,CAAA,CAAC,OAAO;AACjC,CAAC,EALW,WAAW,2BAAX,WAAW,QAKtB;AAED,IAAA,+BAAgB,EAAC,WAAW,EAAE;IAC5B,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,mEAAmE,CAAC,eAAe;CACjG,CAAC,CAAA;AAgBK,IAAM,OAAO,GAAb,MAAM,OAAO;IAAb;QAO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AO,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,EACpG;QACE,MAAM,EAAE,IAAI;QACZ,KAAK,EAAE,sBAAsB;KAC9B,CACF;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,oDAAoD,EAAE,CAAC,CAAC,0BAA0B;GAChG,OAAO,CAkGnB","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n DeleteDateColumn,\n Entity,\n Index,\n Column,\n RelationId,\n ManyToOne,\n VersionColumn,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID, registerEnumType } from 'type-graphql'\n\nimport { Domain } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Transaction } from '../transaction/transaction'\nimport { BankAccount } from 'service/bank-account/bank-account'\n\nexport enum PaymentDirection {\n Incoming = 'Incoming', // 수금\n Outgoing = 'Outgoing' // 지출\n}\n\nregisterEnumType(PaymentDirection, {\n name: 'PaymentDirection',\n description: 'Indicates whether the payment is incoming (received) or outgoing (paid)' // 결제 방향을 나타냅니다 (수금 또는 지출)\n})\n\nexport enum PaymentType {\n Transfer = 'Transfer', // 계좌 이체\n Cash = 'Cash', // 현금\n CreditCard = 'CreditCard', // 신용카드\n DebitCard = 'DebitCard' // 직불카드\n}\n\nregisterEnumType(PaymentType, {\n name: 'PaymentType',\n description: 'Type of the payment (e.g., Transfer, Cash, CreditCard, DebitCard)' // 결제 유형을 나타냅니다\n})\n\n@Entity()\n@Index('ix_payment_0', (payment: Payment) => [payment.domain, payment.transaction, payment.paidAt], {\n where: '\"deleted_at\" IS NULL',\n unique: true\n})\n@Index(\n 'ix_payment_1',\n (payment: Payment) => [payment.domain, payment.year, payment.quarter, payment.month, payment.paidAt],\n {\n unique: true,\n where: '\"deleted_at\" IS NULL'\n }\n)\n@ObjectType({ description: 'Entity representing a Payment record in the system' }) // 시스템 내에서 결제 기록을 나타내는 엔티티\nexport class Payment {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID, { description: 'Unique identifier for the payment record' })\n readonly id: string // 고유 식별자 (UUID)\n\n @VersionColumn()\n @Field({ nullable: true, description: 'Version number used for optimistic locking' })\n version?: number = 1 // 낙관적 잠금을 위한 버전 관리 필드\n\n @ManyToOne(type => Domain)\n @Field({ nullable: true, description: 'The domain to which this payment belongs' })\n domain?: Domain // 결제가 속한 도메인\n\n @RelationId((payment: Payment) => payment.domain)\n domainId?: string // 도메인의 ID\n\n @ManyToOne(type => Transaction, transaction => transaction.payments)\n @Field(type => Transaction, { description: 'The transaction associated with this payment' })\n transaction: Transaction // 결제와 연결된 트랜잭션\n\n @RelationId((payment: Payment) => payment.transaction)\n transactionId: string // 연결된 트랜잭션의 ID\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'The currency used in the payment' })\n currency?: string // 결제에 사용된 통화\n\n @Column({ nullable: false })\n @Field({ nullable: false, description: 'The amount of money involved in the payment' })\n amount: number // 결제된 금액\n\n @Column({ type: 'enum', enum: PaymentType, nullable: false })\n @Field(type => PaymentType, { description: 'Type of the payment' })\n paymentType: PaymentType // 결제 유형\n\n @ManyToOne(type => BankAccount, { nullable: true })\n @Field(type => BankAccount, { nullable: true, description: 'Source bank account for the payment' })\n sourceBankAccount?: BankAccount\n\n @RelationId((payment: Payment) => payment.sourceBankAccount)\n sourceBankAccountId?: string\n\n @ManyToOne(type => BankAccount, { nullable: true })\n @Field(type => BankAccount, { nullable: true, description: 'Destination bank account for the payment' })\n destinationBankAccount?: BankAccount\n\n @RelationId((payment: Payment) => payment.destinationBankAccount)\n destinationBankAccountId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal year in which the payment was made' })\n year?: number // 결제가 발생한 회계 연도\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal quarter in which the payment was made' })\n quarter?: number // 결제가 발생한 회계 분기\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Fiscal month in which the payment was made' })\n month?: number // 결제가 발생한 회계 월\n\n @Column({ nullable: false })\n @Field({ nullable: false, description: 'The date and time when the payment was made' })\n paidAt: Date // 결제가 이루어진 날짜 및 시간\n\n @Column({ nullable: false })\n @Field(type => PaymentDirection, { description: 'Direction of the payment (Incoming or Outgoing)' })\n direction: PaymentDirection // 결제 방향 (수금 또는 지출)\n\n @Column({ nullable: true })\n @Field({ nullable: true, description: 'Additional notes or comments about the payment' })\n note?: string // 결제에 대한 추가 설명 또는 메모\n\n @CreateDateColumn()\n @Field({ nullable: true, description: 'The date and time when the payment record was created' })\n createdAt?: Date // 결제 레코드가 생성된 날짜 및 시간\n\n @UpdateDateColumn()\n @Field({ nullable: true, description: 'The date and time when the payment record was last updated' })\n updatedAt?: Date // 결제 레코드가 마지막으로 업데이트된 날짜 및 시간\n\n @DeleteDateColumn()\n @Field({ nullable: true, description: 'The date and time when the payment record was deleted' })\n deletedAt?: Date // 결제 레코드가 삭제된 날짜 및 시간\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who created the payment record' })\n creator?: User // 결제 레코드를 생성한 사용자\n\n @RelationId((payment: Payment) => payment.creator)\n creatorId?: string // 결제 레코드를 생성한 사용자의 ID\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true, description: 'The user who last updated the payment record' })\n updater?: User // 결제 레코드를 마지막으로 업데이트한 사용자\n\n @RelationId((payment: Payment) => payment.updater)\n updaterId?: string // 결제 레코드를 업데이트한 사용자의 ID\n}\n"]}