27 lines
1.3 KiB
JavaScript
27 lines
1.3 KiB
JavaScript
/***********************************************************************************************************************************************************************
|
|
* File Name: plan_prices.mdl.js
|
|
* Type of Program: Model
|
|
* Description: Admin-managed localized price overrides for tier plans.
|
|
* One row per (plan_id, currency) pair. When a user's preferred_currency
|
|
* matches a row here, the override price is shown instead of the base price.
|
|
* Author: Kenneth Obsequio (@lash0000)
|
|
* Date Created: Jun. 29, 2026
|
|
***********************************************************************************************************************************************************************/
|
|
'use strict';
|
|
|
|
const { DataTypes } = require('sequelize');
|
|
const sequelize = require('../../config/db.config');
|
|
|
|
const mdl_PlanPrices = sequelize.define('PlanPrice', {
|
|
price_id: { type: DataTypes.BIGINT, primaryKey: true, autoIncrement: true },
|
|
plan_id: { type: DataTypes.BIGINT, allowNull: false },
|
|
currency: { type: DataTypes.CHAR(3), allowNull: false, label: 'Currency' },
|
|
price: { type: DataTypes.DECIMAL(10, 2), allowNull: false, label: 'Price' },
|
|
}, {
|
|
tableName: 'plan_prices',
|
|
timestamps: true,
|
|
paranoid: false,
|
|
});
|
|
|
|
module.exports = mdl_PlanPrices;
|