@things-factory/accounting 7.0.1-beta.9 → 7.0.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-client/activities/activity-book-edit.d.ts +1 -1
- package/dist-client/activities/activity-book-edit.js.map +1 -1
- package/dist-client/activities/activity-book-view.d.ts +1 -1
- package/dist-client/activities/activity-book-view.js.map +1 -1
- package/dist-client/activities/activity-expense-edit.d.ts +1 -1
- package/dist-client/activities/activity-expense-edit.js.map +1 -1
- package/dist-client/activities/activity-expense-view.d.ts +1 -1
- package/dist-client/activities/activity-expense-view.js.map +1 -1
- package/dist-client/pages/account/account-importer.d.ts +1 -1
- package/dist-client/pages/account/account-importer.js.map +1 -1
- package/dist-client/pages/account/account-list-page.d.ts +1 -1
- package/dist-client/pages/account/account-list-page.js.map +1 -1
- package/dist-client/pages/accounting-category/accounting-category-importer.d.ts +1 -1
- package/dist-client/pages/accounting-category/accounting-category-importer.js.map +1 -1
- package/dist-client/pages/accounting-category/accounting-category-list-page.d.ts +1 -1
- package/dist-client/pages/accounting-category/accounting-category-list-page.js.map +1 -1
- package/dist-client/pages/financial-statement/financial-statement-importer.d.ts +1 -1
- package/dist-client/pages/financial-statement/financial-statement-importer.js.map +1 -1
- package/dist-client/pages/financial-statement/financial-statement-list-page.d.ts +1 -1
- package/dist-client/pages/financial-statement/financial-statement-list-page.js.map +1 -1
- package/dist-client/pages/income-statement/income-statement-importer.d.ts +1 -1
- package/dist-client/pages/income-statement/income-statement-importer.js.map +1 -1
- package/dist-client/pages/income-statement/income-statement-list-page.d.ts +1 -1
- package/dist-client/pages/income-statement/income-statement-list-page.js.map +1 -1
- package/dist-client/pages/ledger/ledger-importer.d.ts +1 -1
- package/dist-client/pages/ledger/ledger-importer.js.map +1 -1
- package/dist-client/pages/ledger/ledger-list-page.d.ts +1 -1
- package/dist-client/pages/ledger/ledger-list-page.js.map +1 -1
- package/dist-client/pages/main.js.map +1 -1
- package/dist-client/pages/transaction/transaction-importer.d.ts +1 -1
- package/dist-client/pages/transaction/transaction-importer.js.map +1 -1
- package/dist-client/pages/transaction/transaction-list-page.d.ts +1 -1
- package/dist-client/pages/transaction/transaction-list-page.js.map +1 -1
- package/dist-client/route.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/activities/activity-book.d.ts +58 -0
- package/dist-server/activities/activity-book.js.map +1 -1
- package/dist-server/activities/activity-expense.d.ts +58 -0
- package/dist-server/activities/activity-expense.js.map +1 -1
- package/dist-server/activities/index.d.ts +1 -0
- package/dist-server/activities/index.js +1 -1
- package/dist-server/activities/index.js.map +1 -1
- package/dist-server/controllers/index.d.ts +0 -0
- package/dist-server/index.d.ts +3 -0
- package/dist-server/middlewares/index.d.ts +1 -0
- package/dist-server/middlewares/index.js +1 -2
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/migrations/index.d.ts +1 -0
- package/dist-server/routes.d.ts +0 -0
- package/dist-server/routes.js +0 -1
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/account/account-history.d.ts +23 -0
- package/dist-server/service/account/account-history.js +4 -4
- package/dist-server/service/account/account-history.js.map +1 -1
- package/dist-server/service/account/account-mutation.d.ts +10 -0
- package/dist-server/service/account/account-mutation.js +2 -2
- package/dist-server/service/account/account-mutation.js.map +1 -1
- package/dist-server/service/account/account-query.d.ts +11 -0
- package/dist-server/service/account/account-query.js +3 -3
- package/dist-server/service/account/account-query.js.map +1 -1
- package/dist-server/service/account/account-type.d.ts +17 -0
- package/dist-server/service/account/account-type.js +6 -6
- package/dist-server/service/account/account-type.js.map +1 -1
- package/dist-server/service/account/account.d.ts +22 -0
- package/dist-server/service/account/account.js +2 -2
- package/dist-server/service/account/account.js.map +1 -1
- package/dist-server/service/account/event-subscriber.d.ts +7 -0
- package/dist-server/service/account/event-subscriber.js +2 -2
- package/dist-server/service/account/event-subscriber.js.map +1 -1
- package/dist-server/service/account/index.d.ts +8 -0
- package/dist-server/service/accounting-category/accounting-category-mutation.d.ts +10 -0
- package/dist-server/service/accounting-category/accounting-category-mutation.js +2 -2
- package/dist-server/service/accounting-category/accounting-category-mutation.js.map +1 -1
- package/dist-server/service/accounting-category/accounting-category-query.d.ts +11 -0
- package/dist-server/service/accounting-category/accounting-category-query.js +3 -3
- package/dist-server/service/accounting-category/accounting-category-query.js.map +1 -1
- package/dist-server/service/accounting-category/accounting-category-type.d.ts +17 -0
- package/dist-server/service/accounting-category/accounting-category-type.js +6 -6
- package/dist-server/service/accounting-category/accounting-category-type.js.map +1 -1
- package/dist-server/service/accounting-category/accounting-category.d.ts +19 -0
- package/dist-server/service/accounting-category/accounting-category.js +6 -7
- package/dist-server/service/accounting-category/accounting-category.js.map +1 -1
- package/dist-server/service/accounting-category/index.d.ts +6 -0
- package/dist-server/service/financial-statement/event-subscriber.d.ts +7 -0
- package/dist-server/service/financial-statement/event-subscriber.js +2 -2
- package/dist-server/service/financial-statement/event-subscriber.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement-history.d.ts +24 -0
- package/dist-server/service/financial-statement/financial-statement-history.js +4 -4
- package/dist-server/service/financial-statement/financial-statement-history.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement-mutation.d.ts +10 -0
- package/dist-server/service/financial-statement/financial-statement-mutation.js +2 -2
- package/dist-server/service/financial-statement/financial-statement-mutation.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement-query.d.ts +11 -0
- package/dist-server/service/financial-statement/financial-statement-query.js +3 -3
- package/dist-server/service/financial-statement/financial-statement-query.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement-type.d.ts +20 -0
- package/dist-server/service/financial-statement/financial-statement-type.js +6 -6
- package/dist-server/service/financial-statement/financial-statement-type.js.map +1 -1
- package/dist-server/service/financial-statement/financial-statement.d.ts +25 -0
- package/dist-server/service/financial-statement/financial-statement.js +3 -3
- package/dist-server/service/financial-statement/financial-statement.js.map +1 -1
- package/dist-server/service/financial-statement/index.d.ts +8 -0
- package/dist-server/service/income-statement/event-subscriber.d.ts +7 -0
- package/dist-server/service/income-statement/event-subscriber.js +2 -2
- package/dist-server/service/income-statement/event-subscriber.js.map +1 -1
- package/dist-server/service/income-statement/income-statement-history.d.ts +24 -0
- package/dist-server/service/income-statement/income-statement-history.js +4 -4
- package/dist-server/service/income-statement/income-statement-history.js.map +1 -1
- package/dist-server/service/income-statement/income-statement-mutation.d.ts +10 -0
- package/dist-server/service/income-statement/income-statement-mutation.js +2 -2
- package/dist-server/service/income-statement/income-statement-mutation.js.map +1 -1
- package/dist-server/service/income-statement/income-statement-query.d.ts +11 -0
- package/dist-server/service/income-statement/income-statement-query.js +3 -3
- package/dist-server/service/income-statement/income-statement-query.js.map +1 -1
- package/dist-server/service/income-statement/income-statement-type.d.ts +20 -0
- package/dist-server/service/income-statement/income-statement-type.js +6 -6
- package/dist-server/service/income-statement/income-statement-type.js.map +1 -1
- package/dist-server/service/income-statement/income-statement.d.ts +26 -0
- package/dist-server/service/income-statement/income-statement.js +3 -3
- package/dist-server/service/income-statement/income-statement.js.map +1 -1
- package/dist-server/service/income-statement/index.d.ts +8 -0
- package/dist-server/service/index.d.ts +10 -0
- package/dist-server/service/transaction/event-subscriber.d.ts +7 -0
- package/dist-server/service/transaction/event-subscriber.js +2 -2
- package/dist-server/service/transaction/event-subscriber.js.map +1 -1
- package/dist-server/service/transaction/index.d.ts +8 -0
- package/dist-server/service/transaction/transaction-history.d.ts +24 -0
- package/dist-server/service/transaction/transaction-history.js +4 -4
- package/dist-server/service/transaction/transaction-history.js.map +1 -1
- package/dist-server/service/transaction/transaction-mutation.d.ts +10 -0
- package/dist-server/service/transaction/transaction-mutation.js +2 -2
- package/dist-server/service/transaction/transaction-mutation.js.map +1 -1
- package/dist-server/service/transaction/transaction-query.d.ts +11 -0
- package/dist-server/service/transaction/transaction-query.js +3 -3
- package/dist-server/service/transaction/transaction-query.js.map +1 -1
- package/dist-server/service/transaction/transaction-type.d.ts +19 -0
- package/dist-server/service/transaction/transaction-type.js +6 -6
- package/dist-server/service/transaction/transaction-type.js.map +1 -1
- package/dist-server/service/transaction/transaction.d.ts +32 -0
- package/dist-server/service/transaction/transaction.js +3 -3
- package/dist-server/service/transaction/transaction.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +7 -7
- package/server/activities/index.ts +4 -5
- package/server/routes.ts +0 -2
- package/server/service/account/account-history.ts +2 -2
- package/server/service/account/account-query.ts +1 -1
- package/server/service/accounting-category/accounting-category-query.ts +1 -1
- package/server/service/financial-statement/financial-statement-history.ts +2 -2
- package/server/service/financial-statement/financial-statement-query.ts +1 -1
- package/server/service/income-statement/income-statement-history.ts +2 -2
- package/server/service/income-statement/income-statement-query.ts +4 -1
- package/server/service/transaction/transaction-history.ts +2 -2
- package/server/service/transaction/transaction-query.ts +4 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ActivityInstance, UpdateActivityInstanceStateAddendum } from '@things-factory/worklist';
|
|
2
|
+
declare function callback(activityInstance: ActivityInstance, addendum: UpdateActivityInstanceStateAddendum, context: ResolverContext): Promise<void>;
|
|
3
|
+
export declare const ActivityBook: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
release: string;
|
|
7
|
+
provider: string;
|
|
8
|
+
category: string;
|
|
9
|
+
activityType: string;
|
|
10
|
+
priority: number;
|
|
11
|
+
searchKeys: {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
inputKey: string;
|
|
15
|
+
tKey: string;
|
|
16
|
+
}[];
|
|
17
|
+
startable: boolean;
|
|
18
|
+
startingType: string;
|
|
19
|
+
multiple: any;
|
|
20
|
+
model: ({
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
tag: string;
|
|
24
|
+
hidden: boolean;
|
|
25
|
+
mandatory: boolean;
|
|
26
|
+
inout: string;
|
|
27
|
+
type: string;
|
|
28
|
+
options: {
|
|
29
|
+
options: string[];
|
|
30
|
+
};
|
|
31
|
+
unit: any;
|
|
32
|
+
quantifier: number[];
|
|
33
|
+
spec: {};
|
|
34
|
+
} | {
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
tag: string;
|
|
38
|
+
hidden: boolean;
|
|
39
|
+
mandatory: boolean;
|
|
40
|
+
inout: string;
|
|
41
|
+
type: string;
|
|
42
|
+
options: {
|
|
43
|
+
options?: undefined;
|
|
44
|
+
};
|
|
45
|
+
unit: any;
|
|
46
|
+
quantifier: number[];
|
|
47
|
+
spec: {};
|
|
48
|
+
})[];
|
|
49
|
+
uiType: string;
|
|
50
|
+
uiSource: string;
|
|
51
|
+
viewType: string;
|
|
52
|
+
viewSource: string;
|
|
53
|
+
reportType: string;
|
|
54
|
+
reportSource: string;
|
|
55
|
+
thumbnail: string;
|
|
56
|
+
callback: typeof callback;
|
|
57
|
+
};
|
|
58
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-book.js","sourceRoot":"","sources":["../../server/activities/activity-book.ts"],"names":[],"mappings":";;;AAAA,uDAMiC;AAEjC,KAAK,UAAU,QAAQ,CACrB,gBAAkC,EAClC,QAA6C,EAC7C,OAAwB;IAExB,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IACpC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,CAAA;IACjD,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ,IAAI,EAAE,CAAA;IAEnC,IAAI,KAAK,IAAI,iCAAsB,CAAC,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"activity-book.js","sourceRoot":"","sources":["../../server/activities/activity-book.ts"],"names":[],"mappings":";;;AAAA,uDAMiC;AAEjC,KAAK,UAAU,QAAQ,CACrB,gBAAkC,EAClC,QAA6C,EAC7C,OAAwB;IAExB,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,C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I;YACV,UAAU,EAAE,CAAC,CAAC,CAAC;YACf,IAAI,EAAE,EAAE;SACT;QACD;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,eAAe;YAC5B,GAAG,EAAE,MAAM;YACX,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,CAAC,CAAC,CAAC;YACf,IAAI,EAAE,EAAE;SACT;KACF;IACD,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,WAAW;IACrB,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,gBAAgB;IAC5B,YAAY,EAAE,sBAAsB;IACpC,SAAS,EAAE,kCAAkC;IAC7C,QAAQ,CAAC,mFAAmF;CAC7F,CAAA","sourcesContent":["import {\n Activity,\n ActivityInstance,\n ActivityInstanceStatus,\n ActivityThread,\n UpdateActivityInstanceStateAddendum\n} from '@things-factory/worklist'\n\nasync function callback(\n activityInstance: ActivityInstance,\n addendum: UpdateActivityInstanceStateAddendum,\n context: ResolverContext\n) {\n const { domain, tx } = context.state\n const { input, output, state } = activityInstance\n const { causedBy } = addendum || {}\n\n if (state == ActivityInstanceStatus.Ended) {\n const activity = (await tx.getRepository(Activity).findOneBy({\n domain: { id: domain.id },\n name: 'Book'\n })) as Activity\n\n /* \n book 액티비티는 한명의 assignee(thread)만 수행하도록 한다. 따라서, output 중에서 샘플 한 개만을 data로 취한다.\n 만약, 여러 assignees(threads)가 수행하는 액티비티인 경우에는 output 전체를 data로 처리한다.\n */\n const assignees = Object.keys(output)\n const data = assignees.length > 0 && output[assignees[0]]\n\n if (activity) {\n /* \n custom logic goes here.\n 주로, \n */\n } else {\n console.error('Book Activity not installed.')\n }\n } else if (state == ActivityInstanceStatus.Aborted) {\n }\n}\n\nexport const ActivityBook = {\n name: 'Book',\n description: 'An activity thate enter a incoming or expense in the ledger',\n release: '1.0.0',\n provider: 'hatiolab.com',\n category: 'accounting',\n activityType: 'user',\n priority: 1,\n searchKeys: [\n // sample search keys\n {\n name: 'category',\n description: 'expense category',\n inputKey: 'category',\n tKey: 'category'\n }\n ],\n /* \n startable 설정된 액티비티는 수동으로 업무를 시작하여, 할당할 수 있음을 의미한다.\n issuer로 정의된 역할을 갖는 사용자가 시작할 수 있으며, issuer가 정의되지 않았다면 모든 사용자가 시작할 수 있다.\n 업무를 시작하는 과정에서 assignees와 approval-line은 액티비티의 설정을 디폴트로 하지만 수동으로 조정할 수 있다.\n */\n startable: true,\n /* (미구현 속성) \n startingType 설정된 액티비티는 'issue' 또는 'post' 이 될 수 있다. 'post' 타입은 혼자서 start, assign, end 까지 한번에 다하는 특성을 갖는다. 이 액티비티를 수행하는 사용자는 draft(초안)과 post(완료)단계만 인식하게 된다.\n 이 경우의 모델은 모두 'in' 또는 'inout'의 속성을 갖는 것이 좋다. 'out' 속성의 데이타는 입력될 기회를 갖지 못한다.\n 이 경우의 assignees 설정은 의미가 없다.\n 이 경우에도 approval-line이 설정되어 있다면, 승인 프로세스에 의해서 처리된다.\n 'issue' 타입인 경우에는 모델의 'in' 또는 'inout' 속성을 채워서 assignee에게 할당하는 방식이므로 assignee가 설정되어야 한다.\n */\n startingType: 'post',\n /* (미구현 속성)\n multiple 속성은 'parallel', 'sequential' 값을 설정할 수 있다. parallel로 설정하면, 다중 인스턴스(여기서는 다중 쓰레드)로 처리하되 병렬처리되며,\n sequential로 설정하면 순차적으로 다중 인스턴스가 수행된다.\n 설정하지 않으면, single 인스턴스로 수행된다는 의미이며, 이 경우 assignees가 여럿이 설정되어있어도 1명에게만 할당되게 된다.\n 이 경우에는 액티비티 인스턴스의 결과 데이타(output)도 단일 쓰레드의 output이 그대로 적용된다.\n */\n multiple: null,\n model: [\n {\n name: 'name',\n description: 'name',\n tag: 'name',\n hidden: false,\n mandatory: true,\n inout: 'in',\n type: 'select',\n options: {\n options: ['KRW', 'USD', 'CNY']\n },\n unit: null,\n quantifier: [1],\n spec: {}\n },\n {\n name: 'currency',\n description: 'currency',\n tag: 'currency',\n hidden: false,\n mandatory: true,\n inout: 'in',\n type: 'select',\n options: {\n options: ['KRW', 'USD', 'CNY']\n },\n unit: null,\n quantifier: [1],\n spec: {}\n },\n {\n name: 'amount',\n description: 'amount',\n tag: 'amount',\n hidden: false,\n mandatory: true,\n inout: 'in',\n type: 'number',\n options: {},\n unit: null,\n quantifier: [1],\n spec: {}\n },\n {\n name: 'category',\n description: 'accounting category',\n tag: 'category',\n hidden: true,\n mandatory: true,\n inout: 'in',\n type: 'string',\n options: {},\n unit: null,\n quantifier: [1],\n spec: {}\n },\n {\n name: 'date',\n description: 'issuance date',\n tag: 'date',\n hidden: true,\n mandatory: true,\n inout: 'in',\n type: 'string',\n options: {},\n unit: null,\n quantifier: [1],\n spec: {}\n }\n ],\n uiType: 'generated',\n uiSource: '',\n viewType: 'generated',\n viewSource: '',\n reportType: 'custom-element',\n reportSource: 'activity-book-report',\n thumbnail: '/assets/images/book-activity.jpg',\n callback /* Called when there is a change in the lifecycle of a task (activity-instance). */\n}\n"]}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ActivityInstance } from '@things-factory/worklist';
|
|
2
|
+
declare function callback(activityInstance: ActivityInstance, context: ResolverContext): Promise<void>;
|
|
3
|
+
export declare const ActivityExpense: {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
release: string;
|
|
7
|
+
provider: string;
|
|
8
|
+
category: string;
|
|
9
|
+
activityType: string;
|
|
10
|
+
priority: number;
|
|
11
|
+
searchKeys: {
|
|
12
|
+
name: string;
|
|
13
|
+
description: string;
|
|
14
|
+
inputKey: string;
|
|
15
|
+
tKey: string;
|
|
16
|
+
}[];
|
|
17
|
+
startable: boolean;
|
|
18
|
+
startingType: string;
|
|
19
|
+
multiple: any;
|
|
20
|
+
model: ({
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
tag: string;
|
|
24
|
+
hidden: boolean;
|
|
25
|
+
mandatory: boolean;
|
|
26
|
+
inout: string;
|
|
27
|
+
type: string;
|
|
28
|
+
options: {
|
|
29
|
+
options: string[];
|
|
30
|
+
};
|
|
31
|
+
unit: any;
|
|
32
|
+
quantifier: number[];
|
|
33
|
+
spec: {};
|
|
34
|
+
} | {
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
tag: string;
|
|
38
|
+
hidden: boolean;
|
|
39
|
+
mandatory: boolean;
|
|
40
|
+
inout: string;
|
|
41
|
+
type: string;
|
|
42
|
+
options: {
|
|
43
|
+
options?: undefined;
|
|
44
|
+
};
|
|
45
|
+
unit: any;
|
|
46
|
+
quantifier: number[];
|
|
47
|
+
spec: {};
|
|
48
|
+
})[];
|
|
49
|
+
uiType: string;
|
|
50
|
+
uiSource: string;
|
|
51
|
+
viewType: string;
|
|
52
|
+
viewSource: string;
|
|
53
|
+
reportType: string;
|
|
54
|
+
reportSource: string;
|
|
55
|
+
thumbnail: string;
|
|
56
|
+
callback: typeof callback;
|
|
57
|
+
};
|
|
58
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-expense.js","sourceRoot":"","sources":["../../server/activities/activity-expense.ts"],"names":[],"mappings":";;;AAAA,uDAA6F;AAE7F,KAAK,UAAU,QAAQ,CAAC,gBAAkC,EAAE,OAAwB;IAClF,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;IACpC,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,CAAA;IAEjD,IAAI,KAAK,IAAI,iCAAsB,CAAC,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"activity-expense.js","sourceRoot":"","sources":["../../server/activities/activity-expense.ts"],"names":[],"mappings":";;;AAAA,uDAA6F;AAE7F,KAAK,UAAU,QAAQ,CAAC,gBAAkC,E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IAAI,EAAE,IAAI;YACV,UAAU,EAAE,CAAC,CAAC,CAAC;YACf,IAAI,EAAE,EAAE;SACT;QACD;YACE,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,oBAAoB;YACjC,GAAG,EAAE,MAAM;YACX,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,IAAI;YACX,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,CAAC,CAAC,CAAC;YACf,IAAI,EAAE,EAAE;SACT;KACF;IACD,MAAM,EAAE,WAAW;IACnB,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,WAAW;IACrB,UAAU,EAAE,EAAE;IACd,UAAU,EAAE,gBAAgB;IAC5B,YAAY,EAAE,yBAAyB;IACvC,SAAS,EAAE,qCAAqC;IAChD,QAAQ,CAAC,mFAAmF;CAC7F,CAAA","sourcesContent":["import { Activity, ActivityInstance, ActivityInstanceStatus } from '@things-factory/worklist'\n\nasync function callback(activityInstance: ActivityInstance, context: ResolverContext) {\n const { domain, tx } = context.state\n const { input, output, state } = activityInstance\n\n if (state == ActivityInstanceStatus.Ended) {\n const activity = (await tx.getRepository(Activity).findOneBy({\n domain: { id: domain.id },\n name: 'Expense'\n })) as Activity\n\n /* \n expense 액티비티는 한명의 assignee(thread)만 수행하도록 한다. 따라서, output 중에서 샘플 한 개만을 data로 취한다.\n 만약, 여러 assignees(threads)가 수행하는 액티비티인 경우에는 output 전체를 data로 처리한다.\n */\n const assignees = Object.keys(output)\n const data = assignees.length > 0 && output[assignees[0]]\n\n if (activity) {\n /* \n custom logic goes here.\n 주로, \n */\n } else {\n console.error('Expense Activity not installed.')\n }\n } else if (state == ActivityInstanceStatus.Aborted) {\n }\n}\n\nexport const ActivityExpense = {\n name: 'Expense',\n description: 'An activity for reporting and approving expense spending',\n release: '1.0.0',\n provider: 'hatiolab.com',\n category: 'accounting',\n activityType: 'user',\n priority: 1,\n searchKeys: [\n // sample search keys\n {\n name: 'category',\n description: 'expense category',\n inputKey: 'category',\n tKey: 'category'\n }\n ],\n /* \n startable 설정된 액티비티는 수동으로 업무를 시작하여, 할당할 수 있음을 의미한다.\n issuer로 정의된 역할을 갖는 사용자가 시작할 수 있으며, issuer가 정의되지 않았다면 모든 사용자가 시작할 수 있다.\n 업무를 시작하는 과정에서 assignees와 approval-line은 액티비티의 설정을 디폴트로 하지만 수동으로 조정할 수 있다.\n */\n startable: true,\n /* (미구현 속성) \n startingType 설정된 액티비티는 'issue' 또는 'post' 이 될 수 있다. 'post' 타입은 혼자서 start, assign, end 까지 한번에 다하는 특성을 갖는다. 이 액티비티를 수행하는 사용자는 draft(초안)과 post(완료)단계만 인식하게 된다.\n 이 경우의 모델은 모두 'in' 또는 'inout'의 속성을 갖는 것이 좋다. 'out' 속성의 데이타는 입력될 기회를 갖지 못한다.\n 이 경우의 assignees 설정은 의미가 없다.\n 이 경우에도 approval-line이 설정되어 있다면, 승인 프로세스에 의해서 처리된다.\n 'issue' 타입인 경우에는 모델의 'in' 또는 'inout' 속성을 채워서 assignee에게 할당하는 방식이므로 assignee가 설정되어야 한다.\n */\n startingType: 'post',\n /* (미구현 속성)\n multiple 속성은 'parallel', 'sequential' 값을 설정할 수 있다. parallel로 설정하면, 다중 인스턴스(여기서는 다중 쓰레드)로 처리하되 병렬처리되며,\n sequential로 설정하면 순차적으로 다중 인스턴스가 수행된다.\n 설정하지 않으면, single 인스턴스로 수행된다는 의미이며, 이 경우 assignees가 여럿이 설정되어있어도 1명에게만 할당되게 된다.\n 이 경우에는 액티비티 인스턴스의 결과 데이타(output)도 단일 쓰레드의 output이 그대로 적용된다.\n */\n multiple: null,\n model: [\n {\n name: 'name',\n description: 'name',\n tag: 'name',\n hidden: false,\n mandatory: true,\n inout: 'in',\n type: 'select',\n options: {\n options: ['KRW', 'USD', 'CNY']\n },\n unit: null,\n quantifier: [1],\n spec: {}\n },\n {\n name: 'currency',\n description: 'currency',\n tag: 'currency',\n hidden: false,\n mandatory: true,\n inout: 'in',\n type: 'select',\n options: {\n options: ['KRW', 'USD', 'CNY']\n },\n unit: null,\n quantifier: [1],\n spec: {}\n },\n {\n name: 'amount',\n description: 'amount',\n tag: 'amount',\n hidden: false,\n mandatory: true,\n inout: 'in',\n type: 'number',\n options: {},\n unit: null,\n quantifier: [1],\n spec: {}\n },\n {\n name: 'category',\n description: 'expense category',\n tag: 'category',\n hidden: true,\n mandatory: true,\n inout: 'in',\n type: 'string',\n options: {},\n unit: null,\n quantifier: [1],\n spec: {}\n },\n {\n name: 'date',\n description: 'expense spent date',\n tag: 'date',\n hidden: true,\n mandatory: true,\n inout: 'in',\n type: 'string',\n options: {},\n unit: null,\n quantifier: [1],\n spec: {}\n }\n ],\n uiType: 'generated',\n uiSource: '',\n viewType: 'generated',\n viewSource: '',\n reportType: 'custom-element',\n reportSource: 'activity-expense-report',\n thumbnail: '/assets/images/expense-activity.jpg',\n callback /* Called when there is a change in the lifecycle of a task (activity-instance). */\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -7,7 +7,7 @@ const activity_book_1 = require("./activity-book");
|
|
|
7
7
|
[
|
|
8
8
|
/* ACTIVITY TEMPLATES */
|
|
9
9
|
activity_expense_1.ActivityExpense,
|
|
10
|
-
activity_book_1.ActivityBook
|
|
10
|
+
activity_book_1.ActivityBook
|
|
11
11
|
].forEach(template => {
|
|
12
12
|
worklist_1.ActivityInstallations.installActivityTemplate(template);
|
|
13
13
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/activities/index.ts"],"names":[],"mappings":";;AAAA,uDAAgE;AAEhE,+BAA+B;AAC/B,yDAAoD;AACpD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/activities/index.ts"],"names":[],"mappings":";;AAAA,uDAAgE;AAEhE,+BAA+B;AAC/B,yDAAoD;AACpD,mDACC;AAAA;IACC,wBAAwB;IACxB,kCAAe;IACf,4BAAY;CACb,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;IACnB,gCAAqB,CAAC,uBAAuB,CAAC,QAAe,CAAC,CAAA;AAChE,CAAC,CAAC,CAAA;AAEF;;;;EAIE","sourcesContent":["import { ActivityInstallations } from '@things-factory/worklist'\n\n/* IMPORT ACTIVITY TEMPLATES */\nimport { ActivityExpense } from './activity-expense'\nimport { ActivityBook } from './activity-book'\n;[\n /* ACTIVITY TEMPLATES */\n ActivityExpense,\n ActivityBook\n].forEach(template => {\n ActivityInstallations.installActivityTemplate(template as any)\n})\n\n/* \nAdd the following line to server/index.ts so that activities can be registered when loading a module.\n--\nimport './activities'\n*/\n"]}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function initMiddlewares(app: any): void;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initMiddlewares =
|
|
3
|
+
exports.initMiddlewares = initMiddlewares;
|
|
4
4
|
function initMiddlewares(app) {
|
|
5
5
|
/* can add middlewares into app */
|
|
6
6
|
}
|
|
7
|
-
exports.initMiddlewares = initMiddlewares;
|
|
8
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/middlewares/index.ts"],"names":[],"mappings":";;AAAA,0CAEC;AAFD,SAAgB,eAAe,CAAC,GAAG;IACjC,kCAAkC;AACpC,CAAC","sourcesContent":["export function initMiddlewares(app) {\n /* can add middlewares into app */\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare var migrations: any[];
|
|
File without changes
|
package/dist-server/routes.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../server/routes.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF;;;;;OAKG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF;;OAEG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,sCAA6C,EAAE,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE;IACpF;;OAEG;AACL,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,EAAE,CAAC,uCAA8C,EAAE,CAAC,GAAG,EAAE,mBAAmB,EAAE,EAAE;IACtF;;OAEG;AACL,CAAC,CAAC,CAAA","sourcesContent":["process.on('bootstrap-module-global-public-route' as any, (app, globalPublicRouter) => {\n /*\n * can add global public routes to application (auth not required, tenancy not required)\n *\n * ex) routes.get('/path', async(context, next) => {})\n * ex) routes.post('/path', async(context, next) => {})\n */\n})\n\nprocess.on('bootstrap-module-global-private-route' as any, (app, globalPrivateRouter) => {\n /*\n * can add global private routes to application (auth required, tenancy not required)\n */\n})\n\nprocess.on('bootstrap-module-domain-public-route' as any, (app, domainPublicRouter) => {\n /*\n * can add domain public routes to application (auth not required, tenancy required)\n */\n})\n\nprocess.on('bootstrap-module-domain-private-route' as any, (app, domainPrivateRouter) => {\n /*\n * can add domain private routes to application (auth required, tenancy required)\n */\n})\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HistoryActionType, HistoryEntityInterface } from '@operato/typeorm-history';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
import { Domain } from '@things-factory/shell';
|
|
4
|
+
import { Account } from './account';
|
|
5
|
+
export declare class AccountHistory implements HistoryEntityInterface<Account> {
|
|
6
|
+
readonly id: string;
|
|
7
|
+
version?: number;
|
|
8
|
+
domain?: Domain;
|
|
9
|
+
domainId?: string;
|
|
10
|
+
controlNumber?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
active?: boolean;
|
|
14
|
+
createdAt?: Date;
|
|
15
|
+
updatedAt?: Date;
|
|
16
|
+
deletedAt?: Date;
|
|
17
|
+
creator?: User;
|
|
18
|
+
creatorId?: string;
|
|
19
|
+
updater?: User;
|
|
20
|
+
updaterId?: string;
|
|
21
|
+
originalId: string;
|
|
22
|
+
action: HistoryActionType;
|
|
23
|
+
}
|
|
@@ -15,6 +15,7 @@ let AccountHistory = class AccountHistory {
|
|
|
15
15
|
this.version = 1;
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
+
exports.AccountHistory = AccountHistory;
|
|
18
19
|
tslib_1.__decorate([
|
|
19
20
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
20
21
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
@@ -71,7 +72,7 @@ tslib_1.__decorate([
|
|
|
71
72
|
], AccountHistory.prototype, "deletedAt", void 0);
|
|
72
73
|
tslib_1.__decorate([
|
|
73
74
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
74
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
75
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
75
76
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
76
77
|
], AccountHistory.prototype, "creator", void 0);
|
|
77
78
|
tslib_1.__decorate([
|
|
@@ -80,7 +81,7 @@ tslib_1.__decorate([
|
|
|
80
81
|
], AccountHistory.prototype, "creatorId", void 0);
|
|
81
82
|
tslib_1.__decorate([
|
|
82
83
|
(0, typeorm_1.ManyToOne)(type => auth_base_1.User, { nullable: true }),
|
|
83
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
84
|
+
(0, type_graphql_1.Field)(type => auth_base_1.User, { nullable: true }),
|
|
84
85
|
tslib_1.__metadata("design:type", auth_base_1.User)
|
|
85
86
|
], AccountHistory.prototype, "updater", void 0);
|
|
86
87
|
tslib_1.__decorate([
|
|
@@ -103,11 +104,10 @@ tslib_1.__decorate([
|
|
|
103
104
|
}),
|
|
104
105
|
tslib_1.__metadata("design:type", String)
|
|
105
106
|
], AccountHistory.prototype, "action", void 0);
|
|
106
|
-
AccountHistory = tslib_1.__decorate([
|
|
107
|
+
exports.AccountHistory = AccountHistory = tslib_1.__decorate([
|
|
107
108
|
(0, typeorm_1.Entity)(),
|
|
108
109
|
(0, typeorm_1.Index)('ix_account_history_0', (accountHistory) => [accountHistory.originalId, accountHistory.version], { unique: true }),
|
|
109
110
|
(0, typeorm_1.Index)('ix_account_history_1', (accountHistory) => [accountHistory.domain, accountHistory.originalId, accountHistory.version], { unique: true }),
|
|
110
111
|
(0, type_graphql_1.ObjectType)({ description: 'History Entity of Account' })
|
|
111
112
|
], AccountHistory);
|
|
112
|
-
exports.AccountHistory = AccountHistory;
|
|
113
113
|
//# sourceMappingURL=account-history.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-history.js","sourceRoot":"","sources":["../../../server/service/account/account-history.ts"],"names":[],"mappings":";;;;AAAA,+CAAoD;AACpD,qCAA8F;AAE9F,8DAKiC;AACjC,yDAAsD;AACtD,6CAA4C;AAC5C,iDAA8C;AAI9C,MAAM,SAAS,GAAG,YAAM,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;AAC7C,MAAM,aAAa,GAAG,SAAS,CAAC,IAAI,CAAA;AAc7B,IAAM,cAAc,GAApB,MAAM,cAAc;IAApB;QAOL,YAAO,GAAY,CAAC,CAAA;IAiEtB,CAAC;CAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"account-history.js","sourceRoot":"","sources":["../../../server/service/account/account-history.ts"],"names":[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U,EAAC,CAAC,OAAgB,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;;iDAChC;AAGX;IADN,IAAA,yCAAuB,GAAE;;kDACA;AAYnB;IAVN,IAAA,qCAAmB,EAAC;QACnB,QAAQ,EAAE,KAAK;QACf,IAAI,EACF,aAAa,IAAI,UAAU,IAAI,aAAa,IAAI,OAAO,IAAI,aAAa,IAAI,SAAS;YACnF,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,aAAa,IAAI,QAAQ;gBACzB,CAAC,CAAC,UAAU;gBACZ,CAAC,CAAC,UAAU;QAClB,IAAI,EAAE,mCAAiB;KACxB,CAAC;;8CAC+B;yBAvEtB,cAAc;IAZ1B,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EACJ,sBAAsB,EACtB,CAAC,cAA8B,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,UAAU,EAAE,cAAc,CAAC,OAAO,CAAC,EACvF,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,eAAK,EACJ,sBAAsB,EACtB,CAAC,cAA8B,EAAE,EAAE,CAAC,CAAC,cAAc,CAAC,MAAM,EAAE,cAAc,CAAC,UAAU,EAAE,cAAc,CAAC,OAAO,CAAC,EAC9G,EAAE,MAAM,EAAE,IAAI,EAAE,CACjB;IACA,IAAA,yBAAU,EAAC,EAAE,WAAW,EAAE,2BAA2B,EAAE,CAAC;GAC5C,cAAc,CAwE1B","sourcesContent":["import { Field, ID, ObjectType } from 'type-graphql'\nimport { Column, Entity, Index, ManyToOne, PrimaryGeneratedColumn, RelationId } from 'typeorm'\n\nimport {\n HistoryActionColumn,\n HistoryActionType,\n HistoryEntityInterface,\n HistoryOriginalIdColumn\n} from '@operato/typeorm-history'\nimport { Role, User } from '@things-factory/auth-base'\nimport { config } from '@things-factory/env'\nimport { Domain } from '@things-factory/shell'\n\nimport { Account } from './account'\n\nconst ORMCONFIG = config.get('ormconfig', {})\nconst DATABASE_TYPE = ORMCONFIG.type\n\n@Entity()\n@Index(\n 'ix_account_history_0',\n (accountHistory: AccountHistory) => [accountHistory.originalId, accountHistory.version],\n { unique: true }\n)\n@Index(\n 'ix_account_history_1',\n (accountHistory: AccountHistory) => [accountHistory.domain, accountHistory.originalId, accountHistory.version],\n { unique: true }\n)\n@ObjectType({ description: 'History Entity of Account' })\nexport class AccountHistory implements HistoryEntityInterface<Account> {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column({ nullable: true, default: 1 })\n @Field({ nullable: true })\n version?: number = 1\n\n @ManyToOne(type => Domain)\n @Field(type => Domain)\n domain?: Domain\n\n @RelationId((account: Account) => account.domain)\n domainId?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n controlNumber?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n name?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n description?: string\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n active?: boolean\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n createdAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n updatedAt?: Date\n\n @Column({ nullable: true })\n @Field({ nullable: true })\n deletedAt?: Date\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator?: User\n\n @RelationId((account: Account) => account.creator)\n creatorId?: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater?: User\n\n @RelationId((account: Account) => account.updater)\n updaterId?: string\n\n @HistoryOriginalIdColumn()\n public originalId!: string\n\n @HistoryActionColumn({\n nullable: false,\n type:\n DATABASE_TYPE == 'postgres' || DATABASE_TYPE == 'mysql' || DATABASE_TYPE == 'mariadb'\n ? 'enum'\n : DATABASE_TYPE == 'oracle'\n ? 'varchar2'\n : 'smallint',\n enum: HistoryActionType\n })\n public action!: HistoryActionType\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Account } from './account';
|
|
2
|
+
import { NewAccount, AccountPatch } from './account-type';
|
|
3
|
+
export declare class AccountMutation {
|
|
4
|
+
createAccount(account: NewAccount, context: ResolverContext): Promise<Account>;
|
|
5
|
+
updateAccount(id: string, patch: AccountPatch, context: ResolverContext): Promise<Account>;
|
|
6
|
+
updateMultipleAccount(patches: AccountPatch[], context: ResolverContext): Promise<Account[]>;
|
|
7
|
+
deleteAccount(id: string, context: ResolverContext): Promise<boolean>;
|
|
8
|
+
deleteAccounts(ids: string[], context: ResolverContext): Promise<boolean>;
|
|
9
|
+
importAccounts(accounts: AccountPatch[], context: ResolverContext): Promise<boolean>;
|
|
10
|
+
}
|
|
@@ -68,6 +68,7 @@ let AccountMutation = class AccountMutation {
|
|
|
68
68
|
return true;
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
+
exports.AccountMutation = AccountMutation;
|
|
71
72
|
tslib_1.__decorate([
|
|
72
73
|
(0, type_graphql_1.Directive)('@transaction'),
|
|
73
74
|
(0, type_graphql_1.Mutation)(returns => account_1.Account, { description: 'To create new Account' }),
|
|
@@ -123,8 +124,7 @@ tslib_1.__decorate([
|
|
|
123
124
|
tslib_1.__metadata("design:paramtypes", [Array, Object]),
|
|
124
125
|
tslib_1.__metadata("design:returntype", Promise)
|
|
125
126
|
], AccountMutation.prototype, "importAccounts", null);
|
|
126
|
-
AccountMutation = tslib_1.__decorate([
|
|
127
|
+
exports.AccountMutation = AccountMutation = tslib_1.__decorate([
|
|
127
128
|
(0, type_graphql_1.Resolver)(account_1.Account)
|
|
128
129
|
], AccountMutation);
|
|
129
|
-
exports.AccountMutation = AccountMutation;
|
|
130
130
|
//# sourceMappingURL=account-mutation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-mutation.js","sourceRoot":"","sources":["../../../server/service/account/account-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,uCAAmC;AACnC,iDAAyD;AAGlD,IAAM,eAAe,GAArB,MAAM,eAAe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AM,CAAC,CAAC,KAAU,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAA;QACzF,MAAM,WAAW,GAAG,EAAE,CAAC,aAAa,CAAC,iBAAO,CAAC,CAAA;QAE7C,IAAI,cAAc,CAAC,MAAM,GAAG,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"account-mutation.js","sourceRoot":"","sources":["../../../server/service/account/account-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAAsE;AACtE,qCAA4B;AAE5B,qEAA0F;AAE1F,uCAAmC;AACnC,iDAAyD;AAGlD,IAAM,eAAe,GAArB,MAAM,eAAe;IAGpB,AAAN,KAAK,CAAC,aAAa,CAAiB,OAAmB,EAAS,OAAwB;QACtF,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,aAAa,CAAC,iBAAO,CAAC,CAAC,IAAI,iCAC9C,OAAO,KACV,MAAM,EACN,OAAO,EAAE,IAAI,EACb,OAAO,EAAE,IAAI,IACb,CAAA;QAEF,OAAO,MAAM,CAAA;IACf,CAAC;IAIK,AAAN,KAAK,CAAC,aAAa,CACN,EAAU,EACP,KAAmB,EAC1B,OAAwB;QAE/B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAE1C,MAAM,UAAU,GAAG,EAAE,CAAC,aAAa,CAAC,iBAAO,CAAC,CAAA;QAC5C,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACvC,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;SACzC,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,IAAI,+CAC/B,OAAO,GACP,KAAK,KACR,OAA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IAAI,CAAC,EAAE,CAAC,CAAC,2BAAY,CAAC,CAAC,CAAA;IACtC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;4DAwCP;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;IAC9C,mBAAA,IAAA,kBAAG,EAAC,IAAI,CAAC,CAAA;IAAc,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oDAOhD;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IACvD,mBAAA,IAAA,kBAAG,EAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAWvE;AAIK;IAFL,IAAA,wBAAS,EAAC,cAAc,CAAC;IACzB,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;IAE1E,mBAAA,IAAA,kBAAG,EAAC,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC,2BAAY,CAAC,CAAC,CAAA;IACvC,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAWP;0BA9HU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,iBAAO,CAAC;GACL,eAAe,CA+H3B","sourcesContent":["import { Resolver, Mutation, Arg, Ctx, Directive } from 'type-graphql'\nimport { In } from 'typeorm'\n\nimport { createAttachment, deleteAttachmentsByRef } from '@things-factory/attachment-base'\n\nimport { Account } from './account'\nimport { NewAccount, AccountPatch } from './account-type'\n\n@Resolver(Account)\nexport class AccountMutation {\n @Directive('@transaction')\n @Mutation(returns => Account, { description: 'To create new Account' })\n async createAccount(@Arg('account') account: NewAccount, @Ctx() context: ResolverContext): Promise<Account> {\n const { domain, user, tx } = context.state\n\n const result = await tx.getRepository(Account).save({\n ...account,\n domain,\n creator: user,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => Account, { description: 'To modify Account information' })\n async updateAccount(\n @Arg('id') id: string,\n @Arg('patch') patch: AccountPatch,\n @Ctx() context: ResolverContext\n ): Promise<Account> {\n const { domain, user, tx } = context.state\n\n const repository = tx.getRepository(Account)\n const account = await repository.findOne({\n where: { domain: { id: domain.id }, id }\n })\n\n const result = await repository.save({\n ...account,\n ...patch,\n updater: user\n })\n\n return result\n }\n\n @Directive('@transaction')\n @Mutation(returns => [Account], { description: \"To modify multiple Accounts' information\" })\n async updateMultipleAccount(\n @Arg('patches', type => [AccountPatch]) patches: AccountPatch[],\n @Ctx() context: ResolverContext\n ): Promise<Account[]> {\n const { domain, user, tx } = context.state\n\n let results = []\n const _createRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === '+')\n const _updateRecords = patches.filter((patch: any) => patch.cuFlag.toUpperCase() === 'M')\n const accountRepo = tx.getRepository(Account)\n\n if (_createRecords.length > 0) {\n for (let i = 0; i < _createRecords.length; i++) {\n const newRecord = _createRecords[i]\n\n const result = await accountRepo.save({\n ...newRecord,\n domain,\n creator: user,\n updater: user\n })\n\n results.push({ ...result, cuFlag: '+' })\n }\n }\n\n if (_updateRecords.length > 0) {\n for (let i = 0; i < _updateRecords.length; i++) {\n const updateRecord = _updateRecords[i]\n const account = await accountRepo.findOneBy({ id: updateRecord.id })\n\n const result = await accountRepo.save({\n ...account,\n ...updateRecord,\n updater: user\n })\n\n results.push({ ...result, cuFlag: 'M' })\n }\n }\n\n return results\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete Account' })\n async deleteAccount(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Account).delete({ domain: { id: domain.id }, id })\n await deleteAttachmentsByRef(null, { refBys: [id] }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To delete multiple Accounts' })\n async deleteAccounts(@Arg('ids', type => [String]) ids: string[], @Ctx() context: ResolverContext): Promise<boolean> {\n const { domain, tx } = context.state\n\n await tx.getRepository(Account).delete({\n domain: { id: domain.id },\n id: In(ids)\n })\n\n await deleteAttachmentsByRef(null, { refBys: ids }, context)\n\n return true\n }\n\n @Directive('@transaction')\n @Mutation(returns => Boolean, { description: 'To import multiple Accounts' })\n async importAccounts(\n @Arg('accounts', type => [AccountPatch]) accounts: AccountPatch[],\n @Ctx() context: ResolverContext\n ): Promise<boolean> {\n const { domain, tx } = context.state\n\n await Promise.all(\n accounts.map(async (account: AccountPatch) => {\n const createdAccount: Account = await tx.getRepository(Account).save({ domain, ...account })\n })\n )\n\n return true\n }\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Domain, ListParam } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
import { Account } from './account';
|
|
4
|
+
import { AccountList } from './account-type';
|
|
5
|
+
export declare class AccountQuery {
|
|
6
|
+
account(id: string, context: ResolverContext): Promise<Account>;
|
|
7
|
+
accounts(params: ListParam, context: ResolverContext): Promise<AccountList>;
|
|
8
|
+
domain(account: Account): Promise<Domain>;
|
|
9
|
+
updater(account: Account): Promise<User>;
|
|
10
|
+
creator(account: Account): Promise<User>;
|
|
11
|
+
}
|
|
@@ -35,6 +35,7 @@ let AccountQuery = class AccountQuery {
|
|
|
35
35
|
return await (0, shell_1.getRepository)(auth_base_1.User).findOneBy({ id: account.creatorId });
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
+
exports.AccountQuery = AccountQuery;
|
|
38
39
|
tslib_1.__decorate([
|
|
39
40
|
(0, type_graphql_1.Query)(returns => account_1.Account, { nullable: true, description: 'To fetch a Account' }),
|
|
40
41
|
tslib_1.__param(0, (0, type_graphql_1.Arg)('id')),
|
|
@@ -45,7 +46,7 @@ tslib_1.__decorate([
|
|
|
45
46
|
], AccountQuery.prototype, "account", null);
|
|
46
47
|
tslib_1.__decorate([
|
|
47
48
|
(0, type_graphql_1.Query)(returns => account_type_1.AccountList, { description: 'To fetch multiple Accounts' }),
|
|
48
|
-
tslib_1.__param(0, (0, type_graphql_1.Args)()),
|
|
49
|
+
tslib_1.__param(0, (0, type_graphql_1.Args)(type => shell_1.ListParam)),
|
|
49
50
|
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
50
51
|
tslib_1.__metadata("design:type", Function),
|
|
51
52
|
tslib_1.__metadata("design:paramtypes", [shell_1.ListParam, Object]),
|
|
@@ -72,8 +73,7 @@ tslib_1.__decorate([
|
|
|
72
73
|
tslib_1.__metadata("design:paramtypes", [account_1.Account]),
|
|
73
74
|
tslib_1.__metadata("design:returntype", Promise)
|
|
74
75
|
], AccountQuery.prototype, "creator", null);
|
|
75
|
-
AccountQuery = tslib_1.__decorate([
|
|
76
|
+
exports.AccountQuery = AccountQuery = tslib_1.__decorate([
|
|
76
77
|
(0, type_graphql_1.Resolver)(account_1.Account)
|
|
77
78
|
], AccountQuery);
|
|
78
|
-
exports.AccountQuery = AccountQuery;
|
|
79
79
|
//# sourceMappingURL=account-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-query.js","sourceRoot":"","sources":["../../../server/service/account/account-query.ts"],"names":[],"mappings":";;;;AAAA,+CAA8F;AAE9F,iDAAuG;AACvG,yDAAgD;AAChD,uCAAmC;AACnC,iDAA4C;AAGrC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEjB,AAAN,KAAK,CAAC,OAAO,CAAY,EAAU,EAAS,OAAwB;QAClE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAEhC,OAAO,MAAM,IAAA,qBAAa,EAAC,iBAAO,CAAC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BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,gBAAI,CAAC;IACb,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAU,iBAAO;;2CAErC;uBAvCU,YAAY;IADxB,IAAA,uBAAQ,EAAC,iBAAO,CAAC;GACL,YAAY,CAwCxB","sourcesContent":["import { Resolver, Query, FieldResolver, Root, Args, Arg, Ctx, Directive } from 'type-graphql'\n\nimport { Domain, getQueryBuilderFromListParams, getRepository, ListParam } from '@things-factory/shell'\nimport { User } from '@things-factory/auth-base'\nimport { Account } from './account'\nimport { AccountList } from './account-type'\n\n@Resolver(Account)\nexport class AccountQuery {\n @Query(returns => Account!, { nullable: true, description: 'To fetch a Account' })\n async account(@Arg('id') id: string, @Ctx() context: ResolverContext): Promise<Account> {\n const { domain } = context.state\n\n return await getRepository(Account).findOne({\n where: { domain: { id: domain.id }, id }\n })\n }\n\n @Query(returns => AccountList, { description: 'To fetch multiple Accounts' })\n async accounts(@Args(type => ListParam) params: ListParam, @Ctx() context: ResolverContext): Promise<AccountList> {\n const { domain } = context.state\n\n const queryBuilder = getQueryBuilderFromListParams({\n domain,\n params,\n repository: await getRepository(Account),\n searchables: ['name', 'description']\n })\n\n const [items, total] = await queryBuilder.getManyAndCount()\n\n return { items, total }\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() account: Account): Promise<Domain> {\n return await getRepository(Domain).findOneBy({ id: account.domainId })\n }\n\n @FieldResolver(type => User)\n async updater(@Root() account: Account): Promise<User> {\n return await getRepository(User).findOneBy({ id: account.updaterId })\n }\n\n @FieldResolver(type => User)\n async creator(@Root() account: Account): Promise<User> {\n return await getRepository(User).findOneBy({ id: account.creatorId })\n }\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Account } from './account';
|
|
2
|
+
export declare class NewAccount {
|
|
3
|
+
name: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
active?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare class AccountPatch {
|
|
8
|
+
id?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
cuFlag?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare class AccountList {
|
|
15
|
+
items: Account[];
|
|
16
|
+
total: number;
|
|
17
|
+
}
|
|
@@ -6,6 +6,7 @@ const type_graphql_1 = require("type-graphql");
|
|
|
6
6
|
const account_1 = require("./account");
|
|
7
7
|
let NewAccount = class NewAccount {
|
|
8
8
|
};
|
|
9
|
+
exports.NewAccount = NewAccount;
|
|
9
10
|
tslib_1.__decorate([
|
|
10
11
|
(0, type_graphql_1.Field)(),
|
|
11
12
|
tslib_1.__metadata("design:type", String)
|
|
@@ -18,12 +19,12 @@ tslib_1.__decorate([
|
|
|
18
19
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
19
20
|
tslib_1.__metadata("design:type", Boolean)
|
|
20
21
|
], NewAccount.prototype, "active", void 0);
|
|
21
|
-
NewAccount = tslib_1.__decorate([
|
|
22
|
+
exports.NewAccount = NewAccount = tslib_1.__decorate([
|
|
22
23
|
(0, type_graphql_1.InputType)()
|
|
23
24
|
], NewAccount);
|
|
24
|
-
exports.NewAccount = NewAccount;
|
|
25
25
|
let AccountPatch = class AccountPatch {
|
|
26
26
|
};
|
|
27
|
+
exports.AccountPatch = AccountPatch;
|
|
27
28
|
tslib_1.__decorate([
|
|
28
29
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID, { nullable: true }),
|
|
29
30
|
tslib_1.__metadata("design:type", String)
|
|
@@ -44,12 +45,12 @@ tslib_1.__decorate([
|
|
|
44
45
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
45
46
|
tslib_1.__metadata("design:type", String)
|
|
46
47
|
], AccountPatch.prototype, "cuFlag", void 0);
|
|
47
|
-
AccountPatch = tslib_1.__decorate([
|
|
48
|
+
exports.AccountPatch = AccountPatch = tslib_1.__decorate([
|
|
48
49
|
(0, type_graphql_1.InputType)()
|
|
49
50
|
], AccountPatch);
|
|
50
|
-
exports.AccountPatch = AccountPatch;
|
|
51
51
|
let AccountList = class AccountList {
|
|
52
52
|
};
|
|
53
|
+
exports.AccountList = AccountList;
|
|
53
54
|
tslib_1.__decorate([
|
|
54
55
|
(0, type_graphql_1.Field)(type => [account_1.Account]),
|
|
55
56
|
tslib_1.__metadata("design:type", Array)
|
|
@@ -58,8 +59,7 @@ tslib_1.__decorate([
|
|
|
58
59
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int),
|
|
59
60
|
tslib_1.__metadata("design:type", Number)
|
|
60
61
|
], AccountList.prototype, "total", void 0);
|
|
61
|
-
AccountList = tslib_1.__decorate([
|
|
62
|
+
exports.AccountList = AccountList = tslib_1.__decorate([
|
|
62
63
|
(0, type_graphql_1.ObjectType)()
|
|
63
64
|
], AccountList);
|
|
64
|
-
exports.AccountList = AccountList;
|
|
65
65
|
//# sourceMappingURL=account-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account-type.js","sourceRoot":"","sources":["../../../server/service/account/account-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AAItF,uCAAmC;AAG5B,IAAM,UAAU,GAAhB,MAAM,UAAU;CAStB,CAAA;
|
|
1
|
+
{"version":3,"file":"account-type.js","sourceRoot":"","sources":["../../../server/service/account/account-type.ts"],"names":[],"mappings":";;;;AAAA,+CAAsF;AAItF,uCAAmC;AAG5B,IAAM,UAAU,GAAhB,MAAM,UAAU;CAStB,CAAA;AATY,gCAAU;AAErB;IADC,IAAA,oBAAK,GAAE;;wCACI;AAGZ;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;+CACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACV;qBARL,UAAU;IADtB,IAAA,wBAAS,GAAE;GACC,UAAU,CAStB;AAGM,IAAM,YAAY,GAAlB,MAAM,YAAY;CAexB,CAAA;AAfY,oCAAY;AAEvB;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;wCAC3B;AAGX;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;0CACb;AAGb;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACN;AAGpB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACV;AAGhB;IADC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACX;uBAdJ,YAAY;IADxB,IAAA,wBAAS,GAAE;GACC,YAAY,CAexB;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 { ObjectType, Field, InputType, Int, ID, registerEnumType } from 'type-graphql'\n\nimport { ObjectRef, ScalarObject } from '@things-factory/shell'\n\nimport { Account } from './account'\n\n@InputType()\nexport class NewAccount {\n @Field()\n name: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n}\n\n@InputType()\nexport class AccountPatch {\n @Field(type => ID, { nullable: true })\n id?: string\n\n @Field({ nullable: true })\n name?: string\n\n @Field({ nullable: true })\n description?: string\n\n @Field({ nullable: true })\n active?: boolean\n\n @Field({ nullable: true })\n cuFlag?: string\n}\n\n@ObjectType()\nexport class AccountList {\n @Field(type => [Account])\n items: Account[]\n\n @Field(type => Int)\n total: number\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Domain } from '@things-factory/shell';
|
|
2
|
+
import { User } from '@things-factory/auth-base';
|
|
3
|
+
import { AccountingCategory } from '../accounting-category/accounting-category';
|
|
4
|
+
export declare class Account {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
version?: number;
|
|
7
|
+
domain?: Domain;
|
|
8
|
+
domainId?: string;
|
|
9
|
+
controlNumber?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
active?: boolean;
|
|
13
|
+
category?: AccountingCategory;
|
|
14
|
+
categoryId?: string;
|
|
15
|
+
createdAt?: Date;
|
|
16
|
+
updatedAt?: Date;
|
|
17
|
+
deletedAt?: Date;
|
|
18
|
+
creator?: User;
|
|
19
|
+
creatorId?: string;
|
|
20
|
+
updater?: User;
|
|
21
|
+
updaterId?: string;
|
|
22
|
+
}
|