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

Implement direct funding refunding, and non-destruction of transactions, on cancelled buckets #771

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

Powersource
Copy link
Member

for #450

@Powersource
Copy link
Member Author

was thinking aloud in a chat:

funderar på hur vi ska modella grejer när en buckets blir cancellad och transaktioner/contributions ska reversas. i contribute ser det ut så här

  await prisma.contribution.create({
    data: {
      roundId,
      roundMemberId: roundMember.id,
      amount,
      bucketId: bucket.id,
      amountBefore: contributionsForBucket || 0,
      stripeSessionId,
    },
  });

  await prisma.transaction.create({
    data: {
      roundMemberId: roundMember.id,
      amount,
      toAccountId: bucket.statusAccountId,
      fromAccountId: roundMember.statusAccountId,
      roundId,
      stripeSessionId,
    },
  });

Contributions har ju typ ingen riktning. eller dom är alltid samma riktning. Transactions har man riktning på. vi snackade väl också om att kanske deprecata Contributions? hade det varit rimligt att göra så här när man reversar?:

gör en lika stor, fast negativ, Contribution, SAMT
gör en lika stor, och fortfarande positiv, fast bakochfram, Transaction

blir aningen förvirrande att man har lite olika taktiker för dom. men vi har inte så många snygga alternativ för Contributions. och det här känns som det hållbara alternativet för Transactions

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.

None yet

1 participant