PostNewCoopSharesTransaction

3

tests

0

failures

0

ignored

4.084s

duration

100%

successful

Tests

Test Duration Result
globalAdmin_canAddCoopSharesReversalTransaction() 1.513s passed
globalAdmin_canAddCoopSharesTransaction() 1.309s passed
globalAdmin_canNotCancelMoreSharesThanCurrentlySubscribed() 1.262s passed

Standard output

ContextBasedTestWithCleanup.retrieveInitialTestData
globalAdmin_canAddCoopSharesReversalTransaction(): TOTAL OBJECT COUNT (initial): 210 -> 210
toCleanup(HsOfficeCoopSharesTransactionEntity, 9f66cb48-cf88-4fb4-814e-bc8872051d8e)
HTTP/1.1 201 
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: http://localhost:39879/api/hs/office/coopsharestransactions/5a723283-c30d-46d9-a0a3-c142e0ec124a
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 10 Aug 2026 13:34:45 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "uuid": "5a723283-c30d-46d9-a0a3-c142e0ec124a",
    "membership.uuid": "0b9b1a3d-963d-4c3e-a94e-d507f5fcba93",
    "transactionType": "REVERSAL",
    "shareCount": -13,
    "valueDate": "2022-10-30",
    "reference": "test reversal ref",
    "comment": "some coop shares reversal transaction",
    "revertedShareTx": {
        "uuid": "9f66cb48-cf88-4fb4-814e-bc8872051d8e",
        "membership.uuid": null,
        "transactionType": "SUBSCRIPTION",
        "shareCount": 13,
        "valueDate": "2022-10-20",
        "reference": "test ref",
        "comment": null
    },
    "reversalShareTx": null
}
toCleanup(HsOfficeCoopSharesTransactionEntity, 5a723283-c30d-46d9-a0a3-c142e0ec124a)
ContextBasedTestWithCleanup.cleanupAndCheckCleanup
DELETING temporary HsOfficeCoopSharesTransactionEntity#5a723283-c30d-46d9-a0a3-c142e0ec124a deleted 1 rows
DELETING temporary HsOfficeCoopSharesTransactionEntity#9f66cb48-cf88-4fb4-814e-bc8872051d8e deleted 1 rows
globalAdmin_canAddCoopSharesReversalTransaction(): TOTAL OBJECT COUNT (after): 210 -> 210
ContextBasedTestWithCleanup.retrieveInitialTestData
globalAdmin_canAddCoopSharesTransaction(): TOTAL OBJECT COUNT (initial): 210 -> 210
HTTP/1.1 201 
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: http://localhost:39879/api/hs/office/coopsharestransactions/94a1fed8-edc5-4763-9f81-6b04cdbe1b55
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 10 Aug 2026 13:34:46 GMT
Keep-Alive: timeout=60
Connection: keep-alive

{
    "uuid": "94a1fed8-edc5-4763-9f81-6b04cdbe1b55",
    "membership.uuid": "0b9b1a3d-963d-4c3e-a94e-d507f5fcba93",
    "transactionType": "SUBSCRIPTION",
    "shareCount": 8,
    "valueDate": "2022-10-13",
    "reference": "temp ref A",
    "comment": "just some test coop shares transaction",
    "revertedShareTx": null,
    "reversalShareTx": null
}
ContextBasedTestWithCleanup.cleanupAndCheckCleanup
globalAdmin_canAddCoopSharesTransaction(): TOTAL OBJECT COUNT (after): 210 -> 210
ContextBasedTestWithCleanup.retrieveInitialTestData
globalAdmin_canNotCancelMoreSharesThanCurrentlySubscribed(): TOTAL OBJECT COUNT (initial): 210 -> 210
2026-08-10T13:34:47.740Z  WARN 378 --- [o-auto-1-exec-5] o.h.engine.jdbc.spi.SqlExceptionHelper   : SQL Error: 0, SQLState: P0001
2026-08-10T13:34:47.740Z ERROR 378 --- [o-auto-1-exec-5] o.h.engine.jdbc.spi.SqlExceptionHelper   : ERROR: [400] office.coop-shares.transaction-would-result-in-a-negative-number-of-shares
  Where: PL/pgSQL function hs_office.coopsharetx_enforce_positive_total() line 12 at RAISE
SQL statement "insert
            into hs_office.coopsharetx (uuid, version, membershipuuid, transactiontype, valuedate, sharecount, reference, revertedsharetxuuid, comment)
            values (new.uuid, new.version, new.membershipuuid, new.transactiontype, new.valuedate, new.sharecount, new.reference, new.revertedsharetxuuid, new.comment)
            returning *"
PL/pgSQL function hs_office.coopsharetx_instead_of_insert_tf() line 5 at SQL statement
HTTP/1.1 400 
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Type: application/json
Transfer-Encoding: chunked
Date: Mon, 10 Aug 2026 13:34:47 GMT
Connection: close

{
    "timestamp": "2026-08-10 01:34:47",
    "path": "",
    "statusCode": 400,
    "statusPhrase": "Bad Request",
    "message": "ERROR: [400] Geschäftsanteile-Transaktion würde zu negativen Geschäftsanteilen führen"
}
ContextBasedTestWithCleanup.cleanupAndCheckCleanup
globalAdmin_canNotCancelMoreSharesThanCurrentlySubscribed(): TOTAL OBJECT COUNT (after): 210 -> 210