Skip to content

Commit

Permalink
fix: move DiscountApplicationStrategy to constants
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiusj committed Nov 28, 2023
1 parent 161bd18 commit 5990de0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions .changeset/ninety-tables-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/discount-app-components': patch
---

move strategy to constants
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import React from 'react';
import {Box, Card, ChoiceList, Text, BlockStack} from '@shopify/polaris';
import {useI18n} from '@shopify/react-i18n';

import {DiscountApplicationStrategy, Field} from '../../types';
import {DiscountClass} from '../../constants';
import {Field} from '../../types';
import {DiscountClass, DiscountApplicationStrategy} from '../../constants';

export interface DiscountAppStrategyProps {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import {ChoiceList, TextField} from '@shopify/polaris';
import {mockField, mountWithApp} from 'tests/utilities';

import {DiscountApplicationStrategyCard} from '../DiscountApplicationStrategyCard';
import {DiscountApplicationStrategy} from '../../../types';
import {DiscountClass} from '../../../constants';
import {DiscountClass, DiscountApplicationStrategy} from '../../../constants';

describe('<DiscountApplicationStrategyCard />', () => {
const mockProps = {
Expand Down
6 changes: 6 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,3 +323,9 @@ export enum DiscountValueType {
Percentage = 'PERCENTAGE',
FixedAmount = 'FIXED_AMOUNT',
}

export enum DiscountApplicationStrategy {
First = 'FIRST',
Maximum = 'MAXIMUM',
All = 'ALL',
}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export type {
CustomerSegment,
CombinableDiscountTypes,
CombinableDiscountCounts,
DiscountApplicationStrategy,
} from './types';

// constants
Expand All @@ -32,6 +31,7 @@ export {
DiscountStatus,
Eligibility,
PurchaseType,
DiscountApplicationStrategy,
} from './constants';

// provider
Expand Down
5 changes: 0 additions & 5 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ export interface CombinableDiscountCounts {

export type CountryCode = SupportedCountryCode | typeof REST_OF_WORLD;

export enum DiscountApplicationStrategy {
First = 'FIRST',
Maximum = 'MAXIMUM',
All = 'ALL',
}
export interface ProductOrCollectionResource extends Resource {
title: string;
}

0 comments on commit 5990de0

Please sign in to comment.