@things-factory/accounting 8.0.0-beta.9 → 8.0.2
Sign up to get free protection for your applications and to get access to all the features.
- package/client/activities/activity-book-edit.ts +88 -0
- package/client/activities/activity-book-view.ts +88 -0
- package/client/activities/activity-expense-edit.ts +88 -0
- package/client/activities/activity-expense-view.ts +88 -0
- package/client/bootstrap.ts +10 -0
- package/client/components/accounting-category-selector.ts +136 -0
- package/client/components/accounting-category-view.ts +75 -0
- package/client/grist-editors/grist-editor-accounting-category-object.ts +83 -0
- package/client/grist-editors/grist-renderer-accounting-category-object.ts +13 -0
- package/client/index.ts +0 -0
- package/client/pages/account/account-importer.ts +97 -0
- package/client/pages/account/account-list-page.ts +364 -0
- package/client/pages/accounting-category/accounting-category-importer.ts +97 -0
- package/client/pages/accounting-category/accounting-category-list-page.ts +368 -0
- package/client/pages/accounting-category/accounting-category-tree-page.ts +338 -0
- package/client/pages/accounting-document/accounting-document-importer.ts +90 -0
- package/client/pages/accounting-document/accounting-document-list-page.ts +398 -0
- package/client/pages/financial-statement/financial-statement-importer.ts +97 -0
- package/client/pages/financial-statement/financial-statement-list-page.ts +338 -0
- package/client/pages/fiscal-month/fiscal-month-importer.ts +90 -0
- package/client/pages/fiscal-month/fiscal-month-list-page.ts +398 -0
- package/client/pages/fiscal-quarter/fiscal-quarter-importer.ts +90 -0
- package/client/pages/fiscal-quarter/fiscal-quarter-list-page.ts +398 -0
- package/client/pages/fiscal-year/fiscal-year-importer.ts +90 -0
- package/client/pages/fiscal-year/fiscal-year-list-page.ts +398 -0
- package/client/pages/income-statement/income-statement-importer.ts +97 -0
- package/client/pages/income-statement/income-statement-list-page.ts +338 -0
- package/client/pages/payment/payment-importer.ts +90 -0
- package/client/pages/payment/payment-list-page.ts +398 -0
- package/client/pages/transaction/transaction-importer.ts +97 -0
- package/client/pages/transaction/transaction-list-page.ts +338 -0
- package/client/route.ts +35 -0
- package/client/tsconfig.json +13 -0
- package/client/types/accounting-category.ts +23 -0
- package/client/types/index.ts +1 -0
- 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/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/index.d.ts +2 -3
- package/dist-server/service/index.js +0 -5
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/payment/index.d.ts +2 -1
- package/dist-server/service/payment/payment-history.d.ts +1 -8
- package/dist-server/service/payment/payment-history.js +10 -41
- package/dist-server/service/payment/payment-history.js.map +1 -1
- package/dist-server/service/payment/payment-type.d.ts +1 -7
- package/dist-server/service/payment/payment-type.js +0 -24
- package/dist-server/service/payment/payment-type.js.map +1 -1
- package/dist-server/service/payment/payment.d.ts +0 -12
- package/dist-server/service/payment/payment.js +1 -36
- package/dist-server/service/payment/payment.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/server/activities/activity-book.ts +172 -0
- package/server/activities/activity-expense.ts +149 -0
- package/server/activities/index.ts +18 -0
- package/server/controllers/index.ts +1 -0
- package/server/controllers/summary-statements.ts +166 -0
- package/server/index.ts +6 -0
- package/server/middlewares/index.ts +3 -0
- package/server/migrations/1725200507196-seed-fiscal-entities.ts +106 -0
- package/server/migrations/1725201467183-seed-accounts.ts +339 -0
- package/server/migrations/index.ts +9 -0
- package/server/routes.ts +26 -0
- package/server/service/account/account-history.ts +117 -0
- package/server/service/account/account-mutation.ts +140 -0
- package/server/service/account/account-query.ts +51 -0
- package/server/service/account/account-type.ts +44 -0
- package/server/service/account/account.ts +97 -0
- package/server/service/account/event-subscriber.ts +17 -0
- package/server/service/account/index.ts +9 -0
- package/server/service/accounting-category/accounting-category-history.ts +129 -0
- package/server/service/accounting-category/accounting-category-mutation.ts +148 -0
- package/server/service/accounting-category/accounting-category-query.ts +74 -0
- package/server/service/accounting-category/accounting-category-type.ts +48 -0
- package/server/service/accounting-category/accounting-category.ts +100 -0
- package/server/service/accounting-category/event-subscriber.ts +20 -0
- package/server/service/accounting-category/index.ts +9 -0
- package/server/service/accounting-document/accounting-document-history.ts +123 -0
- package/server/service/accounting-document/accounting-document-mutation.ts +137 -0
- package/server/service/accounting-document/accounting-document-query.ts +48 -0
- package/server/service/accounting-document/accounting-document-type.ts +52 -0
- package/server/service/accounting-document/accounting-document.ts +93 -0
- package/server/service/accounting-document/event-subscriber.ts +17 -0
- package/server/service/accounting-document/index.ts +9 -0
- package/server/service/common-type.ts +12 -0
- package/server/service/financial-statement/event-subscriber.ts +17 -0
- package/server/service/financial-statement/financial-statement-history.ts +129 -0
- package/server/service/financial-statement/financial-statement-line-item.ts +82 -0
- package/server/service/financial-statement/financial-statement-mutation.ts +148 -0
- package/server/service/financial-statement/financial-statement-query.ts +53 -0
- package/server/service/financial-statement/financial-statement-type.ts +51 -0
- package/server/service/financial-statement/financial-statement.ts +116 -0
- package/server/service/financial-statement/index.ts +10 -0
- package/server/service/fiscal-month/fiscal-month-mutation.ts +145 -0
- package/server/service/fiscal-month/fiscal-month-query.ts +58 -0
- package/server/service/fiscal-month/fiscal-month-type.ts +66 -0
- package/server/service/fiscal-month/fiscal-month.ts +84 -0
- package/server/service/fiscal-month/index.ts +7 -0
- package/server/service/fiscal-quarter/fiscal-quarter-mutation.ts +148 -0
- package/server/service/fiscal-quarter/fiscal-quarter-query.ts +60 -0
- package/server/service/fiscal-quarter/fiscal-quarter-type.ts +60 -0
- package/server/service/fiscal-quarter/fiscal-quarter.ts +80 -0
- package/server/service/fiscal-quarter/index.ts +7 -0
- package/server/service/fiscal-year/fiscal-year-mutation.ts +145 -0
- package/server/service/fiscal-year/fiscal-year-query.ts +53 -0
- package/server/service/fiscal-year/fiscal-year-type.ts +54 -0
- package/server/service/fiscal-year/fiscal-year.ts +76 -0
- package/server/service/fiscal-year/index.ts +7 -0
- package/server/service/income-statement/event-subscriber.ts +17 -0
- package/server/service/income-statement/income-statement-history.ts +133 -0
- package/server/service/income-statement/income-statement-line-item.ts +84 -0
- package/server/service/income-statement/income-statement-mutation.ts +147 -0
- package/server/service/income-statement/income-statement-query.ts +50 -0
- package/server/service/income-statement/income-statement-type.ts +51 -0
- package/server/service/income-statement/income-statement.ts +120 -0
- package/server/service/income-statement/index.ts +10 -0
- package/server/service/index.ts +108 -0
- package/server/service/payment/event-subscriber.ts +17 -0
- package/server/service/payment/index.ts +9 -0
- package/server/service/payment/payment-history.ts +132 -0
- package/server/service/payment/payment-mutation.ts +139 -0
- package/server/service/payment/payment-query.ts +50 -0
- package/server/service/payment/payment-type.ts +64 -0
- package/server/service/payment/payment.ts +123 -0
- package/server/service/transaction/event-subscriber.ts +17 -0
- package/server/service/transaction/index.ts +9 -0
- package/server/service/transaction/transaction-history.ts +161 -0
- package/server/service/transaction/transaction-mutation.ts +146 -0
- package/server/service/transaction/transaction-query.ts +50 -0
- package/server/service/transaction/transaction-type.ts +48 -0
- package/server/service/transaction/transaction.ts +230 -0
- package/server/tsconfig.json +10 -0
- package/dist-client/pages/bank/bank-importer.d.ts +0 -23
- package/dist-client/pages/bank/bank-importer.js +0 -93
- package/dist-client/pages/bank/bank-importer.js.map +0 -1
- package/dist-client/pages/bank/bank-list-page.d.ts +0 -66
- package/dist-client/pages/bank/bank-list-page.js +0 -370
- package/dist-client/pages/bank/bank-list-page.js.map +0 -1
- package/dist-client/pages/bank-account/bank-account-importer.d.ts +0 -23
- package/dist-client/pages/bank-account/bank-account-importer.js +0 -93
- package/dist-client/pages/bank-account/bank-account-importer.js.map +0 -1
- package/dist-client/pages/bank-account/bank-account-list-page.d.ts +0 -66
- package/dist-client/pages/bank-account/bank-account-list-page.js +0 -370
- package/dist-client/pages/bank-account/bank-account-list-page.js.map +0 -1
- package/dist-client/pages/financial-institution/financial-institution-importer.d.ts +0 -23
- package/dist-client/pages/financial-institution/financial-institution-importer.js +0 -93
- package/dist-client/pages/financial-institution/financial-institution-importer.js.map +0 -1
- package/dist-client/pages/financial-institution/financial-institution-list-page.d.ts +0 -66
- package/dist-client/pages/financial-institution/financial-institution-list-page.js +0 -370
- package/dist-client/pages/financial-institution/financial-institution-list-page.js.map +0 -1
- package/dist-server/migrations/1725201567284-seed-country-codes.d.ts +0 -5
- package/dist-server/migrations/1725201567284-seed-country-codes.js +0 -248
- package/dist-server/migrations/1725201567284-seed-country-codes.js.map +0 -1
- package/dist-server/migrations/1725201667385-seed-financial-institutions.d.ts +0 -5
- package/dist-server/migrations/1725201667385-seed-financial-institutions.js +0 -348
- package/dist-server/migrations/1725201667385-seed-financial-institutions.js.map +0 -1
- package/dist-server/service/bank-account/bank-account-history.d.ts +0 -34
- package/dist-server/service/bank-account/bank-account-history.js +0 -172
- package/dist-server/service/bank-account/bank-account-history.js.map +0 -1
- package/dist-server/service/bank-account/bank-account-mutation.d.ts +0 -10
- package/dist-server/service/bank-account/bank-account-mutation.js +0 -128
- package/dist-server/service/bank-account/bank-account-mutation.js.map +0 -1
- package/dist-server/service/bank-account/bank-account-query.d.ts +0 -11
- package/dist-server/service/bank-account/bank-account-query.js +0 -79
- package/dist-server/service/bank-account/bank-account-query.js.map +0 -1
- package/dist-server/service/bank-account/bank-account-type.d.ts +0 -39
- package/dist-server/service/bank-account/bank-account-type.js +0 -153
- package/dist-server/service/bank-account/bank-account-type.js.map +0 -1
- package/dist-server/service/bank-account/bank-account.d.ts +0 -38
- package/dist-server/service/bank-account/bank-account.js +0 -164
- package/dist-server/service/bank-account/bank-account.js.map +0 -1
- package/dist-server/service/bank-account/event-subscriber.d.ts +0 -7
- package/dist-server/service/bank-account/event-subscriber.js +0 -21
- package/dist-server/service/bank-account/event-subscriber.js.map +0 -1
- package/dist-server/service/bank-account/index.d.ts +0 -7
- package/dist-server/service/bank-account/index.js +0 -12
- package/dist-server/service/bank-account/index.js.map +0 -1
- package/dist-server/service/financial-institution/financial-institution-mutation.d.ts +0 -10
- package/dist-server/service/financial-institution/financial-institution-mutation.js +0 -169
- package/dist-server/service/financial-institution/financial-institution-mutation.js.map +0 -1
- package/dist-server/service/financial-institution/financial-institution-query.d.ts +0 -12
- package/dist-server/service/financial-institution/financial-institution-query.js +0 -97
- package/dist-server/service/financial-institution/financial-institution-query.js.map +0 -1
- package/dist-server/service/financial-institution/financial-institution-type.d.ts +0 -32
- package/dist-server/service/financial-institution/financial-institution-type.js +0 -126
- package/dist-server/service/financial-institution/financial-institution-type.js.map +0 -1
- package/dist-server/service/financial-institution/financial-institution.d.ts +0 -34
- package/dist-server/service/financial-institution/financial-institution.js +0 -137
- package/dist-server/service/financial-institution/financial-institution.js.map +0 -1
- package/dist-server/service/financial-institution/index.d.ts +0 -6
- package/dist-server/service/financial-institution/index.js +0 -10
- package/dist-server/service/financial-institution/index.js.map +0 -1
- package/helps/accounting/bank-account.md +0 -160
- package/helps/accounting/bank.md +0 -160
- package/helps/accounting/financial-institution.md +0 -160
@@ -0,0 +1,230 @@
|
|
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
|
+
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import '@material/web/icon/icon.js';
|
2
|
-
import '@operato/data-grist';
|
3
|
-
import { LitElement } from 'lit';
|
4
|
-
export declare class BankImporter extends LitElement {
|
5
|
-
static styles: import("lit").CSSResult[];
|
6
|
-
banks: any[];
|
7
|
-
columns: {
|
8
|
-
list: {
|
9
|
-
fields: string[];
|
10
|
-
};
|
11
|
-
pagination: {
|
12
|
-
infinite: boolean;
|
13
|
-
};
|
14
|
-
columns: {
|
15
|
-
type: string;
|
16
|
-
name: string;
|
17
|
-
header: string;
|
18
|
-
width: number;
|
19
|
-
}[];
|
20
|
-
};
|
21
|
-
render(): import("lit-html").TemplateResult<1>;
|
22
|
-
save(): Promise<void>;
|
23
|
-
}
|
@@ -1,93 +0,0 @@
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
2
|
-
import '@material/web/icon/icon.js';
|
3
|
-
import '@operato/data-grist';
|
4
|
-
import gql from 'graphql-tag';
|
5
|
-
import { css, html, LitElement } from 'lit';
|
6
|
-
import { property } from 'lit/decorators.js';
|
7
|
-
import { client } from '@operato/graphql';
|
8
|
-
import { i18next } from '@operato/i18n';
|
9
|
-
import { isMobileDevice } from '@operato/utils';
|
10
|
-
import { ButtonContainerStyles } from '@operato/styles';
|
11
|
-
export class BankImporter extends LitElement {
|
12
|
-
constructor() {
|
13
|
-
super(...arguments);
|
14
|
-
this.banks = [];
|
15
|
-
this.columns = {
|
16
|
-
list: { fields: ['name', 'description'] },
|
17
|
-
pagination: { infinite: true },
|
18
|
-
columns: [
|
19
|
-
{
|
20
|
-
type: 'string',
|
21
|
-
name: 'name',
|
22
|
-
header: i18next.t('field.name'),
|
23
|
-
width: 150
|
24
|
-
},
|
25
|
-
{
|
26
|
-
type: 'string',
|
27
|
-
name: 'description',
|
28
|
-
header: i18next.t('field.description'),
|
29
|
-
width: 200
|
30
|
-
},
|
31
|
-
{
|
32
|
-
type: 'checkbox',
|
33
|
-
name: 'active',
|
34
|
-
header: i18next.t('field.active'),
|
35
|
-
width: 60
|
36
|
-
}
|
37
|
-
]
|
38
|
-
};
|
39
|
-
}
|
40
|
-
render() {
|
41
|
-
return html `
|
42
|
-
<ox-grist
|
43
|
-
.mode=${isMobileDevice() ? 'LIST' : 'GRID'}
|
44
|
-
.config=${this.columns}
|
45
|
-
.data=${{
|
46
|
-
records: this.banks
|
47
|
-
}}
|
48
|
-
></ox-grist>
|
49
|
-
|
50
|
-
<div class="button-container">
|
51
|
-
<button @click="${this.save.bind(this)}"><md-icon>save</md-icon>${i18next.t('button.save')}</button>
|
52
|
-
</div>
|
53
|
-
`;
|
54
|
-
}
|
55
|
-
async save() {
|
56
|
-
var _a;
|
57
|
-
const response = await client.mutate({
|
58
|
-
mutation: gql `
|
59
|
-
mutation importBanks($banks: [BankPatch!]!) {
|
60
|
-
importBanks(banks: $banks)
|
61
|
-
}
|
62
|
-
`,
|
63
|
-
variables: { banks: this.banks }
|
64
|
-
});
|
65
|
-
if ((_a = response.errors) === null || _a === void 0 ? void 0 : _a.length)
|
66
|
-
return;
|
67
|
-
this.dispatchEvent(new CustomEvent('imported'));
|
68
|
-
}
|
69
|
-
}
|
70
|
-
BankImporter.styles = [
|
71
|
-
ButtonContainerStyles,
|
72
|
-
css `
|
73
|
-
:host {
|
74
|
-
display: flex;
|
75
|
-
flex-direction: column;
|
76
|
-
|
77
|
-
background-color: #fff;
|
78
|
-
}
|
79
|
-
|
80
|
-
ox-grist {
|
81
|
-
flex: 1;
|
82
|
-
}
|
83
|
-
`
|
84
|
-
];
|
85
|
-
__decorate([
|
86
|
-
property({ type: Array }),
|
87
|
-
__metadata("design:type", Array)
|
88
|
-
], BankImporter.prototype, "banks", void 0);
|
89
|
-
__decorate([
|
90
|
-
property({ type: Object }),
|
91
|
-
__metadata("design:type", Object)
|
92
|
-
], BankImporter.prototype, "columns", void 0);
|
93
|
-
//# sourceMappingURL=bank-importer.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"bank-importer.js","sourceRoot":"","sources":["../../../client/pages/bank/bank-importer.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qBAAqB,CAAA;AAE5B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE5C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAEvD,MAAM,OAAO,YAAa,SAAQ,UAAU;IAA5C;;QAiB6B,UAAK,GAAU,EAAE,CAAA;QAChB,YAAO,GAAG;YACpC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE;YACzC,UAAU,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;YAC9B,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,MAAM;oBACZ,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,YAAY,CAAC;oBAC/B,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,aAAa;oBACnB,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;oBACtC,KAAK,EAAE,GAAG;iBACX;gBACD;oBACE,IAAI,EAAE,UAAU;oBAChB,IAAI,EAAE,QAAQ;oBACd,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC;oBACjC,KAAK,EAAE,EAAE;iBACV;aACF;SACF,CAAA;IAmCH,CAAC;IAhCC,MAAM;QACJ,OAAO,IAAI,CAAA;;gBAEC,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;kBAChC,IAAI,CAAC,OAAO;gBAEpB;YACE,OAAO,EAAE,IAAI,CAAC,KAAK;SAEvB;;;;0BAIkB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,4BAA4B,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC;;KAE7F,CAAA;IACH,CAAC;IAED,KAAK,CAAC,IAAI;;QACR,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,GAAG,CAAA;;;;OAIZ;YACD,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;SACjC,CAAC,CAAA;QAEF,IAAI,MAAA,QAAQ,CAAC,MAAM,0CAAE,MAAM;YAAE,OAAM;QAEnC,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,UAAU,CAAC,CAAC,CAAA;IACjD,CAAC;;AA1EM,mBAAM,GAAG;IACd,qBAAqB;IACrB,GAAG,CAAA;;;;;;;;;;;KAWF;CACF,AAdY,CAcZ;AAE0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;;2CAAkB;AAChB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;6CAuB1B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/data-grist'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { property } from 'lit/decorators.js'\n\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\nimport { ButtonContainerStyles } from '@operato/styles'\n\nexport class BankImporter extends LitElement {\n static styles = [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n ox-grist {\n flex: 1;\n }\n `\n ]\n\n @property({ type: Array }) banks: any[] = []\n @property({ type: Object }) columns = {\n list: { fields: ['name', 'description'] },\n pagination: { infinite: true },\n columns: [\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n width: 150\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n width: 200\n },\n {\n type: 'checkbox',\n name: 'active',\n header: i18next.t('field.active'),\n width: 60\n }\n ]\n }\n\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.columns}\n .data=${\n { \n records: this.banks \n }\n }\n ></ox-grist>\n\n <div class=\"button-container\">\n <button @click=\"${this.save.bind(this)}\"><md-icon>save</md-icon>${i18next.t('button.save')}</button>\n </div>\n `\n }\n\n async save() {\n const response = await client.mutate({\n mutation: gql`\n mutation importBanks($banks: [BankPatch!]!) {\n importBanks(banks: $banks)\n }\n `,\n variables: { banks: this.banks }\n })\n\n if (response.errors?.length) return\n\n this.dispatchEvent(new CustomEvent('imported'))\n }\n}\n\n"]}
|
@@ -1,66 +0,0 @@
|
|
1
|
-
import '@material/web/icon/icon.js';
|
2
|
-
import '@material/web/button/elevated-button.js';
|
3
|
-
import '@operato/data-grist/ox-grist.js';
|
4
|
-
import '@operato/data-grist/ox-filters-form.js';
|
5
|
-
import '@operato/data-grist/ox-record-creator.js';
|
6
|
-
import { PageView } from '@operato/shell';
|
7
|
-
import { FetchOption } from '@operato/data-grist';
|
8
|
-
import { BankImporter } from './bank-importer';
|
9
|
-
declare const BankListPage_base: (new (...args: any[]) => {
|
10
|
-
_storeUnsubscribe: import("redux").Unsubscribe;
|
11
|
-
connectedCallback(): void;
|
12
|
-
disconnectedCallback(): void;
|
13
|
-
stateChanged(_state: unknown): void;
|
14
|
-
readonly isConnected: boolean;
|
15
|
-
}) & (new (...args: any[]) => import("lit").LitElement) & typeof PageView & import("@open-wc/dedupe-mixin").Constructor<import("@open-wc/scoped-elements/types/src/types").ScopedElementsHost>;
|
16
|
-
export declare class BankListPage extends BankListPage_base {
|
17
|
-
static styles: import("lit").CSSResult[];
|
18
|
-
static get scopedElements(): {
|
19
|
-
'bank-importer': typeof BankImporter;
|
20
|
-
};
|
21
|
-
gristConfig: any;
|
22
|
-
mode: 'CARD' | 'GRID' | 'LIST';
|
23
|
-
private grist;
|
24
|
-
get context(): {
|
25
|
-
title: string;
|
26
|
-
search: {
|
27
|
-
handler: (search: string) => void;
|
28
|
-
value: string;
|
29
|
-
};
|
30
|
-
filter: {
|
31
|
-
handler: () => void;
|
32
|
-
};
|
33
|
-
help: string;
|
34
|
-
actions: {
|
35
|
-
icon: string;
|
36
|
-
emphasis: {
|
37
|
-
raised: boolean;
|
38
|
-
outlined: boolean;
|
39
|
-
dense: boolean;
|
40
|
-
danger: boolean;
|
41
|
-
};
|
42
|
-
title: string;
|
43
|
-
action: () => Promise<void>;
|
44
|
-
}[];
|
45
|
-
exportable: {
|
46
|
-
name: string;
|
47
|
-
data: () => Promise<{}[]>;
|
48
|
-
};
|
49
|
-
importable: {
|
50
|
-
handler: (records: any) => Promise<void>;
|
51
|
-
};
|
52
|
-
};
|
53
|
-
render(): import("lit-html").TemplateResult<1>;
|
54
|
-
pageInitialized(lifecycle: any): Promise<void>;
|
55
|
-
pageUpdated(changes: any, lifecycle: any): Promise<void>;
|
56
|
-
fetchHandler({ page, limit, sortings, filters }: FetchOption): Promise<{
|
57
|
-
total: any;
|
58
|
-
records: any;
|
59
|
-
}>;
|
60
|
-
_deleteBank(): Promise<void>;
|
61
|
-
_updateBank(): Promise<void>;
|
62
|
-
creationCallback(bank: any): Promise<boolean>;
|
63
|
-
exportHandler(): Promise<{}[]>;
|
64
|
-
importHandler(records: any): Promise<void>;
|
65
|
-
}
|
66
|
-
export {};
|