@chevre/domain 20.1.0-alpha.8 → 20.1.0
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/deleteReservationTicketUnderNames.ts +20 -0
- package/example/src/chevre/migrateAccountTitleAdditionalProperties.ts +157 -0
- package/example/src/chevre/migrateCreativeWorkAdditionalProperties.ts +116 -0
- package/example/src/chevre/migrateEventOffersSellerMakesOffer.ts +139 -0
- package/example/src/chevre/migrateEventProjectAttributes.ts +57 -0
- package/example/src/chevre/migratePlaceAdditionalProperties.ts +162 -0
- package/example/src/chevre/migrateSSKTEventCOAEndpoint.ts +64 -0
- package/example/src/chevre/searchEvents.ts +36 -16
- package/example/src/chevre/transaction/callOrderMembershipServiceTask.ts +0 -4
- package/example/src/chevre/transaction/orderMembershipService.ts +0 -4
- package/lib/chevre/factory/reservedAgentIdentifireNames.d.ts +1 -0
- package/lib/chevre/factory/reservedAgentIdentifireNames.js +12 -0
- package/lib/chevre/repo/accountAction.d.ts +0 -18
- package/lib/chevre/repo/accountAction.js +402 -355
- package/lib/chevre/repo/accountTitle.d.ts +1 -0
- package/lib/chevre/repo/accountTitle.js +6 -1
- package/lib/chevre/repo/additionalProperty.d.ts +35 -0
- package/lib/chevre/repo/additionalProperty.js +205 -0
- package/lib/chevre/repo/categoryCode.d.ts +1 -0
- package/lib/chevre/repo/categoryCode.js +15 -1
- package/lib/chevre/repo/creativeWork.js +10 -1
- package/lib/chevre/repo/customer.d.ts +1 -0
- package/lib/chevre/repo/customer.js +5 -0
- package/lib/chevre/repo/event.d.ts +12 -4
- package/lib/chevre/repo/event.js +84 -48
- package/lib/chevre/repo/merchantReturnPolicy.d.ts +1 -0
- package/lib/chevre/repo/merchantReturnPolicy.js +5 -0
- package/lib/chevre/repo/mongoose/model/additionalProperty.d.ts +7 -0
- package/lib/chevre/repo/mongoose/model/additionalProperty.js +81 -0
- package/lib/chevre/repo/mongoose/model/categoryCode.js +18 -2
- package/lib/chevre/repo/mongoose/model/creativeWork.js +6 -0
- package/lib/chevre/repo/mongoose/model/event.js +6 -0
- package/lib/chevre/repo/mongoose/model/offer.js +7 -1
- package/lib/chevre/repo/mongoose/model/offerCatalog.js +21 -2
- package/lib/chevre/repo/mongoose/model/ownershipInfo.js +3 -15
- package/lib/chevre/repo/mongoose/model/place.js +24 -0
- package/lib/chevre/repo/offer.js +10 -1
- package/lib/chevre/repo/offerCatalog.js +10 -10
- package/lib/chevre/repo/person.js +4 -1
- package/lib/chevre/repo/place.d.ts +1 -0
- package/lib/chevre/repo/place.js +54 -7
- package/lib/chevre/repo/reservation.d.ts +17 -2
- package/lib/chevre/repo/reservation.js +41 -1
- package/lib/chevre/repo/transaction.js +20 -5
- package/lib/chevre/repository.d.ts +6 -3
- package/lib/chevre/repository.js +10 -5
- package/lib/chevre/service/account.d.ts +0 -4
- package/lib/chevre/service/account.js +24 -22
- package/lib/chevre/service/accountTransaction/deposit.d.ts +0 -2
- package/lib/chevre/service/accountTransaction/deposit.js +3 -3
- package/lib/chevre/service/accountTransaction/transfer.d.ts +0 -2
- package/lib/chevre/service/accountTransaction/transfer.js +3 -3
- package/lib/chevre/service/accountTransaction/withdraw.d.ts +0 -2
- package/lib/chevre/service/accountTransaction/withdraw.js +3 -3
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.js +86 -42
- package/lib/chevre/service/assetTransaction/pay/potentialActions.js +7 -18
- package/lib/chevre/service/assetTransaction/reserve/factory.js +81 -113
- package/lib/chevre/service/assetTransaction/reserve.js +41 -95
- package/lib/chevre/service/event.js +20 -6
- package/lib/chevre/service/offer/event/authorize.d.ts +4 -0
- package/lib/chevre/service/offer/event/authorize.js +65 -27
- package/lib/chevre/service/offer/event/factory.d.ts +1 -1
- package/lib/chevre/service/offer/event/factory.js +17 -12
- package/lib/chevre/service/offer/eventServiceByCOA/factory.js +19 -9
- package/lib/chevre/service/offer/factory.js +7 -20
- package/lib/chevre/service/order/onOrderStatusChanged/factory.js +32 -22
- package/lib/chevre/service/reserve/cancelReservation.d.ts +5 -5
- package/lib/chevre/service/reserve/cancelReservation.js +260 -107
- package/lib/chevre/service/reserve/confirmReservation.js +65 -33
- package/lib/chevre/service/reserve/factory.d.ts +14 -2
- package/lib/chevre/service/reserve/factory.js +13 -6
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.js +85 -30
- package/lib/chevre/service/task/confirmReserveTransaction.js +1 -1
- package/lib/chevre/service/transaction/orderProgramMembership.js +15 -28
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.d.ts +1 -0
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +14 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/factory.js +9 -4
- package/lib/chevre/service/transaction/placeOrderInProgress/result/acceptedOffers.js +10 -6
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateSeller.d.ts +3 -1
- package/lib/chevre/service/transaction/placeOrderInProgress/validation/validateSeller.js +3 -2
- package/lib/chevre/service/transaction/placeOrderInProgress.js +16 -2
- package/lib/chevre/service/transaction/returnOrder.js +10 -1
- package/lib/chevre/service.d.ts +2 -0
- package/lib/chevre/service.js +2 -0
- package/package.json +4 -4
- package/example/src/chevre/accountBlanceTest.ts +0 -24
- package/example/src/chevre/checkOffersAppliesToMovieTicket.ts +0 -56
- package/example/src/chevre/createSeats.ts +0 -59
- package/example/src/chevre/deleteEvents.ts +0 -50
- package/example/src/chevre/manageOwnedByOfOwnershipInfo.ts +0 -35
- package/example/src/chevre/migrateEventOffersItemOfferedName.ts +0 -82
- package/example/src/chevre/migrateMovieTicketChargePriceSpecs.ts +0 -92
- package/example/src/chevre/migrateSellerMakesOffers.ts +0 -84
- package/example/src/chevre/migrateTTTSOldEventId.ts +0 -68
- package/example/src/chevre/publishConfirmationNumber.ts +0 -30
- package/example/src/chevre/publishServiceOutputIdentifier.ts +0 -28
- package/example/src/chevre/publishTransactionNumber.ts +0 -28
- package/example/src/chevre/renameTransaction.ts +0 -22
- package/lib/chevre/service/task/accountMoneyTransfer.d.ts +0 -3
- package/lib/chevre/service/task/accountMoneyTransfer.js +0 -31
- package/lib/chevre/service/task/cancelAccountMoneyTransfer.d.ts +0 -3
- package/lib/chevre/service/task/cancelAccountMoneyTransfer.js +0 -33
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// tslint:disable:no-console
|
|
2
|
+
import * as mongoose from 'mongoose';
|
|
3
|
+
|
|
4
|
+
import { chevre } from '../../../lib/index';
|
|
5
|
+
|
|
6
|
+
const project = { id: String(process.env.PROJECT_ID) };
|
|
7
|
+
const DELETING_PROPERTY_NAME: string = 'COA_ENDPOINT';
|
|
8
|
+
|
|
9
|
+
async function main() {
|
|
10
|
+
await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
|
|
11
|
+
|
|
12
|
+
const eventRepo = new chevre.repository.Event(mongoose.connection);
|
|
13
|
+
|
|
14
|
+
const cursor = eventRepo.getCursor(
|
|
15
|
+
{
|
|
16
|
+
'project.id': { $eq: project.id },
|
|
17
|
+
typeOf: { $eq: chevre.factory.eventType.ScreeningEventSeries }
|
|
18
|
+
// typeOf: { $eq: chevre.factory.eventType.ScreeningEvent },
|
|
19
|
+
// startDate: { $gte: new Date() }
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
// _id: 1,
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
console.log('events found');
|
|
26
|
+
|
|
27
|
+
let i = 0;
|
|
28
|
+
let updateCount = 0;
|
|
29
|
+
await cursor.eachAsync(async (doc) => {
|
|
30
|
+
i += 1;
|
|
31
|
+
const event: chevre.factory.event.IEvent<chevre.factory.eventType> = doc.toObject();
|
|
32
|
+
|
|
33
|
+
const coaEndpointPropert = event.additionalProperty?.find((p) => p.name === DELETING_PROPERTY_NAME);
|
|
34
|
+
|
|
35
|
+
if (coaEndpointPropert !== undefined) {
|
|
36
|
+
const newAdditionalProperty: chevre.factory.propertyValue.IPropertyValue<string>[] =
|
|
37
|
+
(Array.isArray(event.additionalProperty))
|
|
38
|
+
? event.additionalProperty.filter((p) => {
|
|
39
|
+
return p.name !== DELETING_PROPERTY_NAME;
|
|
40
|
+
})
|
|
41
|
+
: [];
|
|
42
|
+
console.log(
|
|
43
|
+
'updating event...', event.project.id, event.id, event.startDate, coaEndpointPropert.value, newAdditionalProperty, i);
|
|
44
|
+
await eventRepo.updatePartiallyById({
|
|
45
|
+
id: event.id,
|
|
46
|
+
attributes: <any>{
|
|
47
|
+
typeOf: event.typeOf,
|
|
48
|
+
additionalProperty: newAdditionalProperty
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
updateCount += 1;
|
|
52
|
+
console.log('event updated', event.project.id, event.id, event.startDate, i);
|
|
53
|
+
} else {
|
|
54
|
+
console.log('no property...', event.project.id, event.id, event.startDate, i);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
console.log(i, 'events checked');
|
|
59
|
+
console.log(updateCount, 'events updated');
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
main()
|
|
63
|
+
.then()
|
|
64
|
+
.catch(console.error);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// tslint:disable:no-console
|
|
2
|
-
|
|
2
|
+
import * as moment from 'moment';
|
|
3
3
|
import * as mongoose from 'mongoose';
|
|
4
4
|
|
|
5
5
|
import { chevre } from '../../../lib/index';
|
|
@@ -15,22 +15,42 @@ async function main() {
|
|
|
15
15
|
limit: 100,
|
|
16
16
|
page: 1,
|
|
17
17
|
sort: { startDate: 1 },
|
|
18
|
-
typeOf: chevre.factory.eventType.
|
|
18
|
+
typeOf: chevre.factory.eventType.ScreeningEvent,
|
|
19
19
|
project: { id: { $eq: PROJECT_ID } },
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
offers: {
|
|
21
|
+
seller: {
|
|
22
|
+
makesOffer: {
|
|
23
|
+
$elemMatch: {
|
|
24
|
+
'availableAtOrFrom.id': { $eq: '5h3gs22mu9j3ok7o63uog9o9i3' },
|
|
25
|
+
availabilityEnds: {
|
|
26
|
+
$gte: moment('2022-11-18T02:20:00.000Z')
|
|
27
|
+
.toDate(),
|
|
28
|
+
$lte: moment('2022-11-18T02:20:00.000Z')
|
|
29
|
+
.toDate()
|
|
30
|
+
},
|
|
31
|
+
availabilityStarts: {
|
|
32
|
+
$gte: moment('2022-11-15T15:00:00.000Z')
|
|
33
|
+
.toDate(),
|
|
34
|
+
$lte: moment('2022-11-15T15:00:00.000Z')
|
|
35
|
+
.toDate()
|
|
36
|
+
},
|
|
37
|
+
validFrom: {
|
|
38
|
+
$gte: moment('2022-11-15T15:00:00.000Z')
|
|
39
|
+
.toDate(),
|
|
40
|
+
$lte: moment('2022-11-15T15:00:00.000Z')
|
|
41
|
+
.toDate()
|
|
42
|
+
},
|
|
43
|
+
validThrough: {
|
|
44
|
+
$gte: moment('2022-11-18T02:20:00.000Z')
|
|
45
|
+
.toDate(),
|
|
46
|
+
$lte: moment('2022-11-18T02:20:00.000Z')
|
|
47
|
+
.toDate()
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
id: { $in: ['al6aff83y'] }
|
|
34
54
|
});
|
|
35
55
|
console.log(events);
|
|
36
56
|
console.log(events.length);
|
|
@@ -22,10 +22,6 @@ async function main() {
|
|
|
22
22
|
typeOf: chevre.factory.personType.Person,
|
|
23
23
|
id: 'b2bc2b6d-aea2-41fc-9f6e-e4ec89c11d2e',
|
|
24
24
|
identifier: [
|
|
25
|
-
{
|
|
26
|
-
name: 'tokenIssuer',
|
|
27
|
-
value: String(process.env.ISS)
|
|
28
|
-
},
|
|
29
25
|
{
|
|
30
26
|
name: 'iss',
|
|
31
27
|
value: String(process.env.ISS)
|
|
@@ -43,10 +43,6 @@ async function main() {
|
|
|
43
43
|
typeOf: chevre.factory.personType.Person,
|
|
44
44
|
id: 'b2bc2b6d-aea2-41fc-9f6e-e4ec89c11d2e',
|
|
45
45
|
identifier: [
|
|
46
|
-
{
|
|
47
|
-
name: 'tokenIssuer',
|
|
48
|
-
value: String(process.env.ISS)
|
|
49
|
-
},
|
|
50
46
|
{
|
|
51
47
|
name: 'iss',
|
|
52
48
|
value: String(process.env.ISS)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RESERVED_AGENT_IDENTIFIER_NAMES: string[];
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RESERVED_AGENT_IDENTIFIER_NAMES = void 0;
|
|
4
|
+
exports.RESERVED_AGENT_IDENTIFIER_NAMES = [
|
|
5
|
+
'orderNumber',
|
|
6
|
+
'tokenIssuer',
|
|
7
|
+
'iss',
|
|
8
|
+
'clientId',
|
|
9
|
+
'sub',
|
|
10
|
+
'hostname',
|
|
11
|
+
'username'
|
|
12
|
+
];
|
|
@@ -9,46 +9,28 @@ export declare type IAction<T extends factory.actionType> = T extends factory.ac
|
|
|
9
9
|
export declare class MongoRepository {
|
|
10
10
|
private readonly actionModel;
|
|
11
11
|
constructor(connection: Connection);
|
|
12
|
-
static CREATE_MONEY_TRANSFER_ACTIONS_MONGO_CONDITIONS(params: factory.account.action.moneyTransfer.ISearchConditions): any[];
|
|
13
12
|
/**
|
|
14
13
|
* アクション開始
|
|
15
14
|
*/
|
|
16
|
-
startByIdentifier<T extends factory.actionType>(params: factory.account.action.moneyTransfer.IAttributes): Promise<IAction<T>>;
|
|
17
15
|
/**
|
|
18
16
|
* アクション完了
|
|
19
17
|
*/
|
|
20
|
-
complete<T extends factory.actionType>(typeOf: T, actionId: string, result: any): Promise<IAction<T>>;
|
|
21
18
|
/**
|
|
22
19
|
* アクション中止
|
|
23
20
|
*/
|
|
24
|
-
cancel<T extends factory.actionType>(typeOf: T, actionId: string): Promise<IAction<T>>;
|
|
25
21
|
/**
|
|
26
22
|
* アクション失敗
|
|
27
23
|
*/
|
|
28
|
-
giveUp<T extends factory.actionType>(typeOf: T, actionId: string, error: any): Promise<IAction<T>>;
|
|
29
24
|
/**
|
|
30
25
|
* アクション検索
|
|
31
26
|
*/
|
|
32
|
-
findById<T extends factory.actionType>(typeOf: T, actionId: string): Promise<IAction<T>>;
|
|
33
|
-
countTransferActions(params: factory.account.action.moneyTransfer.ISearchConditions): Promise<number>;
|
|
34
27
|
/**
|
|
35
28
|
* 転送アクションを検索する
|
|
36
29
|
*/
|
|
37
|
-
searchTransferActions(params: factory.account.action.moneyTransfer.ISearchConditions): Promise<factory.account.action.moneyTransfer.IAction[]>;
|
|
38
30
|
/**
|
|
39
31
|
* アクションを検索する
|
|
40
32
|
* @param searchConditions 検索条件
|
|
41
33
|
*/
|
|
42
|
-
search<T extends factory.actionType>(searchConditions: {
|
|
43
|
-
typeOf: T;
|
|
44
|
-
actionStatuses?: factory.account.AccountStatusType[];
|
|
45
|
-
startDateFrom?: Date;
|
|
46
|
-
startDateThrough?: Date;
|
|
47
|
-
purposeTypeOfs?: factory.account.transactionType[];
|
|
48
|
-
fromLocationAccountNumbers?: string[];
|
|
49
|
-
toLocationAccountNumbers?: string[];
|
|
50
|
-
limit: number;
|
|
51
|
-
}): Promise<IAction<T>[]>;
|
|
52
34
|
clean(params: {
|
|
53
35
|
project?: {
|
|
54
36
|
id?: string;
|