Skip to content

Commit

Permalink
fix: Removed card number property from all tracking events (#2892)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimple16 authored and Dimple committed Apr 24, 2024
1 parent c404088 commit ce7053b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 26 deletions.
13 changes: 0 additions & 13 deletions src/app/core/mock-data/corporate-card-trackers.data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,57 +9,44 @@ import {
export const cardEnrolledProperties1: CardEnrolledProperties = {
Source: '/enterprise/manage_corporate_cards',
'Card Network': CardNetworkType.VISA,
'Existing Card': '',
'Card ID': 'bacc15bbrRGWzf',
};

export const cardEnrolledProperties2: CardEnrolledProperties = {
Source: '/enterprise/manage_corporate_cards',
'Card Network': CardNetworkType.VISA,
'Existing Card': '5555',
'Card ID': 'bacc15bbrRGWzf',
};

export const cardUnenrolledProperties: CardUnenrolledProperties = {
'Card Network': CardNetworkType.VISA,
'Card ID': 'bacc15bbrRGWzf',
'Card Number': '455555******5555',
};

export const cardEnrollmentErrorsProperties1: CardEnrollmentErrorsProperties = {
'Card Network': CardNetworkType.VISA,
Source: '/enterprise/manage_corporate_cards',
'Existing Card': '',
'Error Message': 'This card already exists in the system',
'Card Number': '4555 **** **** 5555',
};

export const cardEnrollmentErrorsProperties2: CardEnrollmentErrorsProperties = {
'Card Network': CardNetworkType.VISA,
Source: '/enterprise/manage_corporate_cards',
'Existing Card': '',
'Error Message': 'Something went wrong. Please try after some time.',
'Card Number': '4555 **** **** 5555',
};

export const cardEnrollmentErrorsProperties3: CardEnrollmentErrorsProperties = {
'Card Network': CardNetworkType.VISA,
Source: '/enterprise/manage_corporate_cards',
'Existing Card': '',
'Error Message': 'Invalid card number',
'Card Number': '4234 **** **** 1111',
};

export const cardEnrollmentErrorsProperties4: CardEnrollmentErrorsProperties = {
'Card Network': CardNetworkType.VISA,
Source: '/enterprise/manage_corporate_cards',
'Existing Card': '',
'Error Message': 'Invalid card network',
'Card Number': '4111 **** **** 1111',
};

export const enrollingNonRTFCardProperties: EnrollingNonRTFCardProperties = {
'Existing Card': '',
'Card Number': '3111 **** **** 1111',
Source: '/enterprise/manage_corporate_cards',
};
6 changes: 0 additions & 6 deletions src/app/core/models/tracking-properties.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,26 +157,20 @@ export interface ReportNameChangeProperties {
export interface CardEnrolledProperties {
Source: string;
'Card Network': CardNetworkType;
'Existing Card': string;
'Card ID': string;
}

export interface CardUnenrolledProperties {
'Card Network': CardNetworkType;
'Card ID': string;
'Card Number': string;
}

export interface CardEnrollmentErrorsProperties {
'Card Network': CardNetworkType;
Source: string;
'Existing Card': string;
'Error Message': string;
'Card Number': string;
}

export interface EnrollingNonRTFCardProperties {
'Existing Card': string;
'Card Number': string;
Source: string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ export class AddCorporateCardComponent implements OnInit {

if (this.isAddingNonRTFCard) {
this.trackingService.enrollingNonRTFCard({
'Existing Card': this.card ? this.card.card_number : '',
'Card Number': `${value.slice(0, 4)} **** **** ${value.slice(12)}`,
Source: this.router.url,
});
}
Expand Down Expand Up @@ -97,7 +95,6 @@ export class AddCorporateCardComponent implements OnInit {
}

private trackEnrollmentErrors(): void {
const cardNumber = this.cardForm.value as string;
let error = '';

if (this.cardForm.errors.invalidCardNumber) {
Expand All @@ -110,9 +107,7 @@ export class AddCorporateCardComponent implements OnInit {

this.trackingService.cardEnrollmentErrors({
'Card Network': this.cardType,
'Existing Card': this.card ? this.card.card_number : '',
'Error Message': error,
'Card Number': `${cardNumber.slice(0, 4)} **** **** ${cardNumber.slice(12)}`,
Source: this.router.url,
});
}
Expand Down Expand Up @@ -189,7 +184,6 @@ export class AddCorporateCardComponent implements OnInit {
private handleEnrollmentSuccess(card: PlatformCorporateCard): void {
this.trackingService.cardEnrolled({
'Card Network': this.cardType,
'Existing Card': this.card ? this.card.card_number : '',
'Card ID': card.id,
Source: this.router.url,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ export class ManageCorporateCardsPage {
this.trackingService.cardUnenrolled({
'Card Network': cardType,
'Card ID': card.id,
'Card Number': card.card_number,
});
});
}
Expand Down

0 comments on commit ce7053b

Please sign in to comment.