Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send timezone country code on create site #591

Merged
merged 4 commits into from
Apr 17, 2024

Conversation

Tooseriuz
Copy link
Member

βœ… DoD

  • Release notes updated na
  • Deployment notes updated na
  • Unit or integration tests added na
  • DB migrations tested na

(use na when API docs (Release notes, etc) do not need to be updated)

πŸ“ Summary

  • Add timezone and country_code on create Arbimon site

@Tooseriuz Tooseriuz self-assigned this Apr 17, 2024
}
// Get timezone and countryCode for Arbimon
const fullStream = { ...stream, ...(await dao.computedAdditions(stream)) }
return sequelize.transaction(async (transaction) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need transaction here? We only make one action to the database.
If creating on arbimon is failed, you will throw error anyway

Copy link
Member Author

Choose a reason for hiding this comment

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

you're right. I added it when there were 2 actions there.

const externalSite = await arbimonService.createSite(arbimonSite, options.idToken)
fullStream.externalId = externalSite.site_id
} catch (error) {
console.error(`Error creating site in Arbimon (stream: ${fullStream.id})`)
Copy link
Contributor

Choose a reason for hiding this comment

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

should we rollback arbimonService.createSite if we have failed inserting row to the database?

Copy link
Member Author

Choose a reason for hiding this comment

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

If I remember correctly. we all agree to make it like this and won't rollback the arbimon side even it is failing on Core.

@Tooseriuz Tooseriuz merged commit 6724c0b into develop Apr 17, 2024
3 checks passed
@Tooseriuz Tooseriuz deleted the feature/send-timezone-country-on-create-site branch April 17, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants