Skip to content

Conversation

@xabg2
Copy link
Collaborator

@xabg2 xabg2 commented Oct 3, 2025

This PR implements a new command in the CLI folder to be able to sync the user with their tier in Drive.

By passing the business parameter, it will be sync the business subscriptions. By default it syncs the Individual ones (subscription/lifetime).

⚠️ This PR requires a new env variable called: X_INTERNXT_PAYMENTS_HEADER

@xabg2 xabg2 requested a review from apsantiso October 3, 2025 08:32
@xabg2 xabg2 self-assigned this Oct 3, 2025
@xabg2 xabg2 added the enhancement New feature or request label Oct 3, 2025
apsantiso
apsantiso previously approved these changes Oct 7, 2025
@apsantiso apsantiso requested review from apsantiso October 7, 2025 09:12
Base automatically changed from feat/update-the-user-tier-in-drive to master October 7, 2025 09:39
@xabg2 xabg2 dismissed apsantiso’s stale review October 7, 2025 09:39

The base branch was changed.

@xabg2 xabg2 marked this pull request as ready for review October 7, 2025 10:06
@xabg2 xabg2 requested a review from sg-gs as a code owner October 7, 2025 10:06
$project: {
_id: 0,
userUuid: '$user.uuid',
foreignTierId: '$tier.foreignTierId',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this working if foreignTierId is inside tier.drive field?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. It should be tier.featuresPerService.drive.foreignTierId. Nice catch! 🚀

@xabg2 xabg2 requested a review from sg-gs October 7, 2025 11:17
sg-gs
sg-gs previously approved these changes Oct 7, 2025
Copy link
Member

@sg-gs sg-gs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Coverage is on the floor, we need that check to pass first

@xabg2
Copy link
Collaborator Author

xabg2 commented Oct 7, 2025

The Coverage is on the floor, we need that check to pass first

Okay, I will add coverage to the script

sg-gs
sg-gs previously approved these changes Oct 7, 2025
Copy link
Member

@sg-gs sg-gs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. WDYT @apsantiso about the ref on Workspaces from the payment's user, is it correct? I would not like to re-run this again to undo things haha

return { total: userIdsAndForeignTierId.length, failed: errors.length, errors };
}

export async function updatePersonalUsers(usersTiersRepository: UsersTiersRepository, storageService: StorageService) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let call it "Individual" instead of Personal, to keep the business jargon in order

Copy link
Collaborator Author

@xabg2 xabg2 Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On it.
Update:
The function name has been updated.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 8, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
8.0% Coverage on New Code (required ≥ 85%)
15.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@github-actions
Copy link

⚠️ This pull request has been marked as stale due to 30 days of inactivity.

It will be automatically closed in 7 days if no further updates are made.

@github-actions github-actions bot added the stale No activity for a while. Needs attention. label Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready-for-preview stale No activity for a while. Needs attention.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants