@chevre/domain 24.0.0-alpha.77 → 24.0.0-alpha.79
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/lib/chevre/repo/action/actionProcess.d.ts +4 -4
- package/lib/chevre/repo/action/authorizeOffer.d.ts +2 -3
- package/lib/chevre/repo/action/authorizeOffer.js +2 -2
- package/lib/chevre/repo/action.d.ts +2 -2
- package/lib/chevre/repo/assetTransaction.d.ts +3 -51
- package/lib/chevre/repo/assetTransaction.js +51 -51
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +1 -1
- package/lib/chevre/repo/product.d.ts +0 -10
- package/lib/chevre/repo/product.js +28 -22
- package/lib/chevre/repo/task.d.ts +1 -1
- package/lib/chevre/repository.d.ts +0 -5
- package/lib/chevre/repository.js +0 -11
- package/lib/chevre/service/assetTransaction/pay/publishPaymentUrl.js +1 -1
- package/lib/chevre/service/assetTransaction/pay/start/factory.js +7 -7
- package/lib/chevre/service/assetTransaction/pay/start/preStart/fixPaymentService.js +18 -16
- package/lib/chevre/service/assetTransaction/refund.js +19 -17
- package/lib/chevre/service/assetTransaction/reserve/start.js +8 -8
- package/lib/chevre/service/assetTransaction.d.ts +0 -2
- package/lib/chevre/service/assetTransaction.js +8 -10
- package/lib/chevre/service/delivery/factory.js +13 -13
- package/lib/chevre/service/offer/any.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize.js +7 -32
- package/lib/chevre/service/offer/product.d.ts +0 -62
- package/lib/chevre/service/offer/product.js +0 -409
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.d.ts +1 -1
- package/lib/chevre/service/order/onAssetTransactionStatusChanged/isDeliverable.js +48 -43
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +38 -37
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderCancelled/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderDeliveredPartially/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/processOrder.js +2 -96
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.js +18 -15
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.d.ts +0 -1
- package/lib/chevre/service/order/placeOrder/factory/orderedItem.js +3 -28
- package/lib/chevre/service/order/placeOrder/factory.js +5 -5
- package/lib/chevre/service/payment/factory/createPayObjectServiceOutput.js +1 -1
- package/lib/chevre/service/payment/factory.js +23 -23
- package/lib/chevre/service/product.js +16 -16
- package/lib/chevre/service/reserve/confirmReservation.js +19 -17
- package/lib/chevre/service/reserve/factory.d.ts +0 -6
- package/lib/chevre/service/reserve/factory.js +0 -59
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +16 -15
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +0 -1
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.d.ts +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.js +2 -2
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +3 -3
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +16 -12
- package/lib/chevre/service/transaction/placeOrder/confirm.js +21 -23
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +0 -21
- package/lib/chevre/service/transaction/returnOrder/potentialActions.js +4 -4
- package/lib/chevre/service/validation/validateOrder.js +11 -10
- package/package.json +2 -2
- package/lib/chevre/repo/action/authorizeProductOffer.d.ts +0 -26
- package/lib/chevre/repo/action/authorizeProductOffer.js +0 -32
- package/lib/chevre/service/assetTransaction/registerService/factory.d.ts +0 -21
- package/lib/chevre/service/assetTransaction/registerService/factory.js +0 -171
- package/lib/chevre/service/assetTransaction/registerService/potentialActions.d.ts +0 -8
- package/lib/chevre/service/assetTransaction/registerService/potentialActions.js +0 -148
- package/lib/chevre/service/assetTransaction/registerService.d.ts +0 -54
- package/lib/chevre/service/assetTransaction/registerService.js +0 -273
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createPointAward.d.ts +0 -15
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createPointAward.js +0 -44
- package/lib/chevre/service/delivery/product/factory.d.ts +0 -13
- package/lib/chevre/service/delivery/product/factory.js +0 -81
- package/lib/chevre/service/offer/product/factory.d.ts +0 -37
- package/lib/chevre/service/offer/product/factory.js +0 -208
- package/lib/chevre/service/task/confirmRegisterService.d.ts +0 -6
- package/lib/chevre/service/task/confirmRegisterService.js +0 -19
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.d.ts +0 -17
- package/lib/chevre/service/task/confirmRegisterServiceTransaction.js +0 -116
- package/lib/chevre/service/task/voidRegisterServiceTransaction.d.ts +0 -6
- package/lib/chevre/service/task/voidRegisterServiceTransaction.js +0 -23
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.d.ts +0 -8
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.js +0 -89
|
@@ -2,8 +2,8 @@ import { Connection } from 'mongoose';
|
|
|
2
2
|
import { factory } from '../../factory';
|
|
3
3
|
import { IModel as IActionModel } from '../mongoose/schemas/action';
|
|
4
4
|
import { IModel as IActionRecipeModel } from '../mongoose/schemas/actionRecipe';
|
|
5
|
-
export type IAction4transaction<T extends factory.actionType.AcceptAction | factory.actionType.AuthorizeAction> = T extends factory.actionType.AcceptAction ? factory.action.accept.coaOffer.IAction | factory.action.accept.pay.IAction : T extends factory.actionType.AuthorizeAction ? (factory.action.authorize.offer.eventService.IAction | factory.action.authorize.
|
|
6
|
-
export type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AcceptAction ? IAction4transaction<factory.actionType.AcceptAction> : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> : T extends factory.actionType.CheckAction ? (factory.action.check.paymentMethod.movieTicket.IAction | factory.action.check.thing.IAction) : T extends factory.actionType.CreateAction ? factory.action.create.IAction : T extends factory.actionType.
|
|
5
|
+
export type IAction4transaction<T extends factory.actionType.AcceptAction | factory.actionType.AuthorizeAction> = T extends factory.actionType.AcceptAction ? factory.action.accept.coaOffer.IAction | factory.action.accept.pay.IAction : T extends factory.actionType.AuthorizeAction ? (factory.action.authorize.offer.eventService.IAction | factory.action.authorize.paymentMethod.any.IAction) : never;
|
|
6
|
+
export type IAction<T extends factory.actionType> = T extends factory.actionType.OrderAction ? factory.action.trade.order.IAction : T extends factory.actionType.AcceptAction ? IAction4transaction<factory.actionType.AcceptAction> : T extends factory.actionType.AuthorizeAction ? factory.action.authorize.IAction<factory.action.authorize.IAttributes<any, any>> : T extends factory.actionType.CheckAction ? (factory.action.check.paymentMethod.movieTicket.IAction | factory.action.check.thing.IAction) : T extends factory.actionType.CreateAction ? factory.action.create.IAction : T extends factory.actionType.AddAction ? factory.action.update.add.IAction : T extends factory.actionType.ReplaceAction ? factory.action.update.replace.IAction : T extends factory.actionType.UpdateAction ? factory.action.update.update.IAction : T extends factory.actionType.InformAction ? factory.action.interact.inform.IAction<factory.action.interact.inform.IAttributes<factory.action.interact.inform.IObject>> & {
|
|
7
7
|
error?: any;
|
|
8
8
|
purpose?: never;
|
|
9
9
|
} : factory.action.IAction<factory.action.IAttributes<T, any, any>>;
|
|
@@ -130,8 +130,8 @@ export declare class ActionProcessRepo<TAction extends IAction<factory.actionTyp
|
|
|
130
130
|
};
|
|
131
131
|
object?: {
|
|
132
132
|
typeOf?: {
|
|
133
|
-
$eq?: factory.action.authorize.offer.eventService.ObjectType.SeatReservation | factory.action.authorize.paymentMethod.any.ResultType.Payment | factory.
|
|
134
|
-
$in?: (factory.action.authorize.offer.eventService.ObjectType.SeatReservation
|
|
133
|
+
$eq?: factory.action.authorize.offer.eventService.ObjectType.SeatReservation | factory.action.authorize.paymentMethod.any.ResultType.Payment | factory.offerType.AggregateOffer;
|
|
134
|
+
$in?: (factory.action.authorize.offer.eventService.ObjectType.SeatReservation)[];
|
|
135
135
|
};
|
|
136
136
|
paymentMethodId?: {
|
|
137
137
|
$eq?: string;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
2
|
import { ActionProcessRepo } from './actionProcess';
|
|
3
3
|
export type IAuthorizeEventServiceOfferAction = factory.action.authorize.offer.eventService.IAction;
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export type IAuthorizeOfferActionWithInstrument = Pick<IAuthorizeEventServiceOfferAction | IAuthorizeProductOfferAction, 'instrument'>;
|
|
4
|
+
export type IAuthorizeOfferAction = IAuthorizeEventServiceOfferAction;
|
|
5
|
+
export type IAuthorizeOfferActionWithInstrument = Pick<IAuthorizeEventServiceOfferAction, 'instrument'>;
|
|
7
6
|
/**
|
|
8
7
|
* オファー承認リポジトリ
|
|
9
8
|
*/
|
|
@@ -22,7 +22,7 @@ class AuthorizeOfferActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
|
22
22
|
typeOf: {
|
|
23
23
|
$in: [
|
|
24
24
|
factory_1.factory.action.authorize.offer.eventService.ObjectType.SeatReservation,
|
|
25
|
-
|
|
25
|
+
// factory.action.authorize.offer.eventService.ObjectType.AggregateOffer
|
|
26
26
|
]
|
|
27
27
|
}
|
|
28
28
|
},
|
|
@@ -58,7 +58,7 @@ class AuthorizeOfferActionRepo extends actionProcess_1.ActionProcessRepo {
|
|
|
58
58
|
typeOf: {
|
|
59
59
|
$in: [
|
|
60
60
|
factory_1.factory.action.authorize.offer.eventService.ObjectType.SeatReservation,
|
|
61
|
-
|
|
61
|
+
// factory.action.authorize.offer.eventService.ObjectType.AggregateOffer
|
|
62
62
|
]
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -2,7 +2,7 @@ import { FilterQuery } from 'mongoose';
|
|
|
2
2
|
import { factory } from '../factory';
|
|
3
3
|
import type { IDocType } from './mongoose/schemas/action';
|
|
4
4
|
import { IAction, IKeyOfProjection, ActionProcessRepo, ICancelActionAction, IActionRecipe } from './action/actionProcess';
|
|
5
|
-
export type IAction4transaction<T extends factory.actionType.AcceptAction | factory.actionType.AuthorizeAction> = T extends factory.actionType.AcceptAction ? factory.action.accept.coaOffer.IAction | factory.action.accept.pay.IAction : T extends factory.actionType.AuthorizeAction ? (factory.action.authorize.offer.eventService.IAction | factory.action.authorize.
|
|
5
|
+
export type IAction4transaction<T extends factory.actionType.AcceptAction | factory.actionType.AuthorizeAction> = T extends factory.actionType.AcceptAction ? factory.action.accept.coaOffer.IAction | factory.action.accept.pay.IAction : T extends factory.actionType.AuthorizeAction ? (factory.action.authorize.offer.eventService.IAction | factory.action.authorize.paymentMethod.any.IAction) : never;
|
|
6
6
|
export { ICancelActionAction };
|
|
7
7
|
/**
|
|
8
8
|
* 汎用アクションリポジトリで開始可能なアクションタイプ
|
|
@@ -32,7 +32,7 @@ export declare class ActionRepo extends ActionProcessRepo<IAction<StartableActio
|
|
|
32
32
|
};
|
|
33
33
|
object?: {
|
|
34
34
|
typeOf?: {
|
|
35
|
-
$eq?: factory.action.authorize.offer.eventService.ObjectType.SeatReservation | factory.action.authorize.paymentMethod.any.ResultType.Payment
|
|
35
|
+
$eq?: factory.action.authorize.offer.eventService.ObjectType.SeatReservation | factory.action.authorize.paymentMethod.any.ResultType.Payment;
|
|
36
36
|
};
|
|
37
37
|
paymentMethodId?: {
|
|
38
38
|
$eq?: string;
|
|
@@ -23,14 +23,14 @@ export interface IAggregateReserve {
|
|
|
23
23
|
statuses: IStatus[];
|
|
24
24
|
}
|
|
25
25
|
type IKeyOfProjection<T extends factory.assetTransactionType> = keyof Pick<factory.assetTransaction.ITransaction<factory.assetTransactionType>, 'agent' | 'endDate' | 'expires' | 'project' | 'startDate' | 'status' | 'typeOf' | 'transactionNumber'> | Exclude<keyof factory.assetTransaction.ITransaction<T>, 'id'>;
|
|
26
|
-
type AvailableAssetTransactionType = factory.assetTransactionType.CancelReservation | factory.assetTransactionType.
|
|
26
|
+
type AvailableAssetTransactionType = factory.assetTransactionType.CancelReservation | factory.assetTransactionType.Pay | factory.assetTransactionType.Refund | factory.assetTransactionType.Reserve;
|
|
27
27
|
/**
|
|
28
28
|
* 資産取引リポジトリ
|
|
29
29
|
*/
|
|
30
30
|
export declare class AssetTransactionRepo {
|
|
31
31
|
private readonly transactionModel;
|
|
32
32
|
constructor(connection: Connection);
|
|
33
|
-
static CREATE_MONGO_CONDITIONS(params: factory.assetTransaction.ISearchConditions<factory.assetTransactionType>): FilterQuery<import("@chevre/factory/lib/chevre/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/
|
|
33
|
+
static CREATE_MONGO_CONDITIONS(params: factory.assetTransaction.ISearchConditions<factory.assetTransactionType>): FilterQuery<import("@chevre/factory/lib/chevre/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/reserve").ITransaction>[];
|
|
34
34
|
/**
|
|
35
35
|
* 取引を開始する
|
|
36
36
|
*/
|
|
@@ -124,7 +124,7 @@ export declare class AssetTransactionRepo {
|
|
|
124
124
|
$in: factory.transactionStatusType[];
|
|
125
125
|
};
|
|
126
126
|
limit: number;
|
|
127
|
-
}): Promise<Pick<import("@chevre/factory/lib/chevre/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/
|
|
127
|
+
}): Promise<Pick<import("@chevre/factory/lib/chevre/assetTransaction/cancelReservation").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/pay").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/refund").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/reserve").ITransaction, "id" | "typeOf" | "status">[]>;
|
|
128
128
|
/**
|
|
129
129
|
* set task status exported by transaction id
|
|
130
130
|
* IDでタスクをエクスポート済に変更する
|
|
@@ -227,14 +227,6 @@ export declare class AssetTransactionRepo {
|
|
|
227
227
|
_id: import("mongoose").Types.ObjectId;
|
|
228
228
|
} & {
|
|
229
229
|
__v: number;
|
|
230
|
-
}) | (import("@chevre/factory/lib/chevre/assetTransaction/moneyTransfer").IAttributes & {
|
|
231
|
-
id: string;
|
|
232
|
-
} & {
|
|
233
|
-
seller?: any;
|
|
234
|
-
} & {
|
|
235
|
-
_id: import("mongoose").Types.ObjectId;
|
|
236
|
-
} & {
|
|
237
|
-
__v: number;
|
|
238
230
|
}) | (import("@chevre/factory/lib/chevre/assetTransaction/pay").IAttributes & {
|
|
239
231
|
id: string;
|
|
240
232
|
} & {
|
|
@@ -251,14 +243,6 @@ export declare class AssetTransactionRepo {
|
|
|
251
243
|
_id: import("mongoose").Types.ObjectId;
|
|
252
244
|
} & {
|
|
253
245
|
__v: number;
|
|
254
|
-
}) | (import("@chevre/factory/lib/chevre/assetTransaction/registerService").IAttributes & {
|
|
255
|
-
id: string;
|
|
256
|
-
} & {
|
|
257
|
-
seller?: any;
|
|
258
|
-
} & {
|
|
259
|
-
_id: import("mongoose").Types.ObjectId;
|
|
260
|
-
} & {
|
|
261
|
-
__v: number;
|
|
262
246
|
}) | (import("@chevre/factory/lib/chevre/assetTransaction/reserve").IAttributes & {
|
|
263
247
|
id: string;
|
|
264
248
|
} & {
|
|
@@ -293,14 +277,6 @@ export declare class AssetTransactionRepo {
|
|
|
293
277
|
_id: import("mongoose").Types.ObjectId;
|
|
294
278
|
} & {
|
|
295
279
|
__v: number;
|
|
296
|
-
}) | (import("@chevre/factory/lib/chevre/assetTransaction/moneyTransfer").IAttributes & {
|
|
297
|
-
id: string;
|
|
298
|
-
} & {
|
|
299
|
-
seller?: any;
|
|
300
|
-
} & {
|
|
301
|
-
_id: import("mongoose").Types.ObjectId;
|
|
302
|
-
} & {
|
|
303
|
-
__v: number;
|
|
304
280
|
}) | (import("@chevre/factory/lib/chevre/assetTransaction/pay").IAttributes & {
|
|
305
281
|
id: string;
|
|
306
282
|
} & {
|
|
@@ -317,14 +293,6 @@ export declare class AssetTransactionRepo {
|
|
|
317
293
|
_id: import("mongoose").Types.ObjectId;
|
|
318
294
|
} & {
|
|
319
295
|
__v: number;
|
|
320
|
-
}) | (import("@chevre/factory/lib/chevre/assetTransaction/registerService").IAttributes & {
|
|
321
|
-
id: string;
|
|
322
|
-
} & {
|
|
323
|
-
seller?: any;
|
|
324
|
-
} & {
|
|
325
|
-
_id: import("mongoose").Types.ObjectId;
|
|
326
|
-
} & {
|
|
327
|
-
__v: number;
|
|
328
296
|
}) | (import("@chevre/factory/lib/chevre/assetTransaction/reserve").IAttributes & {
|
|
329
297
|
id: string;
|
|
330
298
|
} & {
|
|
@@ -341,14 +309,6 @@ export declare class AssetTransactionRepo {
|
|
|
341
309
|
_id: import("mongoose").Types.ObjectId;
|
|
342
310
|
} & {
|
|
343
311
|
__v: number;
|
|
344
|
-
}) | (import("@chevre/factory/lib/chevre/assetTransaction/moneyTransfer").IAttributes & {
|
|
345
|
-
id: string;
|
|
346
|
-
} & {
|
|
347
|
-
seller?: any;
|
|
348
|
-
} & {
|
|
349
|
-
_id: import("mongoose").Types.ObjectId;
|
|
350
|
-
} & {
|
|
351
|
-
__v: number;
|
|
352
312
|
}) | (import("@chevre/factory/lib/chevre/assetTransaction/pay").IAttributes & {
|
|
353
313
|
id: string;
|
|
354
314
|
} & {
|
|
@@ -365,14 +325,6 @@ export declare class AssetTransactionRepo {
|
|
|
365
325
|
_id: import("mongoose").Types.ObjectId;
|
|
366
326
|
} & {
|
|
367
327
|
__v: number;
|
|
368
|
-
}) | (import("@chevre/factory/lib/chevre/assetTransaction/registerService").IAttributes & {
|
|
369
|
-
id: string;
|
|
370
|
-
} & {
|
|
371
|
-
seller?: any;
|
|
372
|
-
} & {
|
|
373
|
-
_id: import("mongoose").Types.ObjectId;
|
|
374
|
-
} & {
|
|
375
|
-
__v: number;
|
|
376
328
|
}) | (import("@chevre/factory/lib/chevre/assetTransaction/reserve").IAttributes & {
|
|
377
329
|
id: string;
|
|
378
330
|
} & {
|
|
@@ -134,36 +134,36 @@ class AssetTransactionRepo {
|
|
|
134
134
|
}
|
|
135
135
|
break;
|
|
136
136
|
}
|
|
137
|
-
case
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
137
|
+
// case factory.assetTransactionType.MoneyTransfer: {
|
|
138
|
+
// const fromLocationIdentifierEq = params.object?.fromLocation?.identifier?.$eq;
|
|
139
|
+
// if (typeof fromLocationIdentifierEq === 'string') {
|
|
140
|
+
// andConditions.push({
|
|
141
|
+
// 'object.fromLocation.identifier': {
|
|
142
|
+
// $exists: true,
|
|
143
|
+
// $eq: fromLocationIdentifierEq
|
|
144
|
+
// }
|
|
145
|
+
// });
|
|
146
|
+
// }
|
|
147
|
+
// const toLocationIdentifierEq = params.object?.toLocation?.identifier?.$eq;
|
|
148
|
+
// if (typeof toLocationIdentifierEq === 'string') {
|
|
149
|
+
// andConditions.push({
|
|
150
|
+
// 'object.toLocation.identifier': {
|
|
151
|
+
// $exists: true,
|
|
152
|
+
// $eq: toLocationIdentifierEq
|
|
153
|
+
// }
|
|
154
|
+
// });
|
|
155
|
+
// }
|
|
156
|
+
// const pendingTransactionIdentifierEq = params.object?.pendingTransaction?.identifier?.$eq;
|
|
157
|
+
// if (typeof pendingTransactionIdentifierEq === 'string') {
|
|
158
|
+
// andConditions.push({
|
|
159
|
+
// 'object.pendingTransaction.identifier': {
|
|
160
|
+
// $exists: true,
|
|
161
|
+
// $eq: pendingTransactionIdentifierEq
|
|
162
|
+
// }
|
|
163
|
+
// });
|
|
164
|
+
// }
|
|
165
|
+
// break;
|
|
166
|
+
// }
|
|
167
167
|
case factory_1.factory.assetTransactionType.CancelReservation: {
|
|
168
168
|
const objectReservationNumberIn4cancelReservation = params.object?.reservationNumber?.$in;
|
|
169
169
|
if (Array.isArray(objectReservationNumberIn4cancelReservation)) {
|
|
@@ -260,27 +260,27 @@ class AssetTransactionRepo {
|
|
|
260
260
|
}
|
|
261
261
|
break;
|
|
262
262
|
}
|
|
263
|
-
case
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
}
|
|
263
|
+
// case factory.assetTransactionType.RegisterService: {
|
|
264
|
+
// const objectItemOfferedServiceOutputIdentifierEq = params.object?.itemOffered?.serviceOutput?.identifier?.$eq;
|
|
265
|
+
// if (typeof objectItemOfferedServiceOutputIdentifierEq === 'string') {
|
|
266
|
+
// andConditions.push({
|
|
267
|
+
// 'object.itemOffered.serviceOutput.identifier': {
|
|
268
|
+
// $exists: true,
|
|
269
|
+
// $eq: objectItemOfferedServiceOutputIdentifierEq
|
|
270
|
+
// }
|
|
271
|
+
// });
|
|
272
|
+
// }
|
|
273
|
+
// const objectItemOfferedServiceOutputIdentifierIn = params.object?.itemOffered?.serviceOutput?.identifier?.$in;
|
|
274
|
+
// if (Array.isArray(objectItemOfferedServiceOutputIdentifierIn)) {
|
|
275
|
+
// andConditions.push({
|
|
276
|
+
// 'object.itemOffered.serviceOutput.identifier': {
|
|
277
|
+
// $exists: true,
|
|
278
|
+
// $in: objectItemOfferedServiceOutputIdentifierIn
|
|
279
|
+
// }
|
|
280
|
+
// });
|
|
281
|
+
// }
|
|
282
|
+
// break;
|
|
283
|
+
// }
|
|
284
284
|
default:
|
|
285
285
|
}
|
|
286
286
|
return andConditions;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import { IVirtuals } from '../virtuals';
|
|
3
3
|
import { factory } from '../../../factory';
|
|
4
|
-
type IDocType = (factory.assetTransaction.ITransaction<factory.assetTransactionType.CancelReservation> | factory.assetTransaction.ITransaction<factory.assetTransactionType.
|
|
4
|
+
type IDocType = (factory.assetTransaction.ITransaction<factory.assetTransactionType.CancelReservation> | factory.assetTransaction.ITransaction<factory.assetTransactionType.Pay> | factory.assetTransaction.ITransaction<factory.assetTransactionType.Refund> | factory.assetTransaction.ITransaction<factory.assetTransactionType.Reserve>) & {
|
|
5
5
|
seller?: any;
|
|
6
6
|
};
|
|
7
7
|
type IModel = Model<IDocType, Record<string, never>, Record<string, never>, IVirtuals>;
|
|
@@ -70,16 +70,6 @@ export declare class ProductRepo {
|
|
|
70
70
|
id: string;
|
|
71
71
|
}[];
|
|
72
72
|
}>;
|
|
73
|
-
/**
|
|
74
|
-
* プロダクトIDからavailableChannelを取得する
|
|
75
|
-
*/
|
|
76
|
-
findAvailableChannel(params: {
|
|
77
|
-
project: {
|
|
78
|
-
id: string;
|
|
79
|
-
};
|
|
80
|
-
typeOf: factory.service.paymentService.PaymentServiceType.PaymentCard;
|
|
81
|
-
id: string;
|
|
82
|
-
}): Promise<factory.product.IAvailableChannel>;
|
|
83
73
|
/**
|
|
84
74
|
* 指定カタログの設定されたプロダクトを削除する
|
|
85
75
|
*/
|
|
@@ -317,28 +317,34 @@ class ProductRepo {
|
|
|
317
317
|
}
|
|
318
318
|
return {};
|
|
319
319
|
}
|
|
320
|
-
/**
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
async findAvailableChannel(params
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}
|
|
320
|
+
// /**
|
|
321
|
+
// * プロダクトIDからavailableChannelを取得する
|
|
322
|
+
// */
|
|
323
|
+
// public async findAvailableChannel(params: {
|
|
324
|
+
// project: { id: string };
|
|
325
|
+
// typeOf: factory.service.paymentService.PaymentServiceType.PaymentCard;
|
|
326
|
+
// id: string;
|
|
327
|
+
// }): Promise<factory.product.IAvailableChannel> {
|
|
328
|
+
// const paymentService = (await this.projectFields(
|
|
329
|
+
// {
|
|
330
|
+
// limit: 1,
|
|
331
|
+
// page: 1,
|
|
332
|
+
// project: { id: { $eq: params.project.id } },
|
|
333
|
+
// typeOf: { $eq: factory.product.ProductType.PaymentCard },
|
|
334
|
+
// id: { $eq: params.id }
|
|
335
|
+
// },
|
|
336
|
+
// ['availableChannel']
|
|
337
|
+
// // []
|
|
338
|
+
// ) as Pick<factory.product.IProduct, 'availableChannel'>[]).shift();
|
|
339
|
+
// if (paymentService === undefined) {
|
|
340
|
+
// throw new factory.errors.NotFound('PaymentService');
|
|
341
|
+
// }
|
|
342
|
+
// const availableChannel = paymentService.availableChannel;
|
|
343
|
+
// if (availableChannel === undefined) {
|
|
344
|
+
// throw new factory.errors.NotFound('paymentService.availableChannel');
|
|
345
|
+
// }
|
|
346
|
+
// return availableChannel;
|
|
347
|
+
// }
|
|
342
348
|
/**
|
|
343
349
|
* 指定カタログの設定されたプロダクトを削除する
|
|
344
350
|
*/
|
|
@@ -31,7 +31,7 @@ type ICreatingTask = Pick<factory.task.IAttributes<factory.taskName>, 'data' | '
|
|
|
31
31
|
export declare class TaskRepo {
|
|
32
32
|
readonly taskModel: IModel;
|
|
33
33
|
constructor(connection: Connection);
|
|
34
|
-
static CREATE_MONGO_CONDITIONS(params: factory.task.ISearchConditions): FilterQuery<import("@chevre/factory/lib/chevre/task").ITask | import("@chevre/factory/lib/chevre/task/
|
|
34
|
+
static CREATE_MONGO_CONDITIONS(params: factory.task.ISearchConditions): FilterQuery<import("@chevre/factory/lib/chevre/task").ITask | import("@chevre/factory/lib/chevre/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/createAccountingReport").ITask | import("@chevre/factory/lib/chevre/task/deletePerson").ITask | import("@chevre/factory/lib/chevre/task/deleteTransaction").ITask | import("@chevre/factory/lib/chevre/task/onAssetTransactionStatusChanged").ITask | import("@chevre/factory/lib/chevre/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/chevre/task/onEventChanged").ITask | import("@chevre/factory/lib/chevre/task/onResourceDeleted").ITask | import("@chevre/factory/lib/chevre/task/onResourceUpdated").ITask | import("@chevre/factory/lib/chevre/task/onOrderPaymentCompleted").ITask | import("@chevre/factory/lib/chevre/task/placeOrder").ITask | import("@chevre/factory/lib/chevre/task/returnOrder").ITask | import("@chevre/factory/lib/chevre/task/returnPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/chevre/task/sendEmailMessage").ITask | import("@chevre/factory/lib/chevre/task/sendOrder").ITask | import("@chevre/factory/lib/chevre/task/triggerWebhook").ITask | import("@chevre/factory/lib/chevre/task/useReservation").ITask | import("@chevre/factory/lib/chevre/task/voidPayTransaction").ITask | import("@chevre/factory/lib/chevre/task/voidReserveTransaction").ITask>[];
|
|
35
35
|
runImmediately(params: Pick<factory.task.IAttributes<factory.taskName>, 'data' | 'expires' | 'name' | 'project' | 'remainingNumberOfTries' | 'runsAt'> & {
|
|
36
36
|
alternateName?: never;
|
|
37
37
|
identifier?: never;
|
|
@@ -11,7 +11,6 @@ import type { AcceptCOAOfferActionRepo } from './repo/action/acceptCOAOffer';
|
|
|
11
11
|
import type { AcceptPayActionRepo } from './repo/action/acceptPay';
|
|
12
12
|
import type { AuthorizeInvoiceActionRepo } from './repo/action/authorizeInvoice';
|
|
13
13
|
import type { AuthorizeOfferActionRepo } from './repo/action/authorizeOffer';
|
|
14
|
-
import type { AuthorizeProductOfferActionRepo } from './repo/action/authorizeProductOffer';
|
|
15
14
|
import type { AuthorizePaymentMethodActionRepo } from './repo/action/authorizePaymentMethod';
|
|
16
15
|
import type { AuthorizeTicketedObjectActionRepo } from './repo/action/authorizeTicketedObject';
|
|
17
16
|
import type { CheckMovieTicketActionRepo } from './repo/action/checkMovieTicket';
|
|
@@ -145,10 +144,6 @@ export declare namespace action {
|
|
|
145
144
|
namespace AuthorizeOffer {
|
|
146
145
|
function createInstance(...params: ConstructorParameters<typeof AuthorizeOfferActionRepo>): Promise<AuthorizeOfferActionRepo>;
|
|
147
146
|
}
|
|
148
|
-
type AuthorizeProductOffer = AuthorizeProductOfferActionRepo;
|
|
149
|
-
namespace AuthorizeProductOffer {
|
|
150
|
-
function createInstance(...params: ConstructorParameters<typeof AuthorizeProductOfferActionRepo>): Promise<AuthorizeProductOfferActionRepo>;
|
|
151
|
-
}
|
|
152
147
|
type AuthorizePaymentMethod = AuthorizePaymentMethodActionRepo;
|
|
153
148
|
namespace AuthorizePaymentMethod {
|
|
154
149
|
function createInstance(...params: ConstructorParameters<typeof AuthorizePaymentMethodActionRepo>): Promise<AuthorizePaymentMethodActionRepo>;
|
package/lib/chevre/repository.js
CHANGED
|
@@ -114,17 +114,6 @@ var action;
|
|
|
114
114
|
}
|
|
115
115
|
AuthorizeOffer.createInstance = createInstance;
|
|
116
116
|
})(AuthorizeOffer = action.AuthorizeOffer || (action.AuthorizeOffer = {}));
|
|
117
|
-
let AuthorizeProductOffer;
|
|
118
|
-
(function (AuthorizeProductOffer) {
|
|
119
|
-
let repo;
|
|
120
|
-
async function createInstance(...params) {
|
|
121
|
-
if (repo === undefined) {
|
|
122
|
-
repo = (await import('./repo/action/authorizeProductOffer.js')).AuthorizeProductOfferActionRepo;
|
|
123
|
-
}
|
|
124
|
-
return new repo(...params);
|
|
125
|
-
}
|
|
126
|
-
AuthorizeProductOffer.createInstance = createInstance;
|
|
127
|
-
})(AuthorizeProductOffer = action.AuthorizeProductOffer || (action.AuthorizeProductOffer = {}));
|
|
128
117
|
let AuthorizePaymentMethod;
|
|
129
118
|
(function (AuthorizePaymentMethod) {
|
|
130
119
|
let repo;
|
|
@@ -184,7 +184,7 @@ function getPaymentServiceId(params) {
|
|
|
184
184
|
case factory_1.factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
185
185
|
// 対面決済は特に何もしない
|
|
186
186
|
break;
|
|
187
|
-
case
|
|
187
|
+
// case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
188
188
|
case factory_1.factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
189
189
|
case factory_1.factory.service.paymentService.PaymentServiceType.MovieTicket:
|
|
190
190
|
// リクエストでの指定を必須化(2022-04-12~)
|
|
@@ -89,13 +89,13 @@ function createStartParams(params, options) {
|
|
|
89
89
|
// });
|
|
90
90
|
// currencyはデフォルトでJPY
|
|
91
91
|
let paymentMethodCurrency = factory_1.factory.priceCurrency.JPY;
|
|
92
|
-
if (params.paymentServiceType ===
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
98
|
-
|
|
92
|
+
// if (params.paymentServiceType === factory.service.paymentService.PaymentServiceType.PaymentCard) {
|
|
93
|
+
// const paymentCardServiceOutputCurrency = (params.paymentService as factory.product.IProduct)?.serviceOutput?.amount?.currency;
|
|
94
|
+
// if (typeof paymentCardServiceOutputCurrency === 'string') {
|
|
95
|
+
// paymentMethodCurrency = paymentCardServiceOutputCurrency;
|
|
96
|
+
// }
|
|
97
|
+
// } else
|
|
98
|
+
if (params.paymentServiceType === factory_1.factory.service.paymentService.PaymentServiceType.CreditCard) {
|
|
99
99
|
const creditCardPaymentServiceOutput = params.paymentService?.serviceOutput;
|
|
100
100
|
const invoiceAsServiceOutput = (Array.isArray(creditCardPaymentServiceOutput))
|
|
101
101
|
? creditCardPaymentServiceOutput.find((output) => output?.typeOf === 'Invoice')
|
|
@@ -13,7 +13,7 @@ function getPaymentServiceId(params) {
|
|
|
13
13
|
case factory_1.factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
14
14
|
// 対面決済は特に何もしない
|
|
15
15
|
break;
|
|
16
|
-
case
|
|
16
|
+
// case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
17
17
|
case factory_1.factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
18
18
|
case factory_1.factory.service.paymentService.PaymentServiceType.MovieTicket:
|
|
19
19
|
// リクエストでの指定を必須化(2022-04-12~)
|
|
@@ -33,21 +33,23 @@ function fixPaymentService(params) {
|
|
|
33
33
|
// no op
|
|
34
34
|
// FaceToFaceの場合プロダクトは存在しない
|
|
35
35
|
break;
|
|
36
|
-
// PaymentCardの場合、プロダクト検索
|
|
37
|
-
case
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
// // PaymentCardの場合、プロダクト検索
|
|
37
|
+
// case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
38
|
+
// paymentService = (await repos.product.projectFields(
|
|
39
|
+
// {
|
|
40
|
+
// limit: 1,
|
|
41
|
+
// page: 1,
|
|
42
|
+
// project: { id: { $eq: params.project.id } },
|
|
43
|
+
// typeOf: { $eq: factory.product.ProductType.PaymentCard },
|
|
44
|
+
// id: { $eq: getPaymentServiceId(params) }
|
|
45
|
+
// },
|
|
46
|
+
// ['availableChannel', 'serviceOutput', 'serviceType', 'potentialAction']
|
|
47
|
+
// // []
|
|
48
|
+
// ) as Pick<factory.product.IProduct, 'availableChannel' | 'id' | 'serviceOutput' | 'serviceType' | 'potentialAction'>[]).shift();
|
|
49
|
+
// if (paymentService === undefined) {
|
|
50
|
+
// throw new factory.errors.NotFound('PaymentService');
|
|
51
|
+
// }
|
|
52
|
+
// break;
|
|
51
53
|
default:
|
|
52
54
|
paymentService = (await repos.paymentService.projectFields({
|
|
53
55
|
limit: 1,
|
|
@@ -58,8 +58,8 @@ function start(params) {
|
|
|
58
58
|
switch (paymentServiceType) {
|
|
59
59
|
case factory_1.factory.service.paymentService.PaymentServiceType.FaceToFace:
|
|
60
60
|
break;
|
|
61
|
-
case
|
|
62
|
-
|
|
61
|
+
// case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
62
|
+
// break;
|
|
63
63
|
case factory_1.factory.service.paymentService.PaymentServiceType.CreditCard:
|
|
64
64
|
break;
|
|
65
65
|
case factory_1.factory.service.paymentService.PaymentServiceType.MovieTicket:
|
|
@@ -81,21 +81,23 @@ function fixPaymentService(params) {
|
|
|
81
81
|
// no op
|
|
82
82
|
// FaceToFaceの場合プロダクトは存在しない
|
|
83
83
|
break;
|
|
84
|
-
// PaymentCardの場合、プロダクト検索
|
|
85
|
-
case
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
84
|
+
// // PaymentCardの場合、プロダクト検索
|
|
85
|
+
// case factory.service.paymentService.PaymentServiceType.PaymentCard:
|
|
86
|
+
// paymentService = (await repos.product.projectFields(
|
|
87
|
+
// {
|
|
88
|
+
// limit: 1,
|
|
89
|
+
// page: 1,
|
|
90
|
+
// project: { id: { $eq: params.payAction.project.id } },
|
|
91
|
+
// typeOf: { $eq: factory.product.ProductType.PaymentCard },
|
|
92
|
+
// id: { $eq: paymentServiceId }
|
|
93
|
+
// },
|
|
94
|
+
// ['availableChannel', 'typeOf', 'potentialAction']
|
|
95
|
+
// // []
|
|
96
|
+
// ) as Pick<factory.product.IProduct, 'availableChannel' | 'typeOf' | 'potentialAction'>[]).shift();
|
|
97
|
+
// if (paymentService === undefined) {
|
|
98
|
+
// throw new factory.errors.NotFound('PaymentService');
|
|
99
|
+
// }
|
|
100
|
+
// break;
|
|
99
101
|
default:
|
|
100
102
|
paymentService = (await repos.paymentService.projectFields({
|
|
101
103
|
limit: 1,
|