-- Fetch all the Invoices belonging to the Xero
-- account of a particular user.
SELECT *
FROM fiber.xero_invoice
WHERE account_id = '{user.xero_id}'
-- Fetch all the Invoices belonging to the Xero
-- account of a particular user.
SELECT *
FROM fiber.xero_invoice
WHERE account_id = '{user.xero_id}'
Code
CREATE TABLE fiber.xero_invoice (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
type TEXT,
contact JSONB,
date TIMESTAMP WITH TIME ZONE,
due_date TIMESTAMP WITH TIME ZONE,
date_string TEXT,
due_date_string TEXT,
status TEXT,
line_amount_types TEXT,
line_items JSONB,
sub_total TEXT,
total_tax TEXT,
total TEXT,
updated_date_utc TIMESTAMP WITH TIME ZONE,
currency_code TEXT,
invoice_id TEXT,
invoice_number TEXT,
payments JSONB,
amount_due TEXT,
amount_paid TEXT,
amount_credited TEXT
)
CREATE TABLE fiber.xero_invoice (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
type TEXT,
contact JSONB,
date TIMESTAMP WITH TIME ZONE,
due_date TIMESTAMP WITH TIME ZONE,
date_string TEXT,
due_date_string TEXT,
status TEXT,
line_amount_types TEXT,
line_items JSONB,
sub_total TEXT,
total_tax TEXT,
total TEXT,
updated_date_utc TIMESTAMP WITH TIME ZONE,
currency_code TEXT,
invoice_id TEXT,
invoice_number TEXT,
payments JSONB,
amount_due TEXT,
amount_paid TEXT,
amount_credited TEXT
)
Model definition