mirror of
				https://github.com/public-transport/db-vendo-client.git
				synced 2025-10-31 08:06:33 +02:00 
			
		
		
		
	Enable usage of 1st class BahnCards and fix typo
This commit is contained in:
		
							parent
							
								
									9bfd4566ae
								
							
						
					
					
						commit
						6f56f15284
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| // todo: generate from https://reiseauskunft.bahn.de/addons/fachkonfig-utf8.cfg ?
 | // todo: generate from https://reiseauskunft.bahn.de/addons/fachkonfig-utf8.cfg ?
 | ||||||
| const c = { | const c = { | ||||||
| 	NONE: Symbol('no loyaly card'), | 	NONE: Symbol('no loyalty card'), | ||||||
| 	BAHNCARD: Symbol('Bahncard'), | 	BAHNCARD: Symbol('Bahncard'), | ||||||
| 	VORTEILSCARD: Symbol('VorteilsCard'), | 	VORTEILSCARD: Symbol('VorteilsCard'), | ||||||
| 	HALBTAXABO: Symbol('HalbtaxAbo'), | 	HALBTAXABO: Symbol('HalbtaxAbo'), | ||||||
|  | @ -14,8 +14,8 @@ const c = { | ||||||
| // see https://gist.github.com/juliuste/202bb04f450a79f8fa12a2ec3abcd72d
 | // see https://gist.github.com/juliuste/202bb04f450a79f8fa12a2ec3abcd72d
 | ||||||
| const formatLoyaltyCard = (data) => { | const formatLoyaltyCard = (data) => { | ||||||
| 	if (data.type === c.BAHNCARD) { | 	if (data.type === c.BAHNCARD) { | ||||||
| 		if (data.discount === 25) return c.class === 1 ? 1 : 2 | 		if (data.discount === 25) return data.class === 1 ? 1 : 2 | ||||||
| 		if (data.discount === 50) return c.class === 1 ? 3 : 4 | 		if (data.discount === 50) return data.class === 1 ? 3 : 4 | ||||||
| 	} | 	} | ||||||
| 	if (data.type === c.VORTEILSCARD) return 9 | 	if (data.type === c.VORTEILSCARD) return 9 | ||||||
| 	if (data.type === c.HALBTAXABO) return data.railplus ? 10 : 11 | 	if (data.type === c.HALBTAXABO) return data.railplus ? 10 : 11 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue