feat: Link transations with payment methods

This commit is contained in:
Ahmed Bouhuolia
2024-09-15 19:42:43 +02:00
parent 542e61dbfc
commit 430cf19533
21 changed files with 581 additions and 8 deletions

View File

@@ -0,0 +1,24 @@
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.up = function (knex) {
return knex.schema.createTable('payment_links', (table) => {
table.increments('id');
table.integer('tenant_id');
table.integer('resource_id');
table.text('resource_type');
table.string('linkId');
table.string('publicity');
table.datetime('expiry_at');
table.timestamps();
});
};
/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
exports.down = function (knex) {
return knex.schema.dropTableIfExists('payment_links');
};

View File

@@ -0,0 +1,26 @@
import { Model } from 'objection';
export class PaymentLink extends Model {
static get tableName() {
return 'payment_links';
}
/**
* Timestamps columns.
* @returns {string[]}
*/
static get timestamps() {
return ['createdAt', 'updatedAt'];
}
public tenantId!: number;
public resourceId!: number;
public resourceType!: string;
public linkId!: string;
public publicity!: string;
public expiryAt!: Date;
// Timestamps
public createdAt!: Date;
public updatedAt!: Date;
}

View File

@@ -8,6 +8,7 @@ import Invite from './Invite';
import SystemPlaidItem from './SystemPlaidItem';
import { Import } from './Import';
import { StripeAccount } from './StripeAccount';
import { PaymentLink } from './PaymentLink';
export {
Plan,
@@ -19,5 +20,6 @@ export {
Invite,
SystemPlaidItem,
Import,
StripeAccount
StripeAccount,
PaymentLink,
};