feat(backend): reactivate endpoint for dissolved colonies and inactive apiaries

Da fachliche Objekte nie hart geloescht werden (nur status +
deactivatedAt), fehlte bisher ein Weg, ein versehentlich aufgeloestes
Volk oder deaktivierten Bienenstand wieder zu aktivieren. Neue
POST :id/reactivate-Endpunkte setzen status zurueck auf ACTIVE und
loeschen deactivatedAt; ConflictException wenn bereits aktiv.
This commit is contained in:
Nick Szaunig committed 2026-08-23 11:37:06 +02:00
1 parent 4a9fdd5c71
commit 6346bfab1d
8 files changed
+144 -2

No files matched your search

+13
View File
@@ -195,4 +195,17 @@ describe('Colonies (e2e)', () => {
.send({ apiaryId: apiaryAId })
.expect(409);
});
it('reactivates a dissolved colony, and rejects reactivating an already-active one', async () => {
const response = await request(app.getHttpServer())
.post(`/api/v1/colonies/${colonyId}/reactivate`)
.set('Authorization', `Bearer ${beekeeperToken}`)
.expect(201);
expect((response.body as ColonyBody).status).toBe('ACTIVE');
await request(app.getHttpServer())
.post(`/api/v1/colonies/${colonyId}/reactivate`)
.set('Authorization', `Bearer ${beekeeperToken}`)
.expect(409);
});
});