@chevre/domain 24.0.0-alpha.46 → 24.0.0-alpha.48

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.
Files changed (28) hide show
  1. package/lib/chevre/repo/assetTransaction/reserve.d.ts +2 -1
  2. package/lib/chevre/repo/factory/reservation/createMongoConditions.d.ts +3 -0
  3. package/lib/chevre/repo/factory/reservation/createMongoConditions.js +771 -0
  4. package/lib/chevre/repo/mongoose/schemas/reservation.d.ts +1 -1
  5. package/lib/chevre/repo/reservation.d.ts +23 -17
  6. package/lib/chevre/repo/reservation.js +8 -752
  7. package/lib/chevre/service/assetTransaction/cancelReservation/factory.d.ts +2 -2
  8. package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
  9. package/lib/chevre/service/assetTransaction/cancelReservation/start.js +1 -1
  10. package/lib/chevre/service/assetTransaction/reserve/confirm/factory.d.ts +1 -1
  11. package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.d.ts +2 -2
  12. package/lib/chevre/service/offer/event/authorize/factory.d.ts +1 -1
  13. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
  14. package/lib/chevre/service/reserve/cancelReservation.d.ts +1 -1
  15. package/lib/chevre/service/reserve/cancelReservation.js +14 -10
  16. package/lib/chevre/service/reserve/confirmReservation.js +10 -6
  17. package/lib/chevre/service/reserve/factory.d.ts +2 -2
  18. package/lib/chevre/service/reserve/findByCode.d.ts +1 -2
  19. package/lib/chevre/service/reserve/findByCode.js +1 -1
  20. package/lib/chevre/service/reserve/findReservations.d.ts +19 -0
  21. package/lib/chevre/service/reserve/findReservations.js +74 -0
  22. package/lib/chevre/service/reserve/potentialActions/onReservationCanceled.d.ts +1 -1
  23. package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +5 -2
  24. package/lib/chevre/service/reserve/searchByOrder.d.ts +1 -1
  25. package/lib/chevre/service/reserve/useReservation.js +1 -1
  26. package/lib/chevre/service/reserve.d.ts +2 -1
  27. package/lib/chevre/service/reserve.js +3 -1
  28. package/package.json +3 -3
@@ -1,7 +1,7 @@
1
1
  import { IndexDefinition, IndexOptions, Model, Schema, SchemaDefinition } from 'mongoose';
2
2
  import { IVirtuals } from '../virtuals';
3
3
  import * as factory from '../../../factory';
4
- type IDocType = (Omit<factory.reservation.IReservation<factory.reservationType.EventReservation>, 'id'>) & {
4
+ type IDocType = (Omit<factory.reservation.eventReservation.IReservation, 'id'>) & {
5
5
  _id: string;
6
6
  bookingAgent?: any;
7
7
  previousReservationStatus?: factory.reservationStatusType;
@@ -1,5 +1,5 @@
1
1
  import type { BulkWriteResult } from 'mongodb';
2
- import type { Connection, FilterQuery, UpdateWriteOpResult } from 'mongoose';
2
+ import type { Connection, UpdateWriteOpResult } from 'mongoose';
3
3
  import { IDocType } from './mongoose/schemas/reservation';
4
4
  import * as factory from '../factory';
5
5
  export interface IUpdatePartiallyParams {
@@ -7,15 +7,24 @@ export interface IUpdatePartiallyParams {
7
7
  }
8
8
  export type ICancelResult = UpdateWriteOpResult;
9
9
  export type ICheckedInResult = UpdateWriteOpResult;
10
- export type ICreatingReservation<T extends factory.reservationType> = T extends factory.reservationType.EventReservation ? (Omit<factory.reservation.eventReservation.IReservation, 'id'>) & {
10
+ export type ICreatingReservation = Omit<factory.reservation.eventReservation.IReservation, 'id' | 'price' | 'reservedTicket'> & {
11
11
  _id: string;
12
- } : never;
13
- type IKeyOfProjection = keyof factory.reservation.IReservation<factory.reservationType.EventReservation> | 'reservedTicket.dateUsed' | 'reservationFor.id' | 'reservationFor.typeOf';
14
- export type IAttendedReservation = Pick<factory.reservation.IReservation<factory.reservationType.EventReservation>, 'id' | 'typeOf' | 'project' | 'modifiedTime'> & {
15
- reservationFor: Pick<factory.reservation.IReservationFor<factory.reservationType.EventReservation>, 'id' | 'typeOf'>;
12
+ /**
13
+ * priceは廃止予定だが、互換性維持対応としてひとまず型を強制的に合わせる
14
+ */
15
+ price?: factory.reservation.eventReservation.IPrice;
16
+ reservedTicket: factory.assetTransaction.reserve.ISubReservationReservedTicket;
17
+ };
18
+ /**
19
+ * 廃止予定の予約属性
20
+ */
21
+ export type IDeprecatedField = 'price' | 'underName';
22
+ export type IKeyOfProjection = Exclude<keyof factory.reservation.eventReservation.IReservation, IDeprecatedField> | 'reservedTicket.dateUsed' | 'reservationFor.id' | 'reservationFor.typeOf';
23
+ export type IAttendedReservation = Pick<factory.reservation.eventReservation.IReservation, 'id' | 'typeOf' | 'project' | 'modifiedTime'> & {
24
+ reservationFor: Pick<factory.reservation.eventReservation.IReservationFor, 'id' | 'typeOf'>;
16
25
  reservedTicket: Pick<factory.reservation.eventReservation.IReservedTicket, 'dateUsed'>;
17
26
  };
18
- export type IReservationAsFindResult = Omit<factory.reservation.eventReservation.IReservation, 'price' | 'underName'> & {
27
+ export type IReservationAsFindResult = Omit<factory.reservation.eventReservation.IReservation, IDeprecatedField> & {
19
28
  /**
20
29
  * 実データとしてはまだ存在しているが型から廃止(2026-03-26~)
21
30
  */
@@ -31,20 +40,18 @@ export type IReservationAsFindResult = Omit<factory.reservation.eventReservation
31
40
  export declare class ReservationRepo {
32
41
  private readonly reservationModel;
33
42
  constructor(connection: Connection);
34
- static CREATE_MONGO_CONDITIONS(params: factory.reservation.ISearchConditions<factory.reservationType>): FilterQuery<import("@chevre/factory/lib/reservation/event").IReservation | import("@chevre/factory/lib/reservation/reservationPackage").IReservation>[];
35
43
  /**
36
44
  * 汎用予約カウント
37
45
  */
38
- count<T extends factory.reservationType>(params: factory.reservation.ISearchConditions<T>): Promise<number>;
46
+ count(params: factory.reservation.eventReservation.ISearchConditions): Promise<number>;
39
47
  /**
40
48
  * 予約検索
41
- * TODO reimplement
42
49
  */
43
50
  findReservations(params: factory.reservation.eventReservation.ISearchConditions, inclusion?: Partial<Record<IKeyOfProjection, 1>>): Promise<IReservationAsFindResult[]>;
44
- projectFieldsById<T extends factory.reservationType>(params: {
51
+ findReservationById(params: {
45
52
  id: string;
46
- inclusion?: IKeyOfProjection[];
47
- }): Promise<factory.reservation.IReservation<T>>;
53
+ inclusion: IKeyOfProjection[];
54
+ }): Promise<IReservationAsFindResult>;
48
55
  confirmManyIfNotExist(params: {
49
56
  bookingTime: Date;
50
57
  project: {
@@ -55,13 +62,13 @@ export declare class ReservationRepo {
55
62
  issuedThrough: factory.assetTransaction.reserve.IIssuedThrough;
56
63
  reservationFor: factory.assetTransaction.reserve.IReservationFor;
57
64
  reservationNumber: string;
58
- underName?: factory.reservation.IUnderName<factory.reservationType.EventReservation>;
59
- broker?: factory.reservation.IBroker<factory.reservationType>;
65
+ underName?: factory.reservation.IUnderName;
66
+ broker?: factory.reservation.IBroker;
60
67
  }): Promise<BulkWriteResult | undefined>;
61
68
  /**
62
69
  * 予約取消
63
70
  */
64
- cancelById<T extends factory.reservationType>(params: {
71
+ cancelById(params: {
65
72
  id: string;
66
73
  previousReservationStatus?: factory.reservationStatusType;
67
74
  modifiedTime: Date;
@@ -154,4 +161,3 @@ export declare class ReservationRepo {
154
161
  $unset: any;
155
162
  }): Promise<UpdateWriteOpResult>;
156
163
  }
157
- export {};