@chevre/domain 24.0.0-alpha.46 → 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.
- package/lib/chevre/repo/assetTransaction/reserve.d.ts +2 -1
- package/lib/chevre/repo/factory/reservation/createMongoConditions.d.ts +3 -0
- package/lib/chevre/repo/factory/reservation/createMongoConditions.js +771 -0
- package/lib/chevre/repo/reservation.d.ts +10 -9
- package/lib/chevre/repo/reservation.js +7 -751
- package/lib/chevre/service/assetTransaction/cancelReservation/start.js +1 -1
- package/lib/chevre/service/reserve/cancelReservation.js +2 -2
- package/lib/chevre/service/reserve/confirmReservation.js +2 -2
- package/lib/chevre/service/reserve/findByCode.js +1 -1
- package/lib/chevre/service/reserve/findReservations.d.ts +19 -0
- package/lib/chevre/service/reserve/findReservations.js +74 -0
- package/lib/chevre/service/reserve/useReservation.js +1 -1
- package/lib/chevre/service/reserve.d.ts +2 -1
- package/lib/chevre/service/reserve.js +3 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BulkWriteResult } from 'mongodb';
|
|
2
|
-
import type { Connection,
|
|
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,12 +10,16 @@ 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
|
-
|
|
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
|
};
|
|
18
|
-
export type IReservationAsFindResult = Omit<factory.reservation.eventReservation.IReservation,
|
|
22
|
+
export type IReservationAsFindResult = Omit<factory.reservation.eventReservation.IReservation, IDeprecatedField> & {
|
|
19
23
|
/**
|
|
20
24
|
* 実データとしてはまだ存在しているが型から廃止(2026-03-26~)
|
|
21
25
|
*/
|
|
@@ -31,20 +35,18 @@ export type IReservationAsFindResult = Omit<factory.reservation.eventReservation
|
|
|
31
35
|
export declare class ReservationRepo {
|
|
32
36
|
private readonly reservationModel;
|
|
33
37
|
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
38
|
/**
|
|
36
39
|
* 汎用予約カウント
|
|
37
40
|
*/
|
|
38
41
|
count<T extends factory.reservationType>(params: factory.reservation.ISearchConditions<T>): Promise<number>;
|
|
39
42
|
/**
|
|
40
43
|
* 予約検索
|
|
41
|
-
* TODO reimplement
|
|
42
44
|
*/
|
|
43
45
|
findReservations(params: factory.reservation.eventReservation.ISearchConditions, inclusion?: Partial<Record<IKeyOfProjection, 1>>): Promise<IReservationAsFindResult[]>;
|
|
44
|
-
|
|
46
|
+
findReservationById(params: {
|
|
45
47
|
id: string;
|
|
46
|
-
inclusion
|
|
47
|
-
}): Promise<
|
|
48
|
+
inclusion: IKeyOfProjection[];
|
|
49
|
+
}): Promise<IReservationAsFindResult>;
|
|
48
50
|
confirmManyIfNotExist(params: {
|
|
49
51
|
bookingTime: Date;
|
|
50
52
|
project: {
|
|
@@ -154,4 +156,3 @@ export declare class ReservationRepo {
|
|
|
154
156
|
$unset: any;
|
|
155
157
|
}): Promise<UpdateWriteOpResult>;
|
|
156
158
|
}
|
|
157
|
-
export {};
|