diff --git a/doc/hs-office-data-structure.md b/doc/hs-office-data-structure.md index b84264d0..4b757b5b 100644 --- a/doc/hs-office-data-structure.md +++ b/doc/hs-office-data-structure.md @@ -115,7 +115,7 @@ classDiagram +BankAccount refundBankAccount +String defaultPrefix: mei } - debitor-MeierGmbH o-- partner-MeierGmbH + debitor-MeierGmbH o-- rel-MeierGmbH debitor-MeierGmbH *-- rel-MeierGmbH-Buha class contactData-MeierGmbH-Buha { diff --git a/src/main/resources/db/changelog/5-hs-office/506-debitor/5060-hs-office-debitor.sql b/src/main/resources/db/changelog/5-hs-office/506-debitor/5060-hs-office-debitor.sql index 3ea372f7..d0218863 100644 --- a/src/main/resources/db/changelog/5-hs-office/506-debitor/5060-hs-office-debitor.sql +++ b/src/main/resources/db/changelog/5-hs-office/506-debitor/5060-hs-office-debitor.sql @@ -8,7 +8,7 @@ create table hs_office_debitor ( uuid uuid unique references rbac.object (uuid) initially deferred, version int not null default 0, - debitorNumberSuffix char(2) not null check (debitorNumberSuffix::text ~ '^[0-9][0-9]$'), + debitorNumberSuffix char(2) not null check (debitorNumberSuffix::text ~ '^[0-9][0-9]$'), -- TODO.spec: more digits? max digits DATEV? debitorRelUuid uuid not null references hs_office_relation(uuid), billable boolean not null default true, vatId varchar(24), diff --git a/src/main/resources/db/changelog/5-hs-office/510-membership/5100-hs-office-membership.sql b/src/main/resources/db/changelog/5-hs-office/510-membership/5100-hs-office-membership.sql index 7fe4223e..1068157d 100644 --- a/src/main/resources/db/changelog/5-hs-office/510-membership/5100-hs-office-membership.sql +++ b/src/main/resources/db/changelog/5-hs-office/510-membership/5100-hs-office-membership.sql @@ -8,7 +8,7 @@ CREATE TYPE HsOfficeMembershipStatus AS ENUM ( 'INVALID', 'ACTIVE', 'CANCELLED', - 'TRANSFERRED', + 'TRANSFERRED', -- only in legally mandatory cases (e.g. community of heirs -> single heir) 'DECEASED', 'LIQUIDATED', 'EXPULSED', @@ -22,7 +22,7 @@ create table if not exists hs_office_membership uuid uuid unique references rbac.object (uuid) initially deferred, version int not null default 0, partnerUuid uuid not null references hs_office_partner(uuid), - memberNumberSuffix char(2) not null check (memberNumberSuffix::text ~ '^[0-9][0-9]$'), + memberNumberSuffix char(2) not null check (memberNumberSuffix::text ~ '^[0-9][0-9]$'), -- TODO.spec: more digits? validity daterange not null, status HsOfficeMembershipStatus not null default 'ACTIVE', membershipFeeBillable boolean not null default true, diff --git a/src/main/resources/db/changelog/5-hs-office/511-coopshares/5110-hs-office-coopshares.sql b/src/main/resources/db/changelog/5-hs-office/511-coopshares/5110-hs-office-coopshares.sql index 119b4a2a..f5fe88a5 100644 --- a/src/main/resources/db/changelog/5-hs-office/511-coopshares/5110-hs-office-coopshares.sql +++ b/src/main/resources/db/changelog/5-hs-office/511-coopshares/5110-hs-office-coopshares.sql @@ -4,7 +4,13 @@ --changeset michael.hoennig:hs-office-coopshares-MAIN-TABLE endDelimiter:--// -- ---------------------------------------------------------------------------- -CREATE TYPE HsOfficeCoopSharesTransactionType AS ENUM ('ADJUSTMENT', 'SUBSCRIPTION', 'CANCELLATION'); +CREATE TYPE HsOfficeCoopSharesTransactionType AS ENUM ( + 'ADJUSTMENT', + 'SUBSCRIPTION', + 'CANCELLATION', + 'TRANSFER', -- only for legally mandatory cases (member deceased) TODO.spec: clarify if that's true + 'ADOPTION' -- only for legally mandatory cases (member deceased) TODO.spec: clarify if that's true +); CREATE CAST (character varying as HsOfficeCoopSharesTransactionType) WITH INOUT AS IMPLICIT; diff --git a/src/main/resources/db/changelog/5-hs-office/512-coopassets/5120-hs-office-coopassets.sql b/src/main/resources/db/changelog/5-hs-office/512-coopassets/5120-hs-office-coopassets.sql index fa3ddf51..39fedd44 100644 --- a/src/main/resources/db/changelog/5-hs-office/512-coopassets/5120-hs-office-coopassets.sql +++ b/src/main/resources/db/changelog/5-hs-office/512-coopassets/5120-hs-office-coopassets.sql @@ -4,14 +4,16 @@ --changeset michael.hoennig:hs-office-coopassets-MAIN-TABLE endDelimiter:--// -- ---------------------------------------------------------------------------- -CREATE TYPE HsOfficeCoopAssetsTransactionType AS ENUM ('ADJUSTMENT', - 'DEPOSIT', - 'DISBURSAL', - 'TRANSFER', - 'ADOPTION', - 'CLEARING', - 'LOSS', - 'LIMITATION'); +CREATE TYPE HsOfficeCoopAssetsTransactionType AS ENUM ( + 'ADJUSTMENT', + 'DEPOSIT', + 'DISBURSAL', + 'TRANSFER', + 'ADOPTION', + 'CLEARING', + 'LOSS', + 'LIMITATION' +); CREATE CAST (character varying as HsOfficeCoopAssetsTransactionType) WITH INOUT AS IMPLICIT;