Skip to content

Commit

Permalink
feat: playerId for shop events
Browse files Browse the repository at this point in the history
  • Loading branch information
niekcandaele committed Jul 18, 2024
1 parent 42df936 commit 19be204
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/app-api/src/service/Shop/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ export class ShopListingService extends TakaroService<
new EventCreateDTO({
eventName: EVENT_TYPES.SHOP_ORDER_CREATED,
gameserverId: gameServerId,
playerId: pog.playerId,
userId,
meta: new TakaroEventShopOrderCreated({
id: order.id,
}),
Expand Down Expand Up @@ -248,6 +250,8 @@ export class ShopListingService extends TakaroService<
new EventCreateDTO({
eventName: EVENT_TYPES.SHOP_ORDER_STATUS_CHANGED,
gameserverId: gameServerId,
playerId: pog.playerId,
userId,
meta: new TakaroEventShopOrderStatusChanged({
id: updatedOrder.id,
status: ShopOrderStatus.COMPLETED,
Expand All @@ -274,10 +278,14 @@ export class ShopListingService extends TakaroService<
const listing = await this.findOne(order.listingId);
const gameServerId = listing.gameServerId;

const user = await new UserService(this.domainId).findOne(order.userId);

await this.eventService.create(
new EventCreateDTO({
eventName: EVENT_TYPES.SHOP_ORDER_STATUS_CHANGED,
gameserverId: gameServerId,
userId: user.id,
playerId: user.playerId,
meta: new TakaroEventShopOrderStatusChanged({
id: updatedOrder.id,
status: ShopOrderStatus.CANCELED,
Expand Down

0 comments on commit 19be204

Please sign in to comment.