The rule: at most one active badge per person
Each person has at most one active badge in the system. The rule is not enforced by a uniqueness constraint in the database, but by a transaction with a row lock when a badge is issued. In practice this means that two parallel prints for the same person do not create two active tokens: the second waits for the first and sees its result.
The administrator should understand the difference, because it affects how data is analysed. Duplicate active tokens are not searched for with a unique key, but through the issue history of the person. If the history shows two active entries for the same person, that is a signal to report, not a normal state.
What the exchange history records
Revoking a badge does not overwrite the old row. The system issues a new token, and the old one stays in the history as revoked. Each row of the history corresponds to one token, so an exchange creates a sequence of entries from the oldest to the current one.
From the audit point of view three facts matter most: which token was active on a given day, when it was revoked, and when the new label was printed. The security panel does not expose the token itself in API responses, only derived facts, so a report for an auditor can be prepared without revealing the value of the code.
- the issue date of each token,
- the revocation date of the old token,
- the print date of the label for the new token,
- the link to a person, not to a card number.
Link with the e-mail carrying the code
Each person receives the e-mail with the QR code at most once, thanks to an atomic flag in the database. A new badge after an exchange triggers a new e-mail with a new code. For the administrator this means that an exchange of a token has a predictable side effect: the person receives a new message, and the old e-mail loses its meaning.
The e-mail is sent only after the trainings required at the gate have been passed. A person without an e-mail address and without a phone receives a printout from security. When analysing an event it is therefore worth checking not only which token was active, but also whether the person was entitled to receive it on that day.
How to prepare the answer for an auditor
Good practice is to prepare a model query to the history and describe it in the administrator's manual. The query takes a person and a date, and returns the token active on that day together with its validity window. It is worth testing it on three cases: a person with one badge, a person with one exchange, and a person with several exchanges in one month.
A second practice is a periodic review of the history. Once a quarter the administrator checks whether any people have frequent exchanges. Repeated exchanges are usually a sign of lost badges or of visits that were not closed. The result of the review goes into the minutes and is another piece of evidence for the auditor.
What to avoid
Do not store tokens in spreadsheets or in messaging apps. The history in the system is a sufficient source, and copies of a token outside the system create a new asset to protect. Do not delete history rows by hand, even when they look like a mistake: replace them with an explanatory entry. A deleted row removes the ability to show what happened.
Checklist
Video
Frequently asked questions
Does the database block two active badges for one person?
The rule is enforced by a transaction with a row lock when a badge is issued, not by a uniqueness constraint in the database. Base analyses on the issue history.
What happens to the old token after an exchange?
It stays in the history as revoked. The system issues a new token, and the old row is not overwritten.
Will the person get a new e-mail after an exchange?
Yes. A new badge after an exchange triggers a new e-mail with a new code, and each person receives the e-mail at most once per token.
Let's prepare the evidence for the auditor
We will show the exchange history and how to demonstrate the active token on the day of an event. Book a conversation with the InnerWeb team.
Let's talk