mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat: Link transations with payment methods
This commit is contained in:
@@ -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');
|
||||
};
|
||||
26
packages/server/src/system/models/PaymentLink.ts
Normal file
26
packages/server/src/system/models/PaymentLink.ts
Normal 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;
|
||||
}
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user