Skip to content

Commit d98ebce

Browse files
zhu-xiaoweixiaoweii
andauthored
feat: change the type of price in item and add currency to item (#21)
Co-authored-by: xiaoweii <xiaoweii@amazom.com>
1 parent e276445 commit d98ebce

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/types/Analytics.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,11 @@ export interface Item {
6767
id?: string;
6868
location_id?: string;
6969
name?: string;
70-
price?: Currency;
70+
price?: number;
71+
currency?: string;
7172
quantity?: number;
7273
}
7374

74-
type Currency = string | number;
75-
7675
export interface ClickstreamEvent {
7776
name: string;
7877
attributes?: ClickstreamAttribute;

test/provider/EventRecorder.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ describe('EventRecorder test', () => {
8787
creative_name: longValue,
8888
creative_slot: longValue,
8989
location_id: longValue,
90-
price: longValue,
90+
price: 99.9,
91+
currency: "$",
9192
quantity: 1000000,
9293
};
9394
for (let i = 0; i < 100; i++) {

0 commit comments

Comments
 (0)