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

Unified type for shipping line #2580

Merged
merged 1 commit into from
Jan 24, 2025
Merged

Unified type for shipping line #2580

merged 1 commit into from
Jan 24, 2025

Conversation

js-goupil
Copy link
Contributor

Background

TS on the POS side is having a hard time reconciling the idea that methodType only exists on one of the types. Let's just unified the type, and make methodType optional, in the case of custom. Much simpler interface and we can document it easily.

Solution

(Describe your solution, why this approach was chosen, and what the alternatives/impacts may be)

🎩

  • ...

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation

@js-goupil js-goupil requested review from fatbattk and vctrchu January 23, 2025 16:59

This comment has been minimized.

@js-goupil js-goupil force-pushed the js-shipping-line-fix-2 branch from 4fc6a64 to 64ee3cf Compare January 23, 2025 17:09
price: string;
title: string;
type: 'Custom';
methodType: 'SHIPPING' | 'RETAIL' | undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

methodType?: 'SHIPPING' | 'RETAIL' maybe?

Copy link
Contributor

Choose a reason for hiding this comment

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

have you tried doing a BaseShippingLine and then extend it for Calculated and Custom?
that should better define the shared vs properties diff.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have a look again?

@js-goupil js-goupil force-pushed the js-shipping-line-fix-2 branch from 94641ff to 20c0feb Compare January 23, 2025 19:13
@js-goupil js-goupil requested a review from fatbattk January 23, 2025 19:13
@js-goupil js-goupil merged commit 747718d into unstable Jan 24, 2025
6 checks passed
@js-goupil js-goupil deleted the js-shipping-line-fix-2 branch January 24, 2025 00:42
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.

3 participants