-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #45 from XYOracleNetwork/feature/coupon-conditions…
…-in-diviner Coupon Conditions in Diviner
- Loading branch information
Showing
7 changed files
with
103 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
packages/payload/packages/payments/src/Discount/Payload/Coupon/types/Condition.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { | ||
isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources, type WithMeta, type WithOptionalMeta, | ||
} from '@xyo-network/payload-model' | ||
import { type SchemaPayload, SchemaSchema } from '@xyo-network/schema-payload-plugin' | ||
|
||
/** | ||
* The payloads that can be used as conditions for a coupon | ||
*/ | ||
export type Condition = SchemaPayload | WithOptionalMeta<SchemaPayload> | WithMeta<SchemaPayload> | ||
|
||
/** | ||
* Identity function for determining if an object is a Condition payload | ||
*/ | ||
export const isCondition = isPayloadOfSchemaType<Condition>(SchemaSchema) | ||
|
||
/** | ||
* Identity function for determining if an object is a Condition payload with sources | ||
*/ | ||
export const isConditionWithSources = isPayloadOfSchemaTypeWithSources<Condition>(SchemaSchema) | ||
|
||
/** | ||
* Identity function for determining if an object is a Condition payload with meta | ||
*/ | ||
export const isConditionWithMeta = isPayloadOfSchemaTypeWithMeta<Condition>(SchemaSchema) |
1 change: 1 addition & 0 deletions
1
packages/payload/packages/payments/src/Discount/Payload/Coupon/types/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * from './Condition.ts' | ||
export * from './CouponFields.ts' | ||
export * from './isStackable.ts' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters