Files
yourpart3/backend/models/falukant/data/credit.js
Torsten Schulz (local) 1ab9407e79
All checks were successful
Deploy to production / deploy (push) Successful in 2m56s
Refactor code structure for improved readability and maintainability; optimize performance across multiple modules.
2026-07-21 09:08:15 +02:00

32 lines
785 B
JavaScript
Executable File

// models/falukant/data/credit.js
import { Model, DataTypes } from 'sequelize';
import { sequelize } from '../../../utils/sequelize.js';
class Credit extends Model {}
Credit.init({
// aufgenommener Kredit-Betrag
amount: {
type: DataTypes.DECIMAL(14,2),
allowNull: false},
// noch offener Kreditbetrag
remainingAmount: {
type: DataTypes.DECIMAL(14,2),
allowNull: false},
// Zinssatz als Prozentsatz (z.B. 3.5 für 3.5%)
interestRate: {
type: DataTypes.DECIMAL(5,2),
allowNull: false},
// Verknüpfung auf FalukantUser
falukantUserId: {
type: DataTypes.INTEGER,
allowNull: false}}, {
sequelize,
modelName: 'Credit',
tableName: 'credit',
schema: 'falukant_data',
timestamps: true,
underscored: true});
export default Credit;