@lemoncloud/alarmo-points-api
Advanced tools
Comparing version 0.24.620 to 0.24.725
@@ -18,3 +18,3 @@ /** | ||
*/ | ||
export interface ListResult<T, R = string> { | ||
export interface ListResult<T, R = any> { | ||
/** | ||
@@ -21,0 +21,0 @@ * total searched count |
@@ -11,3 +11,3 @@ /** | ||
import { SimpleSet, CoreModel, NextIdentityAccess } from 'lemon-model'; | ||
import { ModelType, PointActionType, PointStereo, TicketStereo, TimeInfo, UserStereo } from './backend-types'; | ||
import { ModelType, UserStereo, TicketStereo, TransactionStereo, PointStereo, PointActionType, TimeInfo, TicketActionType, TransactionActionType } from './backend-types'; | ||
export { ModelType }; | ||
@@ -31,2 +31,4 @@ /** | ||
name?: string; | ||
/** stereo type */ | ||
stereo?: UserStereo; | ||
} | ||
@@ -55,2 +57,6 @@ /** | ||
totalCrewPoint?: number; | ||
/** 누적 소모 포인트 */ | ||
consumedPoint?: number; | ||
/** 누적 완료 포인트 */ | ||
completedPoint?: number; | ||
} | ||
@@ -66,2 +72,6 @@ /** | ||
name?: string; | ||
/** stereo type */ | ||
stereo?: TicketStereo; | ||
/** detailed action-type */ | ||
action?: TicketActionType; | ||
} | ||
@@ -79,2 +89,4 @@ /** | ||
stereo?: TicketStereo; | ||
/** detailed action-type */ | ||
action?: TicketActionType; | ||
/** ticket-key in unique */ | ||
@@ -90,2 +102,6 @@ tkey?: string; | ||
parent$?: TicketHead; | ||
/** paired(or issued) id of point-model */ | ||
pointId?: string; | ||
/** point-head */ | ||
point$?: PointHead; | ||
/** issue count (only 1 is valid) */ | ||
@@ -97,2 +113,46 @@ issued?: number; | ||
issued$?: TimeInfo; | ||
} | ||
/** | ||
* type: `TransactionHead` | ||
* - common head of transaction-model. | ||
*/ | ||
export interface TransactionHead { | ||
/** id of transaction */ | ||
id?: string; | ||
/** name of transaction */ | ||
name?: string; | ||
/** stereo type */ | ||
stereo?: TransactionStereo; | ||
/** action type */ | ||
action?: TransactionActionType; | ||
} | ||
/** | ||
* `transaction`: transaction model. | ||
* - 포인트 사용시 이용되는 정보로, 1개의 트랜잭션에 대해서 1번의 포인트 소멸이 이루어짐 | ||
* - RDB기반 트랙잭션 처리에 대비해서, 상태 변경등으로 처리 완료등을 표시하게됨. | ||
* - 포인트 이용시 미리 포인트 차감하고, 이후 구매 완료시 차감 완료 처리를 하게됨. | ||
* | ||
* [flow] | ||
* 1. `consumed`으로 우선 가용할 포인트를 차감시킨다. | ||
* 2. 구매 프로세스 진행하고 -> 완료시 다음단계. | ||
* 단) 에러 발생시, 처리는 수동으로 전환 -> `lastError`에 기록하기... | ||
* 3. `completed`로 최종 차감된 포인트를 적용함. | ||
*/ | ||
export interface TransactionModel extends Model, TransactionHead { | ||
/** id of transaction (:= point-id:<seq>) */ | ||
id?: string; | ||
/** name of model */ | ||
name?: string; | ||
/** stereo type */ | ||
stereo?: TransactionStereo; | ||
/** action type */ | ||
action?: TransactionActionType; | ||
/** target id if of alias */ | ||
aliasId?: string; | ||
/** (optional) the last error message internally */ | ||
lastError?: string; | ||
/** parent id of this transaction (maybe `stereo:main`) */ | ||
parentId?: string; | ||
/** parent information */ | ||
parent$?: TransactionHead; | ||
/** paired(or issued) id of point-model */ | ||
@@ -102,2 +162,16 @@ pointId?: string; | ||
point$?: PointHead; | ||
/** initial consumed point */ | ||
amount?: number; | ||
/** consumed count (only 1 is valid) */ | ||
consumed?: number; | ||
/** timestamp of consumed */ | ||
consumedAt?: number; | ||
/** time info of consumed */ | ||
consumed$?: TimeInfo; | ||
/** completed count (only 1 is valid) */ | ||
completed?: number; | ||
/** timestamp of completed */ | ||
completedAt?: number; | ||
/** time info of completed */ | ||
completed$?: TimeInfo; | ||
} | ||
@@ -111,2 +185,8 @@ /** | ||
id?: string; | ||
/** name of model */ | ||
name?: string; | ||
/** stereo type */ | ||
stereo?: PointStereo; | ||
/** detailed action-type */ | ||
action?: PointActionType; | ||
} | ||
@@ -130,2 +210,4 @@ /** | ||
stereo?: PointStereo; | ||
/** detailed action-type */ | ||
action?: PointActionType; | ||
/** target alias value */ | ||
@@ -139,7 +221,11 @@ aliasId?: string; | ||
ticketId?: string; | ||
/** detailed action-type */ | ||
action?: PointActionType; | ||
/** amount to earn (integer) */ | ||
/** head of `ticket` */ | ||
ticket$?: TicketHead; | ||
/** id of target-model to issue point */ | ||
transactionId?: string; | ||
/** head of `transaction` */ | ||
transaction$?: TransactionHead; | ||
/** point amount (integer) */ | ||
amount?: number; | ||
/** reason to earn */ | ||
/** reason to earn/use point */ | ||
reason?: string; | ||
@@ -152,2 +238,14 @@ /** flag of issued (true if > 0) */ | ||
issued$?: TimeInfo; | ||
/** flag of consumed (true if > 0) */ | ||
consumed?: number; | ||
/** timestamp of consumed */ | ||
consumedAt?: number; | ||
/** time info */ | ||
consumed$?: TimeInfo; | ||
/** flag of completed (true if > 0) */ | ||
completed?: number; | ||
/** timestamp of completed */ | ||
completedAt?: number; | ||
/** time info */ | ||
completed$?: TimeInfo; | ||
/** last state of user's point */ | ||
@@ -206,2 +304,3 @@ readonly $last?: PointModel; | ||
ticket: string[]; | ||
transaction: string[]; | ||
point: string[]; | ||
@@ -214,2 +313,3 @@ /** common data */ | ||
ticket: string[]; | ||
transaction: string[]; | ||
point: string[]; | ||
@@ -216,0 +316,0 @@ /** common data */ |
@@ -24,2 +24,4 @@ /** | ||
ticket: string; | ||
/** transaction model */ | ||
transaction: string; | ||
/** point model */ | ||
@@ -68,3 +70,3 @@ point: string; | ||
}; | ||
/** type: TicketStereo */ | ||
/** type: TicketStereo (티켓사유) */ | ||
TicketStereo: { | ||
@@ -74,4 +76,29 @@ '': string; | ||
'#alias': string; | ||
ad: string; | ||
user: string; | ||
crew: string; | ||
main: string; | ||
}; | ||
/** type: TicketActionType (티켓액션) */ | ||
TicketActionType: { | ||
'': string; | ||
/** view: '조회' - 광고보기시 적용 */ | ||
view: string; | ||
/** crew: '크루' - 상위크루에게 지원 */ | ||
crew: string; | ||
/** like: '좋아요' */ | ||
like: string; | ||
}; | ||
/** type: TransactionStereo (결제사유) */ | ||
TransactionStereo: { | ||
'': string; | ||
'#': string; | ||
'#alias': string; | ||
main: string; | ||
}; | ||
/** type: TransactionActionType (결제액션) */ | ||
TransactionActionType: { | ||
'': string; | ||
'#': string; | ||
}; | ||
/** type: PointStereo */ | ||
@@ -82,5 +109,12 @@ PointStereo: { | ||
'#alias': string; | ||
/** @deprecated 포인트 내역은 적립/소멸으로 나위며, 상세한 부분은 각기 ticket/transaction 참고 */ | ||
ad: string; | ||
/** @deprecated use `ticket` */ | ||
user: string; | ||
/** @deprecated use `ticket` */ | ||
crew: string; | ||
/** ticket으로 발생된 포인트 */ | ||
ticket: string; | ||
/** transaction으로 소묘된 포인트 */ | ||
transaction: string; | ||
}; | ||
@@ -90,7 +124,9 @@ /** type: PointActionType */ | ||
'': string; | ||
/** view: '조회' - 광고보기시 적용 */ | ||
view: string; | ||
/** mine: '본인' - 본인행동에 대한 적립 */ | ||
mine: string; | ||
/** crew: '크루' - 상위크루에게 지원 */ | ||
crew: string; | ||
/** like: '좋아요' */ | ||
/** (deprecated) view: '조회' - 광고보기시 적용 */ | ||
view: string; | ||
/** (deprecated) like: '좋아요' */ | ||
like: string; | ||
@@ -116,6 +152,18 @@ }; | ||
/** | ||
* type: `TicketStereo` | ||
* type: `TicketStereo` (티켓사유) | ||
*/ | ||
export declare type TicketStereo = keyof typeof $LUT.TicketStereo; | ||
/** | ||
* type: `TicketActionType` (티켓액션) | ||
*/ | ||
export declare type TicketActionType = keyof typeof $LUT.TicketActionType; | ||
/** | ||
* type: `TransactionStereo` (결제사유) | ||
*/ | ||
export declare type TransactionStereo = keyof typeof $LUT.TransactionStereo; | ||
/** | ||
* type: `TransactionActionType` (결제액션) | ||
*/ | ||
export declare type TransactionActionType = keyof typeof $LUT.TransactionActionType; | ||
/** | ||
* type: `PointStereo` | ||
@@ -142,5 +190,5 @@ */ | ||
/** stereo of point */ | ||
stereo?: PointStereo; | ||
stereo?: TicketStereo; | ||
/** action to issue (default '') */ | ||
action?: PointActionType; | ||
action?: TicketActionType; | ||
/** amount to issue (default 0) */ | ||
@@ -158,2 +206,22 @@ amount?: number; | ||
/** | ||
* options for `consume-point` | ||
*/ | ||
export interface ConsumePointOptions { | ||
/** stereo of point */ | ||
stereo?: TransactionStereo; | ||
/** action to consume (default '') */ | ||
action?: TransactionActionType; | ||
/** amount of consume */ | ||
amount?: number; | ||
/** reason of consume */ | ||
reason?: string; | ||
} | ||
/** | ||
* options for `complete-point` | ||
*/ | ||
export interface CompletePointOptions { | ||
/** amount of consume */ | ||
amount?: number; | ||
} | ||
/** | ||
* body of `/issue-crew-point` | ||
@@ -167,1 +235,17 @@ */ | ||
} | ||
/** | ||
* body of `/consume-point` | ||
*/ | ||
export interface PostConsumePointBody extends ConsumePointOptions { | ||
/** user-id to be own */ | ||
userId: string; | ||
} | ||
/** | ||
* body of `/complete-point` | ||
*/ | ||
export interface PostCompletePointBody extends CompletePointOptions { | ||
/** id of transaction model */ | ||
transactionId?: string; | ||
/** user-id to be own */ | ||
userId: string; | ||
} |
@@ -11,3 +11,3 @@ /** | ||
import { View, Body } from '../cores/types'; | ||
import { MockModel, PointModel, TestModel, TicketModel, UserModel } from '../service/backend-model'; | ||
import { MockModel, PointModel, TestModel, TicketModel, TransactionModel, UserModel } from '../service/backend-model'; | ||
export * from '../service/backend-types'; | ||
@@ -45,3 +45,3 @@ /** | ||
*/ | ||
export interface TicketView extends View, Omit<Partial<TicketModel>, 'required'> { | ||
export interface TicketView extends View, Omit<Partial<TicketModel>, 'required' | 'parent$'> { | ||
/** | ||
@@ -51,2 +51,6 @@ * (optional) flag required. | ||
required?: boolean; | ||
/** | ||
* infor of parent `ticket` | ||
*/ | ||
readonly parent$?: TicketView; | ||
} | ||
@@ -59,6 +63,25 @@ /** | ||
/** | ||
* type: `TransactionView` | ||
* - usually same as post's body. | ||
*/ | ||
export interface TransactionView extends View, Omit<Partial<TransactionModel>, 'required' | 'parent$'> { | ||
/** | ||
* (optional) flag required. | ||
*/ | ||
required?: boolean; | ||
/** | ||
* infor of parent `ticket` | ||
*/ | ||
readonly parent$?: TransactionView; | ||
} | ||
/** | ||
* Type `TransactionBody` | ||
*/ | ||
export interface TransactionBody extends Body, Partial<TransactionView> { | ||
} | ||
/** | ||
* type: `PointView` | ||
* - usually same as post's body. | ||
*/ | ||
export interface PointView extends View, Omit<Partial<PointModel>, 'required' | 'issued' | '$last'> { | ||
export interface PointView extends View, Omit<Partial<PointModel>, 'required' | 'issued' | 'consumed' | 'completed' | '$last' | 'ticket$'> { | ||
/** | ||
@@ -73,2 +96,14 @@ * (optional) flag required. | ||
/** | ||
* flag of consumed (소모여부 상태) | ||
*/ | ||
consumed?: boolean; | ||
/** | ||
* flag of completed (완료여부 상태) | ||
*/ | ||
completed?: boolean; | ||
/** | ||
* infor of `ticket` | ||
*/ | ||
readonly ticket$?: TicketView; | ||
/** | ||
* (optional) 해당 유저의 최종 상태 정보 | ||
@@ -75,0 +110,0 @@ * - `amount` 에서 최종 합계 금액을 알 수 잇음 |
{ | ||
"name": "@lemoncloud/alarmo-points-api", | ||
"version": "0.24.620", | ||
"version": "0.24.725", | ||
"description": "alarmo-points management api", | ||
@@ -5,0 +5,0 @@ "types": "dist/view/types.d.ts", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58571
806