[Phase 1] Loyalty Script Details

Contents

Overview

This page will cover in detail the plan to run the Loyalty script before the launch of Phase 1 in the loyalty migration for BK ES. The script will:

  1. Delete all previous data from a specific date

  2. Import all transaction data (for earn transactions) from BK ES for the last 7 months and user’s loyalty points balance

  3. Create a remediation transaction to ensure the sum of transaction loyalty points matches the user’s balance loyalty points

Since launch was delayed from July to September, July change:

  • We are going to keep as valid all transactions migrated via script in the month of june that represented 6 months of data (Jan-Jun)

  • We are going to delete all Phase 0 earn transactions created since the beginning

  • We will import NEW data from Jun 24th until launch

1st Script Run (start Aug 1st)

RBIberia will drop file on Aug 1, 2024 before 12pm in OneDrive with data from Jun 17, 2024 until Jul 31, 2024 :

  • One file with users balance

  • One file with transactions data

This script is expected to take [] of days

2nd Script Run (start Aug 26th)

RBIberia will drop file on Aug 26, 2024 before 12pm in OneDrive with data from Aug 1, 2024 until Aug 25, 2024 :

  • One file with users balance

  • One file with transactions data

This script is expected to take [] of days

3rd Script Run (start Sep 1st)

RBIberia will drop file on Sep 2, 2024 before 12pm in OneDrive with data from Aug 26, 2024 until Aug 31, 2024 :

  • One file with users balance

  • One file with transactions data

This script is expected to take [] of days

4th Script Run & onwards to be daily

RBIberia drop file on

Data containing

RBIberia drop file on

Data containing

Sep 3rd

Sep 1st and Sep 2nd

Sep 4th

Sep 3rd

Sep 5th

Sep 4th

Sep 6th

Sep 5th

Sep 7th

Sep 6th

Sep 8th

Sep 7th

Sep 9th

Sep 8th

Sep 10th

Sep 9th

Inconsistent Users

While running initial script we spotted loyalty transactions for users that did not exist in RBI.

Users have now been created in RBI. We need to sync data for those guys from Feb 1, 2024 until Jun 16, 2024

Next steps:

  • @Fragalli, Andre prepare file of emails

  • @Miguel-Romero, Almudena request RBIberia file with data (balance & transactions)

Scripts sequence and status

Status:

  • Completed:

  • In Progress:

  • Not started:

1st & 2nd Script Run

Updating data from 24-06-17 to 24-08-19.

PointBalance.csv → 10.746.533 users
TransactionHistory.csv → 4.970.645 transactions

Script

Input File

Status

Duration

Params

Script

Input File

Status

Duration

Params

1

deleteTransactions.ts

PointBalance.csv

72h

CHUNK_SIZE=100 SLEEP=1000

2

transactions.ts

TransactionHistory.csv

42h

CHUNK_SIZE=100 SLEEP=1000

3

transactions/index.ts

Generated from 2

17.78h

CHUNK_SIZE=100 SLEEP=1000

4

users.ts

PointBalance.csv

43.80h

CHUNK_SIZE=100 SLEEP=1000

5

transactions/index.ts

Generated from 4

5.6h

CHUNK_SIZE=100 SLEEP=1000

3rd Script Run

Updating data from 24-08-20 to 24-09-02.

PointBalance.csv → 1.200.471 users
TransactionHistory.csv → 1.042.907 transactions

Script

Input File

Status

Duration

Params

Script

Input File

Status

Duration

Params

1

deleteTransactions.ts

PointBalance.csv

5h

CHUNK_SIZE=100 SLEEP=1000

2

transactions.ts

TransactionHistory.csv

1h

CHUNK_SIZE=100 SLEEP=1000

3

transactions/index.ts

Generated from 2

3.7h

CHUNK_SIZE=100 SLEEP=1000

4

users.ts

PointBalance.csv

5h

CHUNK_SIZE=100 SLEEP=1000

5

transactions/index.ts

Generated from 4

2h

CHUNK_SIZE=100 SLEEP=1000

4th Script Run

Updating data from 24-09-03 to 24-09-04.

PointBalance.csv → 238.224 users
TransactionHistory.csv → 67.051 transactions

Script

Input File

Status

Duration

Params

Script

Input File

Status

Duration

Params

1

deleteTransactions.ts

PointBalance.csv

1h21

CHUNK_SIZE=100 SLEEP=1000

2

transactions.ts

TransactionHistory.csv

2.8min

CHUNK_SIZE=100 SLEEP=1000

3

transactions/index.ts

Generated from 2

14.37min

CHUNK_SIZE=100 SLEEP=1000

4

users.ts

PointBalance.csv

1h

CHUNK_SIZE=100 SLEEP=1000

5

transactions/index.ts

Generated from 4

44min

CHUNK_SIZE=100 SLEEP=1000

5th Script Run

Updating data from 24-09-04 to 24-09-05.

PointBalance.csv → 184.324 users
TransactionHistory.csv → 71.129 transactions

Script

Input File

Status

Duration

Params

Script

Input File

Status

Duration

Params

1

deleteTransactions.ts

PointBalance.csv

47min

CHUNK_SIZE=100 SLEEP=1000

2

transactions.ts

TransactionHistory.csv

3.2min

CHUNK_SIZE=100 SLEEP=1000

3

transactions/index.ts

Generated from 2

1h8min

CHUNK_SIZE=100 SLEEP=1000

4

users.ts

PointBalance.csv

1h17min

CHUNK_SIZE=100 SLEEP=1000

5

transactions/index.ts

Generated from 4

3h41min

CHUNK_SIZE=100 SLEEP=1000

 

6th Script Run

Updating data from 24-09-05 to 24-09-09.

PointBalance.csv → 272.818 users
TransactionHistory.csv → 276.267 transactions

Script

Input File

Status

Duration

Params

Script

Input File

Status

Duration

Params

1

deleteTransactions.ts

PointBalance.csv

1h13min

CHUNK_SIZE=100 SLEEP=1000

2

transactions.ts

TransactionHistory.csv

10min

CHUNK_SIZE=100 SLEEP=1000

3

transactions/index.ts

Generated from 2

4h38min

CHUNK_SIZE=100 SLEEP=1000

4

users.ts

PointBalance.csv

1h2min

CHUNK_SIZE=100 SLEEP=1000

5

transactions/index.ts

Generated from 4

52min

CHUNK_SIZE=100 SLEEP=1000

7th Script Run

Updating data from 24-09-10 to 24-09-10.

PointBalance.csv 91.742 users
TransactionHistory.csv → 67.368 transactions

Script

Input File

Status

Duration

Params

Script

Input File

Status

Duration

Params

1

deleteTransactions.ts

PointBalance.csv

25min

CHUNK_SIZE=100 SLEEP=1000

2

transactions.ts

TransactionHistory.csv

2min

CHUNK_SIZE=200 SLEEP=1000

3

transactions/index.ts

Generated from 2

8min

CHUNK_SIZE=200 SLEEP=600

4

users.ts

PointBalance.csv

12min

CHUNK_SIZE=200 SLEEP=600

5

transactions/index.ts

Generated from 4

6min

CHUNK_SIZE=200 SLEEP=600