<commit_before>/*
 * Copyright (c) 2014-2022 <NAME> & the OWASP Juice Shop contributors.
 * SPDX-License-Identifier: MIT
 */

/* jslint node: true */

import {
  Model,
  InferAttributes,
  InferCreationAttributes,
  DataTypes,
  CreationOptional,
  Sequelize
} from 'sequelize'

class Recycle extends Model<
InferAttributes<Recycle>,
InferCreationAttributes<Recycle>
> {
  declare id: CreationOptional<number>
  declare UserId: number
  declare AddressId: number
  declare quantity: number
  declare isPickup: boolean
  declare date: string
}

const RecycleModelInit = (sequelize: Sequelize) => {
  Recycle.init(
    {
      UserId: {
        type: DataTypes.INTEGER
      },
      AddressId: {
        type: DataTypes.INTEGER
      },
      id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true
      },
      // TODO set this as DataTypes.INTEGER(4)
      quantity: DataTypes.INTEGER,
      isPickup: { type: DataTypes.BOOLEAN, defaultValue: false },
      date: DataTypes.DATE
    },
    {
      tableName: 'Recycles',
      sequelize
    }
  )
}

export { Recycle as RecycleModel, RecycleModelInit }<commit_msg>fix: remove todo comment for limitation of datatype<commit_after>/*
 * Copyright (c) 2014-2022 <NAME> & the OWASP Juice Shop contributors.
 * SPDX-License-Identifier: MIT
 */

/* jslint node: true */

import {
  Model,
  InferAttributes,
  InferCreationAttributes,
  DataTypes,
  CreationOptional,
  Sequelize
} from 'sequelize'

class Recycle extends Model<
InferAttributes<Recycle>,
InferCreationAttributes<Recycle>
> {
  declare id: CreationOptional<number>
  declare UserId: number
  declare AddressId: number
  declare quantity: number
  declare isPickup: boolean
  declare date: string
}

const RecycleModelInit = (sequelize: Sequelize) => {
  Recycle.init(
    {
      UserId: {
        type: DataTypes.INTEGER
      },
      AddressId: {
        type: DataTypes.INTEGER
      },
      id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true
      },
      quantity: DataTypes.INTEGER,
      isPickup: { type: DataTypes.BOOLEAN, defaultValue: false },
      date: DataTypes.DATE
    },
    {
      tableName: 'Recycles',
      sequelize
    }
  )
}

export { Recycle as RecycleModel, RecycleModelInit }
{'fraction_non_alphanumeric': 0.09647979139504563, 'fraction_numerical': 0.007388092133854845, 'mean_word_length': 2.881956155143339, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6566348', 'n_tokens_mistral': 753, 'n_tokens_neox': 730, 'n_words': 178}