I would maybe look into gorm transactions as you are touching two tables at the same time.
Can try to develop if needed.