@chevre/domain 24.0.0-alpha.81 → 24.0.0-alpha.83
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/mongoose/schemas/setting.d.ts +0 -1
- package/lib/chevre/repository.d.ts +0 -10
- package/lib/chevre/repository.js +2 -24
- package/lib/chevre/service/assetTransaction/reserve/start.d.ts +0 -2
- package/lib/chevre/service/assetTransaction/reserve/start.js +0 -1
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +0 -3
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +1 -11
- package/lib/chevre/service/notification/triggerWebhook.js +43 -48
- package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +0 -2
- package/lib/chevre/service/offer/event/authorize.d.ts +0 -2
- package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +1 -3
- package/lib/chevre/service/offer/event/issueEventOfferTicket.js +11 -13
- package/lib/chevre/service/payment/creditCard/authorize/handleAuthorizeError.js +2 -7
- package/lib/chevre/service/payment/creditCard/gmoError.d.ts +1 -31
- package/lib/chevre/service/payment/creditCard/refundCreditCard.js +2 -2
- package/lib/chevre/service/payment/creditCard/searchGMOTrade.js +1 -1
- package/lib/chevre/service/payment/creditCard/voidTransaction.js +1 -1
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.d.ts +0 -2
- package/lib/chevre/service/task/onResourceDeleted/deleteResourcesBySeller.js +0 -6
- package/lib/chevre/service/task/onResourceDeleted.js +0 -2
- package/lib/chevre/service/task/onResourceUpdated.js +0 -2
- package/package.json +3 -3
- package/lib/chevre/repo/comment.d.ts +0 -42
- package/lib/chevre/repo/comment.js +0 -121
- package/lib/chevre/repo/mongoose/schemas/comments.d.ts +0 -11
- package/lib/chevre/repo/mongoose/schemas/comments.js +0 -103
- package/lib/chevre/repo/mongoose/schemas/productOffer.d.ts +0 -14
- package/lib/chevre/repo/mongoose/schemas/productOffer.js +0 -108
- package/lib/chevre/repo/productOffer.d.ts +0 -52
- package/lib/chevre/repo/productOffer.js +0 -209
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.d.ts +0 -16
- package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.js +0 -129
|
@@ -28,7 +28,6 @@ import type { AssetTransactionRepo } from './repo/assetTransaction';
|
|
|
28
28
|
import type { ReserveTransactionRepo } from './repo/assetTransaction/reserve';
|
|
29
29
|
import type { AuthorizationRepo } from './repo/authorization';
|
|
30
30
|
import type { CategoryCodeRepo } from './repo/categoryCode';
|
|
31
|
-
import type { CommentRepo } from './repo/comment';
|
|
32
31
|
import type { CreativeWorkRepo } from './repo/creativeWork';
|
|
33
32
|
import type { CredentialsRepo } from './repo/credentials';
|
|
34
33
|
import type { CustomerRepo } from './repo/customer';
|
|
@@ -72,7 +71,6 @@ import type { PriceSpecificationRepo } from './repo/priceSpecification';
|
|
|
72
71
|
import type { ProductRepo } from './repo/product';
|
|
73
72
|
import type { ProductHasOfferCatalogRepo } from './repo/productHasOfferCatalog';
|
|
74
73
|
import type { ProductModelRepo } from './repo/productModel';
|
|
75
|
-
import type { ProductOfferRepo } from './repo/productOffer';
|
|
76
74
|
import type { ProjectRepo } from './repo/project';
|
|
77
75
|
import type { ProjectMakesOfferRepo } from './repo/projectMakesOffer';
|
|
78
76
|
import type { OfferRateLimitRepo } from './repo/rateLimit/offer';
|
|
@@ -213,10 +211,6 @@ export type Authorization = AuthorizationRepo;
|
|
|
213
211
|
export declare namespace Authorization {
|
|
214
212
|
function createInstance(...params: ConstructorParameters<typeof AuthorizationRepo>): Promise<AuthorizationRepo>;
|
|
215
213
|
}
|
|
216
|
-
export type Comment = CommentRepo;
|
|
217
|
-
export declare namespace Comment {
|
|
218
|
-
function createInstance(...params: ConstructorParameters<typeof CommentRepo>): Promise<CommentRepo>;
|
|
219
|
-
}
|
|
220
214
|
export type ConfirmationNumber = ConfirmationNumberRepo;
|
|
221
215
|
export declare namespace ConfirmationNumber {
|
|
222
216
|
function createInstance(...params: ConstructorParameters<typeof ConfirmationNumberRepo>): Promise<ConfirmationNumberRepo>;
|
|
@@ -421,10 +415,6 @@ export type ProductModel = ProductModelRepo;
|
|
|
421
415
|
export declare namespace ProductModel {
|
|
422
416
|
function createInstance(...params: ConstructorParameters<typeof ProductModelRepo>): Promise<ProductModelRepo>;
|
|
423
417
|
}
|
|
424
|
-
export type ProductOffer = ProductOfferRepo;
|
|
425
|
-
export declare namespace ProductOffer {
|
|
426
|
-
function createInstance(...params: ConstructorParameters<typeof ProductOfferRepo>): Promise<ProductOfferRepo>;
|
|
427
|
-
}
|
|
428
418
|
export type Project = ProjectRepo;
|
|
429
419
|
export declare namespace Project {
|
|
430
420
|
function createInstance(...params: ConstructorParameters<typeof ProjectRepo>): Promise<ProjectRepo>;
|
package/lib/chevre/repository.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OwnershipInfo = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.MovieTicketType = exports.Message = exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.EventOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.
|
|
4
|
-
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.
|
|
3
|
+
exports.PaymentServiceProvider = exports.PaymentServiceChannel = exports.PaymentService = exports.Passport = exports.OwnershipInfo = exports.OrderNumber = exports.OrderInTransaction = exports.Order = exports.Offer = exports.OfferItemCondition = exports.OfferCatalogItem = exports.OfferCatalog = exports.NoteAboutOrder = exports.Note = exports.MovieTicketType = exports.Message = exports.MerchantReturnPolicy = exports.MemberProgram = exports.Member = exports.Issuer = exports.IdentityProvider = exports.Identity = exports.EventSeries = exports.EventSellerMakesOffer = exports.EventOffer = exports.Event = exports.EmailMessage = exports.CustomerType = exports.Customer = exports.Credentials = exports.CreativeWork = exports.ConfirmationNumber = exports.Authorization = exports.CategoryCode = exports.assetTransaction = exports.AssetTransaction = exports.Aggregation = exports.AggregateReservation = exports.AggregateOrder = exports.AggregateOffer = exports.AggregateAction = exports.AdvanceBookingRequirement = exports.AdditionalProperty = exports.action = exports.Action = exports.AccountTransaction = exports.AccountTitle = exports.AccountingReport = exports.Account = exports.AcceptedOffer = void 0;
|
|
4
|
+
exports.WebSite = exports.rateLimit = exports.TransactionProcess = exports.TransactionNumber = exports.transaction = exports.Transaction = exports.Ticket = exports.Task = exports.StockHolder = exports.setting = exports.Setting = exports.ServiceOutputIdentifier = exports.ServiceOutput = exports.ServiceAvailableHour = exports.SellerReturnPolicy = exports.SellerPaymentAccepted = exports.SellerMakesOffer = exports.Seller = exports.Schedule = exports.Role = exports.ReserveInterface = exports.Reservation = exports.ProjectMakesOffer = exports.Project = exports.ProductModel = exports.ProductHasOfferCatalog = exports.Product = exports.PriceSpecification = exports.PotentialAction = exports.place = exports.Permit = exports.Person = exports.PendingReservation = void 0;
|
|
5
5
|
var AcceptedOffer;
|
|
6
6
|
(function (AcceptedOffer) {
|
|
7
7
|
let repo;
|
|
@@ -305,17 +305,6 @@ var Authorization;
|
|
|
305
305
|
}
|
|
306
306
|
Authorization.createInstance = createInstance;
|
|
307
307
|
})(Authorization || (exports.Authorization = Authorization = {}));
|
|
308
|
-
var Comment;
|
|
309
|
-
(function (Comment) {
|
|
310
|
-
let repo;
|
|
311
|
-
async function createInstance(...params) {
|
|
312
|
-
if (repo === undefined) {
|
|
313
|
-
repo = (await import('./repo/comment.js')).CommentRepo;
|
|
314
|
-
}
|
|
315
|
-
return new repo(...params);
|
|
316
|
-
}
|
|
317
|
-
Comment.createInstance = createInstance;
|
|
318
|
-
})(Comment || (exports.Comment = Comment = {}));
|
|
319
308
|
var ConfirmationNumber;
|
|
320
309
|
(function (ConfirmationNumber) {
|
|
321
310
|
let repo;
|
|
@@ -843,17 +832,6 @@ var ProductModel;
|
|
|
843
832
|
}
|
|
844
833
|
ProductModel.createInstance = createInstance;
|
|
845
834
|
})(ProductModel || (exports.ProductModel = ProductModel = {}));
|
|
846
|
-
var ProductOffer;
|
|
847
|
-
(function (ProductOffer) {
|
|
848
|
-
let repo;
|
|
849
|
-
async function createInstance(...params) {
|
|
850
|
-
if (repo === undefined) {
|
|
851
|
-
repo = (await import('./repo/productOffer.js')).ProductOfferRepo;
|
|
852
|
-
}
|
|
853
|
-
return new repo(...params);
|
|
854
|
-
}
|
|
855
|
-
ProductOffer.createInstance = createInstance;
|
|
856
|
-
})(ProductOffer || (exports.ProductOffer = ProductOffer = {}));
|
|
857
835
|
var Project;
|
|
858
836
|
(function (Project) {
|
|
859
837
|
let repo;
|
|
@@ -16,7 +16,6 @@ import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
|
16
16
|
import { SeatRepo } from '../../../repo/place/seat';
|
|
17
17
|
import type { PriceSpecificationRepo } from '../../../repo/priceSpecification';
|
|
18
18
|
import type { ProductRepo } from '../../../repo/product';
|
|
19
|
-
import type { ProductOfferRepo } from '../../../repo/productOffer';
|
|
20
19
|
import type { ProjectRepo } from '../../../repo/project';
|
|
21
20
|
import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
22
21
|
import type { SettingRepo } from '../../../repo/setting';
|
|
@@ -39,7 +38,6 @@ interface IStartOperationRepos {
|
|
|
39
38
|
offerRateLimit: OfferRateLimitRepo;
|
|
40
39
|
paymentService: PaymentServiceRepo;
|
|
41
40
|
product: ProductRepo;
|
|
42
|
-
productOffer: ProductOfferRepo;
|
|
43
41
|
priceSpecification: PriceSpecificationRepo;
|
|
44
42
|
project: ProjectRepo;
|
|
45
43
|
seat: SeatRepo;
|
|
@@ -5,7 +5,6 @@ import type { EventOfferRepo } from '../../../repo/eventOffer';
|
|
|
5
5
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
6
6
|
import type { MemberRepo } from '../../../repo/member';
|
|
7
7
|
import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
8
|
-
import type { ProductOfferRepo } from '../../../repo/productOffer';
|
|
9
8
|
import type { TicketRepo } from '../../../repo/ticket';
|
|
10
9
|
declare function validateStartRequest(params: {
|
|
11
10
|
object: factory.assetTransaction.reserve.IObjectWithoutDetail;
|
|
@@ -29,7 +28,6 @@ declare function validateStartRequest(params: {
|
|
|
29
28
|
issuer: IssuerRepo;
|
|
30
29
|
member: MemberRepo;
|
|
31
30
|
memberProgram: MemberProgramRepo;
|
|
32
|
-
productOffer: ProductOfferRepo;
|
|
33
31
|
ticket: TicketRepo;
|
|
34
32
|
}) => Promise<void>;
|
|
35
33
|
/**
|
|
@@ -58,6 +56,5 @@ declare function validEventOfferByApplicationExists(params: {
|
|
|
58
56
|
issuer: IssuerRepo;
|
|
59
57
|
member: MemberRepo;
|
|
60
58
|
memberProgram: MemberProgramRepo;
|
|
61
|
-
productOffer: ProductOfferRepo;
|
|
62
59
|
}) => Promise<void>;
|
|
63
60
|
export { validateStartRequest, validEventOfferByApplicationExists };
|
|
@@ -9,7 +9,6 @@ const moment_1 = __importDefault(require("moment"));
|
|
|
9
9
|
const factory_1 = require("../../../factory");
|
|
10
10
|
const fixExtendedEventOffer_1 = require("./validateStartRequest/fixExtendedEventOffer");
|
|
11
11
|
const validateIssuedOfferIfExists_1 = require("./validateStartRequest/validateIssuedOfferIfExists");
|
|
12
|
-
const validateMemberTierIfExists_1 = require("./validateStartRequest/validateMemberTierIfExists");
|
|
13
12
|
const verifyTicketTokenAsNeeded_1 = require("./validateStartRequest/verifyTicketTokenAsNeeded");
|
|
14
13
|
function validateStartRequest(params) {
|
|
15
14
|
return async (repos) => {
|
|
@@ -59,8 +58,6 @@ function validEventOfferByApplicationExists(params) {
|
|
|
59
58
|
}
|
|
60
59
|
const validFrom = makesOfferOnApplication.validFrom;
|
|
61
60
|
const validThrough = makesOfferOnApplication.validThrough;
|
|
62
|
-
// const validFrom = eventOffers?.validFrom;
|
|
63
|
-
// const validThrough = eventOffers?.validThrough;
|
|
64
61
|
if (validFrom !== undefined && validFrom !== null) {
|
|
65
62
|
if (acceptedDate.isBefore((0, moment_1.default)(validFrom))) {
|
|
66
63
|
throw new factory_1.factory.errors.Argument('reservationFor.id', `Offer of ${params.event.id} is valid from ${validFrom}`);
|
|
@@ -84,14 +81,7 @@ function validEventOfferByApplicationExists(params) {
|
|
|
84
81
|
})(repos);
|
|
85
82
|
}
|
|
86
83
|
else {
|
|
87
|
-
//
|
|
88
|
-
// 有効メンバープログラムティアが存在する場合
|
|
89
|
-
await (0, validateMemberTierIfExists_1.validateMemberTierIfExists)({
|
|
90
|
-
event,
|
|
91
|
-
now: params.now,
|
|
92
|
-
makesOfferOnApplication,
|
|
93
|
-
acceptedEventOffer
|
|
94
|
-
})(repos);
|
|
84
|
+
// 拡張イベントオファーを利用しない場合は、これ以上検証なし
|
|
95
85
|
}
|
|
96
86
|
};
|
|
97
87
|
}
|
|
@@ -155,7 +155,6 @@ function signRequest(params) {
|
|
|
155
155
|
function processInformAction(params, options) {
|
|
156
156
|
return async (repos) => {
|
|
157
157
|
const timeout = options?.triggerWebhook?.timeout;
|
|
158
|
-
const useFetchAPI = options?.triggerWebhook?.useFetchAPI === true;
|
|
159
158
|
const secretKey = options?.triggerWebhook?.secretKey;
|
|
160
159
|
const headerIdentifier = options?.triggerWebhook?.headerIdentifier;
|
|
161
160
|
const { identifier } = params;
|
|
@@ -180,63 +179,59 @@ function processInformAction(params, options) {
|
|
|
180
179
|
&& typeof headerIdentifier === 'string' && headerIdentifier !== '') {
|
|
181
180
|
signature = signRequest({ requestBody, timestamp, secretKey });
|
|
182
181
|
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
headers.append(`X-${headerIdentifier}-Webhook-Signature`, signature);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
const res = await fetch(urlTemplate, {
|
|
192
|
-
method: 'POST',
|
|
193
|
-
headers,
|
|
194
|
-
body: requestBody, // body data type must match "Content-Type" header
|
|
195
|
-
...(typeof timeout === 'number')
|
|
196
|
-
? { signal: AbortSignal.timeout(timeout) }
|
|
197
|
-
: undefined
|
|
198
|
-
});
|
|
199
|
-
let body;
|
|
200
|
-
try {
|
|
201
|
-
body = await res.text();
|
|
182
|
+
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
183
|
+
if (typeof headerIdentifier === 'string' && headerIdentifier !== '') {
|
|
184
|
+
headers.append(`X-${headerIdentifier}-Webhook-Timestamp`, String(timestamp));
|
|
185
|
+
if (typeof signature === 'string') {
|
|
186
|
+
headers.append(`X-${headerIdentifier}-Webhook-Signature`, signature);
|
|
202
187
|
}
|
|
203
|
-
|
|
204
|
-
|
|
188
|
+
}
|
|
189
|
+
const res = await fetch(urlTemplate, {
|
|
190
|
+
method: 'POST',
|
|
191
|
+
headers,
|
|
192
|
+
body: requestBody, // body data type must match "Content-Type" header
|
|
193
|
+
...(typeof timeout === 'number')
|
|
194
|
+
? { signal: AbortSignal.timeout(timeout) }
|
|
195
|
+
: undefined
|
|
196
|
+
});
|
|
197
|
+
let body;
|
|
198
|
+
try {
|
|
199
|
+
body = await res.text();
|
|
200
|
+
}
|
|
201
|
+
catch (_error) {
|
|
202
|
+
// no op
|
|
203
|
+
}
|
|
204
|
+
switch (res.status) {
|
|
205
|
+
case http_status_1.status.OK:
|
|
206
|
+
case http_status_1.status.CREATED:
|
|
207
|
+
case http_status_1.status.ACCEPTED:
|
|
208
|
+
case http_status_1.status.NO_CONTENT: {
|
|
209
|
+
result = {
|
|
210
|
+
statusCode: res.status,
|
|
211
|
+
useFetchAPI: true
|
|
212
|
+
};
|
|
213
|
+
break;
|
|
205
214
|
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
statusCode: res.status,
|
|
213
|
-
useFetchAPI
|
|
214
|
-
};
|
|
215
|
-
break;
|
|
216
|
-
default:
|
|
215
|
+
default: {
|
|
216
|
+
// プロジェクト固有の特別対応
|
|
217
|
+
const ignoreUnexpectedResponse = res.status === http_status_1.status.INTERNAL_SERVER_ERROR
|
|
218
|
+
&& typeof body === 'string'
|
|
219
|
+
&& body.includes(USERNAME_ARGUMENT_REQUIRED_MESSAGE);
|
|
220
|
+
if (!ignoreUnexpectedResponse) {
|
|
217
221
|
throw new factory_1.factory.errors.Internal(`statusCode: ${res.status} body: ${body}`);
|
|
222
|
+
}
|
|
218
223
|
}
|
|
219
224
|
}
|
|
220
|
-
else {
|
|
221
|
-
throw new factory_1.factory.errors.NotImplemented('only useFetchAPI implemented');
|
|
222
|
-
}
|
|
223
225
|
}
|
|
224
226
|
}
|
|
225
227
|
catch (error) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
if (error.statusCode === http_status_1.status.INTERNAL_SERVER_ERROR && error.body?.message === USERNAME_ARGUMENT_REQUIRED_MESSAGE) {
|
|
229
|
-
throwsError = false;
|
|
228
|
+
try {
|
|
229
|
+
await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
|
|
230
230
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
await repos.action.giveUp({ typeOf: action.typeOf, id: action.id, error });
|
|
234
|
-
}
|
|
235
|
-
catch (__) {
|
|
236
|
-
// 失敗したら仕方ない
|
|
237
|
-
}
|
|
238
|
-
throw error;
|
|
231
|
+
catch (__) {
|
|
232
|
+
// 失敗したら仕方ない
|
|
239
233
|
}
|
|
234
|
+
throw error;
|
|
240
235
|
}
|
|
241
236
|
await repos.action.completeWithVoid({ typeOf: action.typeOf, id: action.id, result: result });
|
|
242
237
|
};
|
|
@@ -16,7 +16,6 @@ import type { PaymentServiceRepo } from '../../../../repo/paymentService';
|
|
|
16
16
|
import type { SeatRepo } from '../../../../repo/place/seat';
|
|
17
17
|
import type { PriceSpecificationRepo } from '../../../../repo/priceSpecification';
|
|
18
18
|
import type { ProductRepo } from '../../../../repo/product';
|
|
19
|
-
import type { ProductOfferRepo } from '../../../../repo/productOffer';
|
|
20
19
|
import type { ProjectRepo } from '../../../../repo/project';
|
|
21
20
|
import type { OfferRateLimitRepo } from '../../../../repo/rateLimit/offer';
|
|
22
21
|
import type { SettingRepo } from '../../../../repo/setting';
|
|
@@ -65,7 +64,6 @@ declare function processStartReserve4chevre(params: {
|
|
|
65
64
|
offerRateLimit: OfferRateLimitRepo;
|
|
66
65
|
paymentService: PaymentServiceRepo;
|
|
67
66
|
product: ProductRepo;
|
|
68
|
-
productOffer: ProductOfferRepo;
|
|
69
67
|
priceSpecification: PriceSpecificationRepo;
|
|
70
68
|
project: ProjectRepo;
|
|
71
69
|
seat: SeatRepo;
|
|
@@ -19,7 +19,6 @@ import type { PaymentServiceRepo } from '../../../repo/paymentService';
|
|
|
19
19
|
import type { SeatRepo } from '../../../repo/place/seat';
|
|
20
20
|
import type { PriceSpecificationRepo } from '../../../repo/priceSpecification';
|
|
21
21
|
import type { ProductRepo } from '../../../repo/product';
|
|
22
|
-
import type { ProductOfferRepo } from '../../../repo/productOffer';
|
|
23
22
|
import type { ProjectRepo } from '../../../repo/project';
|
|
24
23
|
import type { OfferRateLimitRepo } from '../../../repo/rateLimit/offer';
|
|
25
24
|
import type { SettingRepo } from '../../../repo/setting';
|
|
@@ -50,7 +49,6 @@ interface IAuthorizeRepos {
|
|
|
50
49
|
paymentService: PaymentServiceRepo;
|
|
51
50
|
priceSpecification: PriceSpecificationRepo;
|
|
52
51
|
product: ProductRepo;
|
|
53
|
-
productOffer: ProductOfferRepo;
|
|
54
52
|
project: ProjectRepo;
|
|
55
53
|
seat: SeatRepo;
|
|
56
54
|
setting: SettingRepo;
|
|
@@ -6,7 +6,6 @@ import type { EventOfferRepo } from '../../../repo/eventOffer';
|
|
|
6
6
|
import type { IssuerRepo } from '../../../repo/issuer';
|
|
7
7
|
import type { MemberRepo } from '../../../repo/member';
|
|
8
8
|
import type { MemberProgramRepo } from '../../../repo/memberProgram';
|
|
9
|
-
import type { ProductOfferRepo } from '../../../repo/productOffer';
|
|
10
9
|
import type { TicketRepo } from '../../../repo/ticket';
|
|
11
10
|
import type { PlaceOrderRepo } from '../../../repo/transaction/placeOrder';
|
|
12
11
|
interface IIssueEventOfferTicketRepos {
|
|
@@ -18,7 +17,6 @@ interface IIssueEventOfferTicketRepos {
|
|
|
18
17
|
issuer: IssuerRepo;
|
|
19
18
|
member: MemberRepo;
|
|
20
19
|
memberProgram: MemberProgramRepo;
|
|
21
|
-
productOffer: ProductOfferRepo;
|
|
22
20
|
ticket: TicketRepo;
|
|
23
21
|
placeOrder: PlaceOrderRepo;
|
|
24
22
|
}
|
|
@@ -33,7 +31,7 @@ declare function issueEventOfferTicket(params: {
|
|
|
33
31
|
* 拡張イベントオファーID
|
|
34
32
|
*/
|
|
35
33
|
eventOfferId?: string;
|
|
36
|
-
ticketedOffer?: Pick<factory.authorization.IOfferAsObject, 'token'
|
|
34
|
+
ticketedOffer?: Pick<factory.authorization.IOfferAsObject, 'token'>;
|
|
37
35
|
author: Pick<factory.authorization.IAuthor, 'id' | 'typeOf'>;
|
|
38
36
|
project: {
|
|
39
37
|
id: string;
|
|
@@ -66,8 +66,6 @@ function issueEventOfferTicket(params) {
|
|
|
66
66
|
const transaction = await repos.placeOrder.findPlaceOrderInProgressById({ typeOf: factory_1.factory.transactionType.PlaceOrder, id: audience.id }, ['expires', 'typeOf', 'seller']);
|
|
67
67
|
// イベントは存在するか
|
|
68
68
|
const event = await repos.event.projectEventFieldsById({ id: eventId }, ['project', 'offers', 'identifier']);
|
|
69
|
-
// 取引番号発行
|
|
70
|
-
// const { transactionNumber } = await transactionNumberRepo.publishByTimestamp({ startDate: now });
|
|
71
69
|
const { seller } = transaction;
|
|
72
70
|
// 承認作成
|
|
73
71
|
const issuedBy = {
|
|
@@ -75,8 +73,8 @@ function issueEventOfferTicket(params) {
|
|
|
75
73
|
typeOf: seller.typeOf,
|
|
76
74
|
...(typeof seller.name.ja === 'string') ? { name: seller.name.ja } : undefined
|
|
77
75
|
};
|
|
78
|
-
const validForMemberTierToken = ticketedOffer?.validForMemberTier?.token;
|
|
79
|
-
const validForMemberProgramIdentifier = ticketedOffer?.validForMemberTier?.isTierOf.identifier;
|
|
76
|
+
// const validForMemberTierToken = ticketedOffer?.validForMemberTier?.token;
|
|
77
|
+
// const validForMemberProgramIdentifier = ticketedOffer?.validForMemberTier?.isTierOf.identifier;
|
|
80
78
|
const authorizationObject = {
|
|
81
79
|
typeOf: factory_1.factory.offerType.Offer,
|
|
82
80
|
itemOffered: {
|
|
@@ -90,15 +88,15 @@ function issueEventOfferTicket(params) {
|
|
|
90
88
|
...(typeof ticketedOffer?.token === 'string' && ticketedOffer.token !== '')
|
|
91
89
|
? { token: ticketedOffer.token }
|
|
92
90
|
: undefined,
|
|
93
|
-
...(typeof validForMemberTierToken === 'string' && validForMemberTierToken !== ''
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
91
|
+
// ...(typeof validForMemberTierToken === 'string' && validForMemberTierToken !== ''
|
|
92
|
+
// && typeof validForMemberProgramIdentifier === 'string' && validForMemberProgramIdentifier !== '')
|
|
93
|
+
// ? {
|
|
94
|
+
// validForMemberTier: {
|
|
95
|
+
// token: validForMemberTierToken,
|
|
96
|
+
// isTierOf: { identifier: validForMemberProgramIdentifier }
|
|
97
|
+
// }
|
|
98
|
+
// }
|
|
99
|
+
// : undefined
|
|
102
100
|
};
|
|
103
101
|
// validations(eventId,eventOfferIdentifier,offerToken...)
|
|
104
102
|
await (0, validateStartRequest_1.validEventOfferByApplicationExists)({
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.handleAuthorizeError = handleAuthorizeError;
|
|
7
|
-
const
|
|
4
|
+
const gmo_service_1 = require("@motionpicture/gmo-service");
|
|
8
5
|
const http_status_1 = require("http-status");
|
|
9
6
|
const factory_1 = require("../../../../factory");
|
|
10
|
-
const debug = (0, debug_1.default)('chevre-domain:service:payment');
|
|
11
7
|
function handleAuthorizeError(error) {
|
|
12
|
-
debug('handling creditCard authorizeError:', error);
|
|
13
8
|
let handledError = error;
|
|
14
|
-
if (error
|
|
9
|
+
if (error instanceof gmo_service_1.GMO.error.badRequest.GMOBadRequestError) {
|
|
15
10
|
if (Array.isArray(error.errors) && error.errors.length > 0) {
|
|
16
11
|
const gmoErrors = error.errors;
|
|
17
12
|
// 流量制限オーバーエラーの場合
|
|
@@ -8,34 +8,4 @@ declare enum GMOErrorInfo {
|
|
|
8
8
|
*/
|
|
9
9
|
JobCodeNotAcceptable = "E01050004"
|
|
10
10
|
}
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* エラー番号
|
|
14
|
-
*/
|
|
15
|
-
errorNumber: string;
|
|
16
|
-
/**
|
|
17
|
-
* コード
|
|
18
|
-
*/
|
|
19
|
-
code: string;
|
|
20
|
-
/**
|
|
21
|
-
* 詳細コード
|
|
22
|
-
*/
|
|
23
|
-
info: GMOErrorInfo | string;
|
|
24
|
-
/**
|
|
25
|
-
* 状態
|
|
26
|
-
*/
|
|
27
|
-
state: string;
|
|
28
|
-
/**
|
|
29
|
-
* 課金対象
|
|
30
|
-
*/
|
|
31
|
-
billing: string;
|
|
32
|
-
/**
|
|
33
|
-
* エラー内容と加盟店側の対処の方法
|
|
34
|
-
*/
|
|
35
|
-
content: string;
|
|
36
|
-
/**
|
|
37
|
-
* ユーザへ表示するメッセージ例
|
|
38
|
-
*/
|
|
39
|
-
userMessage: string;
|
|
40
|
-
}
|
|
41
|
-
export { GMOErrorInfo, IGMOError };
|
|
11
|
+
export { GMOErrorInfo };
|
|
@@ -133,7 +133,7 @@ function processAlterTran(params) {
|
|
|
133
133
|
let throwsError = true;
|
|
134
134
|
if (purpose.typeOf === factory_1.factory.transactionType.PlaceOrder) {
|
|
135
135
|
// handle notFoundError as searchTradeResult(2025-02-20~)
|
|
136
|
-
if (error
|
|
136
|
+
if (error instanceof gmo_service_1.GMO.error.badRequest.GMOBadRequestError) {
|
|
137
137
|
if (Array.isArray(error.errors) && error.errors.length > 0) {
|
|
138
138
|
const gmoErrors = error.errors;
|
|
139
139
|
// 指定されたIDとパスワードの取引が存在しません。
|
|
@@ -201,7 +201,7 @@ function processAlterTran(params) {
|
|
|
201
201
|
catch (error) {
|
|
202
202
|
let throwsError = true;
|
|
203
203
|
// 未決済(3D 登録済)->取消をトライするとE01050004エラーとなるが、この場合何もする必要はない(2024-01-09~)
|
|
204
|
-
if (error
|
|
204
|
+
if (error instanceof gmo_service_1.GMO.error.badRequest.GMOBadRequestError) {
|
|
205
205
|
if (Array.isArray(error.errors) && error.errors.length === 1
|
|
206
206
|
&& error.errors[0].info === gmoError_1.GMOErrorInfo.JobCodeNotAcceptable) {
|
|
207
207
|
if (status === gmo_service_1.GMO.factory.util.Status.Authenticated
|
|
@@ -26,7 +26,7 @@ async function searchGMOTrade(params, settings) {
|
|
|
26
26
|
catch (error) {
|
|
27
27
|
// searchTradeでのエラーをハンドリング(2024-04-08~)
|
|
28
28
|
let throwsError = true;
|
|
29
|
-
if (error
|
|
29
|
+
if (error instanceof gmo_service_1.GMO.error.badRequest.GMOBadRequestError) {
|
|
30
30
|
if (Array.isArray(error.errors) && error.errors.length > 0) {
|
|
31
31
|
const gmoErrors = error.errors;
|
|
32
32
|
// 指定されたIDとパスワードの取引が存在しません。
|
|
@@ -73,7 +73,7 @@ function voidTransaction(params) {
|
|
|
73
73
|
catch (error) {
|
|
74
74
|
// searchTradeでのエラーをハンドリング(2024-01-27~)
|
|
75
75
|
let throwsError = true;
|
|
76
|
-
if (error
|
|
76
|
+
if (error instanceof gmo_service_1.GMO.error.badRequest.GMOBadRequestError) {
|
|
77
77
|
if (Array.isArray(error.errors) && error.errors.length > 0) {
|
|
78
78
|
const gmoErrors = error.errors;
|
|
79
79
|
// 指定されたIDとパスワードの取引が存在しません。
|
|
@@ -6,7 +6,6 @@ import type { MemberRepo } from '../../../repo/member';
|
|
|
6
6
|
import type { PaymentServiceProviderRepo } from '../../../repo/paymentServiceProvider';
|
|
7
7
|
import type { MovieTheaterRepo } from '../../../repo/place/movieTheater';
|
|
8
8
|
import type { ScreeningRoomRepo } from '../../../repo/place/screeningRoom';
|
|
9
|
-
import type { ProductOfferRepo } from '../../../repo/productOffer';
|
|
10
9
|
export declare function deleteResourcesBySeller(params: {
|
|
11
10
|
project: {
|
|
12
11
|
id: string;
|
|
@@ -21,5 +20,4 @@ export declare function deleteResourcesBySeller(params: {
|
|
|
21
20
|
movieTheater: MovieTheaterRepo;
|
|
22
21
|
screeningRoom: ScreeningRoomRepo;
|
|
23
22
|
paymentServiceProvider: PaymentServiceProviderRepo;
|
|
24
|
-
productOffer: ProductOfferRepo;
|
|
25
23
|
}) => Promise<void>;
|
|
@@ -57,15 +57,9 @@ function deleteResourcesBySeller(params) {
|
|
|
57
57
|
project: { id: params.project.id },
|
|
58
58
|
parentOrganization: { id: sellerId }
|
|
59
59
|
});
|
|
60
|
-
// プロダクトオファー削除(2025-10-02~)
|
|
61
|
-
const deleteProductOfferResult = await repos.productOffer.deleteProductOffersBySeller({
|
|
62
|
-
project: { id: params.project.id },
|
|
63
|
-
offeredBy: { id: sellerId }
|
|
64
|
-
});
|
|
65
60
|
deleteResult = {
|
|
66
61
|
deleteMemberResult, deletePaymentServiceProviderResult,
|
|
67
62
|
deleteEventOfferResult,
|
|
68
|
-
deleteProductOfferResult,
|
|
69
63
|
deleteEventResult, deleteEventSeriesResult, deleteScreeningRoomResult, deleteMovieTheaterResult
|
|
70
64
|
};
|
|
71
65
|
}
|
|
@@ -18,7 +18,6 @@ const movieTheater_1 = require("../../repo/place/movieTheater");
|
|
|
18
18
|
const screeningRoom_1 = require("../../repo/place/screeningRoom");
|
|
19
19
|
const product_1 = require("../../repo/product");
|
|
20
20
|
const productModel_1 = require("../../repo/productModel");
|
|
21
|
-
const productOffer_1 = require("../../repo/productOffer");
|
|
22
21
|
const setting_1 = require("../../repo/setting");
|
|
23
22
|
const task_1 = require("../../repo/task");
|
|
24
23
|
const deleteResourcesByAggregateOffer_1 = require("./onResourceDeleted/deleteResourcesByAggregateOffer");
|
|
@@ -53,7 +52,6 @@ function call(params) {
|
|
|
53
52
|
screeningRoom: new screeningRoom_1.ScreeningRoomRepo(connection),
|
|
54
53
|
product: new product_1.ProductRepo(connection),
|
|
55
54
|
productModel: new productModel_1.ProductModelRepo(connection),
|
|
56
|
-
productOffer: new productOffer_1.ProductOfferRepo(connection),
|
|
57
55
|
setting: new setting_1.SettingRepo(connection),
|
|
58
56
|
task: new task_1.TaskRepo(connection)
|
|
59
57
|
});
|
|
@@ -21,7 +21,6 @@ const movieTheater_1 = require("../../repo/place/movieTheater");
|
|
|
21
21
|
const screeningRoom_1 = require("../../repo/place/screeningRoom");
|
|
22
22
|
const product_1 = require("../../repo/product");
|
|
23
23
|
const productModel_1 = require("../../repo/productModel");
|
|
24
|
-
const productOffer_1 = require("../../repo/productOffer");
|
|
25
24
|
const setting_1 = require("../../repo/setting");
|
|
26
25
|
const task_1 = require("../../repo/task");
|
|
27
26
|
const onAggregateOfferUpdated_1 = require("./onResourceUpdated/onAggregateOfferUpdated");
|
|
@@ -53,7 +52,6 @@ function call(data) {
|
|
|
53
52
|
screeningRoom: new screeningRoom_1.ScreeningRoomRepo(connection),
|
|
54
53
|
product: new product_1.ProductRepo(connection),
|
|
55
54
|
productModel: new productModel_1.ProductModelRepo(connection),
|
|
56
|
-
productOffer: new productOffer_1.ProductOfferRepo(connection),
|
|
57
55
|
setting: new setting_1.SettingRepo(connection),
|
|
58
56
|
task: new task_1.TaskRepo(connection)
|
|
59
57
|
});
|
package/package.json
CHANGED
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@aws-sdk/client-cognito-identity-provider": "3.600.0",
|
|
13
13
|
"@aws-sdk/credential-providers": "3.600.0",
|
|
14
|
-
"@chevre/factory": "8.0.0-alpha.
|
|
14
|
+
"@chevre/factory": "8.0.0-alpha.5",
|
|
15
15
|
"@motionpicture/coa-service": "10.0.0",
|
|
16
|
-
"@motionpicture/gmo-service": "6.0.0",
|
|
16
|
+
"@motionpicture/gmo-service": "6.1.0-alpha.0",
|
|
17
17
|
"@sendgrid/client": "8.1.4",
|
|
18
18
|
"@surfrock/sdk": "2.0.0",
|
|
19
19
|
"debug": "4.4.3",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"postversion": "git push origin --tags",
|
|
92
92
|
"prepublishOnly": "npm run clean && npm run build"
|
|
93
93
|
},
|
|
94
|
-
"version": "24.0.0-alpha.
|
|
94
|
+
"version": "24.0.0-alpha.83"
|
|
95
95
|
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { Connection } from 'mongoose';
|
|
2
|
-
import { factory } from '../factory';
|
|
3
|
-
/**
|
|
4
|
-
* コメントリポジトリ
|
|
5
|
-
*/
|
|
6
|
-
export declare class CommentRepo {
|
|
7
|
-
private readonly commentModel;
|
|
8
|
-
constructor(connection: Connection);
|
|
9
|
-
static CREATE_MONGO_CONDITIONS(params: factory.creativeWork.comment.ISearchConditions): any[];
|
|
10
|
-
/**
|
|
11
|
-
* 検索
|
|
12
|
-
*/
|
|
13
|
-
search(params: factory.creativeWork.comment.ISearchConditions & {
|
|
14
|
-
inclusion: string[];
|
|
15
|
-
exclusion: string[];
|
|
16
|
-
}): Promise<factory.creativeWork.comment.IComment[]>;
|
|
17
|
-
findById(params: {
|
|
18
|
-
id: string;
|
|
19
|
-
}): Promise<factory.creativeWork.comment.IComment>;
|
|
20
|
-
create(params: factory.creativeWork.comment.IComment): Promise<factory.creativeWork.comment.IComment>;
|
|
21
|
-
updateById(params: {
|
|
22
|
-
id?: string;
|
|
23
|
-
attributes: {
|
|
24
|
-
text: string;
|
|
25
|
-
};
|
|
26
|
-
}): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* 削除する
|
|
29
|
-
*/
|
|
30
|
-
deleteById(params: {
|
|
31
|
-
id: string;
|
|
32
|
-
}): Promise<void>;
|
|
33
|
-
getCursor(conditions: any, projection: any): import("mongoose").Cursor<import("mongoose").Document<unknown, Record<string, never>, import("@chevre/factory/lib/chevre/creativeWork/comment").IComment, import("./mongoose/virtuals").IVirtuals, {}> & import("@chevre/factory/lib/chevre/creativeWork/comment").IComment & {
|
|
34
|
-
_id: import("mongoose").Types.ObjectId;
|
|
35
|
-
} & {
|
|
36
|
-
__v: number;
|
|
37
|
-
}, import("mongoose").QueryOptions<import("@chevre/factory/lib/chevre/creativeWork/comment").IComment>, (import("mongoose").Document<unknown, Record<string, never>, import("@chevre/factory/lib/chevre/creativeWork/comment").IComment, import("./mongoose/virtuals").IVirtuals, {}> & import("@chevre/factory/lib/chevre/creativeWork/comment").IComment & {
|
|
38
|
-
_id: import("mongoose").Types.ObjectId;
|
|
39
|
-
} & {
|
|
40
|
-
__v: number;
|
|
41
|
-
}) | null>;
|
|
42
|
-
}
|