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

Support Gross Values On Cumulative Pricing Model #74

Merged
merged 7 commits into from
May 24, 2024

Conversation

paulofph
Copy link
Member

No description provided.

${baseTiersUnitAmount} | ${undefined} | ${PricingModel.tieredGraduated} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }]}
${baseTiersUnitAmount} | ${-1} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }]}
${baseTiersUnitAmount} | ${0} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }]}
${undefined} | ${0} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${undefined}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
${baseTiersUnitAmount} | ${21} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${baseTiersFlatFeeAmount} | ${0} | ${PricingModel.tieredFlatFee} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersFlatFeeAmount[0], flat_fee_amount_gross: 1000, flat_fee_amount_gross_decimal: '10' }]}
${undefined} | ${0} | ${PricingModel.tieredFlatFee} | ${true} | ${{ rate: 19 }} | ${undefined}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
${baseTiersUnitAmount} | ${21} | ${PricingModel.tieredGraduated} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 900, unit_amount_gross_decimal: '9' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${baseTiersUnitAmount} | ${21} | ${PricingModel.tieredGraduated} | ${false} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1190, unit_amount_gross_decimal: '11.9' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 1071, unit_amount_gross_decimal: '10.71' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 952, unit_amount_gross_decimal: '9.52' }]}
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredGraduated} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 900, unit_amount_gross_decimal: '9' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredGraduated} | ${undefined} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 900, unit_amount_gross_decimal: '9' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
${baseTiersUnitAmount} | ${21} | ${PricingModel.tieredGraduated} | ${false} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1190, unit_amount_gross_decimal: '11.9' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 1071, unit_amount_gross_decimal: '10.71' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 952, unit_amount_gross_decimal: '9.52' }]}
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredGraduated} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 900, unit_amount_gross_decimal: '9' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredGraduated} | ${undefined} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 900, unit_amount_gross_decimal: '9' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredGraduated} | ${undefined} | ${undefined} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 900, unit_amount_gross_decimal: '9' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
${baseTiersUnitAmount} | ${21} | ${PricingModel.tieredGraduated} | ${false} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1190, unit_amount_gross_decimal: '11.9' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 1071, unit_amount_gross_decimal: '10.71' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 952, unit_amount_gross_decimal: '9.52' }]}
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredGraduated} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 900, unit_amount_gross_decimal: '9' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredGraduated} | ${undefined} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 900, unit_amount_gross_decimal: '9' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredGraduated} | ${undefined} | ${undefined} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 900, unit_amount_gross_decimal: '9' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredGraduated} | ${undefined} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 900, unit_amount_gross_decimal: '9' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredGraduated} | ${undefined} | ${undefined} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }, { ...baseTiersUnitAmount[1], unit_amount_gross: 900, unit_amount_gross_decimal: '9' }, { ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${undefined} | ${30} | ${PricingModel.tieredGraduated} | ${true} | ${{ rate: 19 }} | ${undefined}
${baseTiersUnitAmount} | ${undefined} | ${PricingModel.tieredGraduated} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }]}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
${baseTiersUnitAmount} | ${undefined} | ${PricingModel.tieredGraduated} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }]}
${baseTiersUnitAmount} | ${-1} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }]}
${baseTiersUnitAmount} | ${0} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }]}
${undefined} | ${0} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${undefined}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
${baseTiersUnitAmount} | ${-1} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }]}
${baseTiersUnitAmount} | ${0} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }]}
${undefined} | ${0} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${undefined}
${baseTiersUnitAmount} | ${undefined} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[0], unit_amount_gross: 1000, unit_amount_gross_decimal: '10' }]}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
${baseTiersUnitAmount} | ${21} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${baseTiersFlatFeeAmount} | ${0} | ${PricingModel.tieredFlatFee} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersFlatFeeAmount[0], flat_fee_amount_gross: 1000, flat_fee_amount_gross_decimal: '10' }]}
${undefined} | ${0} | ${PricingModel.tieredFlatFee} | ${true} | ${{ rate: 19 }} | ${undefined}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
${baseTiersUnitAmount} | ${100} | ${PricingModel.tieredVolume} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersUnitAmount[2], unit_amount_gross: 800, unit_amount_gross_decimal: '8' }]}
${baseTiersFlatFeeAmount} | ${0} | ${PricingModel.tieredFlatFee} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersFlatFeeAmount[0], flat_fee_amount_gross: 1000, flat_fee_amount_gross_decimal: '10' }]}
${undefined} | ${0} | ${PricingModel.tieredFlatFee} | ${true} | ${{ rate: 19 }} | ${undefined}
${baseTiersFlatFeeAmount} | ${undefined} | ${PricingModel.tieredFlatFee} | ${true} | ${{ rate: 19 }} | ${[{ ...baseTiersFlatFeeAmount[0], flat_fee_amount_gross: 1000, flat_fee_amount_gross_decimal: '10' }]}

Check warning

Code scanning / CodeQL

Implicit operand conversion Warning

This expression will be implicitly converted from undefined to string.
src/tiers/index.ts Outdated Show resolved Hide resolved
src/tiers/index.ts Fixed Show fixed Hide fixed
src/tiers/index.test.ts Fixed Show fixed Hide fixed
src/tiers/index.test.ts Fixed Show fixed Hide fixed
src/tiers/index.test.ts Fixed Show fixed Hide fixed
src/tiers/index.test.ts Fixed Show fixed Hide fixed
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

@paulofph paulofph requested a review from mdnm May 24, 2024 13:46
@paulofph paulofph merged commit eaf5728 into main May 24, 2024
4 checks passed
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.

2 participants