@chevre/domain 22.14.0-alpha.17 → 22.14.0-alpha.3
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/{addEventBySchedule.ts → createEventBySchedule.ts} +2 -2
- package/example/src/chevre/eventOffer/adminEventOffers.ts +67 -0
- package/example/src/chevre/findReservationByCode.ts +1 -0
- package/example/src/chevre/migrateDeleteTransactionTasks.ts +132 -0
- package/example/src/chevre/optimizeDeleteTransactionTasks.ts +119 -0
- package/example/src/chevre/upsertMoviesByIdentifier.ts +58 -0
- package/lib/chevre/repo/accountingReport.d.ts +4 -4
- package/lib/chevre/repo/accountingReport.js +1 -1
- package/lib/chevre/repo/action.d.ts +1 -1
- package/lib/chevre/repo/creativeWork.d.ts +3 -1
- package/lib/chevre/repo/creativeWork.js +47 -65
- package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +15 -2
- package/lib/chevre/repo/mongoose/schemas/offer/event.d.ts +10 -0
- package/lib/chevre/repo/mongoose/schemas/{productOffer.js → offer/event.js} +53 -9
- package/lib/chevre/repo/offer/event.d.ts +38 -0
- package/lib/chevre/repo/offer/event.js +142 -0
- package/lib/chevre/repo/productOffer.d.ts +65 -60
- package/lib/chevre/repo/productOffer.js +163 -121
- package/lib/chevre/repo/task.js +2 -2
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +15 -2
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/reserve/start.js +2 -2
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +53 -68
- package/lib/chevre/service/event.js +2 -10
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +2 -0
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -0
- package/lib/chevre/service/offer/product.d.ts +3 -0
- package/lib/chevre/service/offer/product.js +38 -29
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +1 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +1 -1
- package/lib/chevre/service/reserve/useReservation.js +3 -2
- package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +2 -0
- package/lib/chevre/service/task/checkResource.d.ts +2 -2
- package/lib/chevre/service/task/checkResource.js +6 -8
- package/lib/chevre/service/task/createAccountingReport.d.ts +2 -2
- package/lib/chevre/service/task/createAccountingReport.js +15 -15
- package/lib/chevre/service/task/createEvent/createEventBySchedule.d.ts +1 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule.js +2 -3
- package/lib/chevre/service/task/createEvent/createEventSeries.d.ts +1 -1
- package/lib/chevre/service/task/deletePerson.js +10 -11
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +2 -0
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +5 -7
- package/lib/chevre/service/task/onResourceUpdated.js +2 -1
- package/lib/chevre/service/task/useReservation.js +2 -1
- package/lib/chevre/service/taskHandler.js +0 -2
- package/lib/chevre/service/transaction/deleteTransaction.js +9 -9
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +1 -1
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.d.ts +1 -0
- package/package.json +2 -2
- package/lib/chevre/repo/mongoose/schemas/productOffer.d.ts +0 -36
|
@@ -8,6 +8,7 @@ import type { EventRepo, IMinimizedIndividualEvent } from '../../../../repo/even
|
|
|
8
8
|
import { EventSeriesRepo } from '../../../../repo/eventSeries';
|
|
9
9
|
import type { IssuerRepo } from '../../../../repo/issuer';
|
|
10
10
|
import type { MemberProgramRepo } from '../../../../repo/memberProgram';
|
|
11
|
+
import type { EventOfferRepo } from '../../../../repo/offer/event';
|
|
11
12
|
import type { OfferRepo } from '../../../../repo/offer/unitPriceInCatalog';
|
|
12
13
|
import type { OfferCatalogRepo } from '../../../../repo/offerCatalog';
|
|
13
14
|
import type { OfferCatalogItemRepo } from '../../../../repo/offerCatalogItem';
|
|
@@ -52,6 +53,7 @@ declare function processStartReserve4chevre(params: {
|
|
|
52
53
|
authorization: AuthorizationRepo;
|
|
53
54
|
stockHolder: StockHolderRepo;
|
|
54
55
|
event: EventRepo;
|
|
56
|
+
eventOffer: EventOfferRepo;
|
|
55
57
|
eventSeries: EventSeriesRepo;
|
|
56
58
|
issuer: IssuerRepo;
|
|
57
59
|
memberProgram: MemberProgramRepo;
|
|
@@ -8,6 +8,7 @@ import type { EventRepo } from '../../../repo/event';
|
|
|
8
8
|
import { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
9
9
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
10
10
|
import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
11
|
+
import type { EventOfferRepo } from '../../../repo/offer/event';
|
|
11
12
|
import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog';
|
|
12
13
|
import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
|
|
13
14
|
import type { OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
|
|
@@ -32,6 +33,7 @@ interface IAuthorizeRepos {
|
|
|
32
33
|
assetTransaction: AssetTransactionRepo;
|
|
33
34
|
authorization: AuthorizationRepo;
|
|
34
35
|
event: EventRepo;
|
|
36
|
+
eventOffer: EventOfferRepo;
|
|
35
37
|
eventSeries: EventSeriesRepo;
|
|
36
38
|
issuer: IssuerRepo;
|
|
37
39
|
memberProgram: MemberProgramRepo;
|
|
@@ -8,6 +8,7 @@ import type { OrderInTransactionRepo } from '../../repo/orderInTransaction';
|
|
|
8
8
|
import type { OrderNumberRepo } from '../../repo/orderNumber';
|
|
9
9
|
import type { OwnershipInfoRepo } from '../../repo/ownershipInfo';
|
|
10
10
|
import type { ProductRepo } from '../../repo/product';
|
|
11
|
+
import type { ProductOfferRepo } from '../../repo/productOffer';
|
|
11
12
|
import type { ProjectRepo } from '../../repo/project';
|
|
12
13
|
import type { ServiceOutputRepo } from '../../repo/serviceOutput';
|
|
13
14
|
import type { ServiceOutputIdentifierRepo } from '../../repo/serviceOutputIdentifier';
|
|
@@ -23,6 +24,7 @@ export interface IAuthorizeOperationRepos {
|
|
|
23
24
|
orderNumber: OrderNumberRepo;
|
|
24
25
|
ownershipInfo: OwnershipInfoRepo;
|
|
25
26
|
product: ProductRepo;
|
|
27
|
+
productOffer: ProductOfferRepo;
|
|
26
28
|
project: ProjectRepo;
|
|
27
29
|
serviceOutput: ServiceOutputRepo;
|
|
28
30
|
serviceOutputIdentifier: ServiceOutputIdentifierRepo;
|
|
@@ -63,6 +65,7 @@ export declare function search(params: {
|
|
|
63
65
|
offer: OfferRepo;
|
|
64
66
|
offerCatalog: OfferCatalogRepo;
|
|
65
67
|
product: ProductRepo;
|
|
68
|
+
productOffer: ProductOfferRepo;
|
|
66
69
|
}) => Promise<{
|
|
67
70
|
offers: factory.product.ITicketOffer[];
|
|
68
71
|
product: Pick<factory.product.IProduct, "id" | "productID" | "typeOf" | "name" | "project" | "serviceOutput" | "serviceType" | "description">;
|
|
@@ -13,6 +13,7 @@ exports.ERROR_MESSAGE_ALREADY_REGISTERED = void 0;
|
|
|
13
13
|
exports.search = search;
|
|
14
14
|
exports.authorize = authorize;
|
|
15
15
|
exports.voidTransaction = voidTransaction;
|
|
16
|
+
const moment = require("moment");
|
|
16
17
|
const factory = require("../../factory");
|
|
17
18
|
const accountTransactionIdentifier_1 = require("../../factory/accountTransactionIdentifier");
|
|
18
19
|
const availableProductTypes_1 = require("../../factory/availableProductTypes");
|
|
@@ -27,8 +28,8 @@ exports.ERROR_MESSAGE_ALREADY_REGISTERED = 'Already registered';
|
|
|
27
28
|
*/
|
|
28
29
|
function search(params) {
|
|
29
30
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
// const now = moment();
|
|
31
31
|
var _a;
|
|
32
|
+
const now = moment();
|
|
32
33
|
const searchProductsResult = yield repos.product.projectFields({
|
|
33
34
|
limit: 1,
|
|
34
35
|
page: 1,
|
|
@@ -46,24 +47,28 @@ function search(params) {
|
|
|
46
47
|
|| product.typeOf === factory.product.ProductType.PaymentCard) {
|
|
47
48
|
const sellerId = (_a = params.seller) === null || _a === void 0 ? void 0 : _a.id;
|
|
48
49
|
if (typeof sellerId === 'string') {
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
// project: { id: { $eq: params.project.id } },
|
|
52
|
-
// itemOffered: { id: { $eq: params.itemOffered.id } },
|
|
53
|
-
// seller: { id: { $eq: sellerId } }
|
|
54
|
-
// });
|
|
55
|
-
// const hasValidOffer = productOffers.some((o) => {
|
|
56
|
-
// return o.seller?.id === sellerId
|
|
57
|
-
// && o.validFrom !== undefined
|
|
58
|
-
// && moment(o.validFrom)
|
|
59
|
-
// .isSameOrBefore(now)
|
|
60
|
-
// && o.validThrough !== undefined
|
|
61
|
-
// && moment(o.validThrough)
|
|
62
|
-
// .isSameOrAfter(now);
|
|
63
|
-
// });
|
|
64
|
-
// if (!hasValidOffer) {
|
|
50
|
+
// const productOffers = product.offers;
|
|
51
|
+
// if (!Array.isArray(productOffers)) {
|
|
65
52
|
// return { offers: [], product };
|
|
66
53
|
// }
|
|
54
|
+
const productOffers = yield repos.productOffer.search({
|
|
55
|
+
project: { id: { $eq: params.project.id } },
|
|
56
|
+
itemOffered: { id: { $eq: params.itemOffered.id } },
|
|
57
|
+
seller: { id: { $eq: sellerId } }
|
|
58
|
+
});
|
|
59
|
+
const hasValidOffer = productOffers.some((o) => {
|
|
60
|
+
var _a;
|
|
61
|
+
return ((_a = o.seller) === null || _a === void 0 ? void 0 : _a.id) === sellerId
|
|
62
|
+
&& o.validFrom !== undefined
|
|
63
|
+
&& moment(o.validFrom)
|
|
64
|
+
.isSameOrBefore(now)
|
|
65
|
+
&& o.validThrough !== undefined
|
|
66
|
+
&& moment(o.validThrough)
|
|
67
|
+
.isSameOrAfter(now);
|
|
68
|
+
});
|
|
69
|
+
if (!hasValidOffer) {
|
|
70
|
+
return { offers: [], product };
|
|
71
|
+
}
|
|
67
72
|
}
|
|
68
73
|
}
|
|
69
74
|
const offers = yield (0, searchProductOffers_1.searchProductOffers)({
|
|
@@ -277,7 +282,7 @@ function processVoidRegisterServiceTransaction(params) {
|
|
|
277
282
|
* 受け入れらたオファーの内容を検証
|
|
278
283
|
*/
|
|
279
284
|
function validateAcceptedOffers(params) {
|
|
280
|
-
return (
|
|
285
|
+
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
281
286
|
let acceptedOfferWithoutDetail = params.object;
|
|
282
287
|
if (!Array.isArray(acceptedOfferWithoutDetail)) {
|
|
283
288
|
acceptedOfferWithoutDetail = [acceptedOfferWithoutDetail];
|
|
@@ -292,18 +297,22 @@ function validateAcceptedOffers(params) {
|
|
|
292
297
|
typeOf: params.seller.typeOf
|
|
293
298
|
};
|
|
294
299
|
// 販売者を検証
|
|
295
|
-
//
|
|
296
|
-
//
|
|
297
|
-
//
|
|
298
|
-
// itemOffered: { id: { $eq: String(params.product.id) } },
|
|
299
|
-
// seller: { id: { $eq: params.seller.id } }
|
|
300
|
-
// });
|
|
301
|
-
// const hasValidOffer = productOffers.some((o) => {
|
|
302
|
-
// return o.seller?.id === params.seller.id;
|
|
303
|
-
// });
|
|
304
|
-
// if (!hasValidOffer) {
|
|
305
|
-
// throw new factory.errors.Argument('Product', 'Product has no valid offer');
|
|
300
|
+
// const productOffers = params.product.offers;
|
|
301
|
+
// if (!Array.isArray(productOffers)) {
|
|
302
|
+
// throw new factory.errors.Argument('Product', 'Product offers undefined');
|
|
306
303
|
// }
|
|
304
|
+
const productOffers = yield repos.productOffer.search({
|
|
305
|
+
project: { id: { $eq: params.product.project.id } },
|
|
306
|
+
itemOffered: { id: { $eq: String(params.product.id) } },
|
|
307
|
+
seller: { id: { $eq: params.seller.id } }
|
|
308
|
+
});
|
|
309
|
+
const hasValidOffer = productOffers.some((o) => {
|
|
310
|
+
var _a;
|
|
311
|
+
return ((_a = o.seller) === null || _a === void 0 ? void 0 : _a.id) === params.seller.id;
|
|
312
|
+
});
|
|
313
|
+
if (!hasValidOffer) {
|
|
314
|
+
throw new factory.errors.Argument('Product', 'Product has no valid offer');
|
|
315
|
+
}
|
|
307
316
|
// 利用可能なチケットオファーであれば受け入れる
|
|
308
317
|
return Promise.all(acceptedOfferWithoutDetail.map((offerWithoutDetail) => {
|
|
309
318
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.createAccountingReportIfNotExist = createAccountingReportIfNotExist;
|
|
13
13
|
const moment = require("moment-timezone");
|
|
14
14
|
const factory = require("../../factory");
|
|
15
|
+
// import { createMaskedCustomer } from '../../factory/order';
|
|
15
16
|
function createAccountingReportIfNotExist(params) {
|
|
16
17
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
17
18
|
const order4report = createOrder4report(params);
|
|
@@ -116,8 +116,8 @@ function createCreateAccountingReportTask(order) {
|
|
|
116
116
|
numberOfTried: 0,
|
|
117
117
|
executionResults: [],
|
|
118
118
|
data: {
|
|
119
|
-
object: { mainEntity: { orderNumber: order.orderNumber } }
|
|
120
|
-
|
|
119
|
+
object: { mainEntity: { orderNumber: order.orderNumber } },
|
|
120
|
+
project: { id: order.project.id }
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
return [task];
|
|
@@ -127,7 +127,7 @@ function createCheckResourceTask(order) {
|
|
|
127
127
|
orderNumber: order.orderNumber,
|
|
128
128
|
typeOf: order.typeOf
|
|
129
129
|
},
|
|
130
|
-
|
|
130
|
+
project: order.project,
|
|
131
131
|
typeOf: factory.actionType.CheckAction
|
|
132
132
|
};
|
|
133
133
|
const taskIdentifier = util.format('%s:%s:%s:%s', order.project.id, factory.taskName.CheckResource, order.typeOf, order.orderNumber);
|
|
@@ -28,7 +28,8 @@ function useReservation(params) {
|
|
|
28
28
|
// const ticketToken = params?.instrument?.ticketToken;
|
|
29
29
|
if (Array.isArray(params.instrument)) {
|
|
30
30
|
for (const eachInstrument of params.instrument) {
|
|
31
|
-
if (eachInstrument.typeOf ===
|
|
31
|
+
if (eachInstrument.typeOf === factory.action.check.token.ObjectType.Ticket
|
|
32
|
+
&& typeof eachInstrument.ticketToken === 'string') {
|
|
32
33
|
ticketToken = eachInstrument.ticketToken;
|
|
33
34
|
break;
|
|
34
35
|
}
|
|
@@ -61,7 +62,7 @@ function useReservation(params) {
|
|
|
61
62
|
};
|
|
62
63
|
// extend instrument to array(2025-02-18~)
|
|
63
64
|
const instrument = [
|
|
64
|
-
Object.assign(Object.assign({}, (typeof ticketToken === 'string') ? { ticketToken } : undefined), { typeOf:
|
|
65
|
+
Object.assign(Object.assign({}, (typeof ticketToken === 'string') ? { ticketToken } : undefined), { typeOf: factory.action.check.token.ObjectType.Ticket }),
|
|
65
66
|
// support orderAsInstrument(2025-02-18~)
|
|
66
67
|
...(Array.isArray(params.instrument))
|
|
67
68
|
? params.instrument.filter(({ typeOf }) => typeOf === factory.order.OrderType.Order)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as factory from '../../factory';
|
|
1
2
|
import type { AuthorizationRepo } from '../../repo/authorization';
|
|
2
3
|
import type { OrderRepo } from '../../repo/order';
|
|
3
4
|
import type { TicketRepo } from '../../repo/ticket';
|
|
@@ -11,6 +12,7 @@ export declare function verifyToken4reservation(params: {
|
|
|
11
12
|
seller?: {
|
|
12
13
|
id?: string;
|
|
13
14
|
};
|
|
15
|
+
agent: factory.action.check.token.IAgent;
|
|
14
16
|
reservationId: string;
|
|
15
17
|
ticket: {
|
|
16
18
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as factory from '../../factory';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IOperationExecute } from '../taskHandler';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行関数
|
|
5
5
|
*/
|
|
6
|
-
export declare function call(
|
|
6
|
+
export declare function call(data: factory.task.checkResource.IData): IOperationExecute<void>;
|
|
@@ -24,19 +24,17 @@ const validateOrder_1 = require("../validation/validateOrder");
|
|
|
24
24
|
/**
|
|
25
25
|
* タスク実行関数
|
|
26
26
|
*/
|
|
27
|
-
function call(
|
|
27
|
+
function call(data) {
|
|
28
28
|
return (_a) => __awaiter(this, [_a], void 0, function* ({ connection, redisClient }) {
|
|
29
29
|
if (redisClient === undefined) {
|
|
30
30
|
throw new factory.errors.Argument('settings', 'redisClient required');
|
|
31
31
|
}
|
|
32
32
|
const actionRepo = new action_1.ActionRepo(connection);
|
|
33
|
-
const { data } = params;
|
|
34
33
|
const actionAttributes = {
|
|
35
|
-
agent: { id:
|
|
34
|
+
agent: { id: data.project.id, typeOf: factory.organizationType.Project },
|
|
36
35
|
object: data.object,
|
|
37
|
-
project: { id:
|
|
38
|
-
typeOf: factory.actionType.CheckAction
|
|
39
|
-
sameAs: { id: params.id, typeOf: 'Task' } // add sameAs(2025-09-22~)
|
|
36
|
+
project: { id: data.project.id, typeOf: factory.organizationType.Project },
|
|
37
|
+
typeOf: factory.actionType.CheckAction
|
|
40
38
|
};
|
|
41
39
|
const action = yield actionRepo.start(actionAttributes);
|
|
42
40
|
const objectTypeOf = data.object.typeOf;
|
|
@@ -45,7 +43,7 @@ function call(params) {
|
|
|
45
43
|
case factory.order.OrderType.Order:
|
|
46
44
|
yield (0, validateOrder_1.validateOrder)({
|
|
47
45
|
orderNumber: data.object.orderNumber,
|
|
48
|
-
project: { id:
|
|
46
|
+
project: { id: data.project.id }
|
|
49
47
|
})({
|
|
50
48
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
51
49
|
assetTransaction: new assetTransaction_1.AssetTransactionRepo(connection),
|
|
@@ -58,7 +56,7 @@ function call(params) {
|
|
|
58
56
|
case factory.eventType.ScreeningEvent:
|
|
59
57
|
yield (0, validateEvent_1.validateEvent)({
|
|
60
58
|
id: data.object.id,
|
|
61
|
-
project: { id:
|
|
59
|
+
project: { id: data.project.id }
|
|
62
60
|
})({
|
|
63
61
|
event: new event_1.EventRepo(connection),
|
|
64
62
|
stockHolder: new stockHolder_1.StockHolderRepo({ connection })
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IOperationExecute } from '../taskHandler';
|
|
2
2
|
import * as factory from '../../factory';
|
|
3
3
|
/**
|
|
4
4
|
* タスク実行関数
|
|
5
5
|
*/
|
|
6
|
-
export declare function call(
|
|
6
|
+
export declare function call(data: factory.task.IData<factory.taskName.CreateAccountingReport>): IOperationExecute<void>;
|
|
@@ -19,9 +19,9 @@ const createAccountingReportIfNotExist_1 = require("../order/createAccountingRep
|
|
|
19
19
|
/**
|
|
20
20
|
* タスク実行関数
|
|
21
21
|
*/
|
|
22
|
-
function call(
|
|
22
|
+
function call(data) {
|
|
23
23
|
return (_a) => __awaiter(this, [_a], void 0, function* ({ connection }) {
|
|
24
|
-
yield createAccountingReport(
|
|
24
|
+
yield createAccountingReport(data)({
|
|
25
25
|
acceptedOffer: new acceptedOffer_1.AcceptedOfferRepo(connection),
|
|
26
26
|
accountingReport: new accountingReport_1.AccountingReportRepo(connection),
|
|
27
27
|
action: new action_1.ActionRepo(connection),
|
|
@@ -31,9 +31,8 @@ function call(params) {
|
|
|
31
31
|
}
|
|
32
32
|
function createAccountingReport(params) {
|
|
33
33
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
const { data } = params;
|
|
35
34
|
const order = yield repos.order.projectFieldsByOrderNumber({
|
|
36
|
-
orderNumber:
|
|
35
|
+
orderNumber: params.object.mainEntity.orderNumber,
|
|
37
36
|
project: { id: params.project.id },
|
|
38
37
|
inclusion: [
|
|
39
38
|
'orderNumber', 'project', 'customer', 'confirmationNumber',
|
|
@@ -42,26 +41,28 @@ function createAccountingReport(params) {
|
|
|
42
41
|
});
|
|
43
42
|
const simpleOrder = {
|
|
44
43
|
typeOf: order.typeOf,
|
|
44
|
+
// seller: {
|
|
45
|
+
// id: order.seller.id,
|
|
46
|
+
// typeOf: order.seller.typeOf,
|
|
47
|
+
// name: order.seller.name
|
|
48
|
+
// }, // 廃止(2024-03-06~)
|
|
49
|
+
// customer: { typeOf: order.customer.typeOf, id: order.customer.id }, // 廃止(2024-03-06~)
|
|
45
50
|
orderNumber: order.orderNumber,
|
|
51
|
+
// price: order.price,
|
|
52
|
+
// priceCurrency: order.priceCurrency,
|
|
46
53
|
orderDate: order.orderDate
|
|
47
54
|
};
|
|
48
|
-
const actionObject = {
|
|
49
|
-
// ...params,
|
|
50
|
-
mainEntity: { orderNumber: simpleOrder.orderNumber },
|
|
51
|
-
typeOf: 'Report'
|
|
52
|
-
};
|
|
53
55
|
const actionAttributes = {
|
|
54
56
|
project: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
55
57
|
typeOf: factory.actionType.CreateAction,
|
|
56
58
|
agent: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
57
|
-
object:
|
|
58
|
-
purpose: simpleOrder
|
|
59
|
-
sameAs: { id: params.id, typeOf: 'Task' } // add sameAs(2025-09-21~)
|
|
59
|
+
object: Object.assign(Object.assign({}, params), { typeOf: 'Report' }),
|
|
60
|
+
purpose: simpleOrder
|
|
60
61
|
};
|
|
61
62
|
const action = yield repos.action.start(actionAttributes);
|
|
62
63
|
try {
|
|
63
64
|
const acceptedOffers = yield repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
64
|
-
orderNumber: { $eq:
|
|
65
|
+
orderNumber: { $eq: params.object.mainEntity.orderNumber },
|
|
65
66
|
project: { id: { $eq: params.project.id } }
|
|
66
67
|
});
|
|
67
68
|
yield (0, createAccountingReportIfNotExist_1.createAccountingReportIfNotExist)(Object.assign(Object.assign({}, order), { acceptedOffers }))(repos);
|
|
@@ -75,7 +76,6 @@ function createAccountingReport(params) {
|
|
|
75
76
|
}
|
|
76
77
|
throw error;
|
|
77
78
|
}
|
|
78
|
-
|
|
79
|
-
yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result });
|
|
79
|
+
yield repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: {} });
|
|
80
80
|
});
|
|
81
81
|
}
|
|
@@ -10,7 +10,7 @@ import type { ScheduleRepo } from '../../../repo/schedule';
|
|
|
10
10
|
import type { SettingRepo } from '../../../repo/setting';
|
|
11
11
|
import type { TaskRepo } from '../../../repo/task';
|
|
12
12
|
import * as factory from '../../../factory';
|
|
13
|
-
export declare function createEventBySchedule(params: factory.task.createEvent.
|
|
13
|
+
export declare function createEventBySchedule(params: factory.task.createEvent.ICreateEventByScheduleAction): (repos: {
|
|
14
14
|
action: ActionRepo;
|
|
15
15
|
event: EventRepo;
|
|
16
16
|
eventSeries: EventSeriesRepo;
|
|
@@ -34,10 +34,9 @@ function updateEvent4ttts(params) {
|
|
|
34
34
|
// replacee: reservation,
|
|
35
35
|
// replacer: params.attributes, // $unsetもありうるのでいったん保留
|
|
36
36
|
targetCollection: {
|
|
37
|
-
|
|
37
|
+
id: params.attributes.identifier,
|
|
38
38
|
typeOf: factory.eventType.ScreeningEvent
|
|
39
|
-
}
|
|
40
|
-
instrument: { typeOf: 'Task' }
|
|
39
|
+
}
|
|
41
40
|
};
|
|
42
41
|
const action = yield repos.action.start(actionAttributes);
|
|
43
42
|
let savedEvent;
|
|
@@ -4,7 +4,7 @@ import type { EventRepo } from '../../../repo/event';
|
|
|
4
4
|
import type { EventSeriesRepo } from '../../../repo/eventSeries';
|
|
5
5
|
import type { MovieTheaterRepo } from '../../../repo/place/movieTheater';
|
|
6
6
|
import type { TaskRepo } from '../../../repo/task';
|
|
7
|
-
export declare function createEventSeries(params: factory.task.createEvent.
|
|
7
|
+
export declare function createEventSeries(params: factory.task.createEvent.ICreateEventSeriesAction): (repos: {
|
|
8
8
|
action: ActionRepo;
|
|
9
9
|
event: EventRepo;
|
|
10
10
|
eventSeries: EventSeriesRepo;
|
|
@@ -95,18 +95,17 @@ function deleteById(params, setting) {
|
|
|
95
95
|
// tslint:disable-next-line:max-func-body-length
|
|
96
96
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
97
97
|
var _a;
|
|
98
|
-
const deleteObject = {
|
|
99
|
-
id: params.id,
|
|
100
|
-
typeOf: factory.personType.Person,
|
|
101
|
-
migrate: params.migrate,
|
|
102
|
-
physically: params.physically
|
|
103
|
-
// discontinue(2025-03-29~)
|
|
104
|
-
// ...(typeof params.migratePersonRecipientUrl === 'string')
|
|
105
|
-
// ? { migratePersonRecipientUrl: params.migratePersonRecipientUrl } : undefined
|
|
106
|
-
};
|
|
107
98
|
const deleteMemberAction = {
|
|
108
99
|
agent: params.agent,
|
|
109
|
-
object:
|
|
100
|
+
object: {
|
|
101
|
+
id: params.id,
|
|
102
|
+
typeOf: factory.personType.Person,
|
|
103
|
+
migrate: params.migrate,
|
|
104
|
+
physically: params.physically
|
|
105
|
+
// discontinue(2025-03-29~)
|
|
106
|
+
// ...(typeof params.migratePersonRecipientUrl === 'string')
|
|
107
|
+
// ? { migratePersonRecipientUrl: params.migratePersonRecipientUrl } : undefined
|
|
108
|
+
},
|
|
110
109
|
project: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
111
110
|
typeOf: factory.actionType.DeleteAction
|
|
112
111
|
};
|
|
@@ -387,7 +386,7 @@ function createDeleteTransactionTask(params) {
|
|
|
387
386
|
executionResults: [],
|
|
388
387
|
data: {
|
|
389
388
|
object: {
|
|
390
|
-
specifyingMethod: factory.
|
|
389
|
+
specifyingMethod: factory.task.deleteTransaction.SpecifyingMethod.AgentId,
|
|
391
390
|
agent: { id: params.id },
|
|
392
391
|
project: { id: params.project.id },
|
|
393
392
|
typeOf: transactionType
|
|
@@ -17,6 +17,7 @@ import type { MovieTheaterRepo } from '../../../repo/place/movieTheater';
|
|
|
17
17
|
import type { ScreeningRoomRepo } from '../../../repo/place/screeningRoom';
|
|
18
18
|
import type { ProductRepo } from '../../../repo/product';
|
|
19
19
|
import type { ProductModelRepo } from '../../../repo/productModel';
|
|
20
|
+
import type { ProductOfferRepo } from '../../../repo/productOffer';
|
|
20
21
|
import type { SettingRepo } from '../../../repo/setting';
|
|
21
22
|
import type { TaskRepo } from '../../../repo/task';
|
|
22
23
|
export declare function onResourceDeleted(params: factory.task.onResourceUpdated.IData): (repos: {
|
|
@@ -38,6 +39,7 @@ export declare function onResourceDeleted(params: factory.task.onResourceUpdated
|
|
|
38
39
|
screeningRoom: ScreeningRoomRepo;
|
|
39
40
|
product: ProductRepo;
|
|
40
41
|
productModel: ProductModelRepo;
|
|
42
|
+
productOffer: ProductOfferRepo;
|
|
41
43
|
setting: SettingRepo;
|
|
42
44
|
task: TaskRepo;
|
|
43
45
|
}) => Promise<void>;
|
|
@@ -252,12 +252,11 @@ function deleteResourcesBySeller(params) {
|
|
|
252
252
|
project: { id: params.project.id },
|
|
253
253
|
id: sellerId
|
|
254
254
|
});
|
|
255
|
-
// productsドキュメント参照のoffers検証は廃止(2025-09-22~)
|
|
256
255
|
// プロダクトオファー削除
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
256
|
+
const deleteProductOfferResult = yield repos.productOffer.deleteManyBySellerId({
|
|
257
|
+
project: { id: params.project.id },
|
|
258
|
+
seller: { id: sellerId }
|
|
259
|
+
});
|
|
261
260
|
// イベント削除
|
|
262
261
|
const deleteEventResult = yield repos.event.deleteManyEventByOrganizerId({
|
|
263
262
|
project: { id: params.project.id },
|
|
@@ -279,8 +278,7 @@ function deleteResourcesBySeller(params) {
|
|
|
279
278
|
parentOrganization: { id: sellerId }
|
|
280
279
|
});
|
|
281
280
|
deleteResult = {
|
|
282
|
-
deleteMemberResult, deletePaymentServiceProviderResult,
|
|
283
|
-
// deleteProductOfferResult,
|
|
281
|
+
deleteMemberResult, deletePaymentServiceProviderResult, deleteProductOfferResult,
|
|
284
282
|
deleteEventResult, deleteEventSeriesResult, deleteScreeningRoomResult, deleteMovieTheaterResult
|
|
285
283
|
};
|
|
286
284
|
}
|
|
@@ -29,6 +29,7 @@ const movieTheater_1 = require("../../repo/place/movieTheater");
|
|
|
29
29
|
const screeningRoom_1 = require("../../repo/place/screeningRoom");
|
|
30
30
|
const product_1 = require("../../repo/product");
|
|
31
31
|
const productModel_1 = require("../../repo/productModel");
|
|
32
|
+
const productOffer_1 = require("../../repo/productOffer");
|
|
32
33
|
const setting_1 = require("../../repo/setting");
|
|
33
34
|
const task_1 = require("../../repo/task");
|
|
34
35
|
const onAggregateOfferUpdated_1 = require("./onResourceUpdated/onAggregateOfferUpdated");
|
|
@@ -60,7 +61,7 @@ function call(data) {
|
|
|
60
61
|
screeningRoom: new screeningRoom_1.ScreeningRoomRepo(connection),
|
|
61
62
|
product: new product_1.ProductRepo(connection),
|
|
62
63
|
productModel: new productModel_1.ProductModelRepo(connection),
|
|
63
|
-
|
|
64
|
+
productOffer: new productOffer_1.ProductOfferRepo(connection),
|
|
64
65
|
setting: new setting_1.SettingRepo(connection),
|
|
65
66
|
task: new task_1.TaskRepo(connection)
|
|
66
67
|
});
|
|
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.call = call;
|
|
13
|
+
const factory = require("../../factory");
|
|
13
14
|
const action_1 = require("../../repo/action");
|
|
14
15
|
const assetTransaction_1 = require("../../repo/assetTransaction");
|
|
15
16
|
const authorization_1 = require("../../repo/authorization");
|
|
@@ -30,7 +31,7 @@ function call(data) {
|
|
|
30
31
|
instrument = data.instrument;
|
|
31
32
|
}
|
|
32
33
|
else {
|
|
33
|
-
if (((_b = data.instrument) === null || _b === void 0 ? void 0 : _b.typeOf) ===
|
|
34
|
+
if (((_b = data.instrument) === null || _b === void 0 ? void 0 : _b.typeOf) === factory.action.check.token.ObjectType.Ticket) {
|
|
34
35
|
instrument = [data.instrument];
|
|
35
36
|
}
|
|
36
37
|
}
|
|
@@ -50,8 +50,6 @@ function executeTask(task, next) {
|
|
|
50
50
|
case factory.taskName.AuthorizePayment:
|
|
51
51
|
case factory.taskName.CancelPendingReservation:
|
|
52
52
|
case factory.taskName.CheckMovieTicket:
|
|
53
|
-
case factory.taskName.CheckResource:
|
|
54
|
-
case factory.taskName.CreateAccountingReport:
|
|
55
53
|
case factory.taskName.DeletePerson:
|
|
56
54
|
case factory.taskName.HandleNotification:
|
|
57
55
|
case factory.taskName.ImportEventCapacitiesFromCOA:
|
|
@@ -19,7 +19,7 @@ const deleteOrder_1 = require("../order/deleteOrder");
|
|
|
19
19
|
function deleteTransaction(params) {
|
|
20
20
|
// tslint:disable-next-line:max-func-body-length
|
|
21
21
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
if (params.object.specifyingMethod === factory.
|
|
22
|
+
if (params.object.specifyingMethod === factory.task.deleteTransaction.SpecifyingMethod.AgentId) {
|
|
23
23
|
// transaction.agent.id指定による取引削除に対応(2023-06-30~)
|
|
24
24
|
yield createDeleteTransactionTasksByAgentId(params)(repos);
|
|
25
25
|
}
|
|
@@ -31,8 +31,8 @@ function deleteTransaction(params) {
|
|
|
31
31
|
function createDeleteTransactionTasksByAgentId(params) {
|
|
32
32
|
// tslint:disable-next-line:max-func-body-length
|
|
33
33
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
-
if (params.object.specifyingMethod !== factory.
|
|
35
|
-
throw new factory.errors.Argument('object.specifyingMethod', `must be ${factory.
|
|
34
|
+
if (params.object.specifyingMethod !== factory.task.deleteTransaction.SpecifyingMethod.AgentId) {
|
|
35
|
+
throw new factory.errors.Argument('object.specifyingMethod', `must be ${factory.task.deleteTransaction.SpecifyingMethod.Id}`);
|
|
36
36
|
}
|
|
37
37
|
const agentIdSpecified = params.object.agent.id;
|
|
38
38
|
// agentIdによる全取引についてDeleteTransactionタスクを作成する
|
|
@@ -61,7 +61,7 @@ function createDeleteTransactionTasksByAgentId(params) {
|
|
|
61
61
|
numberOfTried: 0,
|
|
62
62
|
executionResults: [],
|
|
63
63
|
data: {
|
|
64
|
-
object: Object.assign({ specifyingMethod: factory.
|
|
64
|
+
object: Object.assign({ specifyingMethod: factory.task.deleteTransaction.SpecifyingMethod.Id, id: transaction.id, object: Object.assign(Object.assign({}, (typeof transaction.object.confirmationNumber === 'string')
|
|
65
65
|
? { confirmationNumber: transaction.object.confirmationNumber }
|
|
66
66
|
: undefined), (typeof transaction.object.orderNumber === 'string')
|
|
67
67
|
? { orderNumber: transaction.object.orderNumber }
|
|
@@ -81,7 +81,7 @@ function createDeleteTransactionTasksByAgentId(params) {
|
|
|
81
81
|
numberOfTried: 0,
|
|
82
82
|
executionResults: [],
|
|
83
83
|
data: {
|
|
84
|
-
object: Object.assign({ specifyingMethod: factory.
|
|
84
|
+
object: Object.assign({ specifyingMethod: factory.task.deleteTransaction.SpecifyingMethod.Id, id: transaction.id, object: {
|
|
85
85
|
order: transaction.object.order
|
|
86
86
|
}, project: transaction.project, startDate: transaction.startDate, typeOf: transaction.typeOf }, (transaction.endDate !== undefined) ? { endDate: transaction.endDate } : undefined)
|
|
87
87
|
}
|
|
@@ -99,7 +99,7 @@ function createDeleteTransactionTasksByAgentId(params) {
|
|
|
99
99
|
numberOfTried: 0,
|
|
100
100
|
executionResults: [],
|
|
101
101
|
data: {
|
|
102
|
-
object: Object.assign({ specifyingMethod: factory.
|
|
102
|
+
object: Object.assign({ specifyingMethod: factory.task.deleteTransaction.SpecifyingMethod.Id, id: transaction.id, object: Object.assign({}, (transaction.object.pendingTransaction !== undefined)
|
|
103
103
|
? { pendingTransaction: transaction.object.pendingTransaction }
|
|
104
104
|
: undefined), project: transaction.project, startDate: transaction.startDate, typeOf: transaction.typeOf }, (transaction.endDate !== undefined) ? { endDate: transaction.endDate } : undefined)
|
|
105
105
|
}
|
|
@@ -120,8 +120,8 @@ function deleteTransactionById(params) {
|
|
|
120
120
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
121
121
|
var _a;
|
|
122
122
|
if (typeof params.object.specifyingMethod === 'string'
|
|
123
|
-
&& params.object.specifyingMethod !== factory.
|
|
124
|
-
throw new factory.errors.Argument('object.specifyingMethod', `must be ${factory.
|
|
123
|
+
&& params.object.specifyingMethod !== factory.task.deleteTransaction.SpecifyingMethod.Id) {
|
|
124
|
+
throw new factory.errors.Argument('object.specifyingMethod', `must be ${factory.task.deleteTransaction.SpecifyingMethod.Id}`);
|
|
125
125
|
}
|
|
126
126
|
const deletingTransactionId = params.object.id;
|
|
127
127
|
if (typeof deletingTransactionId !== 'string' || deletingTransactionId.length === 0) {
|
|
@@ -364,7 +364,7 @@ function deleteMessagesByPlaceOrder(params) {
|
|
|
364
364
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
365
365
|
let deleteResult;
|
|
366
366
|
if (params.transaction.typeOf === factory.transactionType.PlaceOrder
|
|
367
|
-
&& params.transaction.specifyingMethod === factory.
|
|
367
|
+
&& params.transaction.specifyingMethod === factory.task.deleteTransaction.SpecifyingMethod.Id) {
|
|
368
368
|
const orderNumber = params.transaction.object.orderNumber;
|
|
369
369
|
if (typeof orderNumber === 'string' && orderNumber.length > 0) {
|
|
370
370
|
const deleteReservationsResult = yield repos.message.deleteByMainEntityOrderNumber({
|
|
@@ -53,7 +53,7 @@ function createTasks(params, setting
|
|
|
53
53
|
numberOfTried: 0,
|
|
54
54
|
executionResults: [],
|
|
55
55
|
data: {
|
|
56
|
-
object: Object.assign({ specifyingMethod: factory.
|
|
56
|
+
object: Object.assign({ specifyingMethod: factory.task.deleteTransaction.SpecifyingMethod.Id, id: transaction.id, object: Object.assign({}, (transaction.object.pendingTransaction !== undefined)
|
|
57
57
|
? { pendingTransaction: transaction.object.pendingTransaction }
|
|
58
58
|
: undefined), project: transaction.project, startDate: transaction.startDate, typeOf: transaction.typeOf }, (transaction.endDate !== undefined) ? { endDate: transaction.endDate } : undefined)
|
|
59
59
|
}
|
|
@@ -87,7 +87,7 @@ function createTasks(params, setting
|
|
|
87
87
|
numberOfTried: 0,
|
|
88
88
|
executionResults: [],
|
|
89
89
|
data: {
|
|
90
|
-
object: Object.assign({ specifyingMethod: factory.
|
|
90
|
+
object: Object.assign({ specifyingMethod: factory.task.deleteTransaction.SpecifyingMethod.Id, id: transaction.id, object: Object.assign(Object.assign({}, (typeof transaction.object.confirmationNumber === 'string')
|
|
91
91
|
? { confirmationNumber: transaction.object.confirmationNumber }
|
|
92
92
|
: undefined), (typeof transaction.object.orderNumber === 'string')
|
|
93
93
|
? { orderNumber: transaction.object.orderNumber }
|
|
@@ -53,7 +53,7 @@ function createTasks(params, setting
|
|
|
53
53
|
numberOfTried: 0,
|
|
54
54
|
executionResults: [],
|
|
55
55
|
data: {
|
|
56
|
-
object: Object.assign({ specifyingMethod: factory.
|
|
56
|
+
object: Object.assign({ specifyingMethod: factory.task.deleteTransaction.SpecifyingMethod.Id, id: transaction.id, object: {
|
|
57
57
|
order: transaction.object.order
|
|
58
58
|
}, project: transaction.project, startDate: transaction.startDate, typeOf: transaction.typeOf }, (transaction.endDate !== undefined) ? { endDate: transaction.endDate } : undefined)
|
|
59
59
|
}
|