Re_Backend/src/models/ClaimCreditNoteItem.ts
laxman h f0435c47e4 multiple device login restricted and
in admin hsn sac code cofiguration added and csv file read approach changed to read at interval of 5 minutes with mutiple cred
it note in single csv file
2026-03-25 19:24:54 +05:30

84 lines
1.9 KiB
TypeScript

import { Model, DataTypes } from 'sequelize';
import { sequelize } from '@config/database';
export class ClaimCreditNoteItem extends Model {
public itemId!: string;
public creditNoteId!: string;
public slNo!: number;
public transactionNo!: string | null;
public description!: string | null;
public hsnCd!: string | null;
public amount!: number;
public claimAmount!: number | null;
public tdsAmount!: number | null;
public creditAmount!: number | null;
public readonly createdAt!: Date;
public readonly updatedAt!: Date;
}
ClaimCreditNoteItem.init(
{
itemId: {
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
primaryKey: true,
field: 'item_id',
},
creditNoteId: {
type: DataTypes.UUID,
allowNull: false,
field: 'credit_note_id',
},
slNo: {
type: DataTypes.INTEGER,
allowNull: false,
field: 'sl_no',
},
transactionNo: {
type: DataTypes.STRING(100),
allowNull: true,
field: 'transaction_no',
},
description: {
type: DataTypes.TEXT,
allowNull: true,
field: 'description',
},
hsnCd: {
type: DataTypes.STRING(20),
allowNull: true,
field: 'hsn_cd',
},
amount: {
type: DataTypes.DECIMAL(15, 2),
allowNull: false,
defaultValue: 0,
field: 'amount',
},
claimAmount: {
type: DataTypes.DECIMAL(15, 2),
allowNull: true,
defaultValue: 0,
field: 'claim_amount',
},
tdsAmount: {
type: DataTypes.DECIMAL(15, 2),
allowNull: true,
defaultValue: 0,
field: 'tds_amount',
},
creditAmount: {
type: DataTypes.DECIMAL(15, 2),
allowNull: true,
defaultValue: 0,
field: 'credit_amount',
},
},
{
sequelize,
tableName: 'claim_credit_note_items',
underscored: true,
timestamps: true,
}
);