const Sequelize = require('sequelize')
    , sequelize = require('./config');

class CoupangModel extends Sequelize.Model { }
CoupangModel.init({
    id: {
        type: Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    sellerProductId: Sequelize.INTEGER,
    sellerProductName: Sequelize.STRING,
    displayCategoryCode: Sequelize.INTEGER,
    categoryId: Sequelize.INTEGER,
    productId: Sequelize.INTEGER,
    vendorId: Sequelize.STRING,
    mdId: Sequelize.STRING,
    mdName: Sequelize.STRING,
    saleStartedAt: Sequelize.DATE,
    saleEndedAt: Sequelize.DATE,
    brand: Sequelize.STRING,
    statusName: Sequelize.STRING,
    detail: Sequelize.STRING,
    createdAt: Sequelize.DATE
}, { sequelize, modelName: 'ds_coupang', freezeTableName: true, timestamps: false });


class CoupangOrderModel extends Sequelize.Model { }
CoupangOrderModel.init({
    id: {
        type: Sequelize.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    orderId: Sequelize.STRING,
    orderer: Sequelize.STRING,
    email: Sequelize.STRING,
    safeNumber: Sequelize.STRING,
    ordererNumber: Sequelize.STRING,
    receiver: Sequelize.STRING,
    addr1: Sequelize.STRING,
    addr2: Sequelize.STRING,
    postCode: Sequelize.STRING,
    vendorItemId: Sequelize.STRING,
    productId: Sequelize.STRING,
    orderPrice: Sequelize.STRING,
    orderedAt: Sequelize.DATE
}, { sequelize, modelName: 'ds_coupang_order', freezeTableName: true, timestamps: false });


module.exports = {
    CoupangModel,
    CoupangOrderModel
}