mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
ready to test
Testing Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
/***********************************************************************************************************************************************************************
|
||||
* File Name: user_tiers.mdl.js
|
||||
* Type of Program: Model
|
||||
* Description: Sequelize model for the `user_tiers` table.
|
||||
* Full history of tier grants per user.
|
||||
* Author: Kenneth Obsequio (@lash0000)
|
||||
* Date Created: Jun. 6, 2026
|
||||
***********************************************************************************************************************************************************************/
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../../config/db.config');
|
||||
|
||||
const mdl_UserTiers = sequelize.define('UserTier', {
|
||||
tier_id: { type: DataTypes.BIGINT, primaryKey: true, autoIncrement: true, label: 'Tier ID' },
|
||||
user_id: { type: DataTypes.BIGINT, allowNull: false, label: 'User ID' },
|
||||
tier: { type: DataTypes.ENUM('free', 'premium', 'exclusive'), allowNull: false, defaultValue: 'free', label: 'Tier' },
|
||||
status: { type: DataTypes.ENUM('active', 'expired', 'revoked'), allowNull: false, defaultValue: 'active', label: 'Status' },
|
||||
starts_at: { type: DataTypes.DATE, allowNull: false, defaultValue: DataTypes.NOW, label: 'Starts At' },
|
||||
expires_at: { type: DataTypes.DATE, allowNull: true, label: 'Expires At' },
|
||||
|
||||
granted_by: { type: DataTypes.BIGINT, allowNull: true, label: 'Granted By' },
|
||||
revoked_by: { type: DataTypes.BIGINT, allowNull: true, label: 'Revoked By' },
|
||||
revoked_at: { type: DataTypes.DATE, allowNull: true, label: 'Revoked At' },
|
||||
notes: { type: DataTypes.TEXT, allowNull: true, label: 'Notes' },
|
||||
}, {
|
||||
tableName: 'user_tiers',
|
||||
timestamps: true,
|
||||
paranoid: false,
|
||||
});
|
||||
|
||||
module.exports = mdl_UserTiers;
|
||||
Reference in New Issue
Block a user