@things-factory/accounting 8.0.6 → 9.0.0-beta.12
Sign up to get free protection for your applications and to get access to all the features.
- package/dist-client/pages/accounting-category/accounting-category-tree-page.js +1 -1
- package/dist-client/pages/accounting-category/accounting-category-tree-page.js.map +1 -1
- package/dist-client/pages/bank/bank-importer.d.ts +23 -0
- package/dist-client/pages/bank/bank-importer.js +93 -0
- package/dist-client/pages/bank/bank-importer.js.map +1 -0
- package/dist-client/pages/bank/bank-list-page.d.ts +66 -0
- package/dist-client/pages/bank/bank-list-page.js +370 -0
- package/dist-client/pages/bank/bank-list-page.js.map +1 -0
- package/dist-client/pages/bank-account/bank-account-importer.d.ts +23 -0
- package/dist-client/pages/bank-account/bank-account-importer.js +93 -0
- package/dist-client/pages/bank-account/bank-account-importer.js.map +1 -0
- package/dist-client/pages/bank-account/bank-account-list-page.d.ts +66 -0
- package/dist-client/pages/bank-account/bank-account-list-page.js +370 -0
- package/dist-client/pages/bank-account/bank-account-list-page.js.map +1 -0
- package/dist-client/pages/financial-institution/financial-institution-importer.d.ts +23 -0
- package/dist-client/pages/financial-institution/financial-institution-importer.js +93 -0
- package/dist-client/pages/financial-institution/financial-institution-importer.js.map +1 -0
- package/dist-client/pages/financial-institution/financial-institution-list-page.d.ts +66 -0
- package/dist-client/pages/financial-institution/financial-institution-list-page.js +370 -0
- package/dist-client/pages/financial-institution/financial-institution-list-page.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/migrations/1725201567284-seed-country-codes.d.ts +5 -0
- package/dist-server/migrations/1725201567284-seed-country-codes.js +248 -0
- package/dist-server/migrations/1725201567284-seed-country-codes.js.map +1 -0
- package/dist-server/migrations/1725201667385-seed-financial-institutions.d.ts +5 -0
- package/dist-server/migrations/1725201667385-seed-financial-institutions.js +348 -0
- package/dist-server/migrations/1725201667385-seed-financial-institutions.js.map +1 -0
- package/dist-server/service/bank-account/bank-account-history.d.ts +34 -0
- package/dist-server/service/bank-account/bank-account-history.js +172 -0
- package/dist-server/service/bank-account/bank-account-history.js.map +1 -0
- package/dist-server/service/bank-account/bank-account-mutation.d.ts +10 -0
- package/dist-server/service/bank-account/bank-account-mutation.js +128 -0
- package/dist-server/service/bank-account/bank-account-mutation.js.map +1 -0
- package/dist-server/service/bank-account/bank-account-query.d.ts +11 -0
- package/dist-server/service/bank-account/bank-account-query.js +79 -0
- package/dist-server/service/bank-account/bank-account-query.js.map +1 -0
- package/dist-server/service/bank-account/bank-account-type.d.ts +39 -0
- package/dist-server/service/bank-account/bank-account-type.js +153 -0
- package/dist-server/service/bank-account/bank-account-type.js.map +1 -0
- package/dist-server/service/bank-account/bank-account.d.ts +38 -0
- package/dist-server/service/bank-account/bank-account.js +164 -0
- package/dist-server/service/bank-account/bank-account.js.map +1 -0
- package/dist-server/service/bank-account/event-subscriber.d.ts +7 -0
- package/dist-server/service/bank-account/event-subscriber.js +21 -0
- package/dist-server/service/bank-account/event-subscriber.js.map +1 -0
- package/dist-server/service/bank-account/index.d.ts +7 -0
- package/dist-server/service/bank-account/index.js +12 -0
- package/dist-server/service/bank-account/index.js.map +1 -0
- package/dist-server/service/financial-institution/financial-institution-mutation.d.ts +10 -0
- package/dist-server/service/financial-institution/financial-institution-mutation.js +169 -0
- package/dist-server/service/financial-institution/financial-institution-mutation.js.map +1 -0
- package/dist-server/service/financial-institution/financial-institution-query.d.ts +12 -0
- package/dist-server/service/financial-institution/financial-institution-query.js +97 -0
- package/dist-server/service/financial-institution/financial-institution-query.js.map +1 -0
- package/dist-server/service/financial-institution/financial-institution-type.d.ts +32 -0
- package/dist-server/service/financial-institution/financial-institution-type.js +126 -0
- package/dist-server/service/financial-institution/financial-institution-type.js.map +1 -0
- package/dist-server/service/financial-institution/financial-institution.d.ts +34 -0
- package/dist-server/service/financial-institution/financial-institution.js +137 -0
- package/dist-server/service/financial-institution/financial-institution.js.map +1 -0
- package/dist-server/service/financial-institution/index.d.ts +6 -0
- package/dist-server/service/financial-institution/index.js +10 -0
- package/dist-server/service/financial-institution/index.js.map +1 -0
- package/dist-server/service/index.d.ts +3 -2
- package/dist-server/service/index.js +5 -0
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/payment/index.d.ts +1 -2
- package/dist-server/service/payment/payment-history.d.ts +8 -1
- package/dist-server/service/payment/payment-history.js +41 -10
- package/dist-server/service/payment/payment-history.js.map +1 -1
- package/dist-server/service/payment/payment-type.d.ts +7 -1
- package/dist-server/service/payment/payment-type.js +24 -0
- package/dist-server/service/payment/payment-type.js.map +1 -1
- package/dist-server/service/payment/payment.d.ts +12 -0
- package/dist-server/service/payment/payment.js +36 -1
- package/dist-server/service/payment/payment.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/helps/accounting/bank-account.md +160 -0
- package/helps/accounting/bank.md +160 -0
- package/helps/accounting/financial-institution.md +160 -0
- package/package.json +7 -7
- package/client/activities/activity-book-edit.ts +0 -88
- package/client/activities/activity-book-view.ts +0 -88
- package/client/activities/activity-expense-edit.ts +0 -88
- package/client/activities/activity-expense-view.ts +0 -88
- package/client/bootstrap.ts +0 -10
- package/client/components/accounting-category-selector.ts +0 -136
- package/client/components/accounting-category-view.ts +0 -75
- package/client/grist-editors/grist-editor-accounting-category-object.ts +0 -83
- package/client/grist-editors/grist-renderer-accounting-category-object.ts +0 -13
- package/client/index.ts +0 -0
- package/client/pages/account/account-importer.ts +0 -97
- package/client/pages/account/account-list-page.ts +0 -364
- package/client/pages/accounting-category/accounting-category-importer.ts +0 -97
- package/client/pages/accounting-category/accounting-category-list-page.ts +0 -368
- package/client/pages/accounting-category/accounting-category-tree-page.ts +0 -338
- package/client/pages/accounting-document/accounting-document-importer.ts +0 -90
- package/client/pages/accounting-document/accounting-document-list-page.ts +0 -398
- package/client/pages/financial-statement/financial-statement-importer.ts +0 -97
- package/client/pages/financial-statement/financial-statement-list-page.ts +0 -338
- package/client/pages/fiscal-month/fiscal-month-importer.ts +0 -90
- package/client/pages/fiscal-month/fiscal-month-list-page.ts +0 -398
- package/client/pages/fiscal-quarter/fiscal-quarter-importer.ts +0 -90
- package/client/pages/fiscal-quarter/fiscal-quarter-list-page.ts +0 -398
- package/client/pages/fiscal-year/fiscal-year-importer.ts +0 -90
- package/client/pages/fiscal-year/fiscal-year-list-page.ts +0 -398
- package/client/pages/income-statement/income-statement-importer.ts +0 -97
- package/client/pages/income-statement/income-statement-list-page.ts +0 -338
- package/client/pages/payment/payment-importer.ts +0 -90
- package/client/pages/payment/payment-list-page.ts +0 -398
- package/client/pages/transaction/transaction-importer.ts +0 -97
- package/client/pages/transaction/transaction-list-page.ts +0 -338
- package/client/route.ts +0 -35
- package/client/tsconfig.json +0 -13
- package/client/types/accounting-category.ts +0 -23
- package/client/types/index.ts +0 -1
- package/server/activities/activity-book.ts +0 -172
- package/server/activities/activity-expense.ts +0 -149
- package/server/activities/index.ts +0 -18
- package/server/controllers/index.ts +0 -1
- package/server/controllers/summary-statements.ts +0 -166
- package/server/index.ts +0 -6
- package/server/middlewares/index.ts +0 -3
- package/server/migrations/1725200507196-seed-fiscal-entities.ts +0 -106
- package/server/migrations/1725201467183-seed-accounts.ts +0 -339
- package/server/migrations/index.ts +0 -9
- package/server/routes.ts +0 -26
- package/server/service/account/account-history.ts +0 -117
- package/server/service/account/account-mutation.ts +0 -140
- package/server/service/account/account-query.ts +0 -51
- package/server/service/account/account-type.ts +0 -44
- package/server/service/account/account.ts +0 -97
- package/server/service/account/event-subscriber.ts +0 -17
- package/server/service/account/index.ts +0 -9
- package/server/service/accounting-category/accounting-category-history.ts +0 -129
- package/server/service/accounting-category/accounting-category-mutation.ts +0 -148
- package/server/service/accounting-category/accounting-category-query.ts +0 -74
- package/server/service/accounting-category/accounting-category-type.ts +0 -48
- package/server/service/accounting-category/accounting-category.ts +0 -100
- package/server/service/accounting-category/event-subscriber.ts +0 -20
- package/server/service/accounting-category/index.ts +0 -9
- package/server/service/accounting-document/accounting-document-history.ts +0 -123
- package/server/service/accounting-document/accounting-document-mutation.ts +0 -137
- package/server/service/accounting-document/accounting-document-query.ts +0 -48
- package/server/service/accounting-document/accounting-document-type.ts +0 -52
- package/server/service/accounting-document/accounting-document.ts +0 -93
- package/server/service/accounting-document/event-subscriber.ts +0 -17
- package/server/service/accounting-document/index.ts +0 -9
- package/server/service/common-type.ts +0 -12
- package/server/service/financial-statement/event-subscriber.ts +0 -17
- package/server/service/financial-statement/financial-statement-history.ts +0 -129
- package/server/service/financial-statement/financial-statement-line-item.ts +0 -82
- package/server/service/financial-statement/financial-statement-mutation.ts +0 -148
- package/server/service/financial-statement/financial-statement-query.ts +0 -53
- package/server/service/financial-statement/financial-statement-type.ts +0 -51
- package/server/service/financial-statement/financial-statement.ts +0 -116
- package/server/service/financial-statement/index.ts +0 -10
- package/server/service/fiscal-month/fiscal-month-mutation.ts +0 -145
- package/server/service/fiscal-month/fiscal-month-query.ts +0 -58
- package/server/service/fiscal-month/fiscal-month-type.ts +0 -66
- package/server/service/fiscal-month/fiscal-month.ts +0 -84
- package/server/service/fiscal-month/index.ts +0 -7
- package/server/service/fiscal-quarter/fiscal-quarter-mutation.ts +0 -148
- package/server/service/fiscal-quarter/fiscal-quarter-query.ts +0 -60
- package/server/service/fiscal-quarter/fiscal-quarter-type.ts +0 -60
- package/server/service/fiscal-quarter/fiscal-quarter.ts +0 -80
- package/server/service/fiscal-quarter/index.ts +0 -7
- package/server/service/fiscal-year/fiscal-year-mutation.ts +0 -145
- package/server/service/fiscal-year/fiscal-year-query.ts +0 -53
- package/server/service/fiscal-year/fiscal-year-type.ts +0 -54
- package/server/service/fiscal-year/fiscal-year.ts +0 -76
- package/server/service/fiscal-year/index.ts +0 -7
- package/server/service/income-statement/event-subscriber.ts +0 -17
- package/server/service/income-statement/income-statement-history.ts +0 -133
- package/server/service/income-statement/income-statement-line-item.ts +0 -84
- package/server/service/income-statement/income-statement-mutation.ts +0 -147
- package/server/service/income-statement/income-statement-query.ts +0 -50
- package/server/service/income-statement/income-statement-type.ts +0 -51
- package/server/service/income-statement/income-statement.ts +0 -120
- package/server/service/income-statement/index.ts +0 -10
- package/server/service/index.ts +0 -108
- package/server/service/payment/event-subscriber.ts +0 -17
- package/server/service/payment/index.ts +0 -9
- package/server/service/payment/payment-history.ts +0 -132
- package/server/service/payment/payment-mutation.ts +0 -139
- package/server/service/payment/payment-query.ts +0 -50
- package/server/service/payment/payment-type.ts +0 -64
- package/server/service/payment/payment.ts +0 -123
- package/server/service/transaction/event-subscriber.ts +0 -17
- package/server/service/transaction/index.ts +0 -9
- package/server/service/transaction/transaction-history.ts +0 -161
- package/server/service/transaction/transaction-mutation.ts +0 -146
- package/server/service/transaction/transaction-query.ts +0 -50
- package/server/service/transaction/transaction-type.ts +0 -48
- package/server/service/transaction/transaction.ts +0 -230
- package/server/tsconfig.json +0 -10
@@ -1,230 +0,0 @@
|
|
1
|
-
import {
|
2
|
-
CreateDateColumn,
|
3
|
-
UpdateDateColumn,
|
4
|
-
DeleteDateColumn,
|
5
|
-
Entity,
|
6
|
-
Index,
|
7
|
-
Column,
|
8
|
-
RelationId,
|
9
|
-
ManyToOne,
|
10
|
-
OneToMany,
|
11
|
-
PrimaryGeneratedColumn,
|
12
|
-
VersionColumn
|
13
|
-
} from 'typeorm'
|
14
|
-
import { ObjectType, Field, ID, registerEnumType } from 'type-graphql'
|
15
|
-
|
16
|
-
import { Domain } from '@things-factory/shell'
|
17
|
-
import { User } from '@things-factory/auth-base'
|
18
|
-
import { Account } from '../account/account'
|
19
|
-
import { Payment } from '../payment/payment'
|
20
|
-
import { AccountingDocument } from '../accounting-document/accounting-document'
|
21
|
-
|
22
|
-
export enum TransactionType {
|
23
|
-
SalesIncome, // 매출
|
24
|
-
PurchaseExpense, // 매입
|
25
|
-
Asset, // 자산
|
26
|
-
Liability, // 부채
|
27
|
-
Equity, // 자본
|
28
|
-
OtherIncome, // 기타 수익
|
29
|
-
OtherExpense // 기타 비용
|
30
|
-
}
|
31
|
-
|
32
|
-
registerEnumType(TransactionType, {
|
33
|
-
name: 'TransactionType',
|
34
|
-
description:
|
35
|
-
'Type enumeration of a transaction, indicating the nature of the transaction (e.g., Sales, Purchase, etc.)'
|
36
|
-
})
|
37
|
-
|
38
|
-
export enum TransactionCategory {
|
39
|
-
Confirmed = 'Confirmed', // 확정된 건
|
40
|
-
Forecast = 'Forecast' // 예상 전망 건
|
41
|
-
}
|
42
|
-
|
43
|
-
registerEnumType(TransactionCategory, {
|
44
|
-
name: 'TransactionCategory',
|
45
|
-
description: 'Category of a transaction, indicating whether it is confirmed or a forecast'
|
46
|
-
})
|
47
|
-
|
48
|
-
export enum TransactionStatus {
|
49
|
-
Pending = 'Pending', // 처리 대기 중
|
50
|
-
Paid = 'Paid', // 전액 결제됨
|
51
|
-
PartiallyPaid = 'PartiallyPaid', // 일부만 결제됨
|
52
|
-
Cancelled = 'Cancelled', // 취소됨
|
53
|
-
Delayed = 'Delayed', // 지연됨
|
54
|
-
ForecastFailed = 'ForecastFailed' // 전망이 틀린 경우
|
55
|
-
}
|
56
|
-
|
57
|
-
registerEnumType(TransactionStatus, {
|
58
|
-
name: 'TransactionStatus',
|
59
|
-
description: 'Status of a transaction, indicating its processing state (e.g., Paid, Delayed, etc.)'
|
60
|
-
})
|
61
|
-
|
62
|
-
@ObjectType({
|
63
|
-
description:
|
64
|
-
'Entity representing a financial transaction, which could be sales, purchase, or other types of financial operations.'
|
65
|
-
})
|
66
|
-
@Entity()
|
67
|
-
@Index(
|
68
|
-
'ix_transaction_0',
|
69
|
-
(transaction: Transaction) => [
|
70
|
-
transaction.domain,
|
71
|
-
transaction.transactionDate,
|
72
|
-
transaction.type,
|
73
|
-
transaction.account
|
74
|
-
],
|
75
|
-
{
|
76
|
-
unique: false,
|
77
|
-
where: '"deleted_at" IS NULL'
|
78
|
-
}
|
79
|
-
)
|
80
|
-
@Index(
|
81
|
-
'ix_transaction_1',
|
82
|
-
(transaction: Transaction) => [
|
83
|
-
transaction.domain,
|
84
|
-
transaction.type,
|
85
|
-
transaction.account,
|
86
|
-
transaction.transactionDate
|
87
|
-
],
|
88
|
-
{
|
89
|
-
unique: false,
|
90
|
-
where: '"deleted_at" IS NULL'
|
91
|
-
}
|
92
|
-
)
|
93
|
-
@Index(
|
94
|
-
'ix_transaction_2',
|
95
|
-
(transaction: Transaction) => [
|
96
|
-
transaction.domain,
|
97
|
-
transaction.year,
|
98
|
-
transaction.quarter,
|
99
|
-
transaction.month,
|
100
|
-
transaction.transactionDate,
|
101
|
-
transaction.type,
|
102
|
-
transaction.account
|
103
|
-
],
|
104
|
-
{
|
105
|
-
unique: true,
|
106
|
-
where: '"deleted_at" IS NULL'
|
107
|
-
}
|
108
|
-
)
|
109
|
-
export class Transaction {
|
110
|
-
@PrimaryGeneratedColumn('uuid')
|
111
|
-
@Field(type => ID, { description: 'Unique identifier for the transaction' })
|
112
|
-
readonly id: string
|
113
|
-
|
114
|
-
@VersionColumn()
|
115
|
-
@Field({ nullable: true, description: 'Version number for optimistic locking' })
|
116
|
-
version?: number = 1
|
117
|
-
|
118
|
-
@ManyToOne(type => Domain)
|
119
|
-
@Field({ nullable: true, description: 'The domain in which this transaction belongs' })
|
120
|
-
domain?: Domain
|
121
|
-
|
122
|
-
@RelationId((transaction: Transaction) => transaction.domain)
|
123
|
-
domainId?: string
|
124
|
-
|
125
|
-
@Column()
|
126
|
-
@Field({ nullable: true, description: 'Name or title of the transaction' })
|
127
|
-
name?: string
|
128
|
-
|
129
|
-
@Column({ nullable: true })
|
130
|
-
@Field({ nullable: true, description: 'Detailed description of the transaction' })
|
131
|
-
description?: string
|
132
|
-
|
133
|
-
@Column({ nullable: true })
|
134
|
-
@Field({ nullable: true, description: 'Currency in which the transaction is denominated' })
|
135
|
-
currency?: string
|
136
|
-
|
137
|
-
@Column({ nullable: true })
|
138
|
-
@Field({ nullable: true, description: 'Amount involved in the transaction' })
|
139
|
-
amount?: number = 0
|
140
|
-
|
141
|
-
@Column({ nullable: true })
|
142
|
-
@Field({ nullable: true, description: 'Indicates whether the transaction is currently active or not' })
|
143
|
-
active?: boolean
|
144
|
-
|
145
|
-
@Column({ nullable: true })
|
146
|
-
@Field({ nullable: true, description: 'Type of the transaction (e.g., SalesIncome, PurchaseExpense)' })
|
147
|
-
type?: TransactionType
|
148
|
-
|
149
|
-
@Column({ nullable: false })
|
150
|
-
@Field(type => TransactionCategory, {
|
151
|
-
nullable: false,
|
152
|
-
description: 'Category of the transaction (Confirmed or Forecast)'
|
153
|
-
})
|
154
|
-
category: TransactionCategory // 트랜잭션의 카테고리 (확정, 전망)
|
155
|
-
|
156
|
-
@Column({ nullable: false })
|
157
|
-
@Field(type => TransactionStatus, {
|
158
|
-
nullable: false,
|
159
|
-
description: 'Current status of the transaction (e.g., Paid, Delayed)'
|
160
|
-
})
|
161
|
-
status: TransactionStatus // 트랜잭션의 상태 (예: Paid, Delayed 등)
|
162
|
-
|
163
|
-
@Column({ nullable: true })
|
164
|
-
@Field({ nullable: true, description: 'The probability of the forecast being realized (0 to 100)' })
|
165
|
-
probability?: number // 예측이 실현될 확률 (0 ~ 100)
|
166
|
-
|
167
|
-
@Column({ nullable: true })
|
168
|
-
@Field({ nullable: true, description: 'Additional notes or comments about the forecast' })
|
169
|
-
forecastNotes?: string // 전망에 대한 추가 설명이나 메모
|
170
|
-
|
171
|
-
@ManyToOne(type => Account)
|
172
|
-
@Field({ nullable: true, description: 'Associated account for this transaction' })
|
173
|
-
account?: Account
|
174
|
-
|
175
|
-
@RelationId((transaction: Transaction) => transaction.account)
|
176
|
-
accountId?: string
|
177
|
-
|
178
|
-
@Column({ nullable: true })
|
179
|
-
@Field({ nullable: true, description: 'Fiscal year in which the transaction occurs' })
|
180
|
-
year?: number
|
181
|
-
|
182
|
-
@Column({ nullable: true })
|
183
|
-
@Field({ nullable: true, description: 'Fiscal quarter in which the transaction occurs' })
|
184
|
-
quarter?: number
|
185
|
-
|
186
|
-
@Column({ nullable: true })
|
187
|
-
@Field({ nullable: true, description: 'Fiscal month in which the transaction occurs' })
|
188
|
-
month?: number
|
189
|
-
|
190
|
-
@Column({ nullable: false })
|
191
|
-
@Field({ nullable: false, description: 'The date the transaction occurs or is scheduled (in string format)' })
|
192
|
-
transactionDate: string // 트랜잭션이 발생하거나 발생할 날짜
|
193
|
-
|
194
|
-
@OneToMany(type => Payment, payment => payment.transaction)
|
195
|
-
@Field(type => [Payment], { nullable: true, description: 'List of payments associated with this transaction' })
|
196
|
-
payments?: Payment[]
|
197
|
-
|
198
|
-
@OneToMany(type => AccountingDocument, document => document.transaction)
|
199
|
-
@Field(type => [AccountingDocument], {
|
200
|
-
nullable: true,
|
201
|
-
description: 'List of accounting documents linked to this transaction'
|
202
|
-
})
|
203
|
-
documents?: AccountingDocument[] // 트랜잭션과 연결된 회계 문서
|
204
|
-
|
205
|
-
@CreateDateColumn()
|
206
|
-
@Field({ nullable: true, description: 'Timestamp when the transaction record was created' })
|
207
|
-
createdAt?: Date
|
208
|
-
|
209
|
-
@UpdateDateColumn()
|
210
|
-
@Field({ nullable: true, description: 'Timestamp when the transaction record was last updated' })
|
211
|
-
updatedAt?: Date
|
212
|
-
|
213
|
-
@DeleteDateColumn()
|
214
|
-
@Field({ nullable: true, description: 'Timestamp when the transaction record was deleted (soft delete)' })
|
215
|
-
deletedAt?: Date
|
216
|
-
|
217
|
-
@ManyToOne(type => User, { nullable: true })
|
218
|
-
@Field(type => User, { nullable: true, description: 'User who created the transaction record' })
|
219
|
-
creator?: User
|
220
|
-
|
221
|
-
@RelationId((transaction: Transaction) => transaction.creator)
|
222
|
-
creatorId?: string
|
223
|
-
|
224
|
-
@ManyToOne(type => User, { nullable: true })
|
225
|
-
@Field(type => User, { nullable: true, description: 'User who last updated the transaction record' })
|
226
|
-
updater?: User
|
227
|
-
|
228
|
-
@RelationId((transaction: Transaction) => transaction.updater)
|
229
|
-
updaterId?: string
|
230
|
-
}
|