@chevre/domain 23.1.0-alpha.6 → 23.1.0-alpha.8

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.
@@ -41,6 +41,13 @@ export declare class MemberRepo {
41
41
  name?: {
42
42
  $regex?: string;
43
43
  };
44
+ /**
45
+ * アプリケーションコード
46
+ * 2025-11-15~
47
+ */
48
+ identifier?: {
49
+ $eq?: string;
50
+ };
44
51
  };
45
52
  }): Promise<{
46
53
  member: ICustomerMember;
@@ -30,7 +30,7 @@ class MemberRepo {
30
30
  }
31
31
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
32
32
  static CREATE_MONGO_CONDITIONS(params) {
33
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
33
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
34
34
  const andConditions = [];
35
35
  const idEq = (_a = params.id) === null || _a === void 0 ? void 0 : _a.$eq;
36
36
  if (typeof idEq === 'string') {
@@ -64,7 +64,11 @@ class MemberRepo {
64
64
  if (Array.isArray(memberIdIn)) {
65
65
  andConditions.push({ 'member.id': { $in: memberIdIn } });
66
66
  }
67
- const memberNameRegex = (_u = (_t = params.member) === null || _t === void 0 ? void 0 : _t.name) === null || _u === void 0 ? void 0 : _u.$regex;
67
+ const memberIdentifierEq = (_u = (_t = params.member) === null || _t === void 0 ? void 0 : _t.identifier) === null || _u === void 0 ? void 0 : _u.$eq;
68
+ if (typeof memberIdentifierEq === 'string') {
69
+ andConditions.push({ 'member.identifier': { $exists: true, $eq: memberIdentifierEq } });
70
+ }
71
+ const memberNameRegex = (_w = (_v = params.member) === null || _v === void 0 ? void 0 : _v.name) === null || _w === void 0 ? void 0 : _w.$regex;
68
72
  if (typeof memberNameRegex === 'string' && memberNameRegex.length > 0) {
69
73
  andConditions.push({
70
74
  'member.name': {
@@ -73,7 +77,7 @@ class MemberRepo {
73
77
  }
74
78
  });
75
79
  }
76
- const memberHasRoleRoleNameEq = (_x = (_w = (_v = params.member) === null || _v === void 0 ? void 0 : _v.hasRole) === null || _w === void 0 ? void 0 : _w.roleName) === null || _x === void 0 ? void 0 : _x.$eq;
80
+ const memberHasRoleRoleNameEq = (_z = (_y = (_x = params.member) === null || _x === void 0 ? void 0 : _x.hasRole) === null || _y === void 0 ? void 0 : _y.roleName) === null || _z === void 0 ? void 0 : _z.$eq;
77
81
  if (typeof memberHasRoleRoleNameEq === 'string') {
78
82
  andConditions.push({
79
83
  'member.hasRole.roleName': {
@@ -82,7 +86,7 @@ class MemberRepo {
82
86
  }
83
87
  });
84
88
  }
85
- const memberHasRoleRoleNameIn = (_0 = (_z = (_y = params.member) === null || _y === void 0 ? void 0 : _y.hasRole) === null || _z === void 0 ? void 0 : _z.roleName) === null || _0 === void 0 ? void 0 : _0.$in;
89
+ const memberHasRoleRoleNameIn = (_2 = (_1 = (_0 = params.member) === null || _0 === void 0 ? void 0 : _0.hasRole) === null || _1 === void 0 ? void 0 : _1.roleName) === null || _2 === void 0 ? void 0 : _2.$in;
86
90
  if (Array.isArray(memberHasRoleRoleNameIn)) {
87
91
  andConditions.push({
88
92
  'member.hasRole.roleName': {
@@ -110,7 +114,7 @@ class MemberRepo {
110
114
  */
111
115
  searchCustomerMembers(params) {
112
116
  return __awaiter(this, void 0, void 0, function* () {
113
- var _a, _b, _c, _d, _e, _f, _g;
117
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
114
118
  if (typeof params.project.id !== 'string' || params.project.id === '') {
115
119
  throw new factory.errors.ArgumentNull('project.id');
116
120
  }
@@ -128,7 +132,8 @@ class MemberRepo {
128
132
  }
129
133
  },
130
134
  id: Object.assign(Object.assign({}, (typeof ((_b = (_a = params.member) === null || _a === void 0 ? void 0 : _a.id) === null || _b === void 0 ? void 0 : _b.$eq) === 'string') ? { $eq: params.member.id.$eq } : undefined), (Array.isArray((_d = (_c = params.member) === null || _c === void 0 ? void 0 : _c.id) === null || _d === void 0 ? void 0 : _d.$in)) ? { $in: params.member.id.$in } : undefined),
131
- name: Object.assign({}, (typeof ((_f = (_e = params.member) === null || _e === void 0 ? void 0 : _e.name) === null || _f === void 0 ? void 0 : _f.$regex) === 'string') ? { $regex: params.member.name.$regex } : undefined)
135
+ identifier: Object.assign({}, (typeof ((_f = (_e = params.member) === null || _e === void 0 ? void 0 : _e.identifier) === null || _f === void 0 ? void 0 : _f.$eq) === 'string') ? { $eq: params.member.identifier.$eq } : undefined),
136
+ name: Object.assign({}, (typeof ((_h = (_g = params.member) === null || _g === void 0 ? void 0 : _g.name) === null || _h === void 0 ? void 0 : _h.$regex) === 'string') ? { $regex: params.member.name.$regex } : undefined)
132
137
  }
133
138
  });
134
139
  const projection = {
@@ -155,7 +160,7 @@ class MemberRepo {
155
160
  },
156
161
  { $project: projection }
157
162
  ]);
158
- if (typeof ((_g = params.sort) === null || _g === void 0 ? void 0 : _g['member.id']) === 'number') {
163
+ if (typeof ((_j = params.sort) === null || _j === void 0 ? void 0 : _j['member.id']) === 'number') {
159
164
  aggregate.sort(params.sort);
160
165
  }
161
166
  if (typeof params.limit === 'number' && params.limit > 0) {
@@ -17,7 +17,7 @@ const factory = require("../../../../../factory");
17
17
  function requestedProgramMembershipUsed2permit(params) {
18
18
  // tslint:disable-next-line:cyclomatic-complexity max-func-body-length
19
19
  return (repos) => __awaiter(this, void 0, void 0, function* () {
20
- var _a, _b, _c, _d;
20
+ var _a, _b;
21
21
  let programMembershipUsedAsPermit;
22
22
  const { programMembershipUsed, placeOrder } = params;
23
23
  // discontinue token as fromLocation(ticketTokenへ移行するべき)(2024-12-18~)
@@ -51,28 +51,34 @@ function requestedProgramMembershipUsed2permit(params) {
51
51
  const permitOwnershipInfo = object;
52
52
  const ownedGoodType = (_a = permitOwnershipInfo.typeOfGood) === null || _a === void 0 ? void 0 : _a.typeOf;
53
53
  if (ownedGoodType === factory.permit.PermitType.Permit) {
54
- const issuedThroughTypeOf = (_b = permitOwnershipInfo.typeOfGood.issuedThrough) === null || _b === void 0 ? void 0 : _b.typeOf;
55
- if (issuedThroughTypeOf === factory.service.paymentService.PaymentServiceType.FaceToFace) {
56
- programMembershipUsedAsPermit = {
57
- identifier: permitOwnershipInfo.typeOfGood.identifier,
58
- issuedThrough: { typeOf: issuedThroughTypeOf },
59
- typeOf: factory.permit.PermitType.Permit
60
- };
61
- }
62
- else if (issuedThroughTypeOf === factory.product.ProductType.MembershipService
63
- || issuedThroughTypeOf === factory.service.paymentService.PaymentServiceType.CreditCard) {
64
- if (typeof ((_c = permitOwnershipInfo.typeOfGood.issuedThrough) === null || _c === void 0 ? void 0 : _c.id) !== 'string') {
65
- throw new factory.errors.Argument('programMembershipUsed', 'ownershipInfo.typeOfGood.issuedThrough.id undefined');
66
- }
67
- programMembershipUsedAsPermit = {
68
- identifier: permitOwnershipInfo.typeOfGood.identifier,
69
- issuedThrough: { id: permitOwnershipInfo.typeOfGood.issuedThrough.id, typeOf: issuedThroughTypeOf },
70
- typeOf: factory.permit.PermitType.Permit
71
- };
72
- }
73
- else {
74
- throw new factory.errors.Argument('programMembershipUsed', `invalid issuedThrough.typeOf: ${issuedThroughTypeOf}`);
75
- }
54
+ // discontinue(2025-11-14~)
55
+ throw new factory.errors.Argument('programMembershipUsed', `ownershipInfo.typeOfGood.typeOf: ${ownedGoodType} discontinued`);
56
+ // const issuedThroughTypeOf = permitOwnershipInfo.typeOfGood.issuedThrough?.typeOf;
57
+ // if (issuedThroughTypeOf === factory.service.paymentService.PaymentServiceType.FaceToFace) {
58
+ // programMembershipUsedAsPermit = {
59
+ // identifier: permitOwnershipInfo.typeOfGood.identifier,
60
+ // issuedThrough: { typeOf: issuedThroughTypeOf },
61
+ // typeOf: factory.permit.PermitType.Permit
62
+ // };
63
+ // } else if (issuedThroughTypeOf === factory.product.ProductType.MembershipService
64
+ // || issuedThroughTypeOf === factory.service.paymentService.PaymentServiceType.CreditCard) {
65
+ // if (typeof permitOwnershipInfo.typeOfGood.issuedThrough?.id !== 'string') {
66
+ // throw new factory.errors.Argument(
67
+ // 'programMembershipUsed',
68
+ // 'ownershipInfo.typeOfGood.issuedThrough.id undefined'
69
+ // );
70
+ // }
71
+ // programMembershipUsedAsPermit = {
72
+ // identifier: permitOwnershipInfo.typeOfGood.identifier,
73
+ // issuedThrough: { id: permitOwnershipInfo.typeOfGood.issuedThrough.id, typeOf: issuedThroughTypeOf },
74
+ // typeOf: factory.permit.PermitType.Permit
75
+ // };
76
+ // } else {
77
+ // throw new factory.errors.Argument(
78
+ // 'programMembershipUsed',
79
+ // `invalid issuedThrough.typeOf: ${issuedThroughTypeOf}`
80
+ // );
81
+ // }
76
82
  }
77
83
  else if (ownedGoodType === factory.service.paymentService.PaymentServiceType.FaceToFace) {
78
84
  const paymentMethodId = permitOwnershipInfo.typeOfGood.serviceOutput.paymentMethodId;
@@ -87,7 +93,7 @@ function requestedProgramMembershipUsed2permit(params) {
87
93
  }
88
94
  else if (ownedGoodType === factory.service.paymentService.PaymentServiceType.CreditCard) {
89
95
  // CreditCard決済の場合、決済方法所有権を受け入れる(2025-11-11~)
90
- const paymentServiceId = (_d = permitOwnershipInfo.typeOfGood) === null || _d === void 0 ? void 0 : _d.id;
96
+ const paymentServiceId = (_b = permitOwnershipInfo.typeOfGood) === null || _b === void 0 ? void 0 : _b.id;
91
97
  const paymentMethodId = permitOwnershipInfo.typeOfGood.serviceOutput.paymentMethodId;
92
98
  if (typeof paymentServiceId !== 'string' || paymentServiceId === '') {
93
99
  throw new factory.errors.Argument('programMembershipUsed', 'paymentServiceId required');
@@ -102,7 +108,7 @@ function requestedProgramMembershipUsed2permit(params) {
102
108
  };
103
109
  }
104
110
  else {
105
- throw new factory.errors.Argument('programMembershipUsed', 'ownershipInfo.typeOfGood.typeOf must be Permit');
111
+ throw new factory.errors.Argument('programMembershipUsed', `ownershipInfo.typeOfGood.typeOf: ${ownedGoodType} invalid`);
106
112
  }
107
113
  }
108
114
  }
@@ -15,7 +15,7 @@ const factory = require("../../../factory");
15
15
  function verifyTicketTokenAsNeeded(params) {
16
16
  // tslint:disable-next-line:cyclomatic-complexity
17
17
  return (repos) => __awaiter(this, void 0, void 0, function* () {
18
- var _a, _b;
18
+ var _a;
19
19
  const { paymentServiceType, object, project } = params;
20
20
  const { issuedThrough, ticketToken } = object;
21
21
  let permitOrInvoice;
@@ -48,25 +48,25 @@ function verifyTicketTokenAsNeeded(params) {
48
48
  if (authorizedObject.typeOf === 'OwnershipInfo') {
49
49
  const { typeOfGood } = authorizedObject;
50
50
  if (typeOfGood.typeOf === factory.permit.PermitType.Permit || typeOfGood.typeOf === 'Invoice') {
51
- if (((_b = typeOfGood.issuedThrough) === null || _b === void 0 ? void 0 : _b.typeOf) !== paymentServiceType) {
52
- throw new factory.errors.Argument('ticketToken', 'paymentServiceType not matched');
53
- }
54
- // FaceToFace以外の場合、発行サービスIDを検証
55
- if (typeOfGood.issuedThrough.typeOf !== factory.service.paymentService.PaymentServiceType.FaceToFace) {
56
- if (typeOfGood.issuedThrough.id !== issuedThrough.id) {
57
- throw new factory.errors.Argument('ticketToken', 'issuedThrough.id not matched');
58
- }
59
- }
60
- if (typeOfGood.typeOf === factory.permit.PermitType.Permit) {
61
- permitOrInvoice = { identifier: typeOfGood.identifier, typeOf: factory.permit.PermitType.Permit };
62
- }
63
- else if (typeOfGood.typeOf === 'Invoice') {
64
- // support paymentServiceType.MovieTicket(2024-11-23~)
65
- permitOrInvoice = { paymentMethodId: typeOfGood.paymentMethodId, typeOf: 'Invoice' };
66
- }
67
- else {
68
- throw new factory.errors.Argument('ticketToken', 'must be Permit or Invoice');
69
- }
51
+ // discontinue(2025-11-14~)
52
+ throw new factory.errors.Argument('ticketToken', `typeOfGood.typeOf ${typeOfGood.typeOf} discontinued`);
53
+ // if (typeOfGood.issuedThrough?.typeOf !== paymentServiceType) {
54
+ // throw new factory.errors.Argument('ticketToken', 'paymentServiceType not matched');
55
+ // }
56
+ // // FaceToFace以外の場合、発行サービスIDを検証
57
+ // if (typeOfGood.issuedThrough.typeOf !== factory.service.paymentService.PaymentServiceType.FaceToFace) {
58
+ // if (typeOfGood.issuedThrough.id !== issuedThrough.id) {
59
+ // throw new factory.errors.Argument('ticketToken', 'issuedThrough.id not matched');
60
+ // }
61
+ // }
62
+ // if (typeOfGood.typeOf === factory.permit.PermitType.Permit) {
63
+ // permitOrInvoice = { identifier: typeOfGood.identifier, typeOf: factory.permit.PermitType.Permit };
64
+ // } else if (typeOfGood.typeOf === 'Invoice') {
65
+ // // support paymentServiceType.MovieTicket(2024-11-23~)
66
+ // permitOrInvoice = { paymentMethodId: typeOfGood.paymentMethodId, typeOf: 'Invoice' };
67
+ // } else {
68
+ // throw new factory.errors.Argument('ticketToken', 'must be Permit or Invoice');
69
+ // }
70
70
  }
71
71
  else if (typeOfGood.typeOf === factory.service.paymentService.PaymentServiceType.CreditCard
72
72
  || typeOfGood.typeOf === factory.service.paymentService.PaymentServiceType.MovieTicket
package/package.json CHANGED
@@ -11,7 +11,7 @@
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": "5.2.0-alpha.10",
14
+ "@chevre/factory": "5.2.0-alpha.11",
15
15
  "@cinerino/sdk": "12.7.0-alpha.4",
16
16
  "@motionpicture/coa-service": "9.6.0",
17
17
  "@motionpicture/gmo-service": "5.4.0-alpha.1",
@@ -115,5 +115,5 @@
115
115
  "postversion": "git push origin --tags",
116
116
  "prepublishOnly": "npm run clean && npm run build && npm test && npm run doc"
117
117
  },
118
- "version": "23.1.0-alpha.6"
118
+ "version": "23.1.0-alpha.8"
119
119
  }