@chevre/domain 24.0.0-alpha.78 → 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 +3 -3
- 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 -27
- package/lib/chevre/repo/assetTransaction.js +21 -21
- package/lib/chevre/repo/mongoose/schemas/assetTransaction.d.ts +1 -1
- 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.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/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 +22 -18
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +20 -20
- 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/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/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 +4 -2
- 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/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 -14
- package/lib/chevre/service/assetTransaction/registerService/factory.js +0 -140
- package/lib/chevre/service/assetTransaction/registerService/potentialActions.d.ts +0 -8
- package/lib/chevre/service/assetTransaction/registerService/potentialActions.js +0 -120
- package/lib/chevre/service/assetTransaction/registerService.d.ts +0 -54
- package/lib/chevre/service/assetTransaction/registerService.js +0 -274
- 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
|
@@ -2,7 +2,7 @@ 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.
|
|
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 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;
|
|
@@ -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.Pay | factory.assetTransactionType.Refund | 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/pay").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/refund").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/pay").ITransaction | import("@chevre/factory/lib/chevre/assetTransaction/refund").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でタスクをエクスポート済に変更する
|
|
@@ -243,14 +243,6 @@ export declare class AssetTransactionRepo {
|
|
|
243
243
|
_id: import("mongoose").Types.ObjectId;
|
|
244
244
|
} & {
|
|
245
245
|
__v: number;
|
|
246
|
-
}) | (import("@chevre/factory/lib/chevre/assetTransaction/registerService").IAttributes & {
|
|
247
|
-
id: string;
|
|
248
|
-
} & {
|
|
249
|
-
seller?: any;
|
|
250
|
-
} & {
|
|
251
|
-
_id: import("mongoose").Types.ObjectId;
|
|
252
|
-
} & {
|
|
253
|
-
__v: number;
|
|
254
246
|
}) | (import("@chevre/factory/lib/chevre/assetTransaction/reserve").IAttributes & {
|
|
255
247
|
id: string;
|
|
256
248
|
} & {
|
|
@@ -301,14 +293,6 @@ export declare class AssetTransactionRepo {
|
|
|
301
293
|
_id: import("mongoose").Types.ObjectId;
|
|
302
294
|
} & {
|
|
303
295
|
__v: number;
|
|
304
|
-
}) | (import("@chevre/factory/lib/chevre/assetTransaction/registerService").IAttributes & {
|
|
305
|
-
id: string;
|
|
306
|
-
} & {
|
|
307
|
-
seller?: any;
|
|
308
|
-
} & {
|
|
309
|
-
_id: import("mongoose").Types.ObjectId;
|
|
310
|
-
} & {
|
|
311
|
-
__v: number;
|
|
312
296
|
}) | (import("@chevre/factory/lib/chevre/assetTransaction/reserve").IAttributes & {
|
|
313
297
|
id: string;
|
|
314
298
|
} & {
|
|
@@ -341,14 +325,6 @@ export declare class AssetTransactionRepo {
|
|
|
341
325
|
_id: import("mongoose").Types.ObjectId;
|
|
342
326
|
} & {
|
|
343
327
|
__v: number;
|
|
344
|
-
}) | (import("@chevre/factory/lib/chevre/assetTransaction/registerService").IAttributes & {
|
|
345
|
-
id: string;
|
|
346
|
-
} & {
|
|
347
|
-
seller?: any;
|
|
348
|
-
} & {
|
|
349
|
-
_id: import("mongoose").Types.ObjectId;
|
|
350
|
-
} & {
|
|
351
|
-
__v: number;
|
|
352
328
|
}) | (import("@chevre/factory/lib/chevre/assetTransaction/reserve").IAttributes & {
|
|
353
329
|
id: string;
|
|
354
330
|
} & {
|
|
@@ -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.Pay> | factory.assetTransaction.ITransaction<factory.assetTransactionType.Refund> | 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>;
|
|
@@ -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;
|
|
@@ -4,12 +4,10 @@ import type { TaskRepo } from '../repo/task';
|
|
|
4
4
|
import * as CancelReservationTransactionService from './assetTransaction/cancelReservation';
|
|
5
5
|
import * as PayTransactionService from './assetTransaction/pay';
|
|
6
6
|
import * as RefundTransactionService from './assetTransaction/refund';
|
|
7
|
-
import * as RegisterServiceTransactionService from './assetTransaction/registerService';
|
|
8
7
|
import * as ReserveTransactionService from './assetTransaction/reserve';
|
|
9
8
|
export import cancelReservation = CancelReservationTransactionService;
|
|
10
9
|
export import pay = PayTransactionService;
|
|
11
10
|
export import refund = RefundTransactionService;
|
|
12
|
-
export import registerService = RegisterServiceTransactionService;
|
|
13
11
|
export import reserve = ReserveTransactionService;
|
|
14
12
|
/**
|
|
15
13
|
* reimplement as exportOneTransactionTasksIfExists(2025-03-18~)
|
|
@@ -33,18 +33,16 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.reserve = exports.
|
|
36
|
+
exports.reserve = exports.refund = exports.pay = exports.cancelReservation = void 0;
|
|
37
37
|
exports.exportOneTransactionTasksIfExists = exportOneTransactionTasksIfExists;
|
|
38
38
|
const factory_1 = require("../factory");
|
|
39
39
|
const CancelReservationTransactionService = __importStar(require("./assetTransaction/cancelReservation"));
|
|
40
40
|
const PayTransactionService = __importStar(require("./assetTransaction/pay"));
|
|
41
41
|
const RefundTransactionService = __importStar(require("./assetTransaction/refund"));
|
|
42
|
-
const RegisterServiceTransactionService = __importStar(require("./assetTransaction/registerService"));
|
|
43
42
|
const ReserveTransactionService = __importStar(require("./assetTransaction/reserve"));
|
|
44
43
|
exports.cancelReservation = CancelReservationTransactionService;
|
|
45
44
|
exports.pay = PayTransactionService;
|
|
46
45
|
exports.refund = RefundTransactionService;
|
|
47
|
-
exports.registerService = RegisterServiceTransactionService;
|
|
48
46
|
exports.reserve = ReserveTransactionService;
|
|
49
47
|
/**
|
|
50
48
|
* reimplement as exportOneTransactionTasksIfExists(2025-03-18~)
|
|
@@ -87,13 +85,13 @@ function exportOneTransactionTasksIfExists(params) {
|
|
|
87
85
|
runsTasksAfterInSeconds: params.runsTasksAfterInSeconds
|
|
88
86
|
})(repos);
|
|
89
87
|
break;
|
|
90
|
-
case
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
// case factory.assetTransactionType.RegisterService:
|
|
89
|
+
// // createdTasks =
|
|
90
|
+
// await RegisterServiceTransactionService.exportTasksById({
|
|
91
|
+
// id: transaction.id
|
|
92
|
+
// // runsTasksAfterInSeconds: params.runsTasksAfterInSeconds
|
|
93
|
+
// })(repos);
|
|
94
|
+
// break;
|
|
97
95
|
case factory_1.factory.assetTransactionType.Reserve:
|
|
98
96
|
// createdTasks =
|
|
99
97
|
await ReserveTransactionService.exportTasksById({
|
|
@@ -7,8 +7,8 @@ exports.createOwnershipInfosFromOrder = createOwnershipInfosFromOrder;
|
|
|
7
7
|
const moment_timezone_1 = __importDefault(require("moment-timezone"));
|
|
8
8
|
const util_1 = require("util");
|
|
9
9
|
const factory_1 = require("../../factory");
|
|
10
|
-
|
|
11
|
-
const
|
|
10
|
+
// import { createProductOwnershipInfo } from './product/factory';
|
|
11
|
+
const factory_2 = require("./reservation/factory");
|
|
12
12
|
/**
|
|
13
13
|
* 注文から所有権を作成する
|
|
14
14
|
*/
|
|
@@ -40,7 +40,7 @@ function createOwnershipInfosFromOrder(params) {
|
|
|
40
40
|
// bookingService:COAでは作成しない(2024-12-31~)
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
|
-
ownershipInfo = (0,
|
|
43
|
+
ownershipInfo = (0, factory_2.createReservationOwnershipInfo)({
|
|
44
44
|
project: params.order.project,
|
|
45
45
|
ownedBy: ownedBy,
|
|
46
46
|
acceptedOffer: { ...acceptedOffer, itemOffered },
|
|
@@ -51,16 +51,16 @@ function createOwnershipInfosFromOrder(params) {
|
|
|
51
51
|
}
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
|
-
case
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
// case factory.permit.PermitType.Permit:
|
|
55
|
+
// ownershipInfo = createProductOwnershipInfo({
|
|
56
|
+
// project: params.order.project,
|
|
57
|
+
// ownedBy: ownedBy,
|
|
58
|
+
// acceptedOffer: { ...acceptedOffer, itemOffered },
|
|
59
|
+
// ownedFrom: ownedFrom,
|
|
60
|
+
// identifier: identifier,
|
|
61
|
+
// acquiredFrom: acquiredFrom
|
|
62
|
+
// });
|
|
63
|
+
// break;
|
|
64
64
|
// case factory.actionType.MoneyTransfer:
|
|
65
65
|
// // no op
|
|
66
66
|
// // 所有権は発生しない
|
|
@@ -4,7 +4,7 @@ interface IAcceptOfferOperationRepos {
|
|
|
4
4
|
orderInTransaction: OrderInTransactionRepo;
|
|
5
5
|
}
|
|
6
6
|
type IAcceptOfferOperation<T> = (repos: IAcceptOfferOperationRepos) => Promise<T>;
|
|
7
|
-
export type IAuthorizeActionWithInstrument = Pick<factory.action.authorize.offer.
|
|
7
|
+
export type IAuthorizeActionWithInstrument = Pick<factory.action.authorize.offer.eventService.IAction, 'instrument'>;
|
|
8
8
|
export declare function acceptOffer(params: {
|
|
9
9
|
orderNumber: string;
|
|
10
10
|
project: {
|
|
@@ -1,37 +1,7 @@
|
|
|
1
1
|
import { factory } from '../../factory';
|
|
2
|
-
import type { AccountRepo } from '../../repo/account';
|
|
3
|
-
import type { AuthorizeProductOfferActionRepo } from '../../repo/action/authorizeProductOffer';
|
|
4
|
-
import type { AssetTransactionRepo } from '../../repo/assetTransaction';
|
|
5
2
|
import type { OfferRepo } from '../../repo/offer/unitPriceInCatalog';
|
|
6
3
|
import type { OfferCatalogRepo } from '../../repo/offerCatalog';
|
|
7
|
-
import type { OrderInTransactionRepo } from '../../repo/orderInTransaction';
|
|
8
|
-
import type { OrderNumberRepo } from '../../repo/orderNumber';
|
|
9
|
-
import type { OwnershipInfoRepo } from '../../repo/ownershipInfo';
|
|
10
4
|
import type { ProductRepo } from '../../repo/product';
|
|
11
|
-
import type { ProjectRepo } from '../../repo/project';
|
|
12
|
-
import type { ServiceOutputRepo } from '../../repo/serviceOutput';
|
|
13
|
-
import type { ServiceOutputIdentifierRepo } from '../../repo/serviceOutputIdentifier';
|
|
14
|
-
import type { PlaceOrderRepo } from '../../repo/transaction/placeOrder';
|
|
15
|
-
import type { TransactionNumberRepo } from '../../repo/transactionNumber';
|
|
16
|
-
export interface IAuthorizeOperationRepos {
|
|
17
|
-
account: AccountRepo;
|
|
18
|
-
action?: never;
|
|
19
|
-
authorizeProductOfferAction: AuthorizeProductOfferActionRepo;
|
|
20
|
-
assetTransaction: AssetTransactionRepo;
|
|
21
|
-
offer: OfferRepo;
|
|
22
|
-
offerCatalog: OfferCatalogRepo;
|
|
23
|
-
orderInTransaction: OrderInTransactionRepo;
|
|
24
|
-
orderNumber: OrderNumberRepo;
|
|
25
|
-
ownershipInfo: OwnershipInfoRepo;
|
|
26
|
-
product: ProductRepo;
|
|
27
|
-
project: ProjectRepo;
|
|
28
|
-
serviceOutput: ServiceOutputRepo;
|
|
29
|
-
serviceOutputIdentifier: ServiceOutputIdentifierRepo;
|
|
30
|
-
placeOrder: PlaceOrderRepo;
|
|
31
|
-
transactionNumber: TransactionNumberRepo;
|
|
32
|
-
}
|
|
33
|
-
export type IAuthorizeOperation<T> = (repos: IAuthorizeOperationRepos) => Promise<T>;
|
|
34
|
-
export declare const ERROR_MESSAGE_ALREADY_REGISTERED = "Already registered";
|
|
35
5
|
/**
|
|
36
6
|
* プロダクトオファーを検索する
|
|
37
7
|
*/
|
|
@@ -68,35 +38,3 @@ export declare function search(params: {
|
|
|
68
38
|
offers: factory.product.ITicketOffer[];
|
|
69
39
|
product: Pick<factory.product.IProduct, "id" | "productID" | "typeOf" | "name" | "project" | "serviceOutput" | "serviceType" | "description">;
|
|
70
40
|
}>;
|
|
71
|
-
export type IAuthorizeOfferAction = factory.action.authorize.offer.product.IAction;
|
|
72
|
-
/**
|
|
73
|
-
* サービス(Chevreプロダクト)オファー承認
|
|
74
|
-
*/
|
|
75
|
-
export declare function authorize(params: {
|
|
76
|
-
project: {
|
|
77
|
-
id: string;
|
|
78
|
-
typeOf: factory.organizationType.Project;
|
|
79
|
-
};
|
|
80
|
-
object: factory.action.authorize.offer.product.IAcceptedOffer[];
|
|
81
|
-
agent: {
|
|
82
|
-
id: string;
|
|
83
|
-
typeOf: factory.personType.Person | factory.creativeWorkType.WebApplication;
|
|
84
|
-
};
|
|
85
|
-
/**
|
|
86
|
-
* 利用アプリケーション
|
|
87
|
-
*/
|
|
88
|
-
location?: {
|
|
89
|
-
id?: string;
|
|
90
|
-
};
|
|
91
|
-
transaction: {
|
|
92
|
-
id: string;
|
|
93
|
-
};
|
|
94
|
-
}): IAuthorizeOperation<Pick<IAuthorizeOfferAction, 'id'> & {
|
|
95
|
-
result: IAuthorizeOfferAction['result'];
|
|
96
|
-
}>;
|
|
97
|
-
export declare function voidTransaction(params: factory.task.IData<factory.taskName.VoidRegisterServiceTransaction>): (repos: {
|
|
98
|
-
action?: never;
|
|
99
|
-
authorizeProductOfferAction: AuthorizeProductOfferActionRepo;
|
|
100
|
-
assetTransaction: AssetTransactionRepo;
|
|
101
|
-
placeOrder: PlaceOrderRepo;
|
|
102
|
-
}) => Promise<void>;
|