add deadline unit

master
shoaibalmasi 4 years ago
parent 6992ab47b4
commit 5056d0bcaa
  1. 15
      migrations/20210315210330-add-deadlineUnit-column.js
  2. 17
      migrations/20210315212012-ch-deadlineUnit-column.js
  3. 4
      models/user.js
  4. 3
      services/user.js
  5. BIN
      template/Hform4.docx

@ -0,0 +1,15 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return Promise.all([
queryInterface.addColumn('Users', 'deadlineUnit', {
type: Sequelize.STRING,
}),
]);
},
down: (queryInterface) => {
return Promise.all([queryInterface.removeColumn('Users', 'deadlineUnit')]);
},
};

@ -0,0 +1,17 @@
'use strict';
module.exports = {
up: (queryInterface, Sequelize) => {
return Promise.all([
queryInterface.changeColumn('Users', 'deadlineUnit', {
type: Sequelize.STRING,
defaultValue: 'روز' ,
}),
]);
},
down: (queryInterface) => {
return Promise.all([queryInterface.changeColumn('Users', 'deadlineUnit')]);
},
};

@ -28,6 +28,10 @@ module.exports = (sequelize, DataTypes) => {
writtenOrderNumber: DataTypes.INTEGER, writtenOrderNumber: DataTypes.INTEGER,
writtenOrderDate: DataTypes.DATE, writtenOrderDate: DataTypes.DATE,
deadline: DataTypes.INTEGER, deadline: DataTypes.INTEGER,
deadlineUnit: {
type: DataTypes.STRING,
defaultValue: 'روز'
},
fileName:{ fileName:{
type: DataTypes.STRING, type: DataTypes.STRING,
allowNull: false, allowNull: false,

@ -57,6 +57,7 @@ methods.completeForm =(userId)=>{
let userInfo = user let userInfo = user
userInfo.fullName = user.firstName + ' ' + user.lastName userInfo.fullName = user.firstName + ' ' + user.lastName
userInfo.deadlineAndUnit = user.deadline + ' ' + user.deadlineUnit
userInfo.obligationDate = jalali( user.obligationDate, 'YYYY/MM/DD').locale('fa').format('YYYY/MM/DD') userInfo.obligationDate = jalali( user.obligationDate, 'YYYY/MM/DD').locale('fa').format('YYYY/MM/DD')
userInfo.requestDate = jalali( user.requestDate, 'YYYY/MM/DD').locale('fa').format('YYYY/MM/DD') userInfo.requestDate = jalali( user.requestDate, 'YYYY/MM/DD').locale('fa').format('YYYY/MM/DD')
userInfo.writtenOrderDate = jalali( user.writtenOrderDate, 'YYYY/MM/DD').locale('fa').format('YYYY/MM/DD') userInfo.writtenOrderDate = jalali( user.writtenOrderDate, 'YYYY/MM/DD').locale('fa').format('YYYY/MM/DD')
@ -89,6 +90,4 @@ methods.completeForm =(userId)=>{
} }
module.exports = methods module.exports = methods

Binary file not shown.
Loading…
Cancel
Save