LMS/E-Learning-Backend-main/app/models/payment_transactions.js
2025-09-01 19:37:35 +05:30

90 lines
2.8 KiB
JavaScript

module.exports = (sequelize, type) => {
const PaymentTransaction = sequelize.define('payment_transactions', {
id: {
type: type.INTEGER,
primaryKey: true,
autoIncrement: true
},
user_id: type.INTEGER,
name: type.TEXT,
email: type.TEXT,
address: type.TEXT,
country: type.TEXT,
city: type.TEXT,
state: type.TEXT,
zip: type.TEXT,
card_last4: type.TEXT,
card_type: type.TEXT,
expire_month: type.TEXT,
expire_year: type.TEXT,
payment_type: type.TEXT,//OneTime or Subscription
plan_id: type.INTEGER,
plan_description: type.TEXT,
access_duration: type.TEXT,
amount: type.TEXT,
payment_receipt: type.TEXT,
certi_id: type.INTEGER,
cohort_id: {
type: type.INTEGER,
defaultValue: 0
},
exam_date: type.TEXT,
status: {
type: type.INTEGER,
defaultValue: 0
},
payment_gateway: type.TEXT,
payment_status: type.TEXT,
mode: type.TEXT,
mode_int: type.TEXT,
base_product: type.TEXT,
base_product_name: type.TEXT,
base_product_label: type.TEXT,
base_product_owner: type.TEXT,
order_id: type.TEXT,
invoice_id: type.TEXT,
subscription_ids: type.TEXT,
order_date: type.TEXT,
order_timestamp: type.TEXT,
currency: type.TEXT,
customer_id: type.TEXT,
customer_identifier: type.TEXT,
ip_address: type.TEXT,
transactions: type.TEXT,
payment_res: type.TEXT,
welcome_mail: type.INTEGER, //0 welcome Mail Pending For Thivecart,1 welcome Mail Send For Thivecart (Base On Amount)
is_mini_masterclass_email_sent: {
type: type.INTEGER,
defaultValue: 1
},
notify_mail_count: type.INTEGER,
send_notify: type.TEXT,
//zapier fields
phone: type.TEXT,
last_name: type.TEXT,
contact_id: type.TEXT,
contact_owner_id: type.TEXT,
utm_campaign: type.TEXT,
utm_source: type.TEXT,
utm_content: type.TEXT,
active_campaign_message: type.TEXT,
nick_name: type.TEXT,
group_id: type.TEXT,
buyer_score: type.TEXT,
partial_payment: type.TEXT,
inspire_text: type.TEXT,
utl_medium: type.TEXT,
utl_term: type.TEXT,
contact_account_id: type.TEXT,
contact_company_id: type.TEXT,
contact_created_by: type.TEXT,
contact_lead_source_id: type.TEXT,
contact_groups: type.TEXT,
contact_validated: type.TEXT,
tier_essential: type.TEXT,
product_purchased: type.TEXT
})
return PaymentTransaction;
}