fradrive/models/avs.model
2022-10-28 15:08:26 +02:00

32 lines
1.0 KiB
Plaintext

-- SPDX-FileCopyrightText: 2022 Steffen Jost <jost@tcs.ifi.lmu.de>
--
-- SPDX-License-Identifier: AGPL-3.0-or-later
-- Tables to save data received AVS
-- When creating an AvsUser the following cases are possible:
-- 1. User does not exist, hence a new UserId ought to be created.
-- 2. User does exists and can be matched by UserCompanyPersonalNumber
-- 3. User does exists but cannot be matched now :(
-- How can the matching be performed later?
-- Do we need to merge users?
-- > Handler.Utils.UsersassimilateUser
UserAvs
personId AvsPersonId -- unique identifier for user throughout avs
user UserId
UniqueUserAvsUser user
UniqueUserAvsId personId
deriving Generic
-- Multiple UserAvsCards per UserAvs is possible and not too uncommon.
-- Purpose of saving cards is to detect external changes in qualifications and postal addresses
UserAvsCard
personId AvsPersonId
cardNo AvsCardNo
card AvsDataPersonCard
lastSynch UTCTime
UniqueAvsCard cardNo
deriving Generic