Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9d1f51a
feat(billing): implement promo code functionality and update related …
Dobrunia Jun 11, 2026
d03e093
Bump version up to 1.5.4
github-actions[bot] Jun 12, 2026
fb4e419
utm
Dobrunia Jun 12, 2026
e85c91e
chore: update @hawk.so/types to version 0.6.3
Dobrunia Jun 12, 2026
0aa6738
fix
Dobrunia Jun 12, 2026
72a6e60
feat(promoCode): enhance discount logic and add tests for plan applic…
Dobrunia Jun 12, 2026
377fa6f
feat(billing): refactor promo code handling and update payment data s…
Dobrunia Jun 12, 2026
e926076
lint fix
Dobrunia Jun 13, 2026
4c25dc0
feat(billing): introduce PaymentPromoBenefitType and update promo dat…
Dobrunia Jun 13, 2026
515a9e8
refactor(billing): streamline promo code handling and update payment …
Dobrunia Jun 13, 2026
94001e8
refactor(billing): enhance payment amount validation and improve prom…
Dobrunia Jun 13, 2026
5b2f68a
feat(billing): enhance promo code validation and extend admin checks …
Dobrunia Jun 13, 2026
0b74706
feat(billing): implement previewOrApplyPromoCode function to streamli…
Dobrunia Jun 13, 2026
1197be9
refactor(billing): update promo code handling to calculate payment am…
Dobrunia Jun 13, 2026
210de9f
refactor(billing): move PromoCodeService to services directory and re…
Dobrunia Jun 13, 2026
cad0777
fix(billing): improve error handling in workspace billing updates and…
Dobrunia Jun 13, 2026
2f8e5b5
feat(billing): add tests for promo code application and validation in…
Dobrunia Jun 13, 2026
be4f3b2
feat(billing): implement promo usage reservation and rollback mechani…
Dobrunia Jun 13, 2026
f5b405f
refactor(billing): simplify promo code retrieval and improve index in…
Dobrunia Jun 13, 2026
10f578e
feat(billing): enhance promo validation and payment processing logic …
Dobrunia Jun 15, 2026
7945cdb
refactor(billing): remove unused index initialization logic from prom…
Dobrunia Jun 15, 2026
d782e2b
refactor(billing): rename and restructure promo code application logi…
Dobrunia Jun 15, 2026
e9ed561
refactor(billing): rename applyPromoCode to verifyPromoCode and updat…
Dobrunia Jun 15, 2026
b0ef27a
refactor(billing): streamline promo code pricing calculation logic fo…
Dobrunia Jun 15, 2026
627f8fb
refactor(migrations): update index dropping syntax for promo codes an…
Dobrunia Jun 15, 2026
cf31f71
refactor(billing): enhance CloudPayments test suite with additional m…
Dobrunia Jun 15, 2026
e0af65c
refactor(billing): improve promo code usage creation logic and enhanc…
Dobrunia Jun 16, 2026
5693467
refactor(billing): remove unused promo code fields and simplify payme…
Dobrunia Jun 16, 2026
158f2ef
refactor(billing): enhance promo billing test suite with improved fix…
Dobrunia Jun 16, 2026
02d13a2
fix (tests)
Dobrunia Jun 17, 2026
910ac27
refactor(billing): enhance CloudPayments webhook handling and improve…
Dobrunia Jun 17, 2026
2e5ad23
test(billing): add tests for subscription renewal data retrieval and …
Dobrunia Jun 17, 2026
36af36d
refactor(billing): remove unused promo code fields and update charge …
Dobrunia Jun 17, 2026
9c2e51e
test(billing): add tests for card-link checksum handling and amount v…
Dobrunia Jun 17, 2026
b08177c
refactor(billing): remove validation for discounted recurrent amounts…
Dobrunia Jul 5, 2026
9553935
Merge branch 'master' into feat/promo-code
Dobrunia Jul 21, 2026
b597b5c
Bump version up to 1.5.6
github-actions[bot] Jul 21, 2026
12f927b
Merge branch 'master' into feat/promo-code
Dobrunia Jul 29, 2026
82638b6
Bump version up to 1.5.7
github-actions[bot] Jul 29, 2026
8d026d7
docs(promoCodePricing): add JSDoc comments for clarity on pricing fun…
Dobrunia Jul 29, 2026
b81db5c
Merge branch 'master' into feat/promo-code
Dobrunia Aug 5, 2026
b967ac0
Bump version up to 1.5.9
github-actions[bot] Aug 5, 2026
d2d216d
Bump version to 1.6.0
Dobrunia Aug 5, 2026
66ba861
merge master
Dobrunia Aug 13, 2026
cb04be4
chore(deps): update @types/node and undici-types versions in yarn.lock
Dobrunia Aug 19, 2026
82c9533
merge master
Dobrunia Aug 19, 2026
ca8ff46
feat(promo): enhance promo code validation and pricing logic
Dobrunia Aug 26, 2026
36d926b
refactor(billing): simplify promo code payment flow
Dobrunia Sep 1, 2026
10969e6
Bump version up to 1.5.14
github-actions[bot] Sep 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions migrations/20260615140000-add-promo-code-indexes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* @file Indexes required by promo code validation and reservation flow
*/
module.exports = {
async up(db) {
const promoCodes = db.collection('promoCodes');
const usages = db.collection('promoCodeUsages');

await promoCodes.createIndex({ value: 1 }, { unique: true });
await usages.createIndex({ promoCodeId: 1, userId: 1 }, { unique: true });
await usages.createIndex({ promoCodeId: 1, workspaceId: 1 }, { unique: true });
await usages.createIndex(
{ transactionId: 1 },
{
unique: true,
partialFilterExpression: { transactionId: { $type: 'string' } },
}
);
await usages.createIndex(
{ promoCodeId: 1, ordinal: 1 },
{
unique: true,
partialFilterExpression: { ordinal: { $type: 'number' } },
}
);
await usages.createIndex({ reservationExpiresAt: 1 }, { expireAfterSeconds: 0 });
},

async down(db) {
await db.collection('promoCodes').dropIndex('value_1');

const usages = db.collection('promoCodeUsages');

await usages.dropIndex('promoCodeId_1_userId_1');
await usages.dropIndex('promoCodeId_1_workspaceId_1');
await usages.dropIndex('transactionId_1');
await usages.dropIndex('promoCodeId_1_ordinal_1');
await usages.dropIndex('reservationExpiresAt_1');
},
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hawk.api",
"version": "1.5.13",
"version": "1.5.14",
"main": "index.ts",
"license": "BUSL-1.1",
"scripts": {
Expand Down
Loading