@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.
- 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/mongoose/schemas/reservation.d.ts +1 -1
- package/lib/chevre/repo/reservation.d.ts +23 -17
- package/lib/chevre/repo/reservation.js +8 -752
- package/lib/chevre/service/assetTransaction/cancelReservation/factory.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/cancelReservation/start.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/cancelReservation/start.js +1 -1
- package/lib/chevre/service/assetTransaction/reserve/confirm/factory.d.ts +1 -1
- package/lib/chevre/service/assetTransaction/reserve/start/factory/createReservation.d.ts +2 -2
- package/lib/chevre/service/offer/event/authorize/factory.d.ts +1 -1
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +1 -1
- package/lib/chevre/service/reserve/cancelReservation.d.ts +1 -1
- package/lib/chevre/service/reserve/cancelReservation.js +14 -10
- package/lib/chevre/service/reserve/confirmReservation.js +10 -6
- package/lib/chevre/service/reserve/factory.d.ts +2 -2
- package/lib/chevre/service/reserve/findByCode.d.ts +1 -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/potentialActions/onReservationCanceled.d.ts +1 -1
- package/lib/chevre/service/reserve/potentialActions/onReservationConfirmed.d.ts +5 -2
- package/lib/chevre/service/reserve/searchByOrder.d.ts +1 -1
- 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 +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
|
|
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,
|
|
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
|
|
10
|
+
export type ICreatingReservation = Omit<factory.reservation.eventReservation.IReservation, 'id' | 'price' | 'reservedTicket'> & {
|
|
11
11
|
_id: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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,
|
|
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
|
|
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
|
-
|
|
51
|
+
findReservationById(params: {
|
|
45
52
|
id: string;
|
|
46
|
-
inclusion
|
|
47
|
-
}): Promise<
|
|
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
|
|
59
|
-
broker?: factory.reservation.IBroker
|
|
65
|
+
underName?: factory.reservation.IUnderName;
|
|
66
|
+
broker?: factory.reservation.IBroker;
|
|
60
67
|
}): Promise<BulkWriteResult | undefined>;
|
|
61
68
|
/**
|
|
62
69
|
* 予約取消
|
|
63
70
|
*/
|
|
64
|
-
cancelById
|
|
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 {};
|