1
0

SEPA-Mandate signed date and patcher

This commit is contained in:
Michael Hoennig
2022-10-28 13:44:48 +02:00
parent 3b340a92ed
commit 64461fc4da
15 changed files with 261 additions and 34 deletions

View File

@ -29,7 +29,7 @@ map:
null: org.openapitools.jackson.nullable.JsonNullable
/api/hs/office/debitors/{debitorUUID}:
null: org.openapitools.jackson.nullable.JsonNullable
/api/hs/office/sepamandates/{debitorUUID}:
/api/hs/office/sepamandates/{sepaMandateUUID}:
null: org.openapitools.jackson.nullable.JsonNullable
/api/hs/office/memberships/{membershipUUID}:
null: org.openapitools.jackson.nullable.JsonNullable

View File

@ -15,6 +15,9 @@ components:
$ref: './hs-office-bankaccount-schemas.yaml#/components/schemas/HsOfficeBankAccount'
reference:
type: string
agreement:
type: string
format: date
validFrom:
type: string
format: date
@ -25,9 +28,21 @@ components:
HsOfficeSepaMandatePatch:
type: object
properties:
reference:
type: string
nullable: true
agreement:
type: string
format: date
nullable: true
validFrom:
type: string
format: date
nullable: true
validTo:
type: string
format: date
nullable: true
additionalProperties: false
HsOfficeSepaMandateInsert:
@ -44,6 +59,10 @@ components:
reference:
type: string
nullable: false
agreement:
type: string
format: date
nullable: false
validFrom:
type: string
format: date
@ -56,5 +75,6 @@ components:
- debitorUuid
- bankAccountUuid
- reference
- agreement
- validFrom
additionalProperties: false

View File

@ -10,6 +10,7 @@ create table if not exists hs_office_sepamandate
debitorUuid uuid not null references hs_office_debitor(uuid),
bankAccountUuid uuid not null references hs_office_bankaccount(uuid),
reference varchar(96) not null,
agreement date not null,
validity daterange not null
);
--//

View File

@ -102,6 +102,7 @@ call generateRbacIdentityView('hs_office_sepamandate', idNameExpression => 'targ
call generateRbacRestrictedView('hs_office_sepamandate',
orderby => 'target.reference',
columnUpdates => $updates$
agreement = new.agreement,
validity = new.validity
$updates$);
--//

View File

@ -31,8 +31,8 @@ begin
raise notice '- using debitor (%): %', relatedDebitor.uuid, relatedDebitor;
raise notice '- using bankAccount (%): %', relatedBankAccount.uuid, relatedBankAccount;
insert
into hs_office_sepamandate (uuid, debitoruuid, bankAccountuuid, reference, validity)
values (uuid_generate_v4(), relatedDebitor.uuid, relatedBankAccount.uuid, 'ref'||idName, daterange('20221001' , '20261231', '[]'));
into hs_office_sepamandate (uuid, debitoruuid, bankAccountuuid, reference, agreement, validity)
values (uuid_generate_v4(), relatedDebitor.uuid, relatedBankAccount.uuid, 'ref'||idName, '20220930', daterange('20221001' , '20261231', '[]'));
end; $$;
--//