Skip to content

Commit

Permalink
Add missing stripe tables (twentyhq#5621)
Browse files Browse the repository at this point in the history
As title

Still adding not working tables / columns commented so we know why these
are not available.
  • Loading branch information
thomtrp committed May 28, 2024
1 parent 443fb53 commit ae6d5af
Showing 1 changed file with 103 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
import { DistantTables } from 'src/engine/metadata-modules/remote-server/remote-table/distant-table/types/distant-table';

/* Commented out tables / columns are either:
- not supported by the Stripe API
- not supported by the wrapper
*/

export const STRIPE_DISTANT_TABLES: DistantTables = {
accounts: [
{ columnName: 'id', dataType: 'text', udtName: 'text' },
{ columnName: 'business_type', dataType: 'text', udtName: 'text' },
{ columnName: 'country', dataType: 'text', udtName: 'text' },
{ columnName: 'email', dataType: 'text', udtName: 'text' },
{ columnName: 'type', dataType: 'text', udtName: 'text' },
{ columnName: 'created', dataType: 'timestamp', udtName: 'timestamp' },
],
balance_transactions: [
{ columnName: 'id', dataType: 'text', udtName: 'text' },
{ columnName: 'amount', dataType: 'bigint', udtName: 'int8' },
Expand All @@ -12,6 +25,17 @@ export const STRIPE_DISTANT_TABLES: DistantTables = {
{ columnName: 'type', dataType: 'text', udtName: 'text' },
{ columnName: 'created', dataType: 'timestamp', udtName: 'timestamp' },
],
// charges: [
// { columnName: 'id', dataType: 'text', udtName: 'text' },
// { columnName: 'amount', dataType: 'bigint', udtName: 'int8' },
// { columnName: 'currency', dataType: 'text', udtName: 'text' },
// { columnName: 'customer', dataType: 'text', udtName: 'text' },
// { columnName: 'description', dataType: 'text', udtName: 'text' },
// { columnName: 'invoice', dataType: 'text', udtName: 'text' },
// { columnName: 'payment_intent', dataType: 'text', udtName: 'text' },
// { columnName: 'status', dataType: 'text', udtName: 'text' },
// { columnName: 'created', dataType: 'timestamp', udtName: 'timestamp' },
// ],
customers: [
{ columnName: 'id', dataType: 'text', udtName: 'text' },
{ columnName: 'email', dataType: 'text', udtName: 'text' },
Expand All @@ -29,6 +53,12 @@ export const STRIPE_DISTANT_TABLES: DistantTables = {
{ columnName: 'status', dataType: 'text', udtName: 'text' },
{ columnName: 'created', dataType: 'timestamp', udtName: 'timestamp' },
],
// events: [
// { columnName: 'id', dataType: 'text', udtName: 'text' },
// { columnName: 'type', dataType: 'text', udtName: 'text' },
// { columnName: 'api_version', dataType: 'text', udtName: 'text' },
// { columnName: 'created', dataType: 'timestamp', udtName: 'timestamp' },
// ],
files: [
{ columnName: 'id', dataType: 'text', udtName: 'text' },
{ columnName: 'filename', dataType: 'text', udtName: 'text' },
Expand All @@ -48,6 +78,16 @@ export const STRIPE_DISTANT_TABLES: DistantTables = {
{ columnName: 'expired', dataType: 'bool', udtName: 'boolean' },
{ columnName: 'expires_at', dataType: 'timestamp', udtName: 'timestamp' },
],
invoices: [
{ columnName: 'id', dataType: 'text', udtName: 'text' },
{ columnName: 'customer', dataType: 'text', udtName: 'text' },
{ columnName: 'subscription', dataType: 'text', udtName: 'text' },
{ columnName: 'status', dataType: 'text', udtName: 'text' },
{ columnName: 'total', dataType: 'bigint', udtName: 'int8' },
{ columnName: 'currency', dataType: 'text', udtName: 'text' },
{ columnName: 'period_start', dataType: 'timestamp', udtName: 'timestamp' },
{ columnName: 'period_end', dataType: 'timestamp', udtName: 'timestamp' },
],
mandates: [
{ columnName: 'id', dataType: 'text', udtName: 'text' },
{ columnName: 'payment_method', dataType: 'text', udtName: 'text' },
Expand All @@ -58,10 +98,30 @@ export const STRIPE_DISTANT_TABLES: DistantTables = {
{ columnName: 'id', dataType: 'text', udtName: 'text' },
{ columnName: 'amount', dataType: 'bigint', udtName: 'int8' },
{ columnName: 'currency', dataType: 'text', udtName: 'text' },
// { columnName: 'arrival_date', dataType: 'text', udtName: 'text' },
{ columnName: 'description', dataType: 'text', udtName: 'text' },
// { columnName: 'statement_descriptor', dataType: 'text', udtName: 'text' },
{ columnName: 'status', dataType: 'text', udtName: 'text' },
{ columnName: 'created', dataType: 'timestamp', udtName: 'timestamp' },
],
prices: [
{ columnName: 'id', dataType: 'text', udtName: 'text' },
{ columnName: 'active', dataType: 'bool', udtName: 'boolean' },
{ columnName: 'currency', dataType: 'text', udtName: 'text' },
{ columnName: 'product', dataType: 'text', udtName: 'text' },
// { columnName: 'unit_amount', dataType: 'bigint', udtName: 'int8' },
{ columnName: 'type', dataType: 'text', udtName: 'text' },
{ columnName: 'created', dataType: 'timestamp', udtName: 'timestamp' },
],
products: [
{ columnName: 'id', dataType: 'text', udtName: 'text' },
{ columnName: 'name', dataType: 'text', udtName: 'text' },
{ columnName: 'active', dataType: 'bool', udtName: 'boolean' },
// { columnName: 'default_price', dataType: 'text', udtName: 'text' },
{ columnName: 'description', dataType: 'text', udtName: 'text' },
{ columnName: 'created', dataType: 'timestamp', udtName: 'timestamp' },
{ columnName: 'updated', dataType: 'timestamp', udtName: 'timestamp' },
],
refunds: [
{ columnName: 'id', dataType: 'text', udtName: 'text' },
{ columnName: 'amount', dataType: 'bigint', udtName: 'int8' },
Expand All @@ -72,6 +132,49 @@ export const STRIPE_DISTANT_TABLES: DistantTables = {
{ columnName: 'status', dataType: 'text', udtName: 'text' },
{ columnName: 'created', dataType: 'timestamp', udtName: 'timestamp' },
],
// setup_attempts: [
// { columnName: 'id', dataType: 'text', udtName: 'text' },
// { columnName: 'application', dataType: 'text', udtName: 'text' },
// { columnName: 'customer', dataType: 'text', udtName: 'text' },
// { columnName: 'on_behalf_of', dataType: 'text', udtName: 'text' },
// { columnName: 'payment_method', dataType: 'text', udtName: 'text' },
// { columnName: 'setup_intent', dataType: 'text', udtName: 'text' },
// { columnName: 'status', dataType: 'text', udtName: 'text' },
// { columnName: 'usage', dataType: 'text', udtName: 'text' },
// { columnName: 'created', dataType: 'timestamp', udtName: 'timestamp' },
// ],
// setup_intents: [
// { columnName: 'id', dataType: 'text', udtName: 'text' },
// { columnName: 'client_secret', dataType: 'text', udtName: 'text' },
// { columnName: 'description', dataType: 'text', udtName: 'text' },
// { columnName: 'customer', dataType: 'text', udtName: 'text' },
// { columnName: 'payment_method', dataType: 'text', udtName: 'text' },
// { columnName: 'status', dataType: 'text', udtName: 'text' },
// { columnName: 'usage', dataType: 'text', udtName: 'text' },
// { columnName: 'created', dataType: 'timestamp', udtName: 'timestamp' },
// ],
subscriptions: [
{ columnName: 'id', dataType: 'text', udtName: 'text' },
{ columnName: 'customer', dataType: 'text', udtName: 'text' },
{ columnName: 'currency', dataType: 'text', udtName: 'text' },
// {
// columnName: 'current_period_start',
// dataType: 'timestamp',
// udtName: 'timestamp',
// },
// {
// columnName: 'current_period_end',
// dataType: 'timestamp',
// udtName: 'timestamp',
// },
],
// tokens: [
// { columnName: 'id', dataType: 'text', udtName: 'text' },
// { columnName: 'type', dataType: 'text', udtName: 'text' },
// { columnName: 'client_ip', dataType: 'text', udtName: 'text' },
// { columnName: 'used', dataType: 'bool', udtName: 'boolean' },
// { columnName: 'created', dataType: 'timestamp', udtName: 'timestamp' },
// ],
topups: [
{ columnName: 'id', dataType: 'text', udtName: 'text' },
{ columnName: 'amount', dataType: 'bigint', udtName: 'int8' },
Expand Down

0 comments on commit ae6d5af

Please sign in to comment.