@lemoncloud/clipbiz-goods-api 0.25.1027 → 0.25.1125
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/modules/ai/model.d.ts +136 -0
- package/dist/modules/ai/types.d.ts +80 -0
- package/dist/modules/ai/views.d.ts +70 -0
- package/dist/modules/contracts/model.d.ts +157 -0
- package/dist/modules/contracts/types.d.ts +88 -0
- package/dist/modules/contracts/views.d.ts +45 -0
- package/dist/modules/deals/model.d.ts +31 -3
- package/dist/modules/deals/types.d.ts +127 -14
- package/dist/modules/exams/model.d.ts +2 -0
- package/dist/modules/goods/model.d.ts +12 -3
- package/dist/service/backend-types.d.ts +8 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/view/types.d.ts +17 -0
- package/package.json +1 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `model.ts`
|
|
3
|
+
* - model definitions
|
|
4
|
+
*
|
|
5
|
+
* @author Steve Jung <steve@lemoncloud.io>
|
|
6
|
+
* @date 2025-03-26 initial version.
|
|
7
|
+
*
|
|
8
|
+
* @copyright (C) 2022 LemonCloud Co Ltd. - All Rights Reserved.
|
|
9
|
+
* @origin `@lemoncloud/lemon-templates-api/modules/recommend`
|
|
10
|
+
*/
|
|
11
|
+
import { CoreModel } from 'lemon-model';
|
|
12
|
+
import $LUT, { RecommendState, RecommendStereo, ReferencedContent, ReferencedUsage } from './types';
|
|
13
|
+
/**
|
|
14
|
+
* type: `ModelType`
|
|
15
|
+
*/
|
|
16
|
+
export declare type ModelType = keyof typeof $LUT.ModelType;
|
|
17
|
+
/**
|
|
18
|
+
* type: `Model`: common model
|
|
19
|
+
*/
|
|
20
|
+
export declare type Model = CoreModel<ModelType>;
|
|
21
|
+
/**
|
|
22
|
+
* type: boolean style number.
|
|
23
|
+
*/
|
|
24
|
+
export declare type BoolFlag = 0 | 1;
|
|
25
|
+
/**
|
|
26
|
+
* Type: `RecommendHead`
|
|
27
|
+
*/
|
|
28
|
+
export interface RecommendHead {
|
|
29
|
+
/** auto sequence */
|
|
30
|
+
id?: string;
|
|
31
|
+
/** stereo */
|
|
32
|
+
stereo?: RecommendStereo;
|
|
33
|
+
/** name of recommend */
|
|
34
|
+
name?: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* type: `RecommendModel` (콜백)
|
|
38
|
+
* - 콜백 모델
|
|
39
|
+
* - 콜백 요청과 응답에 대한 내용을 기록 관리하기 위함.
|
|
40
|
+
*/
|
|
41
|
+
export interface RecommendModel extends Model, RecommendHead {
|
|
42
|
+
/**
|
|
43
|
+
* auto-seq or child-no
|
|
44
|
+
* 1. [0-9]+ : auto sequence for all recommends.
|
|
45
|
+
* 2. '#' : means this is root recommend.
|
|
46
|
+
* 3. [A-Z][0-9]+ : linked recommend from other model type. (see `asModelId()` in proxy)
|
|
47
|
+
*/
|
|
48
|
+
id?: string;
|
|
49
|
+
/** stereo */
|
|
50
|
+
stereo?: RecommendStereo;
|
|
51
|
+
/** name of recommend */
|
|
52
|
+
name?: string;
|
|
53
|
+
/** type of llm model */
|
|
54
|
+
modelType?: string;
|
|
55
|
+
/** system prompt to use */
|
|
56
|
+
promptId?: string;
|
|
57
|
+
/** state of recommend */
|
|
58
|
+
state?: RecommendState;
|
|
59
|
+
/** single input */
|
|
60
|
+
input$?: ReferencedContent;
|
|
61
|
+
/** single output */
|
|
62
|
+
output$?: ReferencedContent;
|
|
63
|
+
/** token usage details */
|
|
64
|
+
usage$?: ReferencedUsage;
|
|
65
|
+
/** (optional) multiple input */
|
|
66
|
+
input$$?: ReferencedContent[];
|
|
67
|
+
/** (optional) multiple output */
|
|
68
|
+
output$$?: ReferencedContent[];
|
|
69
|
+
/** internal timestamp */
|
|
70
|
+
ts$?: {
|
|
71
|
+
/** time(ts) of request (entry) */
|
|
72
|
+
request?: number;
|
|
73
|
+
/** time(ts) of thinking (entry) */
|
|
74
|
+
thinking?: number;
|
|
75
|
+
/** time(ts) of response (entry) */
|
|
76
|
+
response?: number;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* (optional) referenced documents
|
|
80
|
+
*/
|
|
81
|
+
docs$$?: ReferencedContent[];
|
|
82
|
+
/** (optional) parent of this */
|
|
83
|
+
parentId?: string;
|
|
84
|
+
/** parent info */
|
|
85
|
+
parent$?: RecommendHead;
|
|
86
|
+
/**
|
|
87
|
+
* child-no for this recommend
|
|
88
|
+
* - if this is root recommend, `no` is `undefined`.
|
|
89
|
+
* - if this is child recommend, `no` is child sequence number (1,2,3,...).
|
|
90
|
+
*/
|
|
91
|
+
no?: number;
|
|
92
|
+
/** meta in json */
|
|
93
|
+
meta?: string;
|
|
94
|
+
/** last error message */
|
|
95
|
+
error?: string;
|
|
96
|
+
/** domain of origin context */
|
|
97
|
+
domain?: string;
|
|
98
|
+
/** client-ip when requested */
|
|
99
|
+
clientIp?: string;
|
|
100
|
+
/** user-agent when requested */
|
|
101
|
+
userAgent?: string;
|
|
102
|
+
/** origin when requested */
|
|
103
|
+
origin?: string;
|
|
104
|
+
/** referer when requested */
|
|
105
|
+
referer?: string;
|
|
106
|
+
/**
|
|
107
|
+
* hidden(숨김) flag
|
|
108
|
+
*/
|
|
109
|
+
hidden?: BoolFlag;
|
|
110
|
+
/**
|
|
111
|
+
* optional(선택) flag
|
|
112
|
+
*/
|
|
113
|
+
optional?: BoolFlag;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* extract field names from models
|
|
117
|
+
* - only fields start with lowercase, or all upper.
|
|
118
|
+
*/
|
|
119
|
+
export declare const filterFields: (fields: string[], base?: string[]) => string[];
|
|
120
|
+
/** field names from head */
|
|
121
|
+
export declare const $HEAD: {
|
|
122
|
+
recommend: string[];
|
|
123
|
+
};
|
|
124
|
+
export declare const $FIELD: {
|
|
125
|
+
recommend: string[];
|
|
126
|
+
};
|
|
127
|
+
/** must export default as below */
|
|
128
|
+
declare const _default: {
|
|
129
|
+
$HEAD: {
|
|
130
|
+
recommend: string[];
|
|
131
|
+
};
|
|
132
|
+
$FIELD: {
|
|
133
|
+
recommend: string[];
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
export default _default;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `types.ts`
|
|
3
|
+
* - basic types used in `proxy`
|
|
4
|
+
*
|
|
5
|
+
* **[중요! exports 순서]**
|
|
6
|
+
* 1. define data type in `types.ts` w/ internal types.
|
|
7
|
+
* 2. define Model in `model.ts`
|
|
8
|
+
* 3. define View/Body in `view.ts`, and external types.
|
|
9
|
+
*
|
|
10
|
+
* @author Steve Jung <steve@lemoncloud.io>
|
|
11
|
+
* @date 2025-03-26 initial version.
|
|
12
|
+
*
|
|
13
|
+
* @copyright (C) 2022 LemonCloud Co Ltd. - All Rights Reserved.
|
|
14
|
+
* @origin `@lemoncloud/lemon-templates-api/modules/recommend`
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Lookup Table
|
|
18
|
+
*
|
|
19
|
+
* WARN! DO NOT EXPORT AS `$LUT`. use default export instead.
|
|
20
|
+
*/
|
|
21
|
+
declare const $LUT: {
|
|
22
|
+
/**
|
|
23
|
+
* Possible type of model.
|
|
24
|
+
*/
|
|
25
|
+
ModelType: {
|
|
26
|
+
/** recommend model */
|
|
27
|
+
recommend: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* 추천의 종류
|
|
31
|
+
*/
|
|
32
|
+
RecommendStereo: {
|
|
33
|
+
'#': string;
|
|
34
|
+
'': string;
|
|
35
|
+
/** 내부 자식 노드의 경우 */
|
|
36
|
+
_child: string;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* 추천의 상태(현재상태)
|
|
40
|
+
* - 상태: `initial` -> `request` -> `thinking` -> `response`
|
|
41
|
+
*/
|
|
42
|
+
RecommendState: {
|
|
43
|
+
'': string;
|
|
44
|
+
/** request: 요청함 */
|
|
45
|
+
request: string;
|
|
46
|
+
/** thinking: 처리중 */
|
|
47
|
+
thinking: string;
|
|
48
|
+
/** response: 응답함 */
|
|
49
|
+
response: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* type: `RecommendStereo`
|
|
54
|
+
*/
|
|
55
|
+
export declare type RecommendStereo = keyof typeof $LUT.RecommendStereo | string;
|
|
56
|
+
/**
|
|
57
|
+
* type: `RecommendState`
|
|
58
|
+
*/
|
|
59
|
+
export declare type RecommendState = keyof typeof $LUT.RecommendState;
|
|
60
|
+
/** must export $LUT as default */
|
|
61
|
+
export default $LUT;
|
|
62
|
+
/**
|
|
63
|
+
* type: `ReferencedContent`
|
|
64
|
+
* - (simply) referenced content information
|
|
65
|
+
*/
|
|
66
|
+
export interface ReferencedContent {
|
|
67
|
+
/** id of doc */
|
|
68
|
+
id?: string;
|
|
69
|
+
/** type of doc (might be content-type) */
|
|
70
|
+
type?: string;
|
|
71
|
+
/** main content in text */
|
|
72
|
+
content: string;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* type: `ReferencedUsage`
|
|
76
|
+
* - token usage information.
|
|
77
|
+
*/
|
|
78
|
+
export interface ReferencedUsage {
|
|
79
|
+
[key: string]: number;
|
|
80
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `views.ts`
|
|
3
|
+
* - type of views used in `transformer`
|
|
4
|
+
*
|
|
5
|
+
* @author Steve Jung <steve@lemoncloud.io>
|
|
6
|
+
* @date 2025-03-26 initial version.
|
|
7
|
+
*
|
|
8
|
+
* @copyright (C) 2022 LemonCloud Co Ltd. - All Rights Reserved.
|
|
9
|
+
* @origin `@lemoncloud/lemon-templates-api/modules/recommend`
|
|
10
|
+
*/
|
|
11
|
+
import { View, Body } from 'lemon-model';
|
|
12
|
+
import { RecommendModel } from './model';
|
|
13
|
+
import $LUT from './types';
|
|
14
|
+
export * from './types';
|
|
15
|
+
export default $LUT;
|
|
16
|
+
/**
|
|
17
|
+
* type `RecommendView`
|
|
18
|
+
*/
|
|
19
|
+
export interface RecommendView extends View, Omit<Partial<RecommendModel>, 'optional' | 'hidden'> {
|
|
20
|
+
/** 사용 활성화 여부 */
|
|
21
|
+
optional?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* hidden(숨김) flag
|
|
24
|
+
*/
|
|
25
|
+
hidden?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* type `RecommendBody`
|
|
29
|
+
*/
|
|
30
|
+
export interface RecommendBody extends Body, Partial<Omit<RecommendView, ''>> {
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* type `RecommendCommonParam`
|
|
34
|
+
* - param for doGetItems() + doPostItems()
|
|
35
|
+
*/
|
|
36
|
+
export interface RecommendCommonParam {
|
|
37
|
+
/**
|
|
38
|
+
* type of recommend stereo
|
|
39
|
+
* - used to determine recommend model id.
|
|
40
|
+
*
|
|
41
|
+
* ex) id=123 type=recommend -> `RCM123`
|
|
42
|
+
*/
|
|
43
|
+
type?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* type `RecommendItemsParam`
|
|
47
|
+
* - param for doGetItems() + doPostItems()
|
|
48
|
+
*/
|
|
49
|
+
export interface RecommendPostItemsParam extends RecommendCommonParam {
|
|
50
|
+
/**
|
|
51
|
+
* flag of save (default: true)
|
|
52
|
+
* - if true, save the recommend result.
|
|
53
|
+
*/
|
|
54
|
+
save?: boolean | string;
|
|
55
|
+
/**
|
|
56
|
+
* flag of mocks (default: false)
|
|
57
|
+
* - if true, use mock data.
|
|
58
|
+
*/
|
|
59
|
+
mocks?: boolean | string;
|
|
60
|
+
/**
|
|
61
|
+
* flag of async (default: false)
|
|
62
|
+
* - if true, return immediately after make notify()
|
|
63
|
+
*/
|
|
64
|
+
async?: boolean | string;
|
|
65
|
+
/**
|
|
66
|
+
* (optional) id of connection-id
|
|
67
|
+
* - send the result of the change to a WebSocket
|
|
68
|
+
*/
|
|
69
|
+
connId?: string;
|
|
70
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `model.ts`
|
|
3
|
+
* - model definitions per contract data
|
|
4
|
+
*
|
|
5
|
+
* @author Steve <steve@lemoncloud.io>
|
|
6
|
+
* @date 2022-08-29 initial version.
|
|
7
|
+
* @author Aiden <aiden@lemoncloud.io>
|
|
8
|
+
* @date 2025-11-30 implement a contract service.
|
|
9
|
+
*
|
|
10
|
+
* Copyright (C) 2022 LemonCloud Co Ltd. - All Rights Reserved.
|
|
11
|
+
*/
|
|
12
|
+
import { CoreModel } from 'lemon-model';
|
|
13
|
+
import $LUT, { ContractStereo, ContractState, DeliveryStereo, DeliveryState, ContractAgreement } from './types';
|
|
14
|
+
import { DealHead, DealModel } from '../deals/model';
|
|
15
|
+
import { Cores } from 'lemon-core';
|
|
16
|
+
/**
|
|
17
|
+
* type: `ModelType`
|
|
18
|
+
*/
|
|
19
|
+
export declare type ModelType = keyof typeof $LUT.ModelType;
|
|
20
|
+
/**
|
|
21
|
+
* type: `Model`: common model interface
|
|
22
|
+
* - modifier 정보 저장을 위해 확장됨 @251124
|
|
23
|
+
*
|
|
24
|
+
* TODO [Steve] 아래의 `$` 부분은 추후 `lemon-model` 쪽으로 이전 검토 필요. @251124
|
|
25
|
+
*/
|
|
26
|
+
export interface Model extends CoreModel<ModelType> {
|
|
27
|
+
/**
|
|
28
|
+
* the modifier information
|
|
29
|
+
* - can't update manually.
|
|
30
|
+
*/
|
|
31
|
+
readonly $?: Cores;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* type: `ContractHead`
|
|
35
|
+
*/
|
|
36
|
+
export interface ContractHead {
|
|
37
|
+
/** id of model */
|
|
38
|
+
id?: string;
|
|
39
|
+
/** name of model */
|
|
40
|
+
name?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* type: `ContractModel`
|
|
44
|
+
* - 매칭(deal)에 대한 계약 정보를 관리함.
|
|
45
|
+
*/
|
|
46
|
+
export interface ContractModel extends ContractHead, Model {
|
|
47
|
+
/** name of model */
|
|
48
|
+
name?: string;
|
|
49
|
+
/** stereo of model */
|
|
50
|
+
stereo?: ContractStereo;
|
|
51
|
+
/** state of model */
|
|
52
|
+
state?: ContractState;
|
|
53
|
+
/** (linked) id of deal */
|
|
54
|
+
dealId?: string;
|
|
55
|
+
/** (linked) parital of deal */
|
|
56
|
+
deal$?: DealHead;
|
|
57
|
+
/** 총 주문수량 */
|
|
58
|
+
totalQuantity?: number;
|
|
59
|
+
/** 단가 */
|
|
60
|
+
unitPrice?: number;
|
|
61
|
+
/** 총 계약금액 */
|
|
62
|
+
totalAmount?: number;
|
|
63
|
+
/** 계약 시작 시각 */
|
|
64
|
+
startedAt?: number;
|
|
65
|
+
/** 계약 만료 시각 */
|
|
66
|
+
expiredAt?: number;
|
|
67
|
+
/** 특이사항 (for 기업) */
|
|
68
|
+
notes?: string;
|
|
69
|
+
/** 메모 (for 사업장) */
|
|
70
|
+
memo?: string;
|
|
71
|
+
/** 반려사유 (for 사업장) */
|
|
72
|
+
reasons?: string[];
|
|
73
|
+
/**
|
|
74
|
+
* no of revision
|
|
75
|
+
* - [parent] no-of-revision
|
|
76
|
+
* - [child] no-in-revision
|
|
77
|
+
*/
|
|
78
|
+
revisionNo?: number;
|
|
79
|
+
/**
|
|
80
|
+
* no of delivery (원자적 증가)
|
|
81
|
+
* - 마지막 생성된 납기 번호
|
|
82
|
+
*/
|
|
83
|
+
deliveryNo?: number;
|
|
84
|
+
/** (optional) id of parent */
|
|
85
|
+
parentId?: string;
|
|
86
|
+
/** (optional) partial of parent */
|
|
87
|
+
parent$?: ContractHead;
|
|
88
|
+
/**
|
|
89
|
+
* 약관 동의 기록
|
|
90
|
+
* - 기업, 표준사업장 동의 기록 관리
|
|
91
|
+
*/
|
|
92
|
+
agreed$?: ContractAgreement;
|
|
93
|
+
/**
|
|
94
|
+
* (internal) detail info of deal
|
|
95
|
+
*/
|
|
96
|
+
readonly $deal?: DealModel;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* interface: `DeliveryHead`
|
|
100
|
+
* - common head of `DeliveryModel`
|
|
101
|
+
*/
|
|
102
|
+
export interface DeliveryHead {
|
|
103
|
+
/** id of model */
|
|
104
|
+
id?: string;
|
|
105
|
+
/** name of model */
|
|
106
|
+
name?: string;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* interface: `DeliveryModel`
|
|
110
|
+
* - 계약(contract)애 대헌 회차/납기 정보를 관리함.
|
|
111
|
+
*/
|
|
112
|
+
export interface DeliveryModel extends DeliveryHead, Model {
|
|
113
|
+
/** name of model */
|
|
114
|
+
name?: string;
|
|
115
|
+
/** stereo of model */
|
|
116
|
+
stereo?: DeliveryStereo;
|
|
117
|
+
/** state of model */
|
|
118
|
+
state?: DeliveryState;
|
|
119
|
+
/** (linked) id of contract */
|
|
120
|
+
contractId?: string;
|
|
121
|
+
/** (linked) partial of contract */
|
|
122
|
+
contract$?: ContractHead;
|
|
123
|
+
/** (internal) 납기 번호 (:= Contract.deliveryNo) */
|
|
124
|
+
no?: number;
|
|
125
|
+
/** 납기 수량 */
|
|
126
|
+
quantity?: number;
|
|
127
|
+
/** 납기 단가 */
|
|
128
|
+
unitPrice?: number;
|
|
129
|
+
/** 납기 금액 */
|
|
130
|
+
amount?: number;
|
|
131
|
+
/** 예정 납기일 */
|
|
132
|
+
scheduledAt?: number;
|
|
133
|
+
/** 실제 납품일 */
|
|
134
|
+
deliveredAt?: number;
|
|
135
|
+
/** 메모 */
|
|
136
|
+
memo?: string;
|
|
137
|
+
}
|
|
138
|
+
export declare const filterFields: (fields: string[], base?: string[]) => string[];
|
|
139
|
+
export declare const $HEAD: {
|
|
140
|
+
contract: string[];
|
|
141
|
+
delivery: string[];
|
|
142
|
+
};
|
|
143
|
+
export declare const $FIELD: {
|
|
144
|
+
contract: string[];
|
|
145
|
+
delivery: string[];
|
|
146
|
+
};
|
|
147
|
+
declare const _default: {
|
|
148
|
+
$HEAD: {
|
|
149
|
+
contract: string[];
|
|
150
|
+
delivery: string[];
|
|
151
|
+
};
|
|
152
|
+
$FIELD: {
|
|
153
|
+
contract: string[];
|
|
154
|
+
delivery: string[];
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
export default _default;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `types.ts`
|
|
3
|
+
* - view types used in API controllers and transformer
|
|
4
|
+
*
|
|
5
|
+
* @author Steve <steve@lemoncloud.io>
|
|
6
|
+
* @date 2022-06-21 optimized w/ `abstract-services`
|
|
7
|
+
* @author Aiden <aiden@lemoncloud.io>
|
|
8
|
+
* @date 2025-11-30 implement a contract service.
|
|
9
|
+
*
|
|
10
|
+
* @copyright (C) 2022 LemonCloud Co Ltd. - All Rights Reserved.
|
|
11
|
+
*/
|
|
12
|
+
declare const $LUT: {
|
|
13
|
+
ModelType: {
|
|
14
|
+
contract: string;
|
|
15
|
+
delivery: string;
|
|
16
|
+
};
|
|
17
|
+
/** ContractStereo **/
|
|
18
|
+
ContractStereo: {
|
|
19
|
+
'': string;
|
|
20
|
+
'#': string;
|
|
21
|
+
'#revision': string;
|
|
22
|
+
};
|
|
23
|
+
/** ContractState */
|
|
24
|
+
ContractState: {
|
|
25
|
+
'': string;
|
|
26
|
+
draft: string;
|
|
27
|
+
pending: string;
|
|
28
|
+
approved: string;
|
|
29
|
+
active: string;
|
|
30
|
+
completed: string;
|
|
31
|
+
expired: string;
|
|
32
|
+
rejected: string;
|
|
33
|
+
cancelled: string;
|
|
34
|
+
};
|
|
35
|
+
/** DeliveryStereo */
|
|
36
|
+
DeliveryStereo: {
|
|
37
|
+
'': string;
|
|
38
|
+
};
|
|
39
|
+
/** DeliveryState */
|
|
40
|
+
DeliveryState: {
|
|
41
|
+
'': string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* type: `ContractStereo`
|
|
46
|
+
*/
|
|
47
|
+
export declare type ContractStereo = keyof typeof $LUT.ContractStereo;
|
|
48
|
+
/**
|
|
49
|
+
* type: `ContractState`
|
|
50
|
+
*/
|
|
51
|
+
export declare type ContractState = keyof typeof $LUT.ContractState;
|
|
52
|
+
/**
|
|
53
|
+
* type: `DeliveryStereo`
|
|
54
|
+
*/
|
|
55
|
+
export declare type DeliveryStereo = keyof typeof $LUT.DeliveryStereo;
|
|
56
|
+
/**
|
|
57
|
+
* type: `DeliveryState`
|
|
58
|
+
*/
|
|
59
|
+
export declare type DeliveryState = keyof typeof $LUT.DeliveryState;
|
|
60
|
+
/**
|
|
61
|
+
* type: `Agreement`
|
|
62
|
+
*/
|
|
63
|
+
export interface Agreement {
|
|
64
|
+
/**
|
|
65
|
+
* 동적 약관 동의 기록
|
|
66
|
+
* - key: 약관 ID
|
|
67
|
+
* - value: 약관 정보
|
|
68
|
+
*/
|
|
69
|
+
[key: string]: {
|
|
70
|
+
/** 약관(term) ID */
|
|
71
|
+
id: string;
|
|
72
|
+
/** 약관(term)명 */
|
|
73
|
+
name: string;
|
|
74
|
+
/** 동의 시각 */
|
|
75
|
+
ts?: number;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* type: `ContractAgreement`
|
|
80
|
+
* - 계약서별 약관 동의 기록
|
|
81
|
+
*/
|
|
82
|
+
export interface ContractAgreement {
|
|
83
|
+
/** 구매업체(기업) 약관 기록 */
|
|
84
|
+
seller?: Agreement;
|
|
85
|
+
/** 판매업체(표준사업장) 약관 기록 */
|
|
86
|
+
buyer?: Agreement;
|
|
87
|
+
}
|
|
88
|
+
export default $LUT;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `contracts/views.ts`
|
|
3
|
+
* - types used in `backed-proxy`
|
|
4
|
+
*
|
|
5
|
+
* @author Steve <steve@lemoncloud.io>
|
|
6
|
+
* @date 2022-08-29 initial version.
|
|
7
|
+
* @author Aiden <aiden@lemoncloud.io>
|
|
8
|
+
* @date 2025-11-30 implement a contract service.
|
|
9
|
+
*
|
|
10
|
+
* @copyright (C) lemoncloud.io 2022 - All Rights Reserved.
|
|
11
|
+
*/
|
|
12
|
+
import { View, Body } from 'lemon-model';
|
|
13
|
+
import { ContractModel, DeliveryModel } from './model';
|
|
14
|
+
import $LUT from './types';
|
|
15
|
+
import { DealView } from '../deals/views';
|
|
16
|
+
export * from './types';
|
|
17
|
+
export default $LUT;
|
|
18
|
+
/**!SECTION */
|
|
19
|
+
/**
|
|
20
|
+
* type: `ContractView`
|
|
21
|
+
* - usually same as post's body.
|
|
22
|
+
*/
|
|
23
|
+
export interface ContractView extends View, Omit<Partial<ContractModel>, 'deal$'> {
|
|
24
|
+
/**
|
|
25
|
+
* (readonly) 매칭 정보
|
|
26
|
+
*/
|
|
27
|
+
readonly deal$?: DealView;
|
|
28
|
+
}
|
|
29
|
+
export interface ContractBody extends Body, Partial<ContractView> {
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* type: `DeliveryView`
|
|
33
|
+
* - usually same as post's body.
|
|
34
|
+
*/
|
|
35
|
+
export interface DeliveryView extends View, Omit<Partial<DeliveryModel>, 'contract$'> {
|
|
36
|
+
/**
|
|
37
|
+
* (readonly) 계약서 정보
|
|
38
|
+
*/
|
|
39
|
+
readonly contract$?: ContractView;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* type: `DeliveryBody`
|
|
43
|
+
*/
|
|
44
|
+
export interface DeliveryBody extends Body, Partial<DeliveryView> {
|
|
45
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Copyright (C) 2022 LemonCloud Co Ltd. - All Rights Reserved.
|
|
9
9
|
*/
|
|
10
|
-
import { CoreModel } from 'lemon-model';
|
|
10
|
+
import { CoreModel, Cores } from 'lemon-model';
|
|
11
11
|
import $LUT, { DealStereo, DealStatus, DealStatusSet } from './types';
|
|
12
12
|
import { ProdHead } from '../goods/model';
|
|
13
13
|
import { ItemHead } from '../goods/model';
|
|
@@ -17,9 +17,18 @@ import { SiteHead } from '../sites/model';
|
|
|
17
17
|
*/
|
|
18
18
|
export declare type ModelType = keyof typeof $LUT.ModelType;
|
|
19
19
|
/**
|
|
20
|
-
* type: `Model`: common model
|
|
20
|
+
* type: `Model`: common model interface
|
|
21
|
+
* - modifier 정보 저장을 위해 확장됨 @251124
|
|
22
|
+
*
|
|
23
|
+
* TODO [Steve] 아래의 `$` 부분은 추후 `lemon-model` 쪽으로 이전 검토 필요. @251124
|
|
21
24
|
*/
|
|
22
|
-
export
|
|
25
|
+
export interface Model extends CoreModel<ModelType> {
|
|
26
|
+
/**
|
|
27
|
+
* the modifier information
|
|
28
|
+
* - can't update manually.
|
|
29
|
+
*/
|
|
30
|
+
readonly $?: Cores;
|
|
31
|
+
}
|
|
23
32
|
/**
|
|
24
33
|
* interface: `DealHead`
|
|
25
34
|
* - common head of deal-model
|
|
@@ -29,6 +38,23 @@ export interface DealHead {
|
|
|
29
38
|
id?: string;
|
|
30
39
|
/** name of deal */
|
|
31
40
|
name?: string;
|
|
41
|
+
/** ==== 계약 시점의 스냅샷 ==== */
|
|
42
|
+
/** (linked) 상품(희망상품) ID */
|
|
43
|
+
prodId?: string;
|
|
44
|
+
/** (linked) 상품(희망상품) 정보 */
|
|
45
|
+
prod$?: ProdHead;
|
|
46
|
+
/** (linked) 품목 ID */
|
|
47
|
+
itemId?: string;
|
|
48
|
+
/** (linked) 품목 정보 */
|
|
49
|
+
item$?: ItemHead;
|
|
50
|
+
/** (linked) 신청 기업(업체) ID */
|
|
51
|
+
buyerSiteId?: string;
|
|
52
|
+
/** (linked) 신청 기업(업체) 정보 */
|
|
53
|
+
buyerSite$?: SiteHead;
|
|
54
|
+
/** (linked) 공급 기업(표준사업장) ID */
|
|
55
|
+
sellerSiteId?: string;
|
|
56
|
+
/** (linked) 공급 기업(표준사업장) 정보 */
|
|
57
|
+
sellerSite$?: SiteHead;
|
|
32
58
|
}
|
|
33
59
|
/**
|
|
34
60
|
* interface: `DealModel`
|
|
@@ -63,6 +89,8 @@ export interface DealModel extends DealHead, Model {
|
|
|
63
89
|
sellerSite$?: SiteHead;
|
|
64
90
|
/** 전체 상태 */
|
|
65
91
|
status?: DealStatus;
|
|
92
|
+
/** 상태 순서 (1-7) */
|
|
93
|
+
stateNo?: number;
|
|
66
94
|
/** 상태 세트 (inner object) */
|
|
67
95
|
status$?: DealStatusSet;
|
|
68
96
|
/** 요청 정보 */
|