Customer wants to require a down payment of 30 % for bookings made one week or more before the actual date, and to make the full payment otherwise. This would require yet another relation to keep these values. Fuck it; i added them to the function, as they are very unlikely to change. That forced me to change the test for draft_payment to use relative dates, otherwise there is no way i can have stable results in the future.
15 lines
297 B
PL/PgSQL
15 lines
297 B
PL/PgSQL
-- Deploy camper:percentage to pg
|
|
-- requires: schema_camper
|
|
|
|
begin;
|
|
|
|
set search_path to camper, public;
|
|
|
|
create domain percentage as numeric(3, 2)
|
|
check( value >= 0 and value <= 1 )
|
|
;
|
|
|
|
comment on domain percentage is 'a positive percentage without decimals, but represented as numeric';
|
|
|
|
commit;
|