Skip to content

Comments

feat: add issuer specific fip validity to operator pages#684

Draft
MoritzWeber0 wants to merge 20 commits intofeat/add-dialogsfrom
feat/fip-validity
Draft

feat: add issuer specific fip validity to operator pages#684
MoritzWeber0 wants to merge 20 commits intofeat/add-dialogsfrom
feat/fip-validity

Conversation

@MoritzWeber0
Copy link
Member

@MoritzWeber0 MoritzWeber0 commented Feb 8, 2026

For each FIP issues a file called validity.yaml can be added to the corresponding operator directory, including information which how many coupons for which operator are issued. For example, let's have a look the at validity.yaml for FIP issuer DB:

_anchors:
  coupon-4fields: &coupon-4fields
    status: valid
    text:
      de: "1 Freifahrtschein mit jeweils 4 Feldern pro Jahr. Jedes Feld ist zwei Tage gültig."
      en: "1 coupon with 4 fields each per year. Each field is valid for two days."
      fr: "1 coupon avec 4 champs chacun par an. Chaque champ est valable deux jours."
  coupon-not-available: &coupon-not-available
    status: invalid
    text:
      de: "Nicht verfügbar"
      en: "Not available"
      fr: "Non disponible"
  reduced-50: &reduced-50
    status: valid
    text:
      de: "50 % Rabatt"
      en: "50 % discount"
      fr: "50 % de réduction"
pkp:
  fip-coupon: *coupon-4fields
  fip-coupon-relatives: *coupon-4fields
  fip-reduced-ticket: *reduced-50
zssk:
  fip-coupon: *coupon-4fields
  fip-coupon-relatives: *coupon-not-available
  fip-reduced-ticket: *reduced-50

Resolves #446

TODO:

@netlify
Copy link

netlify bot commented Feb 8, 2026

Deploy Preview for fipguide ready!

Name Link
🔨 Latest commit dc1a37b
🔍 Latest deploy log https://app.netlify.com/projects/fipguide/deploys/699b06d5493778000886daf4
😎 Deploy Preview https://deploy-preview-684--fipguide.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@MoritzWeber0
Copy link
Member Author

Should be ready for review now, @lenderom @therobrob. I'll keep it in the draft state until #680 is merged as this PR is based on it and should not be merged before.

@lenderom
Copy link
Member

lenderom commented Feb 9, 2026

@MoritzWeber0 Thank you for your implementation. I think this will help many of our collegues. Do you think we should implement a kind of "Default" per employer? Like usually SNCF gives 1 Coupon with 4 Fields and we only specify the deviations on the operator site?

@MoritzWeber0
Copy link
Member Author

MoritzWeber0 commented Feb 9, 2026

@MoritzWeber0 Thank you for your implementation. I think this will help many of our collegues. Do you think we should implement a kind of "Default" per employer? Like usually SNCF gives 1 Coupon with 4 Fields and we only specify the deviations on the operator site?

I'm against an implicitly added default. We should only add explicit information if we have it, otherwise let's fall back to unknown. The only reason would be less boilerplate (the YAML section grows a bit too quickly maybe). But there are probably better solutions like defining some defaults globally and then just reference them via a one-liner.

@lenderom
Copy link
Member

lenderom commented Feb 9, 2026

@MoritzWeber0 Thank you for your implementation. I think this will help many of our collegues. Do you think we should implement a kind of "Default" per employer? Like usually SNCF gives 1 Coupon with 4 Fields and we only specify the deviations on the operator site?

I'm against an implicitly added default. We should only add explicit information if we have it, otherwise let's fall back to unknown. The only reason would be less boilerplate (the YAML section grows a bit too quickly maybe). But there are probably better solutions like defining some defaults globally and then just reference them via a one-liner.

Yeah I was more thinking about the boilerplate, not a "default" information but a way to avoid writing on every page "SBB employees have 8 fields every field is valid for one day" :D
But it's not a must have. Just an idea to avoid extremly large yaml metadata :)

@lenderom
Copy link
Member

lenderom commented Feb 9, 2026

Another point I was thinking about was the considerationfo things like #681

It doesn't have to be implemented in this PR, I was just thinking about covering this problem in your implementation. For example instead of having a row in the table for the FIP Coupon there could be a text like "unlimited free travel". But we could also find other ways of covering this topic :)

@MoritzWeber0
Copy link
Member Author

Another point I was thinking about was the considerationfo things like #681

It doesn't have to be implemented in this PR, I was just thinking about covering this problem in your implementation. For example instead of having a row in the table for the FIP Coupon there could be a text like "unlimited free travel". But we could also find other ways of covering this topic :)

This is the reason why I removed some of the structured data from the previous PR and made it more flexible with the text :)
But for #681 I would need more information about who exactly gets those free benefits. So rather a separate PR.

Copy link
Member

@therobrob therobrob left a comment

Choose a reason for hiding this comment

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

I’ve just reviewed the technical parts, not the md-files.

Two further comments:

  • for me it seems slightly confusing showing the grey status with question marks for cases, where we don’t know the information from all operators. It suggests we have no information at all. I think this case is very common, until we don’t have the information from all operators.
    Edit: why do we handle the same case ("we don’t have information from all operators") in two different ways?
    One time we say "valid" and one time we say "unknown" – where’s the difference between them?
Bildschirmfoto 2026-02-09 um 19 32 08
  • this leads me to the second aspect: the button for the dialog isn’t optimal in my opinion. It is not self-explanatory, because there is no label and there is the second status-icon to the left (two icons, two different meanings for interacting). I envision a single, comprehensive button, so the user can click the whole information.

</div>

{{- if not .disable_dialog -}}
{{- partial "dialog" (
Copy link
Member

@therobrob therobrob Feb 9, 2026

Choose a reason for hiding this comment

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

I prefer not to color the button. Dark green and grey is okay, but red looks rather than an error than an interactive element.
Image

<thead>
<tr>
<th>{{ T "fipValidity.issuer" }}</th>
<th>{{ T "trainCategory.additionalInformation" }}</th>
Copy link
Member

Choose a reason for hiding this comment

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

mhm it isn’t just "additional information" but the information itself :D
what do you think of "validity" or "acceptance"?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think neither "Validity" or "Acceptance" is the correct term if we talk about the number of issued coupons for example. I called it "rules" now and added it it's own translation key. We can talk about the name again, not 100% happy with rules as it sounds so strict, but in the end it is.

Maybe I was just too lazy too create a new translation key when I created the PR, so I used an existing one :D

{{- $statusIcon := index $iconMapping $status -}}
<tr>
<td>
{{ partial "link" (dict "Destination" (print "/operator/" .File.ContentBaseName) "Text" .Title "Page" $.page) }}
Copy link
Member

Choose a reason for hiding this comment

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

do we need the link here? The usecase fot the dialog is to look up the rules for my own operator and i don’t need the fip information about my own operator, do i?

Copy link
Member Author

Choose a reason for hiding this comment

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

In general true, but also it doesn't hurt, or? Maybe there is a use-case that we don't see. I can also remove it though.

@MoritzWeber0 MoritzWeber0 force-pushed the feat/add-dialogs branch 3 times, most recently from 1b5a622 to ea75e56 Compare February 10, 2026 08:02
@MoritzWeber0
Copy link
Member Author

Yeah I was more thinking about the boilerplate, not a "default" information but a way to avoid writing on every page "SBB employees have 8 fields every field is valid for one day" :D But it's not a must have. Just an idea to avoid extremly large yaml metadata :)

I changed the implementation to use a validity.yaml per FIP issuer. This has a few advantages:

  • We can use YAML anchors to reuse texts, this reduces the amount of duplicated content, making it easier to maintain it in the future.
  • The information is now reversed in comparison to the previous implementation. We collect the information per FIP issues in one a file. This represents how we get the information.
  • We don't have to define the validity multiple times for the different languages, only the text is still localized.
  • The frontmatter remains unchanged and we don't have to scroll endlessly to get to the operators content.

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.

Issue with operator ÖBB Number of FIP Coupons and Reduction

3 participants