@chevre/domain 24.0.0-alpha.45 → 24.0.0-alpha.47

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.
@@ -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 {
@@ -10,31 +10,43 @@ export type ICheckedInResult = UpdateWriteOpResult;
10
10
  export type ICreatingReservation<T extends factory.reservationType> = T extends factory.reservationType.EventReservation ? (Omit<factory.reservation.eventReservation.IReservation, 'id'>) & {
11
11
  _id: string;
12
12
  } : never;
13
- type IKeyOfProjection = keyof factory.reservation.IReservation<factory.reservationType.EventReservation> | 'reservedTicket.dateUsed' | 'reservationFor.id' | 'reservationFor.typeOf';
13
+ /**
14
+ * 廃止予定の予約属性
15
+ */
16
+ export type IDeprecatedField = 'price' | 'underName';
17
+ export type IKeyOfProjection = Exclude<keyof factory.reservation.eventReservation.IReservation, IDeprecatedField> | 'reservedTicket.dateUsed' | 'reservationFor.id' | 'reservationFor.typeOf';
14
18
  export type IAttendedReservation = Pick<factory.reservation.IReservation<factory.reservationType.EventReservation>, 'id' | 'typeOf' | 'project' | 'modifiedTime'> & {
15
19
  reservationFor: Pick<factory.reservation.IReservationFor<factory.reservationType.EventReservation>, 'id' | 'typeOf'>;
16
20
  reservedTicket: Pick<factory.reservation.eventReservation.IReservedTicket, 'dateUsed'>;
17
21
  };
22
+ export type IReservationAsFindResult = Omit<factory.reservation.eventReservation.IReservation, IDeprecatedField> & {
23
+ /**
24
+ * 実データとしてはまだ存在しているが型から廃止(2026-03-26~)
25
+ */
26
+ price?: never;
27
+ /**
28
+ * 実データとしてはまだ存在しているが型から廃止(2026-03-26~)
29
+ */
30
+ underName?: never;
31
+ };
18
32
  /**
19
33
  * 予約リポジトリ
20
34
  */
21
35
  export declare class ReservationRepo {
22
36
  private readonly reservationModel;
23
37
  constructor(connection: Connection);
24
- 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>[];
25
38
  /**
26
39
  * 汎用予約カウント
27
40
  */
28
41
  count<T extends factory.reservationType>(params: factory.reservation.ISearchConditions<T>): Promise<number>;
29
42
  /**
30
43
  * 予約検索
31
- * migrate from search(2024-08-08~)
32
44
  */
33
- projectFields<T extends factory.reservationType>(params: factory.reservation.ISearchConditions<T>, inclusion?: Partial<Record<IKeyOfProjection, 1>>): Promise<factory.reservation.IReservation<factory.reservationType.EventReservation>[]>;
34
- projectFieldsById<T extends factory.reservationType>(params: {
45
+ findReservations(params: factory.reservation.eventReservation.ISearchConditions, inclusion?: Partial<Record<IKeyOfProjection, 1>>): Promise<IReservationAsFindResult[]>;
46
+ findReservationById(params: {
35
47
  id: string;
36
- inclusion?: IKeyOfProjection[];
37
- }): Promise<factory.reservation.IReservation<T>>;
48
+ inclusion: IKeyOfProjection[];
49
+ }): Promise<IReservationAsFindResult>;
38
50
  confirmManyIfNotExist(params: {
39
51
  bookingTime: Date;
40
52
  project: {
@@ -144,4 +156,3 @@ export declare class ReservationRepo {
144
156
  $unset: any;
145
157
  }): Promise<UpdateWriteOpResult>;
146
158
  }
147
- export {};