import React from 'react';
export let types = {
id: {
name: 'id',
type: 'string',
description: (
UUID
),
},
month: {
name: 'month',
type: 'string',
description: YYYY-MM,
},
date: {
name: 'date',
type: 'string',
description: YYYY-MM-DD,
},
amount: {
name: 'amount',
type: 'integer',
description: (
A currency amount is an integer representing the value without any
decimal places. Usually it{"'"}s value * 100, but it
depends on your currency. For example, a USD amount of{' '}
$120.30 would be 12030.
),
},
};
export let objects = {
transaction: [
{
name: 'id',
type: types.id,
},
{ name: 'account', type: types.id, required: true },
{ name: 'date', type: 'date', required: true },
{ name: 'amount', type: types.amount },
{
name: 'payee',
type: types.id,
description: (
In a create request, this overrides{' '}
payee_name.
),
},
{
name: 'payee_name',
type: 'string',
description: (
id of the transaction in the other
account for the transfer. See transfers.
),
},
{
name: 'cleared',
type: 'boolean',
description: (
A flag indicating if the transaction has cleared or not.
),
},
{
name: 'subtransactions',
type: 'Transaction[]',
description: (
false
),
},
{
name: 'closed',
type: 'bool',
description: (
Defaults to false
),
},
],
category: [
{ name: 'id', type: types.id },
{ name: 'name', type: 'string', required: true },
{ name: 'group_id', type: types.id, required: true },
{
name: 'is_income',
type: 'bool',
description: (
Defaults to false
),
},
],
categoryGroup: [
{ name: 'id', type: types.id },
{ name: 'name', type: 'string', required: true },
{
name: 'is_income',
type: 'bool',
description: (
Defaults to false
),
},
{
name: 'categories',
type: 'Category[]',
description: (
get.
id of the account this payee transfers to/from, if
this is a transfer payee.
),
},
],
payeeRule: [
{ name: 'id', type: types.id },
{ name: 'payee_id', type: types.id, required: true },
{
name: 'type',
type: 'string',
required: true,
description: (
Must be one of equals or contains
),
},
{
name: 'value',
type: 'string',
description: 'Value to match imported payee names on',
},
],
};
function Table({ style, headers, className, children }) {
return (
| {header} | ))}
|---|
{name}
{type}
{field.name}
|
{typeof field.type === 'string'
? field.type
: field.type.name}
|
{field.required ? 'yes' : 'no'} | {field.description} |
{name}({args.map(arg => ).map(insertCommas)}){' '}
→ {returns}