@things-factory/accounting 8.0.0-beta.1 → 8.0.0-beta.4
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +5 -5
- 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/bank/bank-importer.ts +0 -90
- package/client/pages/bank/bank-list-page.ts +0 -398
- package/client/pages/bank-account/bank-account-importer.ts +0 -90
- package/client/pages/bank-account/bank-account-list-page.ts +0 -398
- package/client/pages/financial-institution/financial-institution-importer.ts +0 -90
- package/client/pages/financial-institution/financial-institution-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/1725201567284-seed-country-codes.ts +0 -261
- package/server/migrations/1725201667385-seed-financial-institutions.ts +0 -348
- 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/bank-account/bank-account-history.ts +0 -149
- package/server/service/bank-account/bank-account-mutation.ts +0 -137
- package/server/service/bank-account/bank-account-query.ts +0 -48
- package/server/service/bank-account/bank-account-type.ts +0 -112
- package/server/service/bank-account/bank-account.ts +0 -142
- package/server/service/bank-account/event-subscriber.ts +0 -17
- package/server/service/bank-account/index.ts +0 -9
- package/server/service/common-type.ts +0 -12
- package/server/service/financial-institution/financial-institution-mutation.ts +0 -198
- package/server/service/financial-institution/financial-institution-query.ts +0 -62
- package/server/service/financial-institution/financial-institution-type.ts +0 -91
- package/server/service/financial-institution/financial-institution.ts +0 -122
- package/server/service/financial-institution/index.ts +0 -7
- 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 -155
- 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 -82
- package/server/service/payment/payment.ts +0 -154
- 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,339 +0,0 @@
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm'
|
2
|
-
import { Domain, getRepository } from '@things-factory/shell'
|
3
|
-
import { User } from '@things-factory/auth-base'
|
4
|
-
import { Account } from '../service/account/account'
|
5
|
-
import { AccountingCategory } from '../service/accounting-category/accounting-category'
|
6
|
-
|
7
|
-
export class SeedAccounts1725201467183 implements MigrationInterface {
|
8
|
-
public async up(queryRunner: QueryRunner): Promise<void> {
|
9
|
-
const domainRepository = getRepository(Domain)
|
10
|
-
const userRepository = getRepository(User)
|
11
|
-
const accountingCategoryRepository = getRepository(AccountingCategory)
|
12
|
-
const accountRepository = getRepository(Account)
|
13
|
-
|
14
|
-
const domain: Domain | null = await domainRepository.findOne({
|
15
|
-
where: { name: 'SYSTEM' }
|
16
|
-
})
|
17
|
-
|
18
|
-
if (!domain) {
|
19
|
-
throw new Error('SYSTEM domain not found')
|
20
|
-
}
|
21
|
-
|
22
|
-
const user = await userRepository.findOne({ where: { id: domain.owner } })
|
23
|
-
|
24
|
-
if (!user) {
|
25
|
-
throw new Error('Domain owner not found')
|
26
|
-
}
|
27
|
-
|
28
|
-
try {
|
29
|
-
// 최상위 카테고리 생성
|
30
|
-
const topLevelCategories = {
|
31
|
-
자산: await accountingCategoryRepository.save({
|
32
|
-
domain,
|
33
|
-
code: 'ASSET',
|
34
|
-
name: '자산',
|
35
|
-
description: '기업이 소유하고 있는 자산',
|
36
|
-
creator: user,
|
37
|
-
updater: user
|
38
|
-
}),
|
39
|
-
부채: await accountingCategoryRepository.save({
|
40
|
-
domain,
|
41
|
-
code: 'LIABILITY',
|
42
|
-
name: '부채',
|
43
|
-
description: '기업이 갚아야 할 빚',
|
44
|
-
creator: user,
|
45
|
-
updater: user
|
46
|
-
}),
|
47
|
-
자본: await accountingCategoryRepository.save({
|
48
|
-
domain,
|
49
|
-
code: 'EQUITY',
|
50
|
-
name: '자본',
|
51
|
-
description: '기업 소유주의 자산',
|
52
|
-
creator: user,
|
53
|
-
updater: user
|
54
|
-
}),
|
55
|
-
수익: await accountingCategoryRepository.save({
|
56
|
-
domain,
|
57
|
-
code: 'REVENUE',
|
58
|
-
name: '수익',
|
59
|
-
description: '기업이 벌어들인 돈',
|
60
|
-
creator: user,
|
61
|
-
updater: user
|
62
|
-
}),
|
63
|
-
비용: await accountingCategoryRepository.save({
|
64
|
-
domain,
|
65
|
-
code: 'EXPENSE',
|
66
|
-
name: '비용',
|
67
|
-
description: '기업 운영에 사용된 돈',
|
68
|
-
creator: user,
|
69
|
-
updater: user
|
70
|
-
})
|
71
|
-
}
|
72
|
-
|
73
|
-
// 유동자산 및 비유동자산과 같은 하위 카테고리 생성
|
74
|
-
const subCategories = {
|
75
|
-
유동자산: await accountingCategoryRepository.save({
|
76
|
-
domain,
|
77
|
-
code: 'CURRENT_ASSET',
|
78
|
-
name: '유동자산',
|
79
|
-
description: '쉽게 현금화할 수 있는 자산',
|
80
|
-
parent: topLevelCategories.자산,
|
81
|
-
creator: user,
|
82
|
-
updater: user
|
83
|
-
}),
|
84
|
-
비유동자산: await accountingCategoryRepository.save({
|
85
|
-
domain,
|
86
|
-
code: 'NON_CURRENT_ASSET',
|
87
|
-
name: '비유동자산',
|
88
|
-
description: '장기 보유 자산',
|
89
|
-
parent: topLevelCategories.자산,
|
90
|
-
creator: user,
|
91
|
-
updater: user
|
92
|
-
}),
|
93
|
-
유동부채: await accountingCategoryRepository.save({
|
94
|
-
domain,
|
95
|
-
code: 'CURRENT_LIABILITY',
|
96
|
-
name: '유동부채',
|
97
|
-
description: '단기간에 상환해야 하는 부채',
|
98
|
-
parent: topLevelCategories.부채,
|
99
|
-
creator: user,
|
100
|
-
updater: user
|
101
|
-
}),
|
102
|
-
비유동부채: await accountingCategoryRepository.save({
|
103
|
-
domain,
|
104
|
-
code: 'NON_CURRENT_LIABILITY',
|
105
|
-
name: '비유동부채',
|
106
|
-
description: '장기 부채',
|
107
|
-
parent: topLevelCategories.부채,
|
108
|
-
creator: user,
|
109
|
-
updater: user
|
110
|
-
})
|
111
|
-
}
|
112
|
-
|
113
|
-
// 이제 유형자산, 무형자산, 단기금융부채 같은 하위 카테고리를 subCategories 객체를 사용하여 생성합니다.
|
114
|
-
const furtherSubCategories = {
|
115
|
-
유형자산: await accountingCategoryRepository.save({
|
116
|
-
domain,
|
117
|
-
code: 'TANGIBLE_ASSET',
|
118
|
-
name: '유형자산',
|
119
|
-
description: '물리적 형태가 있는 자산',
|
120
|
-
parent: subCategories.비유동자산,
|
121
|
-
creator: user,
|
122
|
-
updater: user
|
123
|
-
}),
|
124
|
-
무형자산: await accountingCategoryRepository.save({
|
125
|
-
domain,
|
126
|
-
code: 'INTANGIBLE_ASSET',
|
127
|
-
name: '무형자산',
|
128
|
-
description: '물리적 형태가 없는 자산',
|
129
|
-
parent: subCategories.비유동자산,
|
130
|
-
creator: user,
|
131
|
-
updater: user
|
132
|
-
}),
|
133
|
-
단기금융부채: await accountingCategoryRepository.save({
|
134
|
-
domain,
|
135
|
-
code: 'SHORT_TERM_FINANCIAL_LIABILITY',
|
136
|
-
name: '단기금융부채',
|
137
|
-
description: '단기적으로 갚아야 할 금융부채',
|
138
|
-
parent: subCategories.유동부채,
|
139
|
-
creator: user,
|
140
|
-
updater: user
|
141
|
-
})
|
142
|
-
}
|
143
|
-
|
144
|
-
// 계정 생성 및 하위 카테고리 연결
|
145
|
-
const accounts = [
|
146
|
-
// 유동자산 계정
|
147
|
-
{
|
148
|
-
code: '101',
|
149
|
-
name: '현금 및 현금성 자산',
|
150
|
-
description: '현금, 예금 및 기타 현금성 자산',
|
151
|
-
category: subCategories.유동자산
|
152
|
-
},
|
153
|
-
{
|
154
|
-
code: '102',
|
155
|
-
name: '매출채권',
|
156
|
-
description: '상품 또는 서비스의 판매로 인해 발생한 채권',
|
157
|
-
category: subCategories.유동자산
|
158
|
-
},
|
159
|
-
{
|
160
|
-
code: '103',
|
161
|
-
name: '재고자산',
|
162
|
-
description: '판매를 목적으로 보유한 상품, 제품, 원재료 등',
|
163
|
-
category: subCategories.유동자산
|
164
|
-
},
|
165
|
-
{
|
166
|
-
code: '104',
|
167
|
-
name: '단기금융상품',
|
168
|
-
description: '단기투자 목적으로 보유한 금융상품',
|
169
|
-
category: subCategories.유동자산
|
170
|
-
},
|
171
|
-
{
|
172
|
-
code: '105',
|
173
|
-
name: '선급금',
|
174
|
-
description: '상품, 서비스 제공을 위해 미리 지급한 금액',
|
175
|
-
category: subCategories.유동자산
|
176
|
-
},
|
177
|
-
|
178
|
-
// 비유동자산 계정
|
179
|
-
{
|
180
|
-
code: '201',
|
181
|
-
name: '건물',
|
182
|
-
description: '기업이 소유한 건물',
|
183
|
-
category: furtherSubCategories.유형자산
|
184
|
-
},
|
185
|
-
{
|
186
|
-
code: '202',
|
187
|
-
name: '토지',
|
188
|
-
description: '기업이 소유한 토지',
|
189
|
-
category: furtherSubCategories.유형자산
|
190
|
-
},
|
191
|
-
{
|
192
|
-
code: '203',
|
193
|
-
name: '기계장치',
|
194
|
-
description: '생산을 위해 사용되는 기계 및 장치',
|
195
|
-
category: furtherSubCategories.유형자산
|
196
|
-
},
|
197
|
-
{
|
198
|
-
code: '204',
|
199
|
-
name: '무형자산',
|
200
|
-
description: '특허권, 상표권 등의 무형자산',
|
201
|
-
category: furtherSubCategories.무형자산
|
202
|
-
},
|
203
|
-
|
204
|
-
// 유동부채 계정
|
205
|
-
{
|
206
|
-
code: '301',
|
207
|
-
name: '매입채무',
|
208
|
-
description: '상품 또는 서비스의 구매로 인해 발생한 채무',
|
209
|
-
category: subCategories.유동부채
|
210
|
-
},
|
211
|
-
{
|
212
|
-
code: '302',
|
213
|
-
name: '단기차입금',
|
214
|
-
description: '단기 대출금',
|
215
|
-
category: furtherSubCategories.단기금융부채
|
216
|
-
},
|
217
|
-
{
|
218
|
-
code: '303',
|
219
|
-
name: '미지급금',
|
220
|
-
description: '이미 발생한 비용에 대한 지급할 금액',
|
221
|
-
category: subCategories.유동부채
|
222
|
-
},
|
223
|
-
{
|
224
|
-
code: '304',
|
225
|
-
name: '선수금',
|
226
|
-
description: '고객으로부터 미리 받은 금액',
|
227
|
-
category: subCategories.유동부채
|
228
|
-
},
|
229
|
-
|
230
|
-
// 비유동부채 계정
|
231
|
-
{ code: '401', name: '장기차입금', description: '장기 대출금', category: subCategories.비유동부채 },
|
232
|
-
{
|
233
|
-
code: '402',
|
234
|
-
name: '퇴직급여충당부채',
|
235
|
-
description: '퇴직급여 지급을 위해 설정한 부채',
|
236
|
-
category: subCategories.비유동부채
|
237
|
-
},
|
238
|
-
|
239
|
-
// 자본 계정
|
240
|
-
{ code: '501', name: '자본금', description: '주주가 납입한 자본', category: topLevelCategories.자본 },
|
241
|
-
{ code: '502', name: '이익잉여금', description: '이익의 축적', category: topLevelCategories.자본 },
|
242
|
-
|
243
|
-
// 수익 계정
|
244
|
-
{
|
245
|
-
code: '601',
|
246
|
-
name: '제품매출',
|
247
|
-
description: '제품의 판매로 인한 수익',
|
248
|
-
category: topLevelCategories.수익
|
249
|
-
},
|
250
|
-
{
|
251
|
-
code: '602',
|
252
|
-
name: '상품매출',
|
253
|
-
description: '상품의 판매로 인한 수익',
|
254
|
-
category: topLevelCategories.수익
|
255
|
-
},
|
256
|
-
{
|
257
|
-
code: '603',
|
258
|
-
name: '용역매출',
|
259
|
-
description: '용역 제공으로 인한 수익',
|
260
|
-
category: topLevelCategories.수익
|
261
|
-
},
|
262
|
-
{
|
263
|
-
code: '604',
|
264
|
-
name: '이자수익',
|
265
|
-
description: '금융 자산에서 발생한 이자수익',
|
266
|
-
category: topLevelCategories.수익
|
267
|
-
},
|
268
|
-
{
|
269
|
-
code: '605',
|
270
|
-
name: '배당금수익',
|
271
|
-
description: '주식 투자로 인한 배당금 수익',
|
272
|
-
category: topLevelCategories.수익
|
273
|
-
},
|
274
|
-
|
275
|
-
// 비용 계정
|
276
|
-
{
|
277
|
-
code: '701',
|
278
|
-
name: '매출원가',
|
279
|
-
description: '제품, 상품, 용역 제공에 대한 원가',
|
280
|
-
category: topLevelCategories.비용
|
281
|
-
},
|
282
|
-
{ code: '702', name: '급여', description: '직원 급여 비용', category: topLevelCategories.비용 },
|
283
|
-
{ code: '703', name: '임대료', description: '건물 및 설비 임차료', category: topLevelCategories.비용 },
|
284
|
-
{
|
285
|
-
code: '704',
|
286
|
-
name: '감가상각비',
|
287
|
-
description: '유형자산의 감가상각비용',
|
288
|
-
category: topLevelCategories.비용
|
289
|
-
},
|
290
|
-
{
|
291
|
-
code: '705',
|
292
|
-
name: '이자비용',
|
293
|
-
description: '차입금에 대한 이자비용',
|
294
|
-
category: topLevelCategories.비용
|
295
|
-
},
|
296
|
-
{
|
297
|
-
code: '706',
|
298
|
-
name: '판매비 및 관리비',
|
299
|
-
description: '기업 운영에 필요한 비용',
|
300
|
-
category: topLevelCategories.비용
|
301
|
-
},
|
302
|
-
{ code: '707', name: '법인세비용', description: '법인세 납부 비용', category: topLevelCategories.비용 }
|
303
|
-
]
|
304
|
-
|
305
|
-
// 계정 저장
|
306
|
-
for (const account of accounts) {
|
307
|
-
await accountRepository.save({
|
308
|
-
domain,
|
309
|
-
...account,
|
310
|
-
creator: user,
|
311
|
-
updater: user
|
312
|
-
})
|
313
|
-
}
|
314
|
-
} catch (error) {
|
315
|
-
console.error('Failed to seed accounting categories and accounts:', error)
|
316
|
-
throw error
|
317
|
-
}
|
318
|
-
}
|
319
|
-
|
320
|
-
public async down(queryRunner: QueryRunner): Promise<void> {
|
321
|
-
const domainRepository = getRepository(Domain)
|
322
|
-
const accountingCategoryRepository = getRepository(AccountingCategory)
|
323
|
-
const accountRepository = getRepository(Account)
|
324
|
-
|
325
|
-
const domain: Domain | null = await domainRepository.findOne({
|
326
|
-
where: { name: 'SYSTEM' }
|
327
|
-
})
|
328
|
-
|
329
|
-
if (!domain) {
|
330
|
-
throw new Error('SYSTEM domain not found')
|
331
|
-
}
|
332
|
-
|
333
|
-
// Accounts 삭제
|
334
|
-
await accountRepository.softDelete({ domain: { id: domain.id } })
|
335
|
-
|
336
|
-
// AccountingCategories 삭제
|
337
|
-
await accountingCategoryRepository.softDelete({ domain: { id: domain.id } })
|
338
|
-
}
|
339
|
-
}
|
@@ -1,261 +0,0 @@
|
|
1
|
-
import { MigrationInterface, QueryRunner } from 'typeorm'
|
2
|
-
|
3
|
-
import { CommonCode, CommonCodeDetail } from '@things-factory/code-base'
|
4
|
-
import { Domain, getRepository } from '@things-factory/shell'
|
5
|
-
|
6
|
-
const codes = [
|
7
|
-
{
|
8
|
-
name: 'COUNTRY_CODES',
|
9
|
-
description: 'country code',
|
10
|
-
details: [
|
11
|
-
{ name: 'AF', description: '아프가니스탄' },
|
12
|
-
{ name: 'AL', description: '알바니아' },
|
13
|
-
{ name: 'DZ', description: '알제리' },
|
14
|
-
{ name: 'AS', description: '아메리칸사모아' },
|
15
|
-
{ name: 'AD', description: '안도라' },
|
16
|
-
{ name: 'AO', description: '앙골라' },
|
17
|
-
{ name: 'AI', description: '앵귈라' },
|
18
|
-
{ name: 'AQ', description: '남극' },
|
19
|
-
{ name: 'AG', description: '앤티가 바부다' },
|
20
|
-
{ name: 'AR', description: '아르헨티나' },
|
21
|
-
{ name: 'AM', description: '아르메니아' },
|
22
|
-
{ name: 'AW', description: '아루바' },
|
23
|
-
{ name: 'AU', description: '호주' },
|
24
|
-
{ name: 'AT', description: '오스트리아' },
|
25
|
-
{ name: 'AZ', description: '아제르바이잔' },
|
26
|
-
{ name: 'BS', description: '바하마' },
|
27
|
-
{ name: 'BH', description: '바레인' },
|
28
|
-
{ name: 'BD', description: '방글라데시' },
|
29
|
-
{ name: 'BB', description: '바베이도스' },
|
30
|
-
{ name: 'BY', description: '벨라루스' },
|
31
|
-
{ name: 'BE', description: '벨기에' },
|
32
|
-
{ name: 'BZ', description: '벨리즈' },
|
33
|
-
{ name: 'BJ', description: '베냉' },
|
34
|
-
{ name: 'BM', description: '버뮤다' },
|
35
|
-
{ name: 'BT', description: '부탄' },
|
36
|
-
{ name: 'BO', description: '볼리비아' },
|
37
|
-
{ name: 'BA', description: '보스니아 헤르체고비나' },
|
38
|
-
{ name: 'BW', description: '보츠와나' },
|
39
|
-
{ name: 'BV', description: '부베 섬' },
|
40
|
-
{ name: 'BR', description: '브라질' },
|
41
|
-
{ name: 'IO', description: '영국령 인도양 지역' },
|
42
|
-
{ name: 'BN', description: '브루나이' },
|
43
|
-
{ name: 'BG', description: '불가리아' },
|
44
|
-
{ name: 'BF', description: '부르키나파소' },
|
45
|
-
{ name: 'BI', description: '부룬디' },
|
46
|
-
{ name: 'KH', description: '캄보디아' },
|
47
|
-
{ name: 'CM', description: '카메룬' },
|
48
|
-
{ name: 'CA', description: '캐나다' },
|
49
|
-
{ name: 'CV', description: '카보베르데' },
|
50
|
-
{ name: 'KY', description: '케이맨 제도' },
|
51
|
-
{ name: 'CF', description: '중앙아프리카 공화국' },
|
52
|
-
{ name: 'TD', description: '차드' },
|
53
|
-
{ name: 'CL', description: '칠레' },
|
54
|
-
{ name: 'CN', description: '중국' },
|
55
|
-
{ name: 'CX', description: '크리스마스 섬' },
|
56
|
-
{ name: 'CC', description: '코코스 제도' },
|
57
|
-
{ name: 'CO', description: '콜롬비아' },
|
58
|
-
{ name: 'KM', description: '코모로' },
|
59
|
-
{ name: 'CG', description: '콩고' },
|
60
|
-
{ name: 'CD', description: '콩고 민주 공화국' },
|
61
|
-
{ name: 'CK', description: '쿡 제도' },
|
62
|
-
{ name: 'CR', description: '코스타리카' },
|
63
|
-
{ name: 'CI', description: '코트디부아르' },
|
64
|
-
{ name: 'HR', description: '크로아티아' },
|
65
|
-
{ name: 'CU', description: '쿠바' },
|
66
|
-
{ name: 'CY', description: '키프로스' },
|
67
|
-
{ name: 'CZ', description: '체코' },
|
68
|
-
{ name: 'DK', description: '덴마크' },
|
69
|
-
{ name: 'DJ', description: '지부티' },
|
70
|
-
{ name: 'DM', description: '도미니카' },
|
71
|
-
{ name: 'DO', description: '도미니카 공화국' },
|
72
|
-
{ name: 'EC', description: '에콰도르' },
|
73
|
-
{ name: 'EG', description: '이집트' },
|
74
|
-
{ name: 'SV', description: '엘살바도르' },
|
75
|
-
{ name: 'GQ', description: '적도 기니' },
|
76
|
-
{ name: 'ER', description: '에리트레아' },
|
77
|
-
{ name: 'EE', description: '에스토니아' },
|
78
|
-
{ name: 'ET', description: '에티오피아' },
|
79
|
-
{ name: 'FK', description: '포클랜드 제도' },
|
80
|
-
{ name: 'FO', description: '페로 제도' },
|
81
|
-
{ name: 'FJ', description: '피지' },
|
82
|
-
{ name: 'FI', description: '핀란드' },
|
83
|
-
{ name: 'FR', description: '프랑스' },
|
84
|
-
{ name: 'GF', description: '프랑스령 기아나' },
|
85
|
-
{ name: 'PF', description: '프랑스령 폴리네시아' },
|
86
|
-
{ name: 'TF', description: '프랑스령 남방 및 남극' },
|
87
|
-
{ name: 'GA', description: '가봉' },
|
88
|
-
{ name: 'GM', description: '감비아' },
|
89
|
-
{ name: 'GE', description: '조지아' },
|
90
|
-
{ name: 'DE', description: '독일' },
|
91
|
-
{ name: 'GH', description: '가나' },
|
92
|
-
{ name: 'GI', description: '지브롤터' },
|
93
|
-
{ name: 'GR', description: '그리스' },
|
94
|
-
{ name: 'GL', description: '그린란드' },
|
95
|
-
{ name: 'GD', description: '그레나다' },
|
96
|
-
{ name: 'GP', description: '과들루프' },
|
97
|
-
{ name: 'GU', description: '괌' },
|
98
|
-
{ name: 'GT', description: '과테말라' },
|
99
|
-
{ name: 'GN', description: '기니' },
|
100
|
-
{ name: 'GW', description: '기니비사우' },
|
101
|
-
{ name: 'GY', description: '가이아나' },
|
102
|
-
{ name: 'HT', description: '아이티' },
|
103
|
-
{ name: 'HM', description: '허드 맥도널드 제도' },
|
104
|
-
{ name: 'VA', description: '바티칸 시국' },
|
105
|
-
{ name: 'HN', description: '온두라스' },
|
106
|
-
{ name: 'HK', description: '홍콩' },
|
107
|
-
{ name: 'HU', description: '헝가리' },
|
108
|
-
{ name: 'IS', description: '아이슬란드' },
|
109
|
-
{ name: 'IN', description: '인도' },
|
110
|
-
{ name: 'ID', description: '인도네시아' },
|
111
|
-
{ name: 'IR', description: '이란' },
|
112
|
-
{ name: 'IQ', description: '이라크' },
|
113
|
-
{ name: 'IE', description: '아일랜드' },
|
114
|
-
{ name: 'IL', description: '이스라엘' },
|
115
|
-
{ name: 'IT', description: '이탈리아' },
|
116
|
-
{ name: 'JM', description: '자메이카' },
|
117
|
-
{ name: 'JP', description: '일본' },
|
118
|
-
{ name: 'JO', description: '요르단' },
|
119
|
-
{ name: 'KZ', description: '카자흐스탄' },
|
120
|
-
{ name: 'KE', description: '케냐' },
|
121
|
-
{ name: 'KI', description: '키리바시' },
|
122
|
-
{ name: 'KP', description: '북한' },
|
123
|
-
{ name: 'KR', description: '대한민국' },
|
124
|
-
{ name: 'KW', description: '쿠웨이트' },
|
125
|
-
{ name: 'KG', description: '키르기스스탄' },
|
126
|
-
{ name: 'LA', description: '라오스' },
|
127
|
-
{ name: 'LV', description: '라트비아' },
|
128
|
-
{ name: 'LB', description: '레바논' },
|
129
|
-
{ name: 'LS', description: '레소토' },
|
130
|
-
{ name: 'LR', description: '라이베리아' },
|
131
|
-
{ name: 'LY', description: '리비아' },
|
132
|
-
{ name: 'LI', description: '리히텐슈타인' },
|
133
|
-
{ name: 'LT', description: '리투아니아' },
|
134
|
-
{ name: 'LU', description: '룩셈부르크' },
|
135
|
-
{ name: 'MO', description: '마카오' },
|
136
|
-
{ name: 'MK', description: '북마케도니아' },
|
137
|
-
{ name: 'MG', description: '마다가스카르' },
|
138
|
-
{ name: 'MW', description: '말라위' },
|
139
|
-
{ name: 'MY', description: '말레이시아' },
|
140
|
-
{ name: 'MV', description: '몰디브' },
|
141
|
-
{ name: 'ML', description: '말리' },
|
142
|
-
{ name: 'MT', description: '몰타' },
|
143
|
-
{ name: 'MH', description: '마셜 제도' },
|
144
|
-
{ name: 'MQ', description: '마르티니크' },
|
145
|
-
{ name: 'MR', description: '모리타니' },
|
146
|
-
{ name: 'MU', description: '모리셔스' },
|
147
|
-
{ name: 'YT', description: '마요트' },
|
148
|
-
{ name: 'MX', description: '멕시코' },
|
149
|
-
{ name: 'FM', description: '미크로네시아 연방' },
|
150
|
-
{ name: 'MD', description: '몰도바' },
|
151
|
-
{ name: 'MC', description: '모나코' },
|
152
|
-
{ name: 'MN', description: '몽골' },
|
153
|
-
{ name: 'MS', description: '몬트세랫' },
|
154
|
-
{ name: 'MA', description: '모로코' },
|
155
|
-
{ name: 'MZ', description: '모잠비크' },
|
156
|
-
{ name: 'MM', description: '미얀마' },
|
157
|
-
{ name: 'NA', description: '나미비아' },
|
158
|
-
{ name: 'NR', description: '나우루' },
|
159
|
-
{ name: 'NP', description: '네팔' },
|
160
|
-
{ name: 'NL', description: '네덜란드' },
|
161
|
-
{ name: 'NC', description: '뉴칼레도니아' },
|
162
|
-
{ name: 'NZ', description: '뉴질랜드' },
|
163
|
-
{ name: 'NI', description: '니카라과' },
|
164
|
-
{ name: 'NE', description: '니제르' },
|
165
|
-
{ name: 'NG', description: '나이지리아' },
|
166
|
-
{ name: 'NU', description: '니우에' },
|
167
|
-
{ name: 'NF', description: '노퍽 섬' },
|
168
|
-
{ name: 'MP', description: '북마리아나 제도' },
|
169
|
-
{ name: 'NO', description: '노르웨이' },
|
170
|
-
{ name: 'OM', description: '오만' },
|
171
|
-
{ name: 'PK', description: '파키스탄' },
|
172
|
-
{ name: 'PW', description: '팔라우' },
|
173
|
-
{ name: 'PS', description: '팔레스타인' },
|
174
|
-
{ name: 'PA', description: '파나마' },
|
175
|
-
{ name: 'PG', description: '파푸아뉴기니' },
|
176
|
-
{ name: 'PY', description: '파라과이' },
|
177
|
-
{ name: 'PE', description: '페루' },
|
178
|
-
{ name: 'PH', description: '필리핀' },
|
179
|
-
{ name: 'PN', description: '핏케언 제도' },
|
180
|
-
{ name: 'PL', description: '폴란드' },
|
181
|
-
{ name: 'PT', description: '포르투갈' },
|
182
|
-
{ name: 'PR', description: '푸에르토리코' },
|
183
|
-
{ name: 'QA', description: '카타르' },
|
184
|
-
{ name: 'RE', description: '레위니옹' },
|
185
|
-
{ name: 'RO', description: '루마니아' },
|
186
|
-
{ name: 'RU', description: '러시아' },
|
187
|
-
{ name: 'RW', description: '르완다' },
|
188
|
-
{ name: 'SH', description: '세인트헬레나' },
|
189
|
-
{ name: 'KN', description: '세인트키츠 네비스' },
|
190
|
-
{ name: 'LC', description: '세인트루시아' },
|
191
|
-
{ name: 'PM', description: '생피에르 미클롱' },
|
192
|
-
{ name: 'VC', description: '세인트빈센트 그레나딘' },
|
193
|
-
{ name: 'WS', description: '사모아' },
|
194
|
-
{ name: 'SM', description: '산마리노' },
|
195
|
-
{ name: 'ST', description: '상투메 프린시페' },
|
196
|
-
{ name: 'SA', description: '사우디아라비아' },
|
197
|
-
{ name: 'SN', description: '세네갈' },
|
198
|
-
{ name: 'SC', description: '세이셸' },
|
199
|
-
{ name: 'SL', description: '시에라리온' },
|
200
|
-
{ name: 'SG', description: '싱가포르' },
|
201
|
-
{ name: 'SK', description: '슬로바키아' },
|
202
|
-
{ name: 'SI', description: '슬로베니아' },
|
203
|
-
{ name: 'SB', description: '솔로몬 제도' },
|
204
|
-
{ name: 'SO', description: '소말리아' },
|
205
|
-
{ name: 'ZA', description: '남아프리카 공화국' },
|
206
|
-
{ name: 'GS', description: '사우스조지아 사우스샌드위치 제도' },
|
207
|
-
{ name: 'ES', description: '스페인' },
|
208
|
-
{ name: 'LK', description: '스리랑카' },
|
209
|
-
{ name: 'SD', description: '수단' },
|
210
|
-
{ name: 'SR', description: '수리남' },
|
211
|
-
{ name: 'SJ', description: '스발바르 얀마옌' },
|
212
|
-
{ name: 'SZ', description: '에스와티니' },
|
213
|
-
{ name: 'SE', description: '스웨덴' },
|
214
|
-
{ name: 'CH', description: '스위스' },
|
215
|
-
{ name: 'SY', description: '시리아' },
|
216
|
-
{ name: 'TW', description: '대만' },
|
217
|
-
{ name: 'TJ', description: '타지키스탄' },
|
218
|
-
{ name: 'TZ', description: '탄자니아' },
|
219
|
-
{ name: 'TH', description: '태국' },
|
220
|
-
{ name: 'TL', description: '동티모르' },
|
221
|
-
{ name: 'TG', description: '토고' },
|
222
|
-
{ name: 'TK', description: '토켈라우' },
|
223
|
-
{ name: 'TO', description: '통가' }
|
224
|
-
]
|
225
|
-
}
|
226
|
-
]
|
227
|
-
|
228
|
-
export class SeedCountryCodes1725201567284 implements MigrationInterface {
|
229
|
-
public async up(queryRunner: QueryRunner): Promise<any> {
|
230
|
-
const codeRepo = getRepository(CommonCode)
|
231
|
-
const codeDetailRepo = getRepository(CommonCodeDetail)
|
232
|
-
const domain = await getRepository(Domain).findOneBy({
|
233
|
-
subdomain: 'system'
|
234
|
-
})
|
235
|
-
|
236
|
-
return await Promise.all(
|
237
|
-
codes.map(async code => {
|
238
|
-
const commonCode = await codeRepo.save({
|
239
|
-
...code,
|
240
|
-
domain
|
241
|
-
})
|
242
|
-
|
243
|
-
await codeDetailRepo.save(
|
244
|
-
commonCode.details.map((detail, idx) => {
|
245
|
-
return {
|
246
|
-
...detail,
|
247
|
-
commonCode,
|
248
|
-
domain,
|
249
|
-
rank: (idx + 1) * 10
|
250
|
-
}
|
251
|
-
})
|
252
|
-
)
|
253
|
-
})
|
254
|
-
)
|
255
|
-
}
|
256
|
-
|
257
|
-
public async down(queryRunner: QueryRunner): Promise<any> {
|
258
|
-
const codeRepo = getRepository(CommonCode)
|
259
|
-
const codeDetailRepo = getRepository(CommonCodeDetail)
|
260
|
-
}
|
261
|
-
}
|