chuni: enable ticket system and UserCharge APIs - [closed] #23

Closed
opened 2020-07-30 11:48:27 +03:00 by icex2 · 3 comments
icex2 commented 2020-07-30 11:48:27 +03:00 (Migrated from github.com)

In GitLab by @GRIM.657 on Jul 30, 2020, 10:48

Merges master -> master

This merge request is a continuation of the work started in !7 (unmerged, stagnant). That MR added static responses for getGameEvent and getGameCharge. !8 (merged) also implements getGameEvent and refactored such that event IDs are in a static file.

This MR refactors the GameCharge items in the same fashion, enables the ticket system, and adds a new database table to store the user’s purchased tickets (referred to as UserCharge).

A user’s updated ticket count is sent with upsertUserAll, however there is additionally an UpsertUserChargelogApi request fired at the moment a ticket is purchased. Currently the request contents are not stored, there is never a GetUserChargelogApi request by the game that I can see; the user’s ticket stock is fetched with the GetUserChargeApi request.

Currently ticket prices are stored in the static file. These should possibly be environment variables or easily configurable in some other way.

Thanks to Lawrence and Felix for the excellent work on which this was based!

In GitLab by @GRIM.657 on Jul 30, 2020, 10:48 _Merges master -> master_ This merge request is a continuation of the work started in !7 (unmerged, stagnant). That MR added static responses for getGameEvent and getGameCharge. !8 (merged) also implements getGameEvent and refactored such that event IDs are in a static file. This MR refactors the GameCharge items in the same fashion, enables the ticket system, and adds a new database table to store the user’s purchased tickets (referred to as UserCharge). A user’s updated ticket count is sent with upsertUserAll, however there is additionally an UpsertUserChargelogApi request fired at the moment a ticket is purchased. Currently the request contents are not stored, there is never a GetUserChargelogApi request by the game that I can see; the user’s ticket stock is fetched with the GetUserChargeApi request. Currently ticket prices are stored in the static file. These should possibly be environment variables or easily configurable in some other way. Thanks to Lawrence and Felix for the excellent work on which this was based!
icex2 commented 2020-07-30 20:01:51 +03:00 (Migrated from github.com)

In GitLab by @GRIM.657 on Jul 30, 2020, 19:01

I'm not sure why the build is failing, from either my fork or the master repository it builds locally with no issues, but tests fail due to an aimedb issue, which I have not touched in this MR.

 FAIL  src/aimedb/decoder.test.ts
  √ decode hello (3ms)
  × decode lookup (3ms)

  ● decode lookup

    expect(received).toBe(expected) // Object.is equality

    Expected: "lookup"
    Received: "lookup2"
In GitLab by @GRIM.657 on Jul 30, 2020, 19:01 I'm not sure why the build is failing, from either my fork or the master repository it builds locally with no issues, but tests fail due to an aimedb issue, which I have not touched in this MR. ``` FAIL src/aimedb/decoder.test.ts √ decode hello (3ms) × decode lookup (3ms) ● decode lookup expect(received).toBe(expected) // Object.is equality Expected: "lookup" Received: "lookup2" ```
icex2 commented 2020-08-02 18:26:51 +03:00 (Migrated from github.com)

In GitLab by @tau on Aug 2, 2020, 17:26

closed

In GitLab by @tau on Aug 2, 2020, 17:26 closed
icex2 commented 2020-08-02 18:26:51 +03:00 (Migrated from github.com)

In GitLab by @tau on Aug 2, 2020, 17:26

Merged manually

In GitLab by @tau on Aug 2, 2020, 17:26 Merged manually
Sign in to join this conversation.