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:
1 parent
4a9fdd5c71
commit
6346bfab1d
8 files changed
+144
-2
No files matched your search
@@ -115,5 +115,16 @@ describe('Apiaries (e2e)', () => {
|
||||
.set('Authorization', `Bearer ${beekeeperToken}`)
|
||||
.expect(201);
|
||||
expect((deactivated.body as ApiaryBody).status).toBe('INACTIVE');
|
||||
|
||||
const reactivated = await request(app.getHttpServer())
|
||||
.post(`/api/v1/apiaries/${apiaryId}/reactivate`)
|
||||
.set('Authorization', `Bearer ${beekeeperToken}`)
|
||||
.expect(201);
|
||||
expect((reactivated.body as ApiaryBody).status).toBe('ACTIVE');
|
||||
|
||||
await request(app.getHttpServer())
|
||||
.post(`/api/v1/apiaries/${apiaryId}/reactivate`)
|
||||
.set('Authorization', `Bearer ${beekeeperToken}`)
|
||||
.expect(409);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user