@chevre/domain 24.0.0-alpha.31 → 24.0.0-alpha.33
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/factory/transaction.d.ts +0 -3
- package/lib/chevre/repo/action/actionProcess.d.ts +1 -1
- package/lib/chevre/repo/action.d.ts +1 -1
- package/lib/chevre/repo/aggregateAction.js +1 -1
- package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +1 -1
- package/lib/chevre/repo/mongoose/schemas/transaction.d.ts +1 -2
- package/lib/chevre/repo/order.js +2 -1
- package/lib/chevre/repo/passport.d.ts +1 -1
- package/lib/chevre/repo/reservation.d.ts +6 -24
- package/lib/chevre/repo/reservation.js +35 -48
- package/lib/chevre/repo/task.d.ts +1 -1
- package/lib/chevre/repo/transaction.d.ts +1 -39
- package/lib/chevre/repository.d.ts +0 -10
- package/lib/chevre/repository.js +0 -22
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +1 -17
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.js +1 -41
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createStartParams.js +1 -11
- package/lib/chevre/service/assetTransaction/reserve/start.js +2 -5
- package/lib/chevre/service/delivery/factory.js +4 -5
- package/lib/chevre/service/delivery/reservation/factory.js +8 -13
- package/lib/chevre/service/offer/any.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize/factory.js +0 -38
- package/lib/chevre/service/offer/event/authorize.js +19 -18
- package/lib/chevre/service/offer.d.ts +1 -2
- package/lib/chevre/service/offer.js +1 -3
- package/lib/chevre/service/order/deleteOrder.js +1 -1
- 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 +54 -37
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned/factory.d.ts +1 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderReturned.js +78 -64
- 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 -6
- package/lib/chevre/service/reserve/cancelReservation.js +4 -11
- package/lib/chevre/service/reserve/findByCode.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +1 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +1 -0
- package/lib/chevre/service/reserve/searchByOrder.d.ts +1 -1
- package/lib/chevre/service/task/deletePerson.js +0 -1
- package/lib/chevre/service/task/deleteTransaction.js +0 -2
- package/lib/chevre/service/transaction/deleteTransaction.d.ts +0 -2
- package/lib/chevre/service/transaction/deleteTransaction.js +2 -47
- 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 -3
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +3 -3
- package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +4 -6
- package/lib/chevre/service/transaction/placeOrder/confirm.js +13 -20
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +1 -15
- package/lib/chevre/service/transaction.d.ts +0 -4
- package/lib/chevre/service/transaction.js +1 -11
- package/lib/chevre/service/validation/validateOrder.js +3 -5
- package/package.json +3 -3
- package/lib/chevre/repo/action/authorizeMoneyTransferOffer.d.ts +0 -40
- package/lib/chevre/repo/action/authorizeMoneyTransferOffer.js +0 -61
- package/lib/chevre/repo/transaction/moneyTransfer.d.ts +0 -61
- package/lib/chevre/repo/transaction/moneyTransfer.js +0 -379
- package/lib/chevre/service/offer/moneyTransfer/authorize.d.ts +0 -38
- package/lib/chevre/service/offer/moneyTransfer/authorize.js +0 -250
- package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.d.ts +0 -16
- package/lib/chevre/service/offer/moneyTransfer/returnMoneyTransfer.js +0 -96
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.d.ts +0 -9
- package/lib/chevre/service/offer/moneyTransfer/settleTransaction.js +0 -91
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.d.ts +0 -10
- package/lib/chevre/service/offer/moneyTransfer/voidTransaction.js +0 -81
- package/lib/chevre/service/offer/moneyTransfer.d.ts +0 -5
- package/lib/chevre/service/offer/moneyTransfer.js +0 -11
- package/lib/chevre/service/task/confirmMoneyTransfer.d.ts +0 -6
- package/lib/chevre/service/task/confirmMoneyTransfer.js +0 -19
- package/lib/chevre/service/task/returnMoneyTransfer.d.ts +0 -6
- package/lib/chevre/service/task/returnMoneyTransfer.js +0 -55
- package/lib/chevre/service/task/voidMoneyTransferTransaction.d.ts +0 -6
- package/lib/chevre/service/task/voidMoneyTransferTransaction.js +0 -27
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.d.ts +0 -9
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +0 -138
- package/lib/chevre/service/transaction/moneyTransfer/factory.d.ts +0 -2
- package/lib/chevre/service/transaction/moneyTransfer/factory.js +0 -55
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.d.ts +0 -9
- package/lib/chevre/service/transaction/moneyTransfer/potentialActions.js +0 -65
- package/lib/chevre/service/transaction/moneyTransfer.d.ts +0 -72
- package/lib/chevre/service/transaction/moneyTransfer.js +0 -649
|
@@ -2,9 +2,6 @@ import * as factory from '../factory';
|
|
|
2
2
|
export type IPassportValidator = (params: {
|
|
3
3
|
passport: factory.waiter.passport.IPassport;
|
|
4
4
|
}) => boolean;
|
|
5
|
-
export declare namespace moneyTransfer {
|
|
6
|
-
type IStartParams = factory.transaction.moneyTransfer.IStartParamsWithoutDetail & {};
|
|
7
|
-
}
|
|
8
5
|
export declare namespace placeOrder {
|
|
9
6
|
type IStartParams = factory.transaction.placeOrder.IStartParamsWithoutDetail & {
|
|
10
7
|
broker?: factory.order.IBroker;
|
|
@@ -2,7 +2,7 @@ import { Connection } from 'mongoose';
|
|
|
2
2
|
import * as 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.offer.
|
|
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.offer.product.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.MoneyTransfer ? factory.action.transfer.moneyTransfer.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;
|
|
@@ -2,7 +2,7 @@ import { FilterQuery, UpdateQuery } from 'mongoose';
|
|
|
2
2
|
import * as 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.offer.
|
|
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.offer.product.IAction | factory.action.authorize.paymentMethod.any.IAction) : never;
|
|
6
6
|
export { ICancelActionAction };
|
|
7
7
|
/**
|
|
8
8
|
* 汎用アクションリポジトリで開始可能なアクションタイプ
|
|
@@ -187,7 +187,7 @@ class AggregateActionRepo {
|
|
|
187
187
|
'object.typeOf': {
|
|
188
188
|
$exists: true,
|
|
189
189
|
$in: [
|
|
190
|
-
factory.reservationType.BusReservation,
|
|
190
|
+
// factory.reservationType.BusReservation,
|
|
191
191
|
factory.reservationType.EventReservation,
|
|
192
192
|
factory.reservationType.ReservationPackage
|
|
193
193
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import { IVirtuals } from '../virtuals';
|
|
3
3
|
import * as factory from '../../../factory';
|
|
4
|
-
type IDocType = (Omit<factory.reservation.IReservation<factory.reservationType.
|
|
4
|
+
type IDocType = (Omit<factory.reservation.IReservation<factory.reservationType.EventReservation>, 'id'>) & {
|
|
5
5
|
_id: string;
|
|
6
6
|
bookingAgent?: any;
|
|
7
7
|
previousReservationStatus?: factory.reservationStatusType;
|
|
@@ -3,8 +3,7 @@ import { IVirtuals } from '../virtuals';
|
|
|
3
3
|
import * as factory from '../../../factory';
|
|
4
4
|
type IPlaceOrder = Omit<factory.transaction.placeOrder.ITransaction, 'id'>;
|
|
5
5
|
type IReturnOrder = Omit<factory.transaction.returnOrder.ITransaction, 'id'>;
|
|
6
|
-
type
|
|
7
|
-
type IDocType = IPlaceOrder | IReturnOrder | IMoneyTransfer;
|
|
6
|
+
type IDocType = IPlaceOrder | IReturnOrder;
|
|
8
7
|
type IModel = Model<IDocType, {}, {}, IVirtuals>;
|
|
9
8
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
10
9
|
type ISchema = Schema<IDocType, IModel, {}, {}, IVirtuals, {}, ISchemaDefinition, IDocType>;
|
package/lib/chevre/repo/order.js
CHANGED
|
@@ -949,7 +949,8 @@ class OrderRepo {
|
|
|
949
949
|
typeOf: { $eq: factory.order.OrderType.Order },
|
|
950
950
|
acceptedOffers: {
|
|
951
951
|
$elemMatch: {
|
|
952
|
-
'itemOffered.typeOf': { $in: [factory.reservationType.BusReservation, factory.reservationType.EventReservation] },
|
|
952
|
+
// 'itemOffered.typeOf': { $in: [factory.reservationType.BusReservation, factory.reservationType.EventReservation] },
|
|
953
|
+
'itemOffered.typeOf': { $in: [factory.reservationType.EventReservation] },
|
|
953
954
|
'itemOffered.id': { $eq: params.reservationId }
|
|
954
955
|
}
|
|
955
956
|
},
|
|
@@ -20,7 +20,7 @@ interface IOptions {
|
|
|
20
20
|
secret: string;
|
|
21
21
|
passportValidator?: IPassportValidator;
|
|
22
22
|
}
|
|
23
|
-
type IStartParams = (factory.transaction.placeOrder.IStartParamsWithoutDetail
|
|
23
|
+
type IStartParams = (factory.transaction.placeOrder.IStartParamsWithoutDetail) & {};
|
|
24
24
|
/**
|
|
25
25
|
* 取引許可証リポジトリ
|
|
26
26
|
*/
|
|
@@ -7,12 +7,10 @@ export interface IUpdatePartiallyParams {
|
|
|
7
7
|
}
|
|
8
8
|
export type ICancelResult = UpdateWriteOpResult;
|
|
9
9
|
export type ICheckedInResult = UpdateWriteOpResult;
|
|
10
|
-
export type ICreatingReservation<T extends factory.reservationType> = T extends factory.reservationType.
|
|
11
|
-
_id: string;
|
|
12
|
-
} : T extends factory.reservationType.EventReservation ? (Omit<factory.reservation.eventReservation.IReservation, 'id'>) & {
|
|
10
|
+
export type ICreatingReservation<T extends factory.reservationType> = T extends factory.reservationType.EventReservation ? (Omit<factory.reservation.eventReservation.IReservation, 'id'>) & {
|
|
13
11
|
_id: string;
|
|
14
12
|
} : never;
|
|
15
|
-
type IKeyOfProjection = keyof factory.reservation.IReservation<factory.reservationType.
|
|
13
|
+
type IKeyOfProjection = keyof factory.reservation.IReservation<factory.reservationType.EventReservation> | 'reservedTicket.dateUsed' | 'reservationFor.id' | 'reservationFor.typeOf';
|
|
16
14
|
export type IAttendedReservation = Pick<factory.reservation.IReservation<factory.reservationType.EventReservation>, 'id' | 'typeOf' | 'project' | 'modifiedTime'> & {
|
|
17
15
|
reservationFor: Pick<factory.reservation.IReservationFor<factory.reservationType.EventReservation>, 'id' | 'typeOf'>;
|
|
18
16
|
reservedTicket: Pick<factory.reservation.ITicket, 'dateUsed'>;
|
|
@@ -23,7 +21,7 @@ export type IAttendedReservation = Pick<factory.reservation.IReservation<factory
|
|
|
23
21
|
export declare class ReservationRepo {
|
|
24
22
|
private readonly reservationModel;
|
|
25
23
|
constructor(connection: Connection);
|
|
26
|
-
static CREATE_MONGO_CONDITIONS(params: factory.reservation.ISearchConditions<factory.reservationType>): FilterQuery<import("@chevre/factory/lib/reservation/
|
|
24
|
+
static CREATE_MONGO_CONDITIONS(params: factory.reservation.ISearchConditions<factory.reservationType>): FilterQuery<import("@chevre/factory/lib/reservation/event").IReservation | import("@chevre/factory/lib/reservation/reservationPackage").IReservation>[];
|
|
27
25
|
/**
|
|
28
26
|
* 汎用予約カウント
|
|
29
27
|
*/
|
|
@@ -126,23 +124,7 @@ export declare class ReservationRepo {
|
|
|
126
124
|
$in: string[];
|
|
127
125
|
};
|
|
128
126
|
}): Promise<string[]>;
|
|
129
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<
|
|
130
|
-
_id: string;
|
|
131
|
-
bookingAgent?: any;
|
|
132
|
-
previousReservationStatus?: factory.reservationStatusType;
|
|
133
|
-
} & Required<{
|
|
134
|
-
_id: string;
|
|
135
|
-
}> & {
|
|
136
|
-
__v: number;
|
|
137
|
-
}) | (Omit<import("@chevre/factory/lib/reservation/event").IReservation, "id"> & {
|
|
138
|
-
_id: string;
|
|
139
|
-
bookingAgent?: any;
|
|
140
|
-
previousReservationStatus?: factory.reservationStatusType;
|
|
141
|
-
} & Required<{
|
|
142
|
-
_id: string;
|
|
143
|
-
}> & {
|
|
144
|
-
__v: number;
|
|
145
|
-
}), "id"> & import("./mongoose/virtuals").IVirtuals, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, {}, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<(Omit<import("@chevre/factory/lib/reservation/busReservation").IReservation, "id"> & {
|
|
127
|
+
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, {}, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<Omit<import("@chevre/factory/lib/reservation/event").IReservation, "id"> & {
|
|
146
128
|
_id: string;
|
|
147
129
|
bookingAgent?: any;
|
|
148
130
|
previousReservationStatus?: factory.reservationStatusType;
|
|
@@ -150,7 +132,7 @@ export declare class ReservationRepo {
|
|
|
150
132
|
_id: string;
|
|
151
133
|
}> & {
|
|
152
134
|
__v: number;
|
|
153
|
-
})
|
|
135
|
+
}, "id"> & import("./mongoose/virtuals").IVirtuals, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, {}, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<Omit<import("@chevre/factory/lib/reservation/event").IReservation, "id"> & {
|
|
154
136
|
_id: string;
|
|
155
137
|
bookingAgent?: any;
|
|
156
138
|
previousReservationStatus?: factory.reservationStatusType;
|
|
@@ -158,7 +140,7 @@ export declare class ReservationRepo {
|
|
|
158
140
|
_id: string;
|
|
159
141
|
}> & {
|
|
160
142
|
__v: number;
|
|
161
|
-
}
|
|
143
|
+
}, "id"> & import("./mongoose/virtuals").IVirtuals) | null>;
|
|
162
144
|
unsetUnnecessaryFields(params: {
|
|
163
145
|
filter: any;
|
|
164
146
|
$unset: any;
|
|
@@ -221,35 +221,41 @@ class ReservationRepo {
|
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
223
|
switch (params.typeOf) {
|
|
224
|
-
case factory.reservationType.BusReservation:
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
224
|
+
// case factory.reservationType.BusReservation:
|
|
225
|
+
// const reservationForTypeOfEq = params.reservationFor?.typeOf;
|
|
226
|
+
// if (typeof reservationForTypeOfEq === 'string') {
|
|
227
|
+
// andConditions.push(
|
|
228
|
+
// {
|
|
229
|
+
// 'reservationFor.typeOf': {
|
|
230
|
+
// $exists: true,
|
|
231
|
+
// $eq: reservationForTypeOfEq
|
|
232
|
+
// }
|
|
233
|
+
// }
|
|
234
|
+
// );
|
|
235
|
+
// }
|
|
236
|
+
// const reservationForIdEq = params.reservationFor?.id?.$eq;
|
|
237
|
+
// if (typeof reservationForIdEq === 'string') {
|
|
238
|
+
// andConditions.push(
|
|
239
|
+
// {
|
|
240
|
+
// 'reservationFor.id': {
|
|
241
|
+
// $exists: true,
|
|
242
|
+
// $eq: reservationForIdEq
|
|
243
|
+
// }
|
|
244
|
+
// }
|
|
245
|
+
// );
|
|
246
|
+
// }
|
|
247
|
+
// const reservationForIdIn = params.reservationFor?.id?.$in;
|
|
248
|
+
// if (Array.isArray(reservationForIdIn)) {
|
|
249
|
+
// andConditions.push(
|
|
250
|
+
// {
|
|
251
|
+
// 'reservationFor.id': {
|
|
252
|
+
// $exists: true,
|
|
253
|
+
// $in: reservationForIdIn
|
|
254
|
+
// }
|
|
255
|
+
// }
|
|
256
|
+
// );
|
|
257
|
+
// }
|
|
258
|
+
// break;
|
|
253
259
|
case factory.reservationType.EventReservation:
|
|
254
260
|
if (typeof params.reservationFor?.id === 'string') {
|
|
255
261
|
andConditions.push({
|
|
@@ -876,25 +882,6 @@ class ReservationRepo {
|
|
|
876
882
|
params.subReservation.forEach((subReservation) => {
|
|
877
883
|
let setOnInsert;
|
|
878
884
|
switch (subReservation.typeOf) {
|
|
879
|
-
case factory.reservationType.BusReservation:
|
|
880
|
-
setOnInsert = {
|
|
881
|
-
...subReservation,
|
|
882
|
-
_id: subReservation.id,
|
|
883
|
-
bookingTime: params.bookingTime,
|
|
884
|
-
checkedIn: false,
|
|
885
|
-
attended: false,
|
|
886
|
-
issuedThrough: params.issuedThrough,
|
|
887
|
-
project: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
888
|
-
reservationFor: params.reservationFor,
|
|
889
|
-
reservationNumber: params.reservationNumber,
|
|
890
|
-
reservationStatus: factory.reservationStatusType.ReservationConfirmed,
|
|
891
|
-
modifiedTime,
|
|
892
|
-
// providerを追加(2023-07-19~)
|
|
893
|
-
provider: params.provider,
|
|
894
|
-
...(params.underName !== undefined) ? { underName: params.underName } : undefined,
|
|
895
|
-
...(typeof params.broker?.typeOf === 'string') ? { broker: params.broker } : undefined
|
|
896
|
-
};
|
|
897
|
-
break;
|
|
898
885
|
case factory.reservationType.EventReservation:
|
|
899
886
|
setOnInsert = {
|
|
900
887
|
...subReservation,
|
|
@@ -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/task").ITask | import("@chevre/factory/lib/task/
|
|
34
|
+
static CREATE_MONGO_CONDITIONS(params: factory.task.ISearchConditions): FilterQuery<import("@chevre/factory/lib/task").ITask | import("@chevre/factory/lib/task/confirmRegisterService").ITask | import("@chevre/factory/lib/task/confirmPayTransaction").ITask | import("@chevre/factory/lib/task/confirmRegisterServiceTransaction").ITask | import("@chevre/factory/lib/task/confirmReserveTransaction").ITask | import("@chevre/factory/lib/task/createAccountingReport").ITask | import("@chevre/factory/lib/task/deletePerson").ITask | import("@chevre/factory/lib/task/deleteTransaction").ITask | import("@chevre/factory/lib/task/givePointAward").ITask | import("@chevre/factory/lib/task/onAssetTransactionStatusChanged").ITask | import("@chevre/factory/lib/task/onAuthorizationCreated").ITask | import("@chevre/factory/lib/task/onEventChanged").ITask | import("@chevre/factory/lib/task/onResourceDeleted").ITask | import("@chevre/factory/lib/task/onResourceUpdated").ITask | import("@chevre/factory/lib/task/onOrderPaymentCompleted").ITask | import("@chevre/factory/lib/task/placeOrder").ITask | import("@chevre/factory/lib/task/returnOrder").ITask | import("@chevre/factory/lib/task/returnPayTransaction").ITask | import("@chevre/factory/lib/task/returnPointAward").ITask | import("@chevre/factory/lib/task/returnReserveTransaction").ITask | import("@chevre/factory/lib/task/sendEmailMessage").ITask | import("@chevre/factory/lib/task/sendOrder").ITask | import("@chevre/factory/lib/task/triggerWebhook").ITask | import("@chevre/factory/lib/task/useReservation").ITask | import("@chevre/factory/lib/task/voidPayTransaction").ITask | import("@chevre/factory/lib/task/voidRegisterServiceTransaction").ITask | import("@chevre/factory/lib/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;
|
|
@@ -73,7 +73,7 @@ export declare class TransactionRepo {
|
|
|
73
73
|
$in: factory.transactionStatusType[];
|
|
74
74
|
};
|
|
75
75
|
limit: number;
|
|
76
|
-
}): Promise<Pick<import("@chevre/factory/lib/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/transaction/
|
|
76
|
+
}): Promise<Pick<import("@chevre/factory/lib/transaction/placeOrder").ITransaction | import("@chevre/factory/lib/transaction/returnOrder").ITransaction, "id" | "typeOf" | "status">[]>;
|
|
77
77
|
/**
|
|
78
78
|
* set task status exported by transaction id
|
|
79
79
|
* IDでタスクをエクスポート済に変更する
|
|
@@ -164,25 +164,6 @@ export declare class TransactionRepo {
|
|
|
164
164
|
_id: import("mongoose").Types.ObjectId;
|
|
165
165
|
} & {
|
|
166
166
|
__v: number;
|
|
167
|
-
}) | ({
|
|
168
|
-
object: import("@chevre/factory/lib/transaction/moneyTransfer").IObject;
|
|
169
|
-
error?: any;
|
|
170
|
-
project: import("@chevre/factory/lib/transaction").IProject;
|
|
171
|
-
seller: import("@chevre/factory/lib/transaction").ISeller;
|
|
172
|
-
typeOf: factory.transactionType.MoneyTransfer;
|
|
173
|
-
expires: Date;
|
|
174
|
-
result?: any;
|
|
175
|
-
startDate: Date;
|
|
176
|
-
endDate?: Date | undefined;
|
|
177
|
-
status: factory.transactionStatusType;
|
|
178
|
-
agent: import("@chevre/factory/lib/transaction").IAgent;
|
|
179
|
-
potentialActions?: import("@chevre/factory/lib/transaction/moneyTransfer").IPotentialActions | undefined;
|
|
180
|
-
recipient: import("@chevre/factory/lib/transaction/moneyTransfer").IRecipient;
|
|
181
|
-
tasksExportAction?: import("@chevre/factory/lib/transaction").ITasksExportAction | undefined;
|
|
182
|
-
} & {
|
|
183
|
-
_id: import("mongoose").Types.ObjectId;
|
|
184
|
-
} & {
|
|
185
|
-
__v: number;
|
|
186
167
|
}), "id"> & import("./mongoose/virtuals").IVirtuals, import("mongoose").QueryOptions<IDocType>, (import("mongoose").Document<unknown, {}, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & Omit<({
|
|
187
168
|
object: import("@chevre/factory/lib/transaction/placeOrder").IObject;
|
|
188
169
|
error?: any;
|
|
@@ -221,25 +202,6 @@ export declare class TransactionRepo {
|
|
|
221
202
|
_id: import("mongoose").Types.ObjectId;
|
|
222
203
|
} & {
|
|
223
204
|
__v: number;
|
|
224
|
-
}) | ({
|
|
225
|
-
object: import("@chevre/factory/lib/transaction/moneyTransfer").IObject;
|
|
226
|
-
error?: any;
|
|
227
|
-
project: import("@chevre/factory/lib/transaction").IProject;
|
|
228
|
-
seller: import("@chevre/factory/lib/transaction").ISeller;
|
|
229
|
-
typeOf: factory.transactionType.MoneyTransfer;
|
|
230
|
-
expires: Date;
|
|
231
|
-
result?: any;
|
|
232
|
-
startDate: Date;
|
|
233
|
-
endDate?: Date | undefined;
|
|
234
|
-
status: factory.transactionStatusType;
|
|
235
|
-
agent: import("@chevre/factory/lib/transaction").IAgent;
|
|
236
|
-
potentialActions?: import("@chevre/factory/lib/transaction/moneyTransfer").IPotentialActions | undefined;
|
|
237
|
-
recipient: import("@chevre/factory/lib/transaction/moneyTransfer").IRecipient;
|
|
238
|
-
tasksExportAction?: import("@chevre/factory/lib/transaction").ITasksExportAction | undefined;
|
|
239
|
-
} & {
|
|
240
|
-
_id: import("mongoose").Types.ObjectId;
|
|
241
|
-
} & {
|
|
242
|
-
__v: number;
|
|
243
205
|
}), "id"> & import("./mongoose/virtuals").IVirtuals) | null>;
|
|
244
206
|
aggregatePlaceOrder(params: {
|
|
245
207
|
project?: {
|
|
@@ -11,7 +11,6 @@ import type { ActionRepo } from './repo/action';
|
|
|
11
11
|
import type { AcceptCOAOfferActionRepo } from './repo/action/acceptCOAOffer';
|
|
12
12
|
import type { AcceptPayActionRepo } from './repo/action/acceptPay';
|
|
13
13
|
import type { AuthorizeInvoiceActionRepo } from './repo/action/authorizeInvoice';
|
|
14
|
-
import type { AuthorizeMoneyTransferOfferActionRepo } from './repo/action/authorizeMoneyTransferOffer';
|
|
15
14
|
import type { AuthorizeOfferActionRepo } from './repo/action/authorizeOffer';
|
|
16
15
|
import type { AuthorizeProductOfferActionRepo } from './repo/action/authorizeProductOffer';
|
|
17
16
|
import type { AuthorizePaymentMethodActionRepo } from './repo/action/authorizePaymentMethod';
|
|
@@ -95,7 +94,6 @@ import type { TicketRepo } from './repo/ticket';
|
|
|
95
94
|
import type { TransactionRepo } from './repo/transaction';
|
|
96
95
|
import type { PlaceOrderRepo } from './repo/transaction/placeOrder';
|
|
97
96
|
import type { ReturnOrderRepo } from './repo/transaction/returnOrder';
|
|
98
|
-
import type { MoneyTransferRepo } from './repo/transaction/moneyTransfer';
|
|
99
97
|
import type { TransactionNumberRepo } from './repo/transactionNumber';
|
|
100
98
|
import type { TransactionProcessRepo } from './repo/transactionProcess';
|
|
101
99
|
import type { TripRepo } from './repo/trip';
|
|
@@ -145,10 +143,6 @@ export declare namespace action {
|
|
|
145
143
|
namespace AuthorizeInvoice {
|
|
146
144
|
function createInstance(...params: ConstructorParameters<typeof AuthorizeInvoiceActionRepo>): Promise<AuthorizeInvoiceActionRepo>;
|
|
147
145
|
}
|
|
148
|
-
type AuthorizeMoneyTransferOffer = AuthorizeMoneyTransferOfferActionRepo;
|
|
149
|
-
namespace AuthorizeMoneyTransferOffer {
|
|
150
|
-
function createInstance(...params: ConstructorParameters<typeof AuthorizeMoneyTransferOfferActionRepo>): Promise<AuthorizeMoneyTransferOfferActionRepo>;
|
|
151
|
-
}
|
|
152
146
|
type AuthorizeOffer = AuthorizeOfferActionRepo;
|
|
153
147
|
namespace AuthorizeOffer {
|
|
154
148
|
function createInstance(...params: ConstructorParameters<typeof AuthorizeOfferActionRepo>): Promise<AuthorizeOfferActionRepo>;
|
|
@@ -525,10 +519,6 @@ export declare namespace transaction {
|
|
|
525
519
|
namespace ReturnOrder {
|
|
526
520
|
function createInstance(...params: ConstructorParameters<typeof ReturnOrderRepo>): Promise<ReturnOrderRepo>;
|
|
527
521
|
}
|
|
528
|
-
type MoneyTransfer = MoneyTransferRepo;
|
|
529
|
-
namespace MoneyTransfer {
|
|
530
|
-
function createInstance(...params: ConstructorParameters<typeof MoneyTransferRepo>): Promise<MoneyTransferRepo>;
|
|
531
|
-
}
|
|
532
522
|
}
|
|
533
523
|
export type TransactionNumber = TransactionNumberRepo;
|
|
534
524
|
export declare namespace TransactionNumber {
|
package/lib/chevre/repository.js
CHANGED
|
@@ -137,17 +137,6 @@ var action;
|
|
|
137
137
|
}
|
|
138
138
|
AuthorizeInvoice.createInstance = createInstance;
|
|
139
139
|
})(AuthorizeInvoice = action.AuthorizeInvoice || (action.AuthorizeInvoice = {}));
|
|
140
|
-
let AuthorizeMoneyTransferOffer;
|
|
141
|
-
(function (AuthorizeMoneyTransferOffer) {
|
|
142
|
-
let repo;
|
|
143
|
-
async function createInstance(...params) {
|
|
144
|
-
if (repo === undefined) {
|
|
145
|
-
repo = (await Promise.resolve().then(() => __importStar(require('./repo/action/authorizeMoneyTransferOffer')))).AuthorizeMoneyTransferOfferActionRepo;
|
|
146
|
-
}
|
|
147
|
-
return new repo(...params);
|
|
148
|
-
}
|
|
149
|
-
AuthorizeMoneyTransferOffer.createInstance = createInstance;
|
|
150
|
-
})(AuthorizeMoneyTransferOffer = action.AuthorizeMoneyTransferOffer || (action.AuthorizeMoneyTransferOffer = {}));
|
|
151
140
|
let AuthorizeOffer;
|
|
152
141
|
(function (AuthorizeOffer) {
|
|
153
142
|
let repo;
|
|
@@ -1127,17 +1116,6 @@ var transaction;
|
|
|
1127
1116
|
}
|
|
1128
1117
|
ReturnOrder.createInstance = createInstance;
|
|
1129
1118
|
})(ReturnOrder = transaction.ReturnOrder || (transaction.ReturnOrder = {}));
|
|
1130
|
-
let MoneyTransfer;
|
|
1131
|
-
(function (MoneyTransfer) {
|
|
1132
|
-
let repo;
|
|
1133
|
-
async function createInstance(...params) {
|
|
1134
|
-
if (repo === undefined) {
|
|
1135
|
-
repo = (await Promise.resolve().then(() => __importStar(require('./repo/transaction/moneyTransfer')))).MoneyTransferRepo;
|
|
1136
|
-
}
|
|
1137
|
-
return new repo(...params);
|
|
1138
|
-
}
|
|
1139
|
-
MoneyTransfer.createInstance = createInstance;
|
|
1140
|
-
})(MoneyTransfer = transaction.MoneyTransfer || (transaction.MoneyTransfer = {}));
|
|
1141
1119
|
})(transaction || (exports.transaction = transaction = {}));
|
|
1142
1120
|
var TransactionNumber;
|
|
1143
1121
|
(function (TransactionNumber) {
|
|
@@ -119,23 +119,7 @@ function createPotentialActions(params) {
|
|
|
119
119
|
transaction.object.reservations.map((reservation) => {
|
|
120
120
|
// 最適化(2022-06-06~)
|
|
121
121
|
let cancelObject;
|
|
122
|
-
if (reservation.typeOf === factory.reservationType.
|
|
123
|
-
cancelObject = {
|
|
124
|
-
typeOf: reservation.typeOf,
|
|
125
|
-
id: reservation.id,
|
|
126
|
-
issuedThrough: {
|
|
127
|
-
typeOf: reservation.issuedThrough?.typeOf
|
|
128
|
-
},
|
|
129
|
-
reservationFor: {
|
|
130
|
-
typeOf: reservation.reservationFor.typeOf,
|
|
131
|
-
id: String(reservation.reservationFor.id)
|
|
132
|
-
},
|
|
133
|
-
reservationNumber: reservation.reservationNumber,
|
|
134
|
-
// ReservationConfirmed->ReservationCancelledのみ処理されるように保証する
|
|
135
|
-
reservationStatus: factory.reservationStatusType.ReservationConfirmed
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
else if (reservation.typeOf === factory.reservationType.EventReservation) {
|
|
122
|
+
if (reservation.typeOf === factory.reservationType.EventReservation) {
|
|
139
123
|
cancelObject = {
|
|
140
124
|
typeOf: reservation.typeOf,
|
|
141
125
|
id: reservation.id,
|
|
@@ -393,46 +393,6 @@ function createReservation(params) {
|
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
395
|
else {
|
|
396
|
-
|
|
397
|
-
// project: params.project,
|
|
398
|
-
typeOf: factory.reservationType.BusReservation,
|
|
399
|
-
id: params.id,
|
|
400
|
-
// reservationPackage保管に移行(2023-06-06~)
|
|
401
|
-
// issuedThrough,
|
|
402
|
-
additionalProperty: params.additionalProperty,
|
|
403
|
-
// bookingTime: params.reserveDate,
|
|
404
|
-
// modifiedTime: params.reserveDate,
|
|
405
|
-
numSeats: 1,
|
|
406
|
-
price: price4reservation,
|
|
407
|
-
priceCurrency: factory.priceCurrency.JPY,
|
|
408
|
-
// reservationNumber: params.reservationNumber,
|
|
409
|
-
// statusは不要なので削除(2023-07-19~)
|
|
410
|
-
// reservationStatus: factory.reservationStatusType.ReservationPending,
|
|
411
|
-
reservedTicket: params.reservedTicket,
|
|
412
|
-
// underName: {
|
|
413
|
-
// typeOf: params.agent.typeOf,
|
|
414
|
-
// name: params.agent.name
|
|
415
|
-
// },
|
|
416
|
-
// checkedIn: false,
|
|
417
|
-
// attended: false,
|
|
418
|
-
...(typeof params.additionalTicketText === 'string') ? { additionalTicketText: params.additionalTicketText } : undefined,
|
|
419
|
-
...(Array.isArray(params.subReservation))
|
|
420
|
-
? {
|
|
421
|
-
subReservation: params.subReservation.map((r) => {
|
|
422
|
-
return {
|
|
423
|
-
reservedTicket: {
|
|
424
|
-
ticketedSeat: r.reservedTicket.ticketedSeat,
|
|
425
|
-
typeOf: 'Ticket'
|
|
426
|
-
}
|
|
427
|
-
};
|
|
428
|
-
})
|
|
429
|
-
}
|
|
430
|
-
: undefined,
|
|
431
|
-
// reservationPackage保管に移行(2023-06-06~)
|
|
432
|
-
// ...(typeof params.broker?.typeOf === 'string') ? { broker: params.broker } : undefined,
|
|
433
|
-
...(typeof params.programMembershipUsed?.identifier === 'string')
|
|
434
|
-
? { programMembershipUsed: params.programMembershipUsed }
|
|
435
|
-
: undefined
|
|
436
|
-
};
|
|
396
|
+
throw new factory.errors.NotImplemented(`reservationFor not implemented. typeOf:${params.reservationFor.typeOf}`);
|
|
437
397
|
}
|
|
438
398
|
}
|
|
@@ -144,16 +144,6 @@ function createIssuedThrough(params) {
|
|
|
144
144
|
};
|
|
145
145
|
}
|
|
146
146
|
else {
|
|
147
|
-
|
|
148
|
-
typeOf: factory.product.ProductType.Transportation,
|
|
149
|
-
// 興行IDを追加(2022-09-08~)
|
|
150
|
-
id: eventOffers.itemOffered.id,
|
|
151
|
-
availableChannel,
|
|
152
|
-
// issuedThrough.serviceTypeを連携
|
|
153
|
-
...(typeof serviceTypeOfIssuedThrough?.typeOf === 'string') ? { serviceType: serviceTypeOfIssuedThrough } : undefined
|
|
154
|
-
};
|
|
155
|
-
return {
|
|
156
|
-
issuedThrough
|
|
157
|
-
};
|
|
147
|
+
throw new factory.errors.NotImplemented(`reservationFor not implemented. typeOf:${params.reservationFor.typeOf}`);
|
|
158
148
|
}
|
|
159
149
|
}
|
|
@@ -499,11 +499,8 @@ function processLockOfferRateLimit(params) {
|
|
|
499
499
|
}
|
|
500
500
|
},
|
|
501
501
|
reservationFor: {
|
|
502
|
-
startDate: (params.reservationFor.
|
|
503
|
-
|
|
504
|
-
.toDate()
|
|
505
|
-
: (0, moment_1.default)(params.reservationFor.departureTime)
|
|
506
|
-
.toDate()
|
|
502
|
+
startDate: (0, moment_1.default)(params.reservationFor.startDate)
|
|
503
|
+
.toDate()
|
|
507
504
|
},
|
|
508
505
|
reservationNumber: params.reservationNumber
|
|
509
506
|
};
|
|
@@ -55,7 +55,6 @@ function createOwnershipInfosFromOrder(params) {
|
|
|
55
55
|
const ownedBy = createOwnedby(params);
|
|
56
56
|
const itemOfferedType = itemOffered.typeOf;
|
|
57
57
|
switch (itemOfferedType) {
|
|
58
|
-
case factory.reservationType.BusReservation:
|
|
59
58
|
case factory.reservationType.EventReservation:
|
|
60
59
|
const excludeCOAReservation = acceptedOffer.offeredThrough?.identifier === factory.service.webAPI.Identifier.COA;
|
|
61
60
|
if (excludeCOAReservation) {
|
|
@@ -82,10 +81,10 @@ function createOwnershipInfosFromOrder(params) {
|
|
|
82
81
|
acquiredFrom: acquiredFrom
|
|
83
82
|
});
|
|
84
83
|
break;
|
|
85
|
-
case factory.actionType.MoneyTransfer:
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
// case factory.actionType.MoneyTransfer:
|
|
85
|
+
// // no op
|
|
86
|
+
// // 所有権は発生しない
|
|
87
|
+
// break;
|
|
89
88
|
default:
|
|
90
89
|
throw new factory.errors.NotImplemented(`Offered item type ${itemOfferedType} not implemented`);
|
|
91
90
|
}
|
|
@@ -39,10 +39,6 @@ function createReservationOwnershipInfo(params) {
|
|
|
39
39
|
ownedThrough = (0, moment_timezone_1.default)(itemOffered.reservationFor.endDate)
|
|
40
40
|
.toDate();
|
|
41
41
|
}
|
|
42
|
-
else if (itemOffered.typeOf === factory.reservationType.BusReservation) {
|
|
43
|
-
ownedThrough = (0, moment_timezone_1.default)(itemOffered.reservationFor.arrivalTime)
|
|
44
|
-
.toDate();
|
|
45
|
-
}
|
|
46
42
|
else {
|
|
47
43
|
throw new factory.errors.NotImplemented(`itemOffered.typeOf '${itemOffered.typeOf}' not implemented`);
|
|
48
44
|
}
|
|
@@ -63,15 +59,14 @@ function createReservationOwnershipInfo(params) {
|
|
|
63
59
|
bookingService: bookingService,
|
|
64
60
|
...(typeof itemOffered.issuedThrough?.typeOf === 'string') ? { issuedThrough: itemOffered.issuedThrough } : undefined
|
|
65
61
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
};
|
|
62
|
+
// } else if (itemOffered.typeOf === factory.reservationType.BusReservation) {
|
|
63
|
+
// typeOfGood = {
|
|
64
|
+
// typeOf: itemOffered.typeOf,
|
|
65
|
+
// id: itemOffered.id,
|
|
66
|
+
// reservationNumber: itemOffered.reservationNumber,
|
|
67
|
+
// bookingService: bookingService,
|
|
68
|
+
// ...(typeof itemOffered.issuedThrough?.typeOf === 'string') ? { issuedThrough: itemOffered.issuedThrough } : undefined
|
|
69
|
+
// };
|
|
75
70
|
}
|
|
76
71
|
else {
|
|
77
72
|
throw new factory.errors.NotImplemented(`itemOffered.typeOf '${itemOffered.typeOf}' not implemented`);
|
|
@@ -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.product.IAction | factory.action.authorize.offer.eventService.IAction, 'instrument'>;
|
|
8
8
|
export declare function acceptOffer(params: {
|
|
9
9
|
orderNumber: string;
|
|
10
10
|
project: {
|