@chevre/domain 23.1.0-alpha.2 → 23.1.0-alpha.20

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.
Files changed (66) hide show
  1. package/example/src/chevre/assetTransaction/processReserve.ts +8 -3
  2. package/example/src/chevre/authorizeEventServiceOffer.ts +7 -5
  3. package/example/src/chevre/eventOffer/adminEventOffers.ts +67 -0
  4. package/example/src/chevre/eventOffer/publishEventOfferToken.ts +98 -0
  5. package/example/src/chevre/member/migrateMemberIdentifier.ts +99 -0
  6. package/example/src/chevre/project/unsetProjectSettings.ts +67 -0
  7. package/example/src/chevre/reIndex.ts +2 -2
  8. package/lib/chevre/repo/authorization.d.ts +3 -2
  9. package/lib/chevre/repo/authorization.js +13 -5
  10. package/lib/chevre/repo/event.d.ts +2 -1
  11. package/lib/chevre/repo/event.js +4 -4
  12. package/lib/chevre/repo/eventOffer.d.ts +1 -1
  13. package/lib/chevre/repo/eventOffer.js +14 -8
  14. package/lib/chevre/repo/member.d.ts +18 -1
  15. package/lib/chevre/repo/member.js +14 -8
  16. package/lib/chevre/repo/mongoose/schemas/eventOffer.js +39 -35
  17. package/lib/chevre/repo/mongoose/schemas/member.js +10 -0
  18. package/lib/chevre/service/assetTransaction/pay/factory.js +8 -3
  19. package/lib/chevre/service/assetTransaction/pay.d.ts +1 -0
  20. package/lib/chevre/service/assetTransaction/pay.js +1 -1
  21. package/lib/chevre/service/assetTransaction/reserve/start.d.ts +6 -0
  22. package/lib/chevre/service/assetTransaction/reserve/start.js +5 -1
  23. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.d.ts +22 -0
  24. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/fixExtendedEventOffer.js +63 -0
  25. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateIssuedOfferIfExists.d.ts +7 -2
  26. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateIssuedOfferIfExists.js +32 -32
  27. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.d.ts +1 -1
  28. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/validateMemberTierIfExists.js +10 -54
  29. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/verifyTicketTokenAsNeeded.d.ts +23 -0
  30. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest/verifyTicketTokenAsNeeded.js +62 -0
  31. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.d.ts +36 -1
  32. package/lib/chevre/service/assetTransaction/reserve/validateStartRequest.js +23 -27
  33. package/lib/chevre/service/offer/event/authorize/factory.d.ts +0 -3
  34. package/lib/chevre/service/offer/event/authorize/factory.js +4 -3
  35. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre/requestedProgramMembershipUsed2permit.js +42 -25
  36. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.d.ts +4 -0
  37. package/lib/chevre/service/offer/event/authorize/processStartReserve4chevre.js +4 -4
  38. package/lib/chevre/service/offer/event/authorize.d.ts +3 -0
  39. package/lib/chevre/service/offer/event/authorize.js +10 -5
  40. package/lib/chevre/service/offer/event/issueEventOfferTicket.d.ts +48 -0
  41. package/lib/chevre/service/offer/event/issueEventOfferTicket.js +123 -0
  42. package/lib/chevre/service/offer/event.d.ts +2 -1
  43. package/lib/chevre/service/offer/event.js +3 -1
  44. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.d.ts +5 -0
  45. package/lib/chevre/service/payment/any/authorize/fixTransactionNumber.js +18 -11
  46. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.d.ts +19 -2
  47. package/lib/chevre/service/payment/any/authorize/handlePrePublishedPaymentMethodIdOnAuthorizing.js +87 -9
  48. package/lib/chevre/service/payment/any/factory.d.ts +14 -1
  49. package/lib/chevre/service/payment/any/factory.js +22 -5
  50. package/lib/chevre/service/payment/any/publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl.d.ts +4 -0
  51. package/lib/chevre/service/payment/any/publishPaymentUrl/fixTransactionNumberOnPublishPaymentUrl.js +15 -11
  52. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.d.ts +6 -3
  53. package/lib/chevre/service/payment/any/verifyTicketTokenAsNeeded.js +19 -27
  54. package/lib/chevre/service/payment/any.d.ts +1 -1
  55. package/lib/chevre/service/payment/any.js +20 -12
  56. package/lib/chevre/service/transaction/placeOrder/confirm/publishCode.js +1 -1
  57. package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.d.ts +9 -0
  58. package/lib/chevre/service/transaction/placeOrder/confirm/validation/factory.js +2 -0
  59. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.d.ts +8 -0
  60. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validateInvoiceReferencesOrder.js +45 -0
  61. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.d.ts +3 -0
  62. package/lib/chevre/service/transaction/placeOrder/confirm/validation/validatePrice.js +38 -0
  63. package/lib/chevre/service/transaction/placeOrder/confirm/validation.d.ts +2 -8
  64. package/lib/chevre/service/transaction/placeOrder/confirm/validation.js +5 -35
  65. package/package.json +3 -3
  66. package/example/src/chevre/upsertManyEventsByAdditionalProperty.ts +0 -193
@@ -1,193 +0,0 @@
1
- // tslint:disable:no-console
2
- import * as mongoose from 'mongoose';
3
- import { chevre } from '../../../lib/index';
4
-
5
- const PROJECT_ID = String(process.env.PROJECT_ID);
6
-
7
- // tslint:disable-next-line:max-func-body-length
8
- async function main() {
9
- const now = new Date();
10
- await mongoose.connect(<string>process.env.MONGOLAB_URI, { autoIndex: false });
11
-
12
- const eventRepo = await chevre.repository.Event.createInstance(mongoose.connection);
13
- const result = await eventRepo.upsertManyByAdditionalProperty(
14
- {
15
- events: [
16
- {
17
- additionalProperty: [
18
- {
19
- name: 'sampleCreateId',
20
- value: 'akeuu512i-202410171410-01'
21
- }
22
- ],
23
- project: {
24
- id: PROJECT_ID,
25
- typeOf: chevre.factory.organizationType.Project
26
- },
27
- typeOf: chevre.factory.eventType.ScreeningEvent,
28
- doorTime: new Date('2024-10-17T05:30:00.000Z'),
29
- endDate: new Date('2024-10-17T05:45:00.000Z'),
30
- eventStatus: chevre.factory.eventStatusType.EventScheduled,
31
- // eventStatus: chevre.factory.eventStatusType.EventCancelled,
32
- location: {
33
- typeOf: chevre.factory.placeType.ScreeningRoom,
34
- branchCode: '10',
35
- name: {
36
- ja: 'シネマ1',
37
- en: 'CINEMA1'
38
- },
39
- address: {
40
- ja: '7階',
41
- en: '7F'
42
- }
43
- },
44
- name: {
45
- en: 'Ocean\'s Eight',
46
- ja: 'オーシャンズ8'
47
- },
48
- offers: {
49
- typeOf: chevre.factory.offerType.Offer,
50
- // availabilityEnds: new Date('2024-09-15T11:45:00.000Z'),
51
- // availabilityStarts: new Date('2024-09-01T15:00:00.000Z'),
52
- eligibleQuantity: {
53
- typeOf: 'QuantitativeValue',
54
- unitCode: chevre.factory.unitCode.C62,
55
- maxValue: 10
56
- },
57
- itemOffered: {
58
- id: '6603a61f0c914b6c7fd18f99',
59
- name: {
60
- ja: 'アップロードテスト用(ムビチケあり)'
61
- },
62
- serviceOutput: {
63
- typeOf: chevre.factory.reservationType.EventReservation,
64
- reservedTicket: {
65
- typeOf: 'Ticket',
66
- ticketedSeat: {
67
- typeOf: chevre.factory.placeType.Seat
68
- }
69
- }
70
- },
71
- typeOf: chevre.factory.product.ProductType.EventService,
72
- availableChannel: {
73
- typeOf: 'ServiceChannel',
74
- serviceLocation: {
75
- typeOf: chevre.factory.placeType.ScreeningRoom,
76
- branchCode: '10',
77
- name: {
78
- ja: 'シネマ1',
79
- en: 'CINEMA1'
80
- },
81
- containedInPlace: {
82
- typeOf: chevre.factory.placeType.MovieTheater,
83
- id: '5bfb841d5a78d7948369979a',
84
- branchCode: '118',
85
- name: {
86
- ja: 'シネモーション赤坂 ',
87
- en: 'CineMotion Akasaka'
88
- }
89
- }
90
- }
91
- },
92
- serviceType: {
93
- codeValue: '0001',
94
- id: '64caf203c73a205ccefe80c5',
95
- inCodeSet: {
96
- typeOf: 'CategoryCodeSet',
97
- identifier: chevre.factory.categoryCode.CategorySetIdentifier.ServiceType
98
- },
99
- typeOf: 'CategoryCode'
100
- }
101
- },
102
- // validFrom: new Date('2024-09-01T15:00:00.000Z'),
103
- // validThrough: new Date('2024-09-15T11:45:00.000Z'),
104
- seller: {
105
- typeOf: chevre.factory.organizationType.Corporation,
106
- id: '59d20831e53ebc2b4e774466',
107
- name: {
108
- ja: 'シネモーション赤坂',
109
- en: 'CineMotion Akasaka'
110
- },
111
- makesOffer: [
112
- {
113
- typeOf: chevre.factory.offerType.Offer,
114
- availableAtOrFrom: { id: '51qbjcfr72h62m06vtv5kkhgje' },
115
- availabilityEnds: now,
116
- availabilityStarts: now,
117
- validFrom: now,
118
- validThrough: now
119
- }
120
- ]
121
- },
122
- unacceptedPaymentMethod: [
123
- 'MovieTicket'
124
- ]
125
- },
126
- organizer: {
127
- id: '59d20831e53ebc2b4e774466'
128
- },
129
- startDate: new Date('2024-10-17T05:30:00.000Z'),
130
- superEvent: {
131
- typeOf: chevre.factory.eventType.ScreeningEventSeries,
132
- id: 'akeuu512i',
133
- videoFormat: [
134
- {
135
- typeOf: '2D',
136
- name: '2D'
137
- }
138
- ],
139
- soundFormat: [],
140
- workPerformed: {
141
- typeOf: chevre.factory.creativeWorkType.Movie,
142
- identifier: '00002',
143
- id: '5bfb841d5a78d79483699803',
144
- name: {
145
- en: 'Ocean\'s Eight',
146
- ja: 'オーシャンズ8'
147
- },
148
- duration: 'PT1H50M'
149
- },
150
- location: {
151
- typeOf: chevre.factory.placeType.MovieTheater,
152
- id: '5bfb841d5a78d7948369979a',
153
- branchCode: '118',
154
- name: {
155
- ja: 'シネモーション赤坂 ',
156
- en: 'CineMotion Akasaka'
157
- }
158
- },
159
- kanaName: '',
160
- name: {
161
- en: 'Ocean\'s Eight',
162
- ja: 'オーシャンズ8'
163
- },
164
- additionalProperty: [],
165
- startDate: new Date('2020-08-31T15:00:00.000Z'),
166
- endDate: new Date('2030-01-01T15:00:00.000Z'),
167
- description: {
168
- en: '2018 United States crime movie.',
169
- ja: '2018年のアメリカ合衆国の犯罪映画。'
170
- },
171
- headline: {
172
- ja: '2018/12/14'
173
- }
174
- }
175
- }
176
- ],
177
- additionalPropertyFilter: { name: 'sampleCreateId' },
178
- eventSeries: {
179
- id: 'akeuu512i'
180
- },
181
- screeningRoom: {
182
- branchCode: '10'
183
- }
184
- },
185
- { update: false }
186
- );
187
- // tslint:disable-next-line:no-null-keyword
188
- console.dir(result, { depth: null });
189
- }
190
-
191
- main()
192
- .then(console.log)
193
- .catch(console.error);