@chevre/domain 22.14.0-alpha.12 → 22.14.0-alpha.14
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/{createEventBySchedule.ts → addEventBySchedule.ts} +2 -2
- 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/mongoose/schemas/accountingReport.d.ts +2 -15
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +0 -1
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +2 -2
- 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/createEventSeries.d.ts +1 -1
- package/lib/chevre/service/taskHandler.js +1 -0
- package/package.json +2 -2
|
@@ -15,8 +15,8 @@ async function main() {
|
|
|
15
15
|
typeOf: chevre.factory.eventType.ScreeningEvent,
|
|
16
16
|
eventSchedule: { id: '672bf38b5d6d3f5642d658fc' }
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
typeOf: chevre.factory.actionType.
|
|
18
|
+
targetCollection: { typeOf: chevre.factory.eventType.ScreeningEvent },
|
|
19
|
+
typeOf: chevre.factory.actionType.AddAction
|
|
20
20
|
})(
|
|
21
21
|
{
|
|
22
22
|
connection: mongoose.connection,
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { Connection, PipelineStage } from 'mongoose';
|
|
2
|
-
import { IAccountingReport, IChildReport, IOrder4report } from './mongoose/schemas/accountingReport';
|
|
3
2
|
import * as factory from '../factory';
|
|
3
|
+
import { IDocType } from './mongoose/schemas/accountingReport';
|
|
4
4
|
type IMatchStage = PipelineStage.Match;
|
|
5
|
-
export { IAccountingReport, IChildReport, IOrder4report };
|
|
6
5
|
/**
|
|
7
6
|
* 経理レポートリポジトリ
|
|
8
7
|
*/
|
|
@@ -14,7 +13,7 @@ export declare class AccountingReportRepo {
|
|
|
14
13
|
id?: string;
|
|
15
14
|
};
|
|
16
15
|
}): IMatchStage[];
|
|
17
|
-
syncMainEntity(params:
|
|
16
|
+
syncMainEntity(params: IDocType): Promise<void>;
|
|
18
17
|
/**
|
|
19
18
|
* 注文番号で削除する
|
|
20
19
|
*/
|
|
@@ -34,7 +33,7 @@ export declare class AccountingReportRepo {
|
|
|
34
33
|
mainEntity: {
|
|
35
34
|
orderNumber: string;
|
|
36
35
|
};
|
|
37
|
-
hasPart: IChildReport;
|
|
36
|
+
hasPart: factory.report.accountingReport.IChildReport;
|
|
38
37
|
}): Promise<void>;
|
|
39
38
|
search(params: factory.report.accountingReport.ISearchConditions & {
|
|
40
39
|
seller?: {
|
|
@@ -46,3 +45,4 @@ export declare class AccountingReportRepo {
|
|
|
46
45
|
$unset: any;
|
|
47
46
|
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
48
47
|
}
|
|
48
|
+
export {};
|
|
@@ -10,9 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.AccountingReportRepo = void 0;
|
|
13
|
-
const accountingReport_1 = require("./mongoose/schemas/accountingReport");
|
|
14
13
|
const errorHandler_1 = require("../errorHandler");
|
|
15
14
|
const factory = require("../factory");
|
|
15
|
+
const accountingReport_1 = require("./mongoose/schemas/accountingReport");
|
|
16
16
|
const DEFAULT_SEARCH_LIMIT = 100;
|
|
17
17
|
/**
|
|
18
18
|
* 経理レポートリポジトリ
|
|
@@ -2,7 +2,7 @@ import { factory as surfrockFactory } from '@surfrock/sdk';
|
|
|
2
2
|
import { Connection, FilterQuery, UpdateQuery } from 'mongoose';
|
|
3
3
|
import * as factory from '../factory';
|
|
4
4
|
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.moneyTransfer.IAction | factory.action.authorize.offer.product.IAction | factory.action.authorize.paymentMethod.any.IAction) : never;
|
|
5
|
-
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.token.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>> & {
|
|
5
|
+
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.token.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>> & {
|
|
6
6
|
error?: any;
|
|
7
7
|
purpose?: never;
|
|
8
8
|
} : factory.action.IAction<factory.action.IAttributes<T, any, any>>;
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
|
|
2
2
|
import * as factory from '../../../factory';
|
|
3
|
-
|
|
4
|
-
export interface IChildReport {
|
|
5
|
-
typeOf: 'Report';
|
|
6
|
-
mainEntity: factory.report.accountingReport.IAction;
|
|
7
|
-
}
|
|
8
|
-
export interface IAccountingReport {
|
|
9
|
-
project: {
|
|
10
|
-
id: string;
|
|
11
|
-
typeOf: factory.organizationType.Project;
|
|
12
|
-
};
|
|
13
|
-
typeOf: 'Report';
|
|
14
|
-
hasPart: IChildReport[];
|
|
15
|
-
mainEntity: IOrder4report;
|
|
16
|
-
}
|
|
3
|
+
type IAccountingReport = factory.report.accountingReport.IReportDocument;
|
|
17
4
|
type IDocType = IAccountingReport;
|
|
18
5
|
type IModel = Model<IDocType>;
|
|
19
6
|
type ISchemaDefinition = SchemaDefinition<IDocType>;
|
|
@@ -21,4 +8,4 @@ type ISchema = Schema<IDocType, IModel, {}, {}, {}, {}, ISchemaDefinition, IDocT
|
|
|
21
8
|
declare const modelName = "AccountingReport";
|
|
22
9
|
declare const indexes: [d: IndexDefinition, o: IndexOptions][];
|
|
23
10
|
declare function createSchema(): ISchema;
|
|
24
|
-
export { createSchema, IModel, indexes, modelName };
|
|
11
|
+
export { createSchema, IDocType, IModel, indexes, modelName };
|
|
@@ -12,7 +12,6 @@ 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';
|
|
16
15
|
function createAccountingReportIfNotExist(params) {
|
|
17
16
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
18
17
|
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
|
-
project: { id: order.project.id }
|
|
119
|
+
object: { mainEntity: { orderNumber: order.orderNumber } }
|
|
120
|
+
// project: { id: order.project.id }
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
return [task];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { IOperationExecute } from '../taskHandler';
|
|
1
|
+
import type { ICallResult, IExecutableTaskKeys, 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(params: Pick<factory.task.ITask<factory.taskName.CreateAccountingReport>, IExecutableTaskKeys>): IOperationExecute<ICallResult>;
|
|
@@ -19,9 +19,9 @@ const createAccountingReportIfNotExist_1 = require("../order/createAccountingRep
|
|
|
19
19
|
/**
|
|
20
20
|
* タスク実行関数
|
|
21
21
|
*/
|
|
22
|
-
function call(
|
|
22
|
+
function call(params) {
|
|
23
23
|
return (_a) => __awaiter(this, [_a], void 0, function* ({ connection }) {
|
|
24
|
-
yield createAccountingReport(
|
|
24
|
+
yield createAccountingReport(params)({
|
|
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,8 +31,9 @@ function call(data) {
|
|
|
31
31
|
}
|
|
32
32
|
function createAccountingReport(params) {
|
|
33
33
|
return (repos) => __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
const { data } = params;
|
|
34
35
|
const order = yield repos.order.projectFieldsByOrderNumber({
|
|
35
|
-
orderNumber:
|
|
36
|
+
orderNumber: data.object.mainEntity.orderNumber,
|
|
36
37
|
project: { id: params.project.id },
|
|
37
38
|
inclusion: [
|
|
38
39
|
'orderNumber', 'project', 'customer', 'confirmationNumber',
|
|
@@ -41,28 +42,26 @@ function createAccountingReport(params) {
|
|
|
41
42
|
});
|
|
42
43
|
const simpleOrder = {
|
|
43
44
|
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~)
|
|
50
45
|
orderNumber: order.orderNumber,
|
|
51
|
-
// price: order.price,
|
|
52
|
-
// priceCurrency: order.priceCurrency,
|
|
53
46
|
orderDate: order.orderDate
|
|
54
47
|
};
|
|
48
|
+
const actionObject = {
|
|
49
|
+
// ...params,
|
|
50
|
+
mainEntity: { orderNumber: simpleOrder.orderNumber },
|
|
51
|
+
typeOf: 'Report'
|
|
52
|
+
};
|
|
55
53
|
const actionAttributes = {
|
|
56
54
|
project: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
57
55
|
typeOf: factory.actionType.CreateAction,
|
|
58
56
|
agent: { id: params.project.id, typeOf: factory.organizationType.Project },
|
|
59
|
-
object:
|
|
60
|
-
purpose: simpleOrder
|
|
57
|
+
object: actionObject,
|
|
58
|
+
purpose: simpleOrder,
|
|
59
|
+
sameAs: { id: params.id, typeOf: 'Task' } // add sameAs(2025-09-21~)
|
|
61
60
|
};
|
|
62
61
|
const action = yield repos.action.start(actionAttributes);
|
|
63
62
|
try {
|
|
64
63
|
const acceptedOffers = yield repos.acceptedOffer.searchAcceptedOffersByOrderNumber({
|
|
65
|
-
orderNumber: { $eq:
|
|
64
|
+
orderNumber: { $eq: data.object.mainEntity.orderNumber },
|
|
66
65
|
project: { id: { $eq: params.project.id } }
|
|
67
66
|
});
|
|
68
67
|
yield (0, createAccountingReportIfNotExist_1.createAccountingReportIfNotExist)(Object.assign(Object.assign({}, order), { acceptedOffers }))(repos);
|
|
@@ -76,6 +75,7 @@ function createAccountingReport(params) {
|
|
|
76
75
|
}
|
|
77
76
|
throw error;
|
|
78
77
|
}
|
|
79
|
-
|
|
78
|
+
const 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.IAddEventByScheduleAction): (repos: {
|
|
14
14
|
action: ActionRepo;
|
|
15
15
|
event: EventRepo;
|
|
16
16
|
eventSeries: EventSeriesRepo;
|
|
@@ -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.IAddEventSeriesAction): (repos: {
|
|
8
8
|
action: ActionRepo;
|
|
9
9
|
event: EventRepo;
|
|
10
10
|
eventSeries: EventSeriesRepo;
|
|
@@ -50,6 +50,7 @@ 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.CreateAccountingReport:
|
|
53
54
|
case factory.taskName.DeletePerson:
|
|
54
55
|
case factory.taskName.HandleNotification:
|
|
55
56
|
case factory.taskName.ImportEventCapacitiesFromCOA:
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "4.399.0-alpha.
|
|
14
|
+
"@chevre/factory": "4.399.0-alpha.15",
|
|
15
15
|
"@cinerino/sdk": "12.2.0",
|
|
16
16
|
"@motionpicture/coa-service": "9.6.0",
|
|
17
17
|
"@motionpicture/gmo-service": "5.4.0-alpha.1",
|
|
@@ -115,5 +115,5 @@
|
|
|
115
115
|
"postversion": "git push origin --tags",
|
|
116
116
|
"prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
|
|
117
117
|
},
|
|
118
|
-
"version": "22.14.0-alpha.
|
|
118
|
+
"version": "22.14.0-alpha.14"
|
|
119
119
|
}
|