Falukant production, family and administration enhancements
This commit is contained in:
@@ -5,19 +5,19 @@ class FalukantCharacter extends Model {}
|
||||
|
||||
FalukantCharacter.init(
|
||||
{
|
||||
user_id: {
|
||||
userId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
},
|
||||
region_id: {
|
||||
regionId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
first_name: {
|
||||
firstName: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
last_name: {
|
||||
lastName: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
|
||||
@@ -35,6 +35,11 @@ Director.init({
|
||||
type: DataTypes.BOOLEAN,
|
||||
allowNull: false,
|
||||
defaultValue: true,
|
||||
},
|
||||
lastSalaryPayout: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false,
|
||||
defaultValue: new Date(0)
|
||||
}
|
||||
}, {
|
||||
sequelize,
|
||||
|
||||
56
backend/models/falukant/data/relationship.js
Normal file
56
backend/models/falukant/data/relationship.js
Normal file
@@ -0,0 +1,56 @@
|
||||
import { Model, DataTypes } from 'sequelize';
|
||||
import { sequelize } from '../../../utils/sequelize.js';
|
||||
import FalukantCharacter from './character.js';
|
||||
|
||||
class Relationship extends Model {}
|
||||
|
||||
Relationship.init(
|
||||
{
|
||||
character1Id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: FalukantCharacter,
|
||||
key: 'id',
|
||||
},
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
character2Id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
references: {
|
||||
model: FalukantCharacter,
|
||||
key: 'id',
|
||||
},
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
relationshipTypeId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
onDelete: 'CASCADE',
|
||||
},
|
||||
widowFirstName1: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
},
|
||||
widowFirstName2: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
},
|
||||
nextStepProgress: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true,
|
||||
defaultValue: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
modelName: 'Relationship',
|
||||
tableName: 'relationship',
|
||||
schema: 'falukant_data',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
}
|
||||
);
|
||||
|
||||
export default Relationship;
|
||||
@@ -24,6 +24,11 @@ DayProduction.init({
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false,
|
||||
defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
|
||||
},
|
||||
productionDate: {
|
||||
type: DataTypes.DATEONLY,
|
||||
allowNull: false,
|
||||
defaultValue: sequelize.literal('CURRENT_DATE'),
|
||||
}
|
||||
}, {
|
||||
sequelize,
|
||||
@@ -35,10 +40,9 @@ DayProduction.init({
|
||||
indexes: [
|
||||
{
|
||||
unique: true,
|
||||
fields: ['producer_id', 'product_id', 'region_id']
|
||||
fields: ['producer_id', 'product_id', 'region_id', 'production_date']
|
||||
}
|
||||
]
|
||||
|
||||
});
|
||||
|
||||
export default DayProduction;
|
||||
|
||||
32
backend/models/falukant/log/promotional_gift.js
Normal file
32
backend/models/falukant/log/promotional_gift.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Model, DataTypes } from 'sequelize';
|
||||
import { sequelize } from '../../../utils/sequelize.js';
|
||||
|
||||
class PromotionalGiftLog extends Model { };
|
||||
|
||||
PromotionalGiftLog.init({
|
||||
senderCharacterId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
recipientCharacterId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
giftId: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
changeValue: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
}, {
|
||||
sequelize,
|
||||
modelName: 'PromotionalGiftLog',
|
||||
tableName: 'promotional_gift',
|
||||
schema: 'falukant_log',
|
||||
timestamps: true,
|
||||
underscored: true,
|
||||
});
|
||||
|
||||
export default PromotionalGiftLog;
|
||||
@@ -16,7 +16,7 @@ PromotionalGift.init(
|
||||
value: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 0, // Wert des Geschenks
|
||||
defaultValue: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Model, DataTypes } from 'sequelize';
|
||||
import { sequelize } from '../../../utils/sequelize.js';
|
||||
|
||||
class Relationship extends Model {}
|
||||
class RelationshipType extends Model {}
|
||||
|
||||
Relationship.init(
|
||||
RelationshipType.init(
|
||||
{
|
||||
tr: {
|
||||
type: DataTypes.STRING,
|
||||
@@ -12,7 +12,7 @@ Relationship.init(
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
modelName: 'Relationship',
|
||||
modelName: 'RelationshipType',
|
||||
tableName: 'relationship',
|
||||
schema: 'falukant_type',
|
||||
timestamps: false,
|
||||
@@ -20,4 +20,4 @@ Relationship.init(
|
||||
}
|
||||
);
|
||||
|
||||
export default Relationship;
|
||||
export default RelationshipType;
|
||||
|
||||
@@ -7,6 +7,7 @@ FalukantStockType.init({
|
||||
labelTr: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
unique: true,
|
||||
},
|
||||
cost: {
|
||||
type: DataTypes.INTEGER,
|
||||
|
||||
Reference in New Issue
Block a user