-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added Validation Rules types * Updated Validation Rules types
- Loading branch information
Showing
4 changed files
with
117 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@voucherify/sdk': patch | ||
--- | ||
|
||
Added Validation Rules types |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
export interface ValidationRulesCreate { | ||
name: string | ||
error?: { | ||
message?: string | ||
} | ||
rules?: { | ||
logic?: string | ||
[rule: string]: $FixMe | ||
} | ||
} | ||
|
||
export interface ValidationRulesCreateResponse { | ||
id: string | ||
name: string | ||
error?: { | ||
message?: string | ||
} | ||
rules?: { | ||
logic?: string | ||
[rule: string]: $FixMe | ||
} | ||
created_at: string | ||
updated_at?: string | ||
object: 'validation_rules' | ||
} | ||
|
||
export interface ValidationRulesValidateResponse { | ||
valid: boolean | ||
rule_id: string | ||
applicable_to: { | ||
data: any[] | ||
object: 'list' | ||
total: number | ||
} | ||
} | ||
|
||
export type ValidationRulesGetResponse = ValidationRulesCreateResponse & { assignments_count?: string } | ||
|
||
export type ValidationRulesUpdate = Partial<ValidationRulesCreate> & { id: string } | ||
|
||
export type ValidationRulesUpdateResponse = ValidationRulesCreateResponse | ||
|
||
export interface ValidationRulesCreateAssignment { | ||
voucher?: string | ||
campaign?: string | ||
promotion_tier?: string | ||
} | ||
|
||
export interface ValidationRulesCreateAssignmentResponse { | ||
id: string | ||
rule_id: string | ||
related_object_id?: string | ||
related_object_type?: string | ||
created_at?: string | ||
updated_at: string | ||
object: 'validation_rules_assignment' | ||
} | ||
|
||
export interface ValidationRulesListParams { | ||
limit?: number | ||
page?: number | ||
} | ||
|
||
export interface ValidationRulesListResponse { | ||
object: 'list' | ||
total: number | ||
data_ref: 'data' | ||
data: ValidationRulesGetResponse[] | ||
} | ||
|
||
export interface ValidationRulesListAssignmentsParams { | ||
limit?: number | ||
page?: number | ||
} | ||
|
||
export interface ValidationRulesListAssignmentsResponse { | ||
object: 'list' | ||
total: number | ||
data_ref: 'data' | ||
data: ValidationRulesCreateAssignmentResponse[] | ||
} |
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,10 +1,11 @@ | ||
export * from './Customers' | ||
export * from './Balance' | ||
export * from './ValidationRules' | ||
export * from './Rewards' | ||
export * from './Products' | ||
export * from './Distributions' | ||
export * from './Segments' | ||
export * from './Exports' | ||
export * from './Orders' | ||
export * from './Consents' | ||
export * from './Events' | ||
export * from './Events' |