models for offer info
This commit is contained in:
parent
b0bac5e100
commit
2f092d6998
2 changed files with 90 additions and 0 deletions
27
src/models/offerCreated.js
Normal file
27
src/models/offerCreated.js
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
const { DataTypes } = require('sequelize');
|
||||||
|
const sequelize = require('../database');
|
||||||
|
|
||||||
|
const OfferCreated = sequelize.define(
|
||||||
|
'OfferCreated',
|
||||||
|
{
|
||||||
|
uuid: {
|
||||||
|
type: DataTypes.UUID,
|
||||||
|
allowNull: false,
|
||||||
|
unique: true,
|
||||||
|
primaryKey: true,
|
||||||
|
},
|
||||||
|
public_key: {
|
||||||
|
type: DataTypes.STRING,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
created_at: {
|
||||||
|
type: DataTypes.DATE,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tableName: 'offer_created',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = OfferCreated;
|
||||||
63
src/models/offerDetailsSet.js
Normal file
63
src/models/offerDetailsSet.js
Normal file
|
|
@ -0,0 +1,63 @@
|
||||||
|
const { DataTypes } = require('sequelize');
|
||||||
|
const sequelize = require('../database');
|
||||||
|
|
||||||
|
const OfferDetailsSet = sequelize.define(
|
||||||
|
'OfferDetailsSet',
|
||||||
|
{
|
||||||
|
uuid: {
|
||||||
|
type: DataTypes.UUID,
|
||||||
|
allowNull: false,
|
||||||
|
unique: true,
|
||||||
|
primaryKey: true,
|
||||||
|
},
|
||||||
|
offer_uuid: {
|
||||||
|
type: DataTypes.STRING,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
wants: {
|
||||||
|
type: DataTypes.STRING,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
premium: {
|
||||||
|
type: DataTypes.NUMBER,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
min_trade_amount_eur: {
|
||||||
|
type: DataTypes.NUMBER,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
max_trade_amount_eur: {
|
||||||
|
type: DataTypes.NUMBER,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
location_details: {
|
||||||
|
type: DataTypes.TEXT,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
time_availability_details: {
|
||||||
|
type: DataTypes.TEXT,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
is_onchain_accepted: {
|
||||||
|
type: DataTypes.BOOLEAN,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
is_lightning_accepted: {
|
||||||
|
type: DataTypes.BOOLEAN,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
are_big_notes_accepted: {
|
||||||
|
type: DataTypes.BOOLEAN,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
created_at: {
|
||||||
|
type: DataTypes.DATE,
|
||||||
|
allowNull: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
tableName: 'offer_details_set',
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = OfferDetailsSet;
|
||||||
Loading…
Add table
Add a link
Reference in a new issue