Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Pass object additional feilds #31

Merged
merged 2 commits into from
May 28, 2024

Conversation

annaswims
Copy link
Contributor

Pass.Coupon, Pass.EventTicket, Pass.EventTicket, and Pass.Generic don't have any additional feilds availabe so we don't need to provide methods for additional fields.

https://developer.apple.com/documentation/walletpasses/pass

boardingPass was being overwritten by the additional field method, now fixed.

resolves #29

Pass.Coupon, Pass.EventTicket, Pass.EventTicket, and Pass.Generic don't have any additional feilds availabe so we don't need to provide methods for additional feilds.  boardingPass was being overwritten by the additonal feild method, now fixed.

resolves coorasse#29
Copy link
Owner

@coorasse coorasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need some additional tests here? I am unsure about removing all these fields. Can you give me more context? Thank you

lib/passkit/generator.rb Outdated Show resolved Hide resolved
Co-authored-by: Alessandro Rodi <coorasse@gmail.com>
@annaswims
Copy link
Contributor Author

annaswims commented May 16, 2024

If you look at the documentation for Pass.Coupon Pass.EventTicket Pass.Generic
and Pass.StoreCard they all inherit from PassFields, without any additional properties. So there's nothing we're allowed to pass.

Pass.BoardingPass is the only pass type that allows for an additional property.

pass[:groupingIdentifier] = @pass.grouping_identifier if @pass.grouping_identifier
pass[:nfc] = @pass.nfc if @pass.nfc
pass[:relevantDate] = @pass.relevant_date if @pass.relevant_date
pass[:semantics] = @pass.semantics if @pass.semantics
pass[:store_card] = @pass.store_card if @pass.store_card
pass[:userInfo] = @pass.user_info if @pass.user_info

pass[@pass.pass_type] = {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can be confident that this does not cause any new problems, because

pass[:coupon], pass[:eventTicket], and pass[:generic] were being overwritten by pass[@pass.pass_type] here.

pass[:store_card] should've been pass[:storeCard], so it never did anything useful.

@annaswims annaswims requested a review from coorasse May 22, 2024 20:05
Copy link
Owner

@coorasse coorasse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@coorasse coorasse merged commit 3522c16 into coorasse:main May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Transit type for boarding pass
2 participants