Skip to content

Commit

Permalink
Merge pull request #465 from iGLOO-be/omnipartners/fix-typing-partner…
Browse files Browse the repository at this point in the history
…-transactions-stats

Omnipartners: fix typing of partnerTransactionHistoryStats
  • Loading branch information
Fridus authored Aug 14, 2024
2 parents dae63f5 + f064fa1 commit 10c0b0a
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions packages/omnipartners/src/api/loyalty/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,32 +155,27 @@ type ILoyaltyPartnerTransactionAction =
| "addition"
| "deduction"
| "shop-redemption";
type ILoyaltyPartnerTransactionActionStats = {
total_points_added: number;
total_points_deducted: number; // negative value
total_points_added_alt: number;
total_points_deducted_alt: number; // negative value
actions: {
[action in ILoyaltyPartnerTransactionAction]?: {
reason: string;
count: number;
total_points: number;
total_points_alt: number;
}[];
};
};
interface ILoyaltyPartnerTransactionHistoryStatsResult {
status: number;
data: {
global: {
total_points_added: number;
total_points_deducted: number; // negative value
actions: {
[action in ILoyaltyPartnerTransactionAction]?: {
reason: string;
count: string;
total_points: string;
}[];
};
};
grouped_by_user?: {
total_points_added: number;
total_points_deducted: number; // negative value
global: ILoyaltyPartnerTransactionActionStats;
grouped_by_user?: (ILoyaltyPartnerTransactionActionStats & {
user_guid: string;
actions: {
[action in ILoyaltyPartnerTransactionAction]: {
reason: string;
count: string;
total_points: string;
}[];
};
}[];
})[];
};
}

Expand Down

0 comments on commit 10c0b0a

Please sign in to comment.