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

feat: Claiming of Redeemed Vouchers #24

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

Conversation

C4RR0T02
Copy link
Contributor

No description provided.

@C4RR0T02 C4RR0T02 mentioned this pull request Aug 16, 2023
@C4RR0T02 C4RR0T02 marked this pull request as ready for review August 16, 2023 13:46
@C4RR0T02 C4RR0T02 requested a review from qin-guan August 17, 2023 06:20
components/voucher/RedemptionList.vue Outdated Show resolved Hide resolved
components/voucher/RedemptionList.vue Outdated Show resolved Hide resolved
components/voucher/RedemptionList.vue Show resolved Hide resolved
components/voucher/RedemptionList.vue Outdated Show resolved Hide resolved
components/voucher/RedemptionList.vue Outdated Show resolved Hide resolved
@@ -14,18 +23,69 @@ const relativeRedeemed = computed(() => {
timestamp: formatRelative(v.timestamp, now),
}))
})

function claimVoucher(redemptionId: any) {
Copy link
Member

Choose a reason for hiding this comment

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

Why is there two?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

I believe this are not the same function instead one is a to create a confirmation message before a user officially confirms to claim the voucher.

Copy link
Member

Choose a reason for hiding this comment

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

I meant one on the component and one on the page file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe one is claimAdminVoucher and the other is claimVoucher

@@ -11,6 +11,7 @@ import { deadlineRouter } from './deadline/deadline.router'
import { eventRouter } from './event/event.router'
import { quizRouter } from './quiz/quiz.router'
import { voucherRouter } from './voucher/voucher.router'
import { redeemRouter } from './redemption/redemption.router'
Copy link
Member

Choose a reason for hiding this comment

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

Can merge with voucher router?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is there a need to merge with voucher router?

Copy link
Member

Choose a reason for hiding this comment

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

Belongs under voucher domain.

Copy link
Member

Choose a reason for hiding this comment

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

Redemption cannot exist without voucher

server/trpc/modules/redemption/redemption.router.ts Outdated Show resolved Hide resolved
},
),

adminClaim: protectedProcedure
Copy link
Member

Choose a reason for hiding this comment

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

Why need admin claim?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is to allow admin to essentially claim on the admin end for the vouchers where as the normal claim is for the users to claim on their end

Copy link
Member

Choose a reason for hiding this comment

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

In this case then it is probably better to combine into single claim function and assertInstitutionRole to see if user is admin

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But the user must also be able to mark it as complete on their end

Copy link
Member

Choose a reason for hiding this comment

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

The idea is for users to be able to claim their redeemed voucher right?

Say I redeem a LIHO voucher. I will need to go to an admin to get the voucher code. Then the admin will mark the voucher as claimed right?

What is the use case for members claiming their own voucher?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you have seen how Shopee system can also work where the user is able to claim on their end at the same time on the shopee administrator end, they are also able to mark the voucher as claimed

Copy link
Member

Choose a reason for hiding this comment

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

I don’t think it applies since we have one claimed field only

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