> For the complete documentation index, see [llms.txt](https://gramhal.gitbook.io/bolbhav/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gramhal.gitbook.io/bolbhav/chapter-1-database/wallets-data/user_membership_wallet_tracker.md).

# user\_membership\_wallet\_tracker

This model contains some analytical insights on the app usage by a user for areas that require membership.

{% hint style="danger" %}
This table is incorrectly named. It does not hold any information about membership\_wallet. A more valid name can be user\_membership\_tracker
{% endhint %}

## Model

<table><thead><tr><th width="240">Field</th><th>Type</th><th data-type="checkbox">Nullable</th><th>Constraints</th></tr></thead><tbody><tr><td>id</td><td>int4</td><td>false</td><td></td></tr><tr><td>user_id</td><td>int4</td><td>false</td><td>Foreign key<br>(person table)</td></tr><tr><td>wallet_id</td><td>varchar</td><td>false</td><td>Foreign key<br>(user wallets)</td></tr><tr><td>last_used_timestamp</td><td>timestamp</td><td>false</td><td></td></tr><tr><td>total_count</td><td>int4</td><td>false</td><td></td></tr><tr><td>todays_count</td><td>int4</td><td>false</td><td></td></tr><tr><td>total_unique_days_used</td><td>int4</td><td>false</td><td></td></tr><tr><td>created_at</td><td>timestamp</td><td>true</td><td></td></tr><tr><td>updated_at</td><td>timestamp</td><td>true</td><td></td></tr></tbody></table>

### Description of fields

#### id

This is the primary key.

#### user\_id

The ID of the user for which this tracker belongs to.

#### wallet\_id

The wallet ID of the user.

{% hint style="warning" %}
This field may be redundant as we're only storing membership data here, hence all the wallet ids currently point to user's membership wallet.
{% endhint %}

#### last\_used\_timestamp

This holds the timestamp when the user's last accessed the sale receipt data. This field is updated on the API that fetches the sale receipt data for a day.

This field is also used to determine whether the user has already been debited for today for viewing the sale receipt data or not.

#### total\_count

The total number of times the user accessed the sale receipt data.

#### todays\_count

The total number of times the user accessed the sale receipt data today. This field auto-resets when the user fetches the data for the first time on a day.

#### total\_unique\_days\_used

The total unique days when a user has accessed sale receipt data. This is incremented by 1 daily given the user access the data.

#### created\_at

Timestamp when the row was created.

#### updated\_at

Timestamp when the row was last updated.
