@porulle/plugin-loyalty 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,7 +112,7 @@ export class LoyaltyService {
112
112
  return redeemResult;
113
113
  await this.db.update(loyaltyRedemptionOffers)
114
114
  .set({ timesRedeemed: sql `${loyaltyRedemptionOffers.timesRedeemed} + 1`, updatedAt: new Date() })
115
- .where(eq(loyaltyRedemptionOffers.id, offerId));
115
+ .where(and(eq(loyaltyRedemptionOffers.id, offerId), eq(loyaltyRedemptionOffers.organizationId, orgId)));
116
116
  return Ok({ offer, remainingPoints: redeemResult.value.points });
117
117
  }
118
118
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@porulle/plugin-loyalty",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -19,14 +19,14 @@
19
19
  "dependencies": {
20
20
  "@hono/zod-openapi": "^1.2.2",
21
21
  "hono": "^4.12.5",
22
- "@porulle/core": "0.8.0"
22
+ "@porulle/core": "0.9.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^24.5.2",
26
26
  "typescript": "5.9.2",
27
27
  "vitest": "^3.2.4",
28
- "@porulle/typescript-config": "0.1.0",
29
- "@porulle/eslint-config": "0.1.0"
28
+ "@porulle/eslint-config": "0.1.0",
29
+ "@porulle/typescript-config": "0.1.0"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"
@@ -123,7 +123,7 @@ export class LoyaltyService {
123
123
 
124
124
  await this.db.update(loyaltyRedemptionOffers)
125
125
  .set({ timesRedeemed: sql`${loyaltyRedemptionOffers.timesRedeemed} + 1`, updatedAt: new Date() })
126
- .where(eq(loyaltyRedemptionOffers.id, offerId));
126
+ .where(and(eq(loyaltyRedemptionOffers.id, offerId), eq(loyaltyRedemptionOffers.organizationId, orgId)));
127
127
 
128
128
  return Ok({ offer, remainingPoints: redeemResult.value.points });
129
129
  }