@chevre/domain 21.8.0-alpha.6 → 21.8.0-alpha.60
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/example/src/chevre/countOffers.ts +32 -0
- package/example/src/chevre/findItemListElementByCatalogId.ts +23 -0
- package/example/src/chevre/importOffersFromCOA.ts +7 -1
- package/example/src/chevre/migrateAggregateOffers.ts +89 -0
- package/example/src/chevre/migrateOrderPaymentMethodIdentifier.ts +81 -0
- package/example/src/chevre/migratePayTransactionPaymentMethodId.ts +72 -0
- package/example/src/chevre/migratePayTransactionPaymentMethodIdentifier.ts +78 -0
- package/example/src/chevre/processPay.ts +3 -4
- package/example/src/chevre/publishPermitOwnershipInfoToken.ts +56 -0
- package/example/src/chevre/pullAddOnsFromOffer.ts +26 -0
- package/example/src/chevre/searchAggregateOffers.ts +48 -0
- package/example/src/chevre/searchEventTicketOffers.ts +3 -1
- package/example/src/chevre/searchEvents.ts +9 -7
- package/example/src/chevre/searchOffersByCatalog.ts +9 -5
- package/example/src/chevre/searchOffersFromAggregateOffer.ts +168 -0
- package/example/src/chevre/searchOrders.ts +9 -7
- package/example/src/chevre/sync2aggregateOffer.ts +27 -0
- package/example/src/chevre/syncAggregateOffer.ts +25 -0
- package/lib/chevre/emailMessageBuilder.js +6 -5
- package/lib/chevre/repo/aggregateOffer.d.ts +62 -0
- package/lib/chevre/repo/aggregateOffer.js +534 -0
- package/lib/chevre/repo/assetTransaction.d.ts +16 -1
- package/lib/chevre/repo/assetTransaction.js +54 -2
- package/lib/chevre/repo/mongoose/schemas/aggregateOffer.d.ts +74 -0
- package/lib/chevre/repo/mongoose/schemas/aggregateOffer.js +177 -0
- package/lib/chevre/repo/mongoose/schemas/authorization.d.ts +3 -3
- package/lib/chevre/repo/mongoose/schemas/creativeWork.d.ts +3 -3
- package/lib/chevre/repo/mongoose/schemas/event.d.ts +3 -3
- package/lib/chevre/repo/mongoose/schemas/offer.d.ts +24 -33
- package/lib/chevre/repo/mongoose/schemas/offer.js +4 -3
- package/lib/chevre/repo/mongoose/schemas/order.d.ts +3 -0
- package/lib/chevre/repo/mongoose/schemas/order.js +7 -0
- package/lib/chevre/repo/mongoose/schemas/priceSpecification.d.ts +9 -9
- package/lib/chevre/repo/mongoose/schemas/product.d.ts +3 -3
- package/lib/chevre/repo/mongoose/schemas/project.d.ts +3 -3
- package/lib/chevre/repo/mongoose/schemas/task.d.ts +3 -0
- package/lib/chevre/repo/mongoose/schemas/task.js +8 -0
- package/lib/chevre/repo/offer.d.ts +82 -47
- package/lib/chevre/repo/offer.js +1279 -289
- package/lib/chevre/repo/offerCatalog.d.ts +6 -0
- package/lib/chevre/repo/offerCatalog.js +13 -0
- package/lib/chevre/repo/order.d.ts +15 -0
- package/lib/chevre/repo/order.js +58 -26
- package/lib/chevre/repo/task.d.ts +7 -1
- package/lib/chevre/repo/task.js +100 -0
- package/lib/chevre/repository.d.ts +3 -0
- package/lib/chevre/repository.js +5 -1
- package/lib/chevre/service/aggregation/event/aggregateScreeningEvent.js +2 -1
- package/lib/chevre/service/aggregation/event/aggregateUseActionsOnEvent.js +2 -1
- package/lib/chevre/service/assetTransaction/pay/account/validation.js +2 -2
- package/lib/chevre/service/assetTransaction/pay/factory.js +26 -18
- package/lib/chevre/service/assetTransaction/pay/potentialActions.js +3 -3
- package/lib/chevre/service/assetTransaction/pay.js +65 -46
- package/lib/chevre/service/assetTransaction/refund/factory.js +8 -2
- package/lib/chevre/service/assetTransaction/registerService.js +2 -1
- package/lib/chevre/service/assetTransaction/reserve.js +111 -35
- package/lib/chevre/service/delivery.js +17 -0
- package/lib/chevre/service/offer/event/authorize.js +39 -35
- package/lib/chevre/service/offer/event/factory.d.ts +1 -1
- package/lib/chevre/service/offer/event/factory.js +8 -8
- package/lib/chevre/service/offer/event/importFromCOA.d.ts +2 -0
- package/lib/chevre/service/offer/event/searchEventTicketOffers.d.ts +1 -0
- package/lib/chevre/service/offer/event/searchEventTicketOffers.js +6 -3
- package/lib/chevre/service/offer/event/voidTransaction.js +57 -36
- package/lib/chevre/service/offer/eventServiceByCOA/factory.d.ts +2 -1
- package/lib/chevre/service/offer/eventServiceByCOA/factory.js +7 -11
- package/lib/chevre/service/offer/eventServiceByCOA.js +55 -27
- package/lib/chevre/service/offer/factory.d.ts +12 -4
- package/lib/chevre/service/offer/factory.js +9 -11
- package/lib/chevre/service/offer/product/searchProductOffers.d.ts +8 -1
- package/lib/chevre/service/offer/product/searchProductOffers.js +10 -3
- package/lib/chevre/service/offer/product.d.ts +1 -0
- package/lib/chevre/service/offer/product.js +3 -2
- package/lib/chevre/service/offer.d.ts +1 -0
- package/lib/chevre/service/offer.js +7 -1
- package/lib/chevre/service/order/confirmPayTransaction.d.ts +0 -2
- package/lib/chevre/service/order/confirmPayTransaction.js +29 -40
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.d.ts +27 -0
- package/lib/chevre/service/order/onAssetTransactionStatusChanged.js +226 -0
- package/lib/chevre/service/order/onOrderStatusChanged/factory.d.ts +8 -6
- package/lib/chevre/service/order/onOrderStatusChanged/factory.js +80 -57
- package/lib/chevre/service/order/onOrderStatusChanged.js +81 -54
- package/lib/chevre/service/order/payOrder.d.ts +2 -10
- package/lib/chevre/service/order/payOrder.js +4 -45
- package/lib/chevre/service/order/placeOrder.js +11 -13
- package/lib/chevre/service/order.d.ts +3 -1
- package/lib/chevre/service/order.js +6 -2
- package/lib/chevre/service/payment/any/factory.js +33 -8
- package/lib/chevre/service/payment/any.js +30 -21
- package/lib/chevre/service/payment/creditCard.js +12 -12
- package/lib/chevre/service/payment/movieTicket/validation.js +2 -2
- package/lib/chevre/service/payment/movieTicket.js +10 -11
- package/lib/chevre/service/payment/paymentCard.js +9 -12
- package/lib/chevre/service/project.js +1 -1
- package/lib/chevre/service/reserve/checkInReservation.d.ts +8 -0
- package/lib/chevre/service/reserve/checkInReservation.js +3 -2
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +3 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.js +4 -5
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.d.ts +8 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationCheckedIn.js +16 -11
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +2 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.d.ts +3 -0
- package/lib/chevre/service/reserve/potentialActions/onReservationUsed.js +3 -5
- package/lib/chevre/service/task/confirmPayTransaction.js +1 -3
- package/lib/chevre/service/task/importOffersFromCOA.js +3 -0
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.d.ts +6 -0
- package/lib/chevre/service/task/onAssetTransactionStatusChanged.js +37 -0
- package/lib/chevre/service/task/onAuthorizationCreated.js +5 -1
- package/lib/chevre/service/task/onOrderPaymentCompleted.d.ts +6 -0
- package/lib/chevre/service/task/onOrderPaymentCompleted.js +35 -0
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +2 -0
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +7 -0
- package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.d.ts +17 -0
- package/lib/chevre/service/task/onResourceUpdated/syncOfferCatalog.js +60 -0
- package/lib/chevre/service/task/onResourceUpdated.js +12 -0
- package/lib/chevre/service/task/returnPayTransaction.js +8 -3
- package/lib/chevre/service/task/syncAggregateOffer.d.ts +7 -0
- package/lib/chevre/service/task/syncAggregateOffer.js +23 -0
- package/lib/chevre/service/transaction/placeOrderInProgress/result.js +32 -16
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateMovieTicket.js +13 -11
- package/lib/chevre/service/transaction/placeOrderInProgress/validation.js +53 -17
- package/lib/chevre/service/transaction/placeOrderInProgress.js +4 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPaymentMethod.js +7 -6
- package/lib/chevre/service/transaction/returnOrder.js +5 -1
- package/lib/chevre/settings.d.ts +5 -3
- package/lib/chevre/settings.js +6 -6
- package/package.json +3 -3
- package/example/src/chevre/migrateAuthorizePaymentActionResult.ts +0 -83
- package/example/src/chevre/migrateEventOrganizer.ts +0 -154
|
@@ -9,6 +9,7 @@ exports.modelName = modelName;
|
|
|
9
9
|
* タスクスキーマ
|
|
10
10
|
*/
|
|
11
11
|
const schema = new mongoose_1.Schema({
|
|
12
|
+
identifier: String,
|
|
12
13
|
project: mongoose_1.SchemaTypes.Mixed,
|
|
13
14
|
name: String,
|
|
14
15
|
status: String,
|
|
@@ -52,6 +53,13 @@ schema.index({ 'project.id': 1, runsAt: -1 }, { name: 'searchByProjectId-v202207
|
|
|
52
53
|
schema.index({ name: 1, runsAt: -1 }, { name: 'searchByName-v2' });
|
|
53
54
|
schema.index({ status: 1, runsAt: -1 }, { name: 'searchByStatus-v2' });
|
|
54
55
|
schema.index({ runsAt: -1 }, { name: 'searchByRunsAt-v2' });
|
|
56
|
+
// identifier追加(2023-09-01~)
|
|
57
|
+
schema.index({ identifier: 1, runsAt: -1 }, {
|
|
58
|
+
name: 'searchByIdentifier',
|
|
59
|
+
partialFilterExpression: {
|
|
60
|
+
identifier: { $exists: true }
|
|
61
|
+
}
|
|
62
|
+
});
|
|
55
63
|
schema.index({ dateAborted: 1, runsAt: -1 }, {
|
|
56
64
|
name: 'searchByDateAborted',
|
|
57
65
|
partialFilterExpression: {
|
|
@@ -1,47 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/// <reference types="mongoose/types/collection" />
|
|
4
|
-
/// <reference types="mongoose/types/connection" />
|
|
5
|
-
/// <reference types="mongoose/types/cursor" />
|
|
6
|
-
/// <reference types="mongoose/types/document" />
|
|
7
|
-
/// <reference types="mongoose/types/error" />
|
|
8
|
-
/// <reference types="mongoose/types/expressions" />
|
|
9
|
-
/// <reference types="mongoose/types/helpers" />
|
|
10
|
-
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
-
/// <reference types="mongoose/types/indexes" />
|
|
12
|
-
/// <reference types="mongoose/types/models" />
|
|
13
|
-
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
-
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
-
/// <reference types="mongoose/types/populate" />
|
|
16
|
-
/// <reference types="mongoose/types/query" />
|
|
17
|
-
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
-
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
-
/// <reference types="mongoose/types/session" />
|
|
20
|
-
/// <reference types="mongoose/types/types" />
|
|
21
|
-
/// <reference types="mongoose/types/utility" />
|
|
22
|
-
/// <reference types="mongoose/types/validation" />
|
|
23
|
-
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
-
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
-
import { Connection } from 'mongoose';
|
|
1
|
+
import { BulkWriteResult as BulkWriteOpResultObject } from 'mongodb';
|
|
2
|
+
import { AnyExpression, Connection, PipelineStage } from 'mongoose';
|
|
26
3
|
import * as factory from '../factory';
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
4
|
+
type IMatchStage = PipelineStage.Match;
|
|
5
|
+
type KeyOfUnitPriceOffer = keyof factory.unitPriceOffer.IUnitPriceOffer;
|
|
6
|
+
type IProjection = {
|
|
7
|
+
[key in KeyOfUnitPriceOffer]?: 0 | 1;
|
|
8
|
+
};
|
|
9
|
+
export type IUnitPriceOfferFromAggregateOffer = factory.unitPriceOffer.IUnitPriceOffer & {
|
|
10
|
+
offerIndex?: number;
|
|
11
|
+
parentOffer?: {
|
|
12
|
+
id: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
30
15
|
/**
|
|
31
|
-
*
|
|
16
|
+
* 単価オファーリポジトリ
|
|
32
17
|
*/
|
|
33
18
|
export declare class MongoRepository {
|
|
34
|
-
private readonly
|
|
19
|
+
private readonly aggregateOfferModel;
|
|
35
20
|
private readonly offerCatalogModel;
|
|
21
|
+
private readonly taskModel;
|
|
36
22
|
constructor(connection: Connection);
|
|
37
|
-
static
|
|
23
|
+
static CREATE_AGGREGATE_OFFERS_MATCH_CONDITIONS(params: factory.unitPriceOffer.ISearchConditions): IMatchStage[];
|
|
24
|
+
static CREATE_AGGREGATE_OFFERS_PROJECTION(params: IProjection): {
|
|
25
|
+
[field: string]: AnyExpression;
|
|
26
|
+
};
|
|
38
27
|
/**
|
|
39
|
-
* カタログに含まれるオファーを検索する
|
|
40
|
-
*
|
|
28
|
+
* カタログに含まれるオファーを検索する(カタログ内ソートは保証しない)
|
|
29
|
+
* カタログ内ソートインデックスはsortedOfferIdsで判断する
|
|
41
30
|
*/
|
|
42
31
|
findOffersByOfferCatalogId(params: {
|
|
43
32
|
/**
|
|
44
|
-
* 指定したID
|
|
33
|
+
* 指定したIDの単価オファーだけ取得する場合
|
|
45
34
|
*/
|
|
46
35
|
ids?: string[];
|
|
47
36
|
offerCatalog: {
|
|
@@ -55,18 +44,36 @@ export declare class MongoRepository {
|
|
|
55
44
|
onlyValid?: boolean;
|
|
56
45
|
limit?: number;
|
|
57
46
|
page?: number;
|
|
58
|
-
sort: boolean;
|
|
59
47
|
projection?: IProjection;
|
|
48
|
+
/**
|
|
49
|
+
* 強制的にoffersコレクションを使用する
|
|
50
|
+
*/
|
|
51
|
+
useOffersAsPrimaryForcible: boolean;
|
|
60
52
|
}): Promise<{
|
|
61
|
-
offers:
|
|
53
|
+
offers: IUnitPriceOfferFromAggregateOffer[];
|
|
54
|
+
/**
|
|
55
|
+
* カタログ内ソートされた集計オファーIDリスト
|
|
56
|
+
*/
|
|
62
57
|
sortedOfferIds: string[];
|
|
63
58
|
}>;
|
|
64
|
-
|
|
59
|
+
findAggregateOfferById(params: {
|
|
60
|
+
project: {
|
|
61
|
+
id: string;
|
|
62
|
+
};
|
|
65
63
|
id: string;
|
|
64
|
+
}): Promise<factory.aggregateOffer.IAggregateOffer>;
|
|
65
|
+
count(params: Omit<factory.unitPriceOffer.ISearchConditions, 'limit' | 'page' | 'sort'>): Promise<number>;
|
|
66
|
+
search(params: factory.unitPriceOffer.ISearchConditions, projection?: IProjection,
|
|
67
|
+
/**
|
|
68
|
+
* 強制的にoffersコレクションを使用する
|
|
69
|
+
*/
|
|
70
|
+
useOffersAsPrimary?: boolean): Promise<factory.unitPriceOffer.IUnitPriceOffer[]>;
|
|
71
|
+
save(params: factory.unitPriceOffer.IUnitPriceOffer & {
|
|
72
|
+
$unset?: any;
|
|
66
73
|
}): Promise<factory.unitPriceOffer.IUnitPriceOffer>;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
74
|
+
/**
|
|
75
|
+
* sskts専用オファー保管
|
|
76
|
+
*/
|
|
70
77
|
saveManyByIdentifier(params: {
|
|
71
78
|
attributes: factory.unitPriceOffer.IUnitPriceOffer;
|
|
72
79
|
upsert?: boolean;
|
|
@@ -87,17 +94,45 @@ export declare class MongoRepository {
|
|
|
87
94
|
};
|
|
88
95
|
}): Promise<import("mongodb").UpdateResult | undefined>;
|
|
89
96
|
deleteById(params: {
|
|
97
|
+
project: {
|
|
98
|
+
id: string;
|
|
99
|
+
};
|
|
90
100
|
id: string;
|
|
91
101
|
}): Promise<void>;
|
|
92
|
-
|
|
102
|
+
sync2aggregateOffer(params: {
|
|
103
|
+
id?: {
|
|
104
|
+
$in: string[];
|
|
105
|
+
};
|
|
106
|
+
identifier?: {
|
|
107
|
+
$in: string[];
|
|
108
|
+
};
|
|
93
109
|
project: {
|
|
94
110
|
id: string;
|
|
95
111
|
};
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
112
|
+
isDeleted: boolean;
|
|
113
|
+
typeOf: factory.offerType.AggregateOffer | factory.offerType.Offer;
|
|
114
|
+
}): Promise<BulkWriteOpResultObject | void>;
|
|
115
|
+
/**
|
|
116
|
+
* オファー同期専用のタスク保管
|
|
117
|
+
*/
|
|
118
|
+
saveSyncTask(params: {
|
|
119
|
+
id: {
|
|
120
|
+
$in: string[];
|
|
121
|
+
};
|
|
122
|
+
identifier: {
|
|
123
|
+
$in: string[];
|
|
124
|
+
};
|
|
125
|
+
isDeleted: boolean;
|
|
126
|
+
project: {
|
|
127
|
+
id: string;
|
|
128
|
+
};
|
|
129
|
+
typeOf: factory.offerType.AggregateOffer | factory.offerType.Offer;
|
|
130
|
+
options: {
|
|
131
|
+
emitImmediately: boolean;
|
|
132
|
+
};
|
|
133
|
+
}): Promise<{
|
|
134
|
+
id: string;
|
|
135
|
+
}[]>;
|
|
136
|
+
private searchFromAggregateOffer;
|
|
102
137
|
}
|
|
103
138
|
export {};
|