camper/test/new_invoice_amount.sql
jordi fita mas 17f7520876 Add customer and invoices sections
Copied as much as i could from Numerus, and made as few modifications as
i could to adapt to this code base; it is, quite frankly, a piece of
shit.

We need to be able to create invoices from scratch “just in case”,
apparently, but it is not yet possible to create an invoice from a
booking.
2024-04-28 20:28:45 +02:00

23 lines
693 B
PL/PgSQL

-- Test new_invoice_amount
set client_min_messages to warning;
create extension if not exists pgtap;
reset client_min_messages;
begin;
select plan(5);
set search_path to camper, public;
select has_composite('camper', 'new_invoice_amount', 'Composite type camper.new_invoice_amount should exist');
select columns_are('camper', 'new_invoice_amount', array['subtotal', 'taxes', 'total']);
select col_type_is('camper'::name, 'new_invoice_amount'::name, 'subtotal'::name, 'text');
select col_type_is('camper'::name, 'new_invoice_amount'::name, 'taxes'::name, 'text[]');
select col_type_is('camper'::name, 'new_invoice_amount'::name, 'total'::name, 'text');
select *
from finish();
rollback;