@chevre/domain 22.14.0-alpha.17 → 22.14.0-alpha.3
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/example/src/chevre/{addEventBySchedule.ts → createEventBySchedule.ts} +2 -2
- package/example/src/chevre/eventOffer/adminEventOffers.ts +67 -0
- package/example/src/chevre/findReservationByCode.ts +1 -0
- package/example/src/chevre/migrateDeleteTransactionTasks.ts +132 -0
- package/example/src/chevre/optimizeDeleteTransactionTasks.ts +119 -0
- package/example/src/chevre/upsertMoviesByIdentifier.ts +58 -0
- package/lib/chevre/repo/accountingReport.d.ts +4 -4
- package/lib/chevre/repo/accountingReport.js +1 -1
- package/lib/chevre/repo/action.d.ts +1 -1
- package/lib/chevre/repo/creativeWork.d.ts +3 -1
- package/lib/chevre/repo/creativeWork.js +47 -65
- package/lib/chevre/repo/mongoose/schemas/accountingReport.d.ts +15 -2
- package/lib/chevre/repo/mongoose/schemas/offer/event.d.ts +10 -0
- package/lib/chevre/repo/mongoose/schemas/{productOffer.js → offer/event.js} +53 -9
- package/lib/chevre/repo/offer/event.d.ts +38 -0
- package/lib/chevre/repo/offer/event.js +142 -0
- package/lib/chevre/repo/productOffer.d.ts +65 -60
- package/lib/chevre/repo/productOffer.js +163 -121
- package/lib/chevre/repo/task.js +2 -2
- package/lib/chevre/repository.d.ts +5 -0
- package/lib/chevre/repository.js +15 -2
- package/lib/chevre/service/assetTransaction/reserve/start/createSubReservations.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +2 -0
- package/lib/chevre/service/assetTransaction/reserve/start.js +2 -2
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +2 -2
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +53 -68
- package/lib/chevre/service/event.js +2 -10
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +2 -0
- package/lib/chevre/service/offer/event/authorize.d.ts +2 -0
- package/lib/chevre/service/offer/product.d.ts +3 -0
- package/lib/chevre/service/offer/product.js +38 -29
- package/lib/chevre/service/order/createAccountingReportIfNotExist.js +1 -0
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderPaymentDue.js +2 -2
- package/lib/chevre/service/order/onOrderStatusChanged/onOrderProcessing/factory.js +1 -1
- package/lib/chevre/service/reserve/useReservation.js +3 -2
- package/lib/chevre/service/reserve/verifyToken4reservation.d.ts +2 -0
- package/lib/chevre/service/task/checkResource.d.ts +2 -2
- package/lib/chevre/service/task/checkResource.js +6 -8
- package/lib/chevre/service/task/createAccountingReport.d.ts +2 -2
- package/lib/chevre/service/task/createAccountingReport.js +15 -15
- package/lib/chevre/service/task/createEvent/createEventBySchedule.d.ts +1 -1
- package/lib/chevre/service/task/createEvent/createEventBySchedule.js +2 -3
- package/lib/chevre/service/task/createEvent/createEventSeries.d.ts +1 -1
- package/lib/chevre/service/task/deletePerson.js +10 -11
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.d.ts +2 -0
- package/lib/chevre/service/task/onResourceUpdated/onResourceDeleted.js +5 -7
- package/lib/chevre/service/task/onResourceUpdated.js +2 -1
- package/lib/chevre/service/task/useReservation.js +2 -1
- package/lib/chevre/service/taskHandler.js +0 -2
- package/lib/chevre/service/transaction/deleteTransaction.js +9 -9
- package/lib/chevre/service/transaction/moneyTransfer/exportTasks/factory.js +1 -1
- package/lib/chevre/service/transaction/placeOrder/exportTasks/factory.js +1 -1
- package/lib/chevre/service/transaction/returnOrder/exportTasks/factory.js +1 -1
- package/lib/chevre/service/transaction/returnOrder/potentialActions/returnPointAward.d.ts +1 -0
- package/package.json +2 -2
- package/lib/chevre/repo/mongoose/schemas/productOffer.d.ts +0 -36
|
@@ -3,26 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.modelName = exports.indexes = void 0;
|
|
4
4
|
exports.createSchema = createSchema;
|
|
5
5
|
const mongoose_1 = require("mongoose");
|
|
6
|
-
const settings_1 = require("
|
|
7
|
-
const writeConcern_1 = require("
|
|
8
|
-
const modelName = '
|
|
6
|
+
const settings_1 = require("../../../../settings");
|
|
7
|
+
const writeConcern_1 = require("../../writeConcern");
|
|
8
|
+
const modelName = 'Offer.Event';
|
|
9
9
|
exports.modelName = modelName;
|
|
10
10
|
const schemaDefinition = {
|
|
11
11
|
project: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
12
|
+
seller: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
12
13
|
typeOf: { type: String, required: true },
|
|
13
14
|
identifier: { type: String, required: true },
|
|
14
15
|
itemOffered: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
15
|
-
|
|
16
|
+
availableAtOrFrom: { type: mongoose_1.SchemaTypes.Mixed, required: true },
|
|
16
17
|
validFrom: { type: Date, required: true },
|
|
17
18
|
validThrough: { type: Date, required: true },
|
|
18
|
-
|
|
19
|
-
validForMemberTier: { type: mongoose_1.SchemaTypes.Mixed, required: false },
|
|
20
|
-
acceptedPaymentMethod: { type: mongoose_1.SchemaTypes.Mixed, required: false }
|
|
19
|
+
validForMemberTier: { type: mongoose_1.SchemaTypes.Mixed, required: true }
|
|
21
20
|
};
|
|
22
21
|
const schemaOptions = {
|
|
23
22
|
autoIndex: settings_1.MONGO_AUTO_INDEX,
|
|
24
23
|
autoCreate: false,
|
|
25
|
-
collection: '
|
|
24
|
+
collection: 'offers.event',
|
|
26
25
|
id: true,
|
|
27
26
|
read: settings_1.MONGO_READ_PREFERENCE,
|
|
28
27
|
writeConcern: writeConcern_1.writeConcern,
|
|
@@ -47,11 +46,56 @@ const indexes = [
|
|
|
47
46
|
[
|
|
48
47
|
{ validFrom: 1 },
|
|
49
48
|
{ name: 'validFrom' }
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
{
|
|
52
|
+
'itemOffered.id': 1,
|
|
53
|
+
identifier: 1
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: 'uniqueByItemOfferedAndIdentifier',
|
|
57
|
+
unique: true
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
{
|
|
62
|
+
'itemOffered.id': 1,
|
|
63
|
+
'availableAtOrFrom.id': 1,
|
|
64
|
+
'validForMemberTier.identifier': 1
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'uniqueByItemOfferedAndAvailableAt',
|
|
68
|
+
unique: true
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
{ 'project.id': 1, validFrom: 1 },
|
|
73
|
+
{ name: 'projectId' }
|
|
74
|
+
],
|
|
75
|
+
[
|
|
76
|
+
{ 'seller.id': 1, validFrom: 1 },
|
|
77
|
+
{ name: 'sellerId' }
|
|
78
|
+
],
|
|
79
|
+
[
|
|
80
|
+
{ identifier: 1, validFrom: 1 },
|
|
81
|
+
{ name: 'identifier' }
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
{ 'itemOffered.id': 1, validFrom: 1 },
|
|
85
|
+
{ name: 'itemOfferedId' }
|
|
86
|
+
],
|
|
87
|
+
[
|
|
88
|
+
{ 'availableAtOrFrom.id': 1, validFrom: 1 },
|
|
89
|
+
{ name: 'availableAtOrFromId' }
|
|
90
|
+
],
|
|
91
|
+
[
|
|
92
|
+
{ 'validForMemberTier.identifier': 1, validFrom: 1 },
|
|
93
|
+
{ name: 'validForMemberTierIdentifier' }
|
|
50
94
|
]
|
|
51
95
|
];
|
|
52
96
|
exports.indexes = indexes;
|
|
53
97
|
/**
|
|
54
|
-
*
|
|
98
|
+
* イベントオファー(クライアントごとの有効期間)スキーマ
|
|
55
99
|
*/
|
|
56
100
|
let schema;
|
|
57
101
|
function createSchema() {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Connection, FilterQuery } from 'mongoose';
|
|
2
|
+
import * as factory from '../../factory';
|
|
3
|
+
import { IDocType } from '../mongoose/schemas/offer/event';
|
|
4
|
+
type ISearchConditions = factory.eventOffer.ISearchConditions;
|
|
5
|
+
export type ISavingOffer = Pick<IDocType, 'availableAtOrFrom' | 'identifier' | 'itemOffered' | 'project' | 'seller' | 'typeOf' | 'validForMemberTier' | 'validFrom' | 'validThrough'> & {
|
|
6
|
+
id?: never;
|
|
7
|
+
};
|
|
8
|
+
interface IUnset {
|
|
9
|
+
$unset?: {
|
|
10
|
+
[key: string]: 1;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
type IDocWithId = IDocType & {
|
|
14
|
+
id: string;
|
|
15
|
+
};
|
|
16
|
+
type IKeyOfProjection = keyof IDocType;
|
|
17
|
+
/**
|
|
18
|
+
* イベントオファーリポジトリ
|
|
19
|
+
*/
|
|
20
|
+
export declare class EventOfferRepo {
|
|
21
|
+
private readonly eventOfferModel;
|
|
22
|
+
constructor(connection: Connection);
|
|
23
|
+
static CREATE_FILTER_QUERY(params: ISearchConditions): FilterQuery<IDocType>[];
|
|
24
|
+
save(params: {
|
|
25
|
+
id?: string;
|
|
26
|
+
attributes: ISavingOffer & IUnset;
|
|
27
|
+
}): Promise<{
|
|
28
|
+
id: string;
|
|
29
|
+
}>;
|
|
30
|
+
projectFields(conditions: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<IDocWithId[]>;
|
|
31
|
+
deleteById(params: {
|
|
32
|
+
id: string;
|
|
33
|
+
project: {
|
|
34
|
+
id: string;
|
|
35
|
+
};
|
|
36
|
+
}): Promise<void>;
|
|
37
|
+
}
|
|
38
|
+
export {};
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
12
|
+
var t = {};
|
|
13
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
14
|
+
t[p] = s[p];
|
|
15
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
16
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
18
|
+
t[p[i]] = s[p[i]];
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
exports.EventOfferRepo = void 0;
|
|
24
|
+
const factory = require("../../factory");
|
|
25
|
+
const settings_1 = require("../../settings");
|
|
26
|
+
const event_1 = require("../mongoose/schemas/offer/event");
|
|
27
|
+
/**
|
|
28
|
+
* イベントオファーリポジトリ
|
|
29
|
+
*/
|
|
30
|
+
class EventOfferRepo {
|
|
31
|
+
constructor(connection) {
|
|
32
|
+
this.eventOfferModel = connection.model(event_1.modelName, (0, event_1.createSchema)());
|
|
33
|
+
}
|
|
34
|
+
// tslint:disable-next-line:max-func-body-length
|
|
35
|
+
static CREATE_FILTER_QUERY(params) {
|
|
36
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
37
|
+
const andConditions = [];
|
|
38
|
+
const projectIdEq = (_b = (_a = params.project) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq;
|
|
39
|
+
if (typeof projectIdEq === 'string') {
|
|
40
|
+
andConditions.push({ 'project.id': { $eq: projectIdEq } });
|
|
41
|
+
}
|
|
42
|
+
const idEq = (_c = params.id) === null || _c === void 0 ? void 0 : _c.$eq;
|
|
43
|
+
if (typeof idEq === 'string') {
|
|
44
|
+
andConditions.push({ _id: { $eq: idEq } });
|
|
45
|
+
}
|
|
46
|
+
const idIn = (_d = params.id) === null || _d === void 0 ? void 0 : _d.$in;
|
|
47
|
+
if (Array.isArray(idIn)) {
|
|
48
|
+
andConditions.push({ _id: { $in: idIn } });
|
|
49
|
+
}
|
|
50
|
+
const identifierEq = (_e = params.identifier) === null || _e === void 0 ? void 0 : _e.$eq;
|
|
51
|
+
if (typeof identifierEq === 'string') {
|
|
52
|
+
andConditions.push({ identifier: { $eq: identifierEq } });
|
|
53
|
+
}
|
|
54
|
+
const sellerIdEq = (_g = (_f = params.seller) === null || _f === void 0 ? void 0 : _f.id) === null || _g === void 0 ? void 0 : _g.$eq;
|
|
55
|
+
if (typeof sellerIdEq === 'string') {
|
|
56
|
+
andConditions.push({ 'seller.id': { $eq: sellerIdEq } });
|
|
57
|
+
}
|
|
58
|
+
const itemOfferedIdEq = (_j = (_h = params.itemOffered) === null || _h === void 0 ? void 0 : _h.id) === null || _j === void 0 ? void 0 : _j.$eq;
|
|
59
|
+
if (typeof itemOfferedIdEq === 'string') {
|
|
60
|
+
andConditions.push({ 'itemOffered.id': { $eq: itemOfferedIdEq } });
|
|
61
|
+
}
|
|
62
|
+
const availableAtOrFromIdEq = (_l = (_k = params.availableAtOrFrom) === null || _k === void 0 ? void 0 : _k.id) === null || _l === void 0 ? void 0 : _l.$eq;
|
|
63
|
+
if (typeof availableAtOrFromIdEq === 'string') {
|
|
64
|
+
andConditions.push({ 'availableAtOrFrom.id': { $eq: availableAtOrFromIdEq } });
|
|
65
|
+
}
|
|
66
|
+
const validForMemberTierIdentifierEq = (_o = (_m = params.validForMemberTier) === null || _m === void 0 ? void 0 : _m.identifier) === null || _o === void 0 ? void 0 : _o.$eq;
|
|
67
|
+
if (typeof validForMemberTierIdentifierEq === 'string') {
|
|
68
|
+
andConditions.push({ 'validForMemberTier.identifier': { $exists: true, $eq: validForMemberTierIdentifierEq } });
|
|
69
|
+
}
|
|
70
|
+
return andConditions;
|
|
71
|
+
}
|
|
72
|
+
save(params) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
let doc;
|
|
76
|
+
let savedId;
|
|
77
|
+
const savingId = params.id;
|
|
78
|
+
if (typeof savingId === 'string') {
|
|
79
|
+
if (savingId === '') {
|
|
80
|
+
throw new factory.errors.ArgumentNull('id');
|
|
81
|
+
}
|
|
82
|
+
const _c = params.attributes, { id, identifier, itemOffered, project, seller, typeOf, availableAtOrFrom, validForMemberTier, $unset } = _c, updateFields = __rest(_c, ["id", "identifier", "itemOffered", "project", "seller", "typeOf", "availableAtOrFrom", "validForMemberTier", "$unset"]);
|
|
83
|
+
const filter = {
|
|
84
|
+
_id: { $eq: savingId },
|
|
85
|
+
'project.id': { $eq: project.id }
|
|
86
|
+
};
|
|
87
|
+
const update = Object.assign({ $set: Object.assign({}, updateFields) }, ($unset !== undefined && $unset !== null) ? { $unset } : undefined);
|
|
88
|
+
const options = {
|
|
89
|
+
upsert: false,
|
|
90
|
+
new: true,
|
|
91
|
+
projection: { _id: 1, id: { $toString: '$_id' } }
|
|
92
|
+
};
|
|
93
|
+
doc = yield this.eventOfferModel.findOneAndUpdate(filter, update, options)
|
|
94
|
+
.lean()
|
|
95
|
+
.exec();
|
|
96
|
+
if (doc === null) {
|
|
97
|
+
throw new factory.errors.NotFound(this.eventOfferModel.modelName);
|
|
98
|
+
}
|
|
99
|
+
savedId = savingId;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
const _d = params.attributes, { $unset, id } = _d, createParams = __rest(_d, ["$unset", "id"]);
|
|
103
|
+
const result = yield this.eventOfferModel.insertMany(Object.assign({}, createParams), { rawResult: true });
|
|
104
|
+
const insertedId = (_b = (_a = result.insertedIds) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.toHexString();
|
|
105
|
+
if (typeof insertedId !== 'string') {
|
|
106
|
+
throw new factory.errors.Internal(`seller not saved unexpectedly. result:${JSON.stringify(result)}`);
|
|
107
|
+
}
|
|
108
|
+
savedId = insertedId;
|
|
109
|
+
}
|
|
110
|
+
return { id: savedId };
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
projectFields(conditions, inclusion) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
var _a;
|
|
116
|
+
const andConditions = EventOfferRepo.CREATE_FILTER_QUERY(conditions);
|
|
117
|
+
const projection = Object.assign({ _id: 0, id: { $toString: '$_id' } }, Object.fromEntries(inclusion.map((key) => ([key, 1]))));
|
|
118
|
+
const query = this.eventOfferModel.find((andConditions.length > 0) ? { $and: andConditions } : {}, projection);
|
|
119
|
+
if (typeof conditions.limit === 'number' && conditions.limit > 0) {
|
|
120
|
+
const page = (typeof conditions.page === 'number' && conditions.page > 0) ? conditions.page : 1;
|
|
121
|
+
query.limit(conditions.limit)
|
|
122
|
+
.skip(conditions.limit * (page - 1));
|
|
123
|
+
}
|
|
124
|
+
if (typeof ((_a = conditions.sort) === null || _a === void 0 ? void 0 : _a.validFrom) === 'number') {
|
|
125
|
+
query.sort({ validFrom: conditions.sort.validFrom });
|
|
126
|
+
}
|
|
127
|
+
return query.setOptions({ maxTimeMS: settings_1.MONGO_MAX_TIME_MS })
|
|
128
|
+
.lean()
|
|
129
|
+
.exec();
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
deleteById(params) {
|
|
133
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
+
yield this.eventOfferModel.findOneAndDelete({
|
|
135
|
+
_id: { $eq: params.id },
|
|
136
|
+
'project.id': { $eq: params.project.id }
|
|
137
|
+
}, { projection: { _id: 1 } })
|
|
138
|
+
.exec();
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
exports.EventOfferRepo = EventOfferRepo;
|
|
@@ -1,72 +1,77 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Connection, FilterQuery } from 'mongoose';
|
|
1
|
+
import { Connection } from 'mongoose';
|
|
3
2
|
import * as factory from '../factory';
|
|
4
|
-
import { IDocType } from './mongoose/schemas/productOffer';
|
|
5
|
-
export { IDocType as IProductOffer };
|
|
6
|
-
interface ISearchConditions {
|
|
7
|
-
limit?: number;
|
|
8
|
-
page?: number;
|
|
9
|
-
sort?: {
|
|
10
|
-
validFrom?: factory.sortType;
|
|
11
|
-
};
|
|
12
|
-
project?: {
|
|
13
|
-
id?: {
|
|
14
|
-
$eq?: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
itemOffered?: {
|
|
18
|
-
identifier?: {
|
|
19
|
-
$eq?: string;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
validForMemberTier?: {
|
|
23
|
-
identifier?: {
|
|
24
|
-
$eq?: string;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
validFrom?: {
|
|
28
|
-
$lte?: Date;
|
|
29
|
-
};
|
|
30
|
-
validThrough?: {
|
|
31
|
-
$gte?: Date;
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export type ISavingOffer = Pick<IDocType, 'identifier' | 'itemOffered' | 'project' | 'typeOf' | 'validFrom' | 'validThrough' | 'availability' | 'validForMemberTier' | 'acceptedPaymentMethod'> & {
|
|
35
|
-
id?: never;
|
|
36
|
-
};
|
|
37
|
-
type IUnset = {
|
|
38
|
-
[key in keyof IDocType]?: 1;
|
|
39
|
-
};
|
|
40
|
-
type IDocWithId = IDocType & {
|
|
41
|
-
id: string;
|
|
42
|
-
};
|
|
43
|
-
type IKeyOfProjection = keyof IDocType;
|
|
44
3
|
/**
|
|
45
4
|
* プロダクトオファーリポジトリ
|
|
46
5
|
*/
|
|
47
6
|
export declare class ProductOfferRepo {
|
|
48
|
-
private readonly
|
|
7
|
+
private readonly productModel;
|
|
49
8
|
constructor(connection: Connection);
|
|
50
|
-
static CREATE_MONGO_CONDITIONS(params: ISearchConditions): FilterQuery<IDocType>[];
|
|
51
|
-
findProductOffers(params: ISearchConditions, inclusion: IKeyOfProjection[]): Promise<IDocWithId[]>;
|
|
52
9
|
/**
|
|
53
|
-
*
|
|
10
|
+
* プロダクトオファー検索
|
|
54
11
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
12
|
+
search(params: {
|
|
13
|
+
limit?: number;
|
|
14
|
+
page?: number;
|
|
15
|
+
project?: {
|
|
16
|
+
id?: {
|
|
17
|
+
$eq?: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
itemOffered?: {
|
|
21
|
+
id?: {
|
|
22
|
+
$eq?: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
seller?: {
|
|
26
|
+
id?: {
|
|
27
|
+
$eq?: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}): Promise<(Pick<factory.product.IOffer, 'availabilityEnds' | 'availabilityStarts' | 'seller' | 'validFrom' | 'validThrough'> & {
|
|
31
|
+
itemOffered: Pick<factory.product.IProduct, 'id' | 'name' | 'typeOf'>;
|
|
32
|
+
})[]>;
|
|
33
|
+
create(params: factory.product.IOffer & {
|
|
34
|
+
project: {
|
|
35
|
+
id: string;
|
|
36
|
+
};
|
|
37
|
+
itemOffered: {
|
|
38
|
+
/**
|
|
39
|
+
* プロダクトID
|
|
40
|
+
*/
|
|
41
|
+
id: string;
|
|
58
42
|
};
|
|
59
|
-
$unset: IUnset;
|
|
60
|
-
}[], options: {
|
|
61
|
-
/**
|
|
62
|
-
* falseの場合setOnInsertのみ
|
|
63
|
-
* trueの場合setのみ
|
|
64
|
-
*/
|
|
65
|
-
update: boolean;
|
|
66
43
|
}): Promise<{
|
|
67
|
-
|
|
68
|
-
|
|
44
|
+
id: string;
|
|
45
|
+
}>;
|
|
46
|
+
update(params: factory.product.IOffer & {
|
|
47
|
+
project: {
|
|
69
48
|
id: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
49
|
+
};
|
|
50
|
+
itemOffered: {
|
|
51
|
+
/**
|
|
52
|
+
* プロダクトID
|
|
53
|
+
*/
|
|
54
|
+
id: string;
|
|
55
|
+
};
|
|
56
|
+
}): Promise<{
|
|
57
|
+
id: string;
|
|
58
|
+
}>;
|
|
59
|
+
deleteOne(params: Pick<factory.product.IOffer, 'seller'> & {
|
|
60
|
+
project: {
|
|
61
|
+
id: string;
|
|
62
|
+
};
|
|
63
|
+
itemOffered: {
|
|
64
|
+
/**
|
|
65
|
+
* プロダクトID
|
|
66
|
+
*/
|
|
67
|
+
id: string;
|
|
68
|
+
};
|
|
69
|
+
}): Promise<{
|
|
70
|
+
id: string;
|
|
71
|
+
}>;
|
|
72
|
+
deleteManyBySellerId(params: Pick<factory.product.IOffer, 'seller'> & {
|
|
73
|
+
project: {
|
|
74
|
+
id: string;
|
|
75
|
+
};
|
|
76
|
+
}): Promise<import("mongoose").UpdateWriteOpResult>;
|
|
72
77
|
}
|