File tree Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Expand file tree Collapse file tree 3 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 1
1
export const Constants = {
2
2
PEATIX_LOGIN_URL : 'https://peatix.com/signin' ,
3
3
PEATIX_DASHBOARD_URL : 'https://peatix.com/event/' ,
4
- }
4
+ PEATIX_GENERAL_TICKET : '一般チケット' ,
5
+ PEATIX_WITH_PARTY_TICKET : '一般+アフターパーティーチケット' ,
6
+ PEATIX_GENERAL_ROLE : 'attendee' ,
7
+ PEATIX_WITH_PARTY_ROLE : 'attendee + party' ,
8
+ } as const
9
+
10
+ export type TicketRole = Extract < typeof Constants [ keyof typeof Constants ] , 'attendee' | 'attendee + party' >
Original file line number Diff line number Diff line change @@ -174,8 +174,14 @@ export class PeatixOrderService extends ScraperPage {
174
174
const ticketName = attendee [ Object . keys ( attendee ) [ 4 ] ]
175
175
176
176
// チケット名から参加者の種別を特定する
177
-
178
- return { role : 'attendee' , receipt_id : receiptId }
177
+ if ( ticketName . includes ( Constants . PEATIX_GENERAL_TICKET ) ) {
178
+ return { role : Constants . PEATIX_GENERAL_ROLE , receipt_id : receiptId }
179
+ }
180
+ if ( ticketName . includes ( Constants . PEATIX_WITH_PARTY_TICKET ) ) {
181
+ return { role : Constants . PEATIX_WITH_PARTY_ROLE , receipt_id : receiptId }
182
+ }
183
+
184
+ // return { role: 'attendee', receipt_id: receiptId }
179
185
} )
180
186
this . logger . log ( receipts )
181
187
Original file line number Diff line number Diff line change 1
1
import { Role } from '@vuejs-jp/model'
2
+ import { TicketRole } from '../constnats'
2
3
3
4
export type { Database } from './generated/supabase'
4
5
@@ -7,6 +8,6 @@ export type FormAttendee = Database['public']['Tables']['attendees']['Insert']
7
8
export type FormAdminUser = Database [ 'public' ] [ 'Tables' ] [ 'admin_users' ] [ 'Insert' ]
8
9
9
10
export type AttendeeReceipt = {
10
- role : Extract < Role , 'attendee' | 'attendee + party' >
11
+ role : Extract < Role , TicketRole >
11
12
receipt_id : string
12
13
}
You can’t perform that action at this time.
0 commit comments