@chevre/domain 25.0.0-alpha.16 → 25.0.0-alpha.17

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.
@@ -130,7 +130,7 @@ export declare class TransactionRepo {
130
130
  $lt: Date;
131
131
  };
132
132
  }): Promise<import("mongodb").DeleteResult>;
133
- getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
133
+ getCursor(conditions: any, projection: any, sort?: factory.sortType): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, IDocType, import("./mongoose/virtuals").IVirtuals, {}> & (({
134
134
  object: import("@chevre/factory/lib/chevre/transaction/placeOrder").IObject;
135
135
  error?: any;
136
136
  project: import("@chevre/factory/lib/chevre/transaction").IProject;
@@ -316,9 +316,9 @@ class TransactionRepo {
316
316
  })
317
317
  .exec();
318
318
  }
319
- getCursor(conditions, projection) {
319
+ getCursor(conditions, projection, sort) {
320
320
  return this.transactionModel.find(conditions, projection)
321
- .sort({ startDate: factory_1.factory.sortType.Descending })
321
+ .sort({ startDate: (sort === factory_1.factory.sortType.Ascending) ? sort : factory_1.factory.sortType.Descending })
322
322
  .cursor();
323
323
  }
324
324
  async aggregatePlaceOrder(params) {
@@ -15,7 +15,6 @@ import type { PaymentServiceRepo } from '../../../repo/paymentService';
15
15
  import { SeatRepo } from '../../../repo/place/seat';
16
16
  import type { PriceSpecificationRepo } from '../../../repo/priceSpecification';
17
17
  import type { ProductRepo } from '../../../repo/product';
18
- import type { ProjectRepo } from '../../../repo/project';
19
18
  import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
20
19
  import type { SettingRepo } from '../../../repo/setting';
21
20
  import type { StockHolderRepo } from '../../../repo/stockHolder';
@@ -37,7 +36,6 @@ interface IStartOperationRepos {
37
36
  paymentService: PaymentServiceRepo;
38
37
  product: ProductRepo;
39
38
  priceSpecification: PriceSpecificationRepo;
40
- project: ProjectRepo;
41
39
  seat: SeatRepo;
42
40
  setting: SettingRepo;
43
41
  task: TaskRepo;
@@ -15,7 +15,6 @@ import type { PaymentServiceRepo } from '../../../../repo/paymentService';
15
15
  import type { SeatRepo } from '../../../../repo/place/seat';
16
16
  import type { PriceSpecificationRepo } from '../../../../repo/priceSpecification';
17
17
  import type { ProductRepo } from '../../../../repo/product';
18
- import type { ProjectRepo } from '../../../../repo/project';
19
18
  import type { OfferRateLimitRepo } from '../../../../repo/rateLimit/offer';
20
19
  import type { SettingRepo } from '../../../../repo/setting';
21
20
  import type { StockHolderRepo } from '../../../../repo/stockHolder';
@@ -63,7 +62,6 @@ declare function processStartReserve4chevre(params: {
63
62
  paymentService: PaymentServiceRepo;
64
63
  product: ProductRepo;
65
64
  priceSpecification: PriceSpecificationRepo;
66
- project: ProjectRepo;
67
65
  seat: SeatRepo;
68
66
  setting: SettingRepo;
69
67
  task: TaskRepo;
@@ -13,12 +13,10 @@ import type { OfferRepo } from '../../../repo/offer/unitPriceInCatalog';
13
13
  import type { OfferCatalogRepo } from '../../../repo/offerCatalog';
14
14
  import type { OfferCatalogItemRepo } from '../../../repo/offerCatalogItem';
15
15
  import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
16
- import type { OrderNumberRepo } from '../../../repo/orderNumber';
17
16
  import type { PaymentServiceRepo } from '../../../repo/paymentService';
18
17
  import type { SeatRepo } from '../../../repo/place/seat';
19
18
  import type { PriceSpecificationRepo } from '../../../repo/priceSpecification';
20
19
  import type { ProductRepo } from '../../../repo/product';
21
- import type { ProjectRepo } from '../../../repo/project';
22
20
  import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
23
21
  import type { SettingRepo } from '../../../repo/setting';
24
22
  import type { StockHolderRepo } from '../../../repo/stockHolder';
@@ -43,11 +41,9 @@ interface IAuthorizeRepos {
43
41
  offerCatalogItem: OfferCatalogItemRepo;
44
42
  offerRateLimit: OfferRateLimitRepo;
45
43
  orderInTransaction: OrderInTransactionRepo;
46
- orderNumber: OrderNumberRepo;
47
44
  paymentService: PaymentServiceRepo;
48
45
  priceSpecification: PriceSpecificationRepo;
49
46
  product: ProductRepo;
50
- project: ProjectRepo;
51
47
  seat: SeatRepo;
52
48
  setting: SettingRepo;
53
49
  task: TaskRepo;
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.authorize = authorize;
4
4
  const factory_1 = require("../../../factory");
5
- const issueOrderNumberIfNotExist_1 = require("../../transaction/placeOrder/issueOrderNumberIfNotExist");
6
5
  const any_1 = require("../any");
7
6
  const defaultOffer_1 = require("./authorize/defaultOffer");
8
7
  const factory_2 = require("./authorize/factory");
@@ -25,11 +24,11 @@ function authorize(params, options) {
25
24
  })(repos);
26
25
  let acceptedOffers4result;
27
26
  const now = new Date();
28
- const orderNumber = await (0, issueOrderNumberIfNotExist_1.issueOrderNumberIfNotExist)({
27
+ // 注文ドキュメントを参照(2026-06-24~)
28
+ const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
29
+ identifier: transaction.id,
29
30
  project: { id: params.project.id },
30
- id: transaction.id,
31
- object: { orderDate: now }
32
- }, { issueForce: false })(repos);
31
+ });
33
32
  // まず取引番号発行
34
33
  const { transactionNumber } = await repos.transactionNumber.publishByTimestamp({ startDate: now });
35
34
  const actionAttributes = (0, factory_2.createAuthorizeSeatReservationActionAttributes)({
@@ -2,17 +2,11 @@ import type { COA } from '@motionpicture/coa-service';
2
2
  import type { AcceptCOAOfferActionRepo } from '../../../repo/action/acceptCOAOffer';
3
3
  import type { AuthorizeOfferActionRepo } from '../../../repo/action/authorizeOffer';
4
4
  import type { EventRepo } from '../../../repo/event';
5
- import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
6
- import type { OrderNumberRepo } from '../../../repo/orderNumber';
7
- import type { ProjectRepo } from '../../../repo/project';
8
5
  import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
9
6
  import { factory } from '../../../factory';
10
7
  interface IAcceptRepos {
11
8
  action: AcceptCOAOfferActionRepo;
12
9
  event: EventRepo;
13
- orderInTransaction: OrderInTransactionRepo;
14
- orderNumber: OrderNumberRepo;
15
- project: ProjectRepo;
16
10
  placeOrder: PlaceOrderRepo;
17
11
  reserveService: COA.service.Reserve;
18
12
  masterService: COA.service.Master;
@@ -21,8 +15,6 @@ interface IReAcceptRepos {
21
15
  action: AcceptCOAOfferActionRepo;
22
16
  authorizeOfferAction: AuthorizeOfferActionRepo;
23
17
  event: EventRepo;
24
- orderNumber: OrderNumberRepo;
25
- project: ProjectRepo;
26
18
  placeOrder: PlaceOrderRepo;
27
19
  reserveService: COA.service.Reserve;
28
20
  masterService: COA.service.Master;
@@ -4,7 +4,6 @@ exports.acceptOffer = acceptOffer;
4
4
  exports.reAcceptOffer = reAcceptOffer;
5
5
  const errorHandler_1 = require("../../../errorHandler");
6
6
  const factory_1 = require("../../../factory");
7
- const issueOrderNumberIfNotExist_1 = require("../../transaction/placeOrder/issueOrderNumberIfNotExist");
8
7
  const authorize_1 = require("./acceptOffer/authorize");
9
8
  const factory_2 = require("./acceptOffer/factory");
10
9
  function findCOAInfo(params) {
@@ -39,12 +38,11 @@ function acceptOffer(params) {
39
38
  typeOf: factory_1.factory.transactionType.PlaceOrder,
40
39
  id: params.purpose.id
41
40
  }, ['project', 'agent', 'typeOf']);
42
- // issueOrderNumber(2025-03-11~)
43
- await (0, issueOrderNumberIfNotExist_1.issueOrderNumberIfNotExist)({
44
- project: { id: transaction.project.id },
45
- id: transaction.id,
46
- object: { orderDate: new Date() }
47
- }, { issueForce: false })(repos);
41
+ // // 注文ドキュメントを参照(2026-06-24~)
42
+ // const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
43
+ // identifier: transaction.id,
44
+ // project: { id: transaction.project.id },
45
+ // });
48
46
  const coaInfo = await findCOAInfo({ id: params.object.event.id, project: { id: transaction.project.id } })(repos);
49
47
  const updTmpReserveSeatArgs = (0, factory_2.createUpdTmpReserveSeatArgs)({ object: params.object, coaInfo });
50
48
  let updTmpReserveSeatResult;
@@ -1,8 +1,6 @@
1
1
  import { factory } from '../../../../factory';
2
2
  import type { ConfirmationNumberRepo } from '../../../../repo/confirmationNumber';
3
3
  import type { OrderInTransactionRepo } from '../../../../repo/orderInTransaction';
4
- import type { OrderNumberRepo } from '../../../../repo/orderNumber';
5
- import type { ProjectRepo } from '../../../../repo/project';
6
4
  import type { PlaceOrderRepo } from '../../../../repo/transaction/placeOrder';
7
5
  declare function fixOrderAsNeeded(params: {
8
6
  project: {
@@ -10,11 +8,9 @@ declare function fixOrderAsNeeded(params: {
10
8
  };
11
9
  purpose: factory.action.authorize.paymentMethod.any.IPurpose;
12
10
  }): (repos: {
13
- project: ProjectRepo;
14
11
  placeOrder: PlaceOrderRepo;
15
12
  confirmationNumber: ConfirmationNumberRepo;
16
13
  orderInTransaction: OrderInTransactionRepo;
17
- orderNumber: OrderNumberRepo;
18
14
  }) => Promise<{
19
15
  confirmationNumber: string;
20
16
  orderNumber: string;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.fixOrderAsNeeded = fixOrderAsNeeded;
4
4
  const factory_1 = require("../../../../factory");
5
5
  const publishConfirmationNumberIfNotExist_1 = require("../../../transaction/placeOrder/publishConfirmationNumberIfNotExist");
6
- const issueOrderNumberIfNotExist_1 = require("../../../transaction/placeOrder/issueOrderNumberIfNotExist");
7
6
  function fixOrderAsNeeded(params) {
8
7
  return async (repos) => {
9
8
  const orderDate = new Date();
@@ -17,12 +16,11 @@ function fixOrderAsNeeded(params) {
17
16
  object: { orderDate }
18
17
  })(repos);
19
18
  // }
20
- // publish orderNumber(2025-02-14~)
21
- const orderNumber = await (0, issueOrderNumberIfNotExist_1.issueOrderNumberIfNotExist)({
19
+ // 注文ドキュメントを参照(2026-06-24~)
20
+ const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
21
+ identifier: params.purpose.id,
22
22
  project: { id: params.project.id },
23
- id: params.purpose.id,
24
- object: { orderDate }
25
- }, { issueForce: false })(repos);
23
+ });
26
24
  return { confirmationNumber, orderNumber };
27
25
  };
28
26
  }
@@ -7,11 +7,8 @@ import type { AuthorizationRepo } from '../../../repo/authorization';
7
7
  import type { EventRepo } from '../../../repo/event';
8
8
  import type { EventSeriesRepo } from '../../../repo/eventSeries';
9
9
  import type { IssuerRepo } from '../../../repo/issuer';
10
- import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
11
- import type { OrderNumberRepo } from '../../../repo/orderNumber';
12
10
  import type { PaymentServiceRepo } from '../../../repo/paymentService';
13
11
  import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
14
- import type { ProjectRepo } from '../../../repo/project';
15
12
  import type { SellerPaymentAcceptedRepo } from '../../../repo/sellerPaymentAccepted';
16
13
  import type { TicketRepo } from '../../../repo/ticket';
17
14
  import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
@@ -25,12 +22,9 @@ interface IPublishPaymentUrlRepos {
25
22
  event: EventRepo;
26
23
  eventSeries: EventSeriesRepo;
27
24
  issuer: IssuerRepo;
28
- orderInTransaction: OrderInTransactionRepo;
29
- orderNumber: OrderNumberRepo;
30
25
  paymentAccepted: SellerPaymentAcceptedRepo;
31
26
  paymentService: PaymentServiceRepo;
32
27
  paymentServiceProvider: PaymentServiceProviderRepo;
33
- project: ProjectRepo;
34
28
  ticket: TicketRepo;
35
29
  placeOrder: PlaceOrderRepo;
36
30
  transactionNumber: TransactionNumberRepo;
@@ -36,7 +36,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.publishPaymentUrl = publishPaymentUrl;
37
37
  const factory_1 = require("../../../factory");
38
38
  const PayTransactionService = __importStar(require("../../assetTransaction/pay"));
39
- const issueOrderNumberIfNotExist_1 = require("../../transaction/placeOrder/issueOrderNumberIfNotExist");
40
39
  const fixTransactionNumberOnPublishPaymentUrl_1 = require("./publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl");
41
40
  const factory_2 = require("./factory");
42
41
  /**
@@ -53,12 +52,11 @@ function publishPaymentUrl(params) {
53
52
  if (project.id !== transaction.project.id) {
54
53
  throw new factory_1.factory.errors.NotFound(factory_1.factory.transactionType.PlaceOrder);
55
54
  }
56
- // issueOrderNumber(2025-03-11~)
57
- await (0, issueOrderNumberIfNotExist_1.issueOrderNumberIfNotExist)({
58
- project: { id: transaction.project.id },
59
- id: transaction.id,
60
- object: { orderDate: new Date() }
61
- }, { issueForce: false })(repos);
55
+ // // 注文ドキュメントを参照(2026-06-24~)
56
+ // const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
57
+ // identifier: transaction.id,
58
+ // project: { id: transaction.project.id },
59
+ // });
62
60
  // 取引番号生成
63
61
  const { transactionNumber, ticketToken } = await (0, fixTransactionNumberOnPublishPaymentUrl_1.fixTransactionNumberOnPublishPaymentUrl)({
64
62
  object: params.object,
@@ -7,9 +7,9 @@ const acceptCOAOffer_1 = require("../../repo/action/acceptCOAOffer");
7
7
  const authorizeOffer_1 = require("../../repo/action/authorizeOffer");
8
8
  const credentials_1 = require("../../repo/credentials");
9
9
  const event_1 = require("../../repo/event");
10
- const orderInTransaction_1 = require("../../repo/orderInTransaction");
11
- const orderNumber_1 = require("../../repo/orderNumber");
12
- const project_1 = require("../../repo/project");
10
+ // import { OrderInTransactionRepo } from '../../repo/orderInTransaction';
11
+ // import { OrderNumberRepo } from '../../repo/orderNumber';
12
+ // import { ProjectRepo } from '../../repo/project';
13
13
  const reserveInterface_1 = require("../../repo/reserveInterface");
14
14
  const integration_1 = require("../../repo/setting/integration");
15
15
  const placeOrder_1 = require("../../repo/transaction/placeOrder");
@@ -86,8 +86,8 @@ function call(params) {
86
86
  action: actionRepo,
87
87
  authorizeOfferAction: new authorizeOffer_1.AuthorizeOfferActionRepo(connection),
88
88
  event: new event_1.EventRepo(connection),
89
- orderNumber: new orderNumber_1.OrderNumberRepo({ connection }),
90
- project: new project_1.ProjectRepo(connection),
89
+ // orderNumber: new OrderNumberRepo({ connection }),
90
+ // project: new ProjectRepo(connection),
91
91
  placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
92
92
  reserveService,
93
93
  masterService
@@ -104,9 +104,9 @@ function call(params) {
104
104
  })({
105
105
  action: actionRepo,
106
106
  event: new event_1.EventRepo(connection),
107
- orderInTransaction: new orderInTransaction_1.OrderInTransactionRepo(connection),
108
- orderNumber: new orderNumber_1.OrderNumberRepo({ connection }),
109
- project: new project_1.ProjectRepo(connection),
107
+ // orderInTransaction: new OrderInTransactionRepo(connection),
108
+ // orderNumber: new OrderNumberRepo({ connection }),
109
+ // project: new ProjectRepo(connection),
110
110
  placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
111
111
  reserveService,
112
112
  masterService
@@ -9,11 +9,11 @@ const authorization_1 = require("../../repo/authorization");
9
9
  const event_1 = require("../../repo/event");
10
10
  const eventSeries_1 = require("../../repo/eventSeries");
11
11
  const issuer_1 = require("../../repo/issuer");
12
- const orderInTransaction_1 = require("../../repo/orderInTransaction");
13
- const orderNumber_1 = require("../../repo/orderNumber");
12
+ // import { OrderInTransactionRepo } from '../../repo/orderInTransaction';
13
+ // import { OrderNumberRepo } from '../../repo/orderNumber';
14
14
  const paymentService_1 = require("../../repo/paymentService");
15
15
  const paymentServiceProvider_1 = require("../../repo/paymentServiceProvider");
16
- const project_1 = require("../../repo/project");
16
+ // import { ProjectRepo } from '../../repo/project';
17
17
  const sellerPaymentAccepted_1 = require("../../repo/sellerPaymentAccepted");
18
18
  const integration_1 = require("../../repo/setting/integration");
19
19
  const ticket_1 = require("../../repo/ticket");
@@ -48,12 +48,12 @@ function call(params) {
48
48
  event: new event_1.EventRepo(connection),
49
49
  eventSeries: new eventSeries_1.EventSeriesRepo(connection),
50
50
  issuer: new issuer_1.IssuerRepo(connection),
51
- orderInTransaction: new orderInTransaction_1.OrderInTransactionRepo(connection),
52
- orderNumber: new orderNumber_1.OrderNumberRepo({ connection }),
51
+ // orderInTransaction: new OrderInTransactionRepo(connection),
52
+ // orderNumber: new OrderNumberRepo({ connection }),
53
53
  paymentAccepted: new sellerPaymentAccepted_1.SellerPaymentAcceptedRepo(connection),
54
54
  paymentService: new paymentService_1.PaymentServiceRepo(connection),
55
55
  paymentServiceProvider: new paymentServiceProvider_1.PaymentServiceProviderRepo(connection),
56
- project: new project_1.ProjectRepo(connection),
56
+ // project: new ProjectRepo(connection),
57
57
  ticket: new ticket_1.TicketRepo(connection),
58
58
  placeOrder: new placeOrder_1.PlaceOrderRepo(connection),
59
59
  transactionNumber: new transactionNumber_1.TransactionNumberRepo({ connection })
@@ -80,12 +80,6 @@ function confirm(params, options) {
80
80
  if (typeof transaction.object.paymentMethods?.paymentMethodId === 'string') {
81
81
  acceptPayActions = await searchAcceptPayActions(params)(repos);
82
82
  }
83
- // 注文番号は興行オファー承認時に発行済のはずなので、ここは不要(承認オファーなしの注文は存在しえない)(2026-06-16~)
84
- // const orderNumber = await issueOrderNumberIfNotExist({
85
- // project: { id: transaction.project.id },
86
- // id: transaction.id,
87
- // object: { orderDate: params.result.order.orderDate }
88
- // })(repos);
89
83
  // 必要あらば注文コード発行(2024-02-05~)
90
84
  let code;
91
85
  const publishCodeExpiresInSeconds = options.publishCodeExpiresInSeconds;
@@ -16,8 +16,6 @@ declare function issueOrderNumberIfNotExist(params: {
16
16
  object: {
17
17
  orderDate: Date;
18
18
  };
19
- }, options: {
20
- issueForce: boolean;
21
19
  }): (repos: {
22
20
  project: ProjectRepo;
23
21
  placeOrder: PlaceOrderRepo;
@@ -2,21 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.issueOrderNumberIfNotExist = issueOrderNumberIfNotExist;
4
4
  const factory_1 = require("../../../factory");
5
- const USE_LEGACY_ISSUE_ORDER_NUMBER = process.env.USE_LEGACY_ISSUE_ORDER_NUMBER === '1';
5
+ // const USE_LEGACY_ISSUE_ORDER_NUMBER = process.env.USE_LEGACY_ISSUE_ORDER_NUMBER === '1';
6
6
  /**
7
7
  * 未発行であれば、注文番号を発行して取引に保管する
8
8
  */
9
- function issueOrderNumberIfNotExist(params, options) {
9
+ function issueOrderNumberIfNotExist(params) {
10
10
  return async (repos) => {
11
- // issueForceオプションあるいは、廃止予定の発行オプションの場合、注文番号を新たに発行する
12
- const issueOrderNumber = options?.issueForce === true || USE_LEGACY_ISSUE_ORDER_NUMBER;
13
- if (!issueOrderNumber) {
14
- // 注文ドキュメントを参照(2026-06-24~)
15
- return repos.orderInTransaction.findOrderNumberByIdentifier({
16
- identifier: params.id,
17
- project: { id: params.project.id }
18
- });
19
- }
11
+ // // issueForceオプションあるいは、廃止予定の発行オプションの場合、注文番号を新たに発行する
12
+ // const issueOrderNumber = options?.issueForce === true || USE_LEGACY_ISSUE_ORDER_NUMBER;
13
+ // if (!issueOrderNumber) {
14
+ // // 注文ドキュメントを参照(2026-06-24~)
15
+ // return repos.orderInTransaction.findOrderNumberByIdentifier({
16
+ // identifier: params.id,
17
+ // project: { id: params.project.id }
18
+ // })
19
+ // }
20
20
  // 1. 最初のチェック
21
21
  let orderNumber = await repos.placeOrder.findInProgressOrderNumberById({ id: params.id });
22
22
  // すでに発行済であれば何もしない
@@ -23,7 +23,6 @@ interface IStartOperationRepos {
23
23
  }
24
24
  type IStartOperation<T> = (repos: IStartOperationRepos) => Promise<T>;
25
25
  interface IStartOptions {
26
- createOrderDocument: boolean;
27
26
  minimizeStartPlaceOrderParams: boolean;
28
27
  }
29
28
  /**
@@ -54,27 +54,25 @@ function start(params, options) {
54
54
  transaction = await repos.placeOrder.startPlaceOrder(startParams);
55
55
  }
56
56
  // support createOrderDocument(2026-06-23~)
57
- if (options.createOrderDocument) {
58
- const orderNumber = await (0, issueOrderNumberIfNotExist_1.issueOrderNumberIfNotExist)({
59
- project: { id: params.project.id },
60
- id: transaction.id,
61
- object: { orderDate: new Date() }
62
- }, { issueForce: true })(repos);
63
- await repos.orderInTransaction.createPlaceOrderIfNotExists({
64
- orderNumber,
65
- project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
66
- identifier: transaction.id,
67
- seller: {
68
- id: seller.id,
69
- name: (typeof seller.name === 'string') ? seller.name : String(seller.name?.ja),
70
- typeOf: seller.typeOf,
71
- additionalProperty: (Array.isArray(seller.additionalProperty)) ? seller.additionalProperty : [] // 追加特性を追加(2023-08-08~)
72
- },
73
- ...((typeof params.object.customer?.typeOf === 'string') && { customer: params.object.customer }),
74
- ...((typeof params.broker?.typeOf === 'string') && { broker: params.broker })
75
- });
76
- // console.log('createPlaceOrderResult:', createPlaceOrderResult);
77
- }
57
+ const orderNumber = await (0, issueOrderNumberIfNotExist_1.issueOrderNumberIfNotExist)({
58
+ project: { id: params.project.id },
59
+ id: transaction.id,
60
+ object: { orderDate: new Date() }
61
+ })(repos);
62
+ await repos.orderInTransaction.createPlaceOrderIfNotExists({
63
+ orderNumber,
64
+ project: { id: params.project.id, typeOf: factory_1.factory.organizationType.Project },
65
+ identifier: transaction.id,
66
+ seller: {
67
+ id: seller.id,
68
+ name: (typeof seller.name === 'string') ? seller.name : String(seller.name?.ja),
69
+ typeOf: seller.typeOf,
70
+ additionalProperty: (Array.isArray(seller.additionalProperty)) ? seller.additionalProperty : [] // 追加特性を追加(2023-08-08~)
71
+ },
72
+ ...((typeof params.object.customer?.typeOf === 'string') && { customer: params.object.customer }),
73
+ ...((typeof params.broker?.typeOf === 'string') && { broker: params.broker })
74
+ });
75
+ // console.log('createPlaceOrderResult:', createPlaceOrderResult);
78
76
  return transaction;
79
77
  };
80
78
  }
@@ -1,7 +1,5 @@
1
1
  import { factory } from '../../../factory';
2
2
  import type { OrderInTransactionRepo } from '../../../repo/orderInTransaction';
3
- import type { OrderNumberRepo } from '../../../repo/orderNumber';
4
- import type { ProjectRepo } from '../../../repo/project';
5
3
  import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
6
4
  /**
7
5
  * 取引人プロフィール更新
@@ -17,7 +15,5 @@ export declare function updateAgent(params: {
17
15
  };
18
16
  }): (repos: {
19
17
  orderInTransaction: OrderInTransactionRepo;
20
- orderNumber: OrderNumberRepo;
21
- project: ProjectRepo;
22
18
  placeOrder: PlaceOrderRepo;
23
19
  }) => Promise<void>;
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateAgent = updateAgent;
4
4
  const google_libphonenumber_1 = require("google-libphonenumber");
5
5
  const factory_1 = require("../../../factory");
6
- const issueOrderNumberIfNotExist_1 = require("./issueOrderNumberIfNotExist");
7
6
  function fixCustomer(params) {
8
7
  return async (repos) => {
9
8
  let formattedTelephone;
@@ -74,11 +73,11 @@ function updateAgent(params) {
74
73
  const { customer, transaction } = await fixCustomer(params)(repos);
75
74
  // also save in orderInTransaction(2024-06-20~)
76
75
  if (customer !== undefined) {
77
- const orderNumber = await (0, issueOrderNumberIfNotExist_1.issueOrderNumberIfNotExist)({
76
+ // 注文ドキュメントを参照(2026-06-24~)
77
+ const orderNumber = await repos.orderInTransaction.findOrderNumberByIdentifier({
78
+ identifier: params.id,
78
79
  project: { id: transaction.project.id },
79
- id: params.id,
80
- object: { orderDate: new Date() }
81
- }, { issueForce: false })(repos);
80
+ });
82
81
  const customerName = (typeof customer.name === 'string' && customer.name !== '')
83
82
  ? customer.name
84
83
  : (typeof customer.givenName === 'string' && typeof customer.familyName === 'string'
package/package.json CHANGED
@@ -91,5 +91,5 @@
91
91
  "postversion": "git push origin --tags",
92
92
  "prepublishOnly": "npm run clean && npm run build"
93
93
  },
94
- "version": "25.0.0-alpha.16"
94
+ "version": "25.0.0-alpha.17"
95
95
  }