transfer into an existing resource hands the source resource's rights and custody to the receiver
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 78/100
Direzione di ricerca
Leggi il ramo to_resource_inventoried_as_id in src/zenflows/vf/economic_event/domain.ex intorno alle righe 980–990 e confrontalo con il ramo intorno alle righe 1023–1029. Aggiungi un test per un trasferimento parziale in test/vf/economic_event/domain.test.exs, basato sul test esistente di :to_resource_inventoried_as, e verifica l’accountable e il custodian della risorsa di origine. Il lavoro è completato quando la risorsa di origine conserva entrambi dopo un trasferimento parziale verso una risorsa esistente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
When a transfer names an existing destination (toResourceInventoriedAs), the update of the source resource also sets its primaryAccountable and custodian to the receiver:
|> Multi.update_all("#{key}.set_and_dec",
where(EconomicResource, id: ^evt.resource_inventoried_as_id),
set: [
previous_event_id: evt.id,
primary_accountable_id: evt.receiver_id,
custodian_id: evt.receiver_id,
],
inc: [ ...negate(resource_quantity)... ])
A partial transfer (for example 2 of 5 units into the buyer's existing resource) therefore gives the receiver the rights and custody of the 3 units the provider kept. The branch without a destination keeps the source's owner (set: [previous_event_id: evt.id] only, L1023-L1029). That is what we'd expect in both cases.
The existing test "pass with :to_resource_inventoried_as" transfers the whole accounting quantity and does not assert the source's accountable or custodian afterwards, so this goes unnoticed.
Proposal
In the to_resource_inventoried_as_id branch, set only previous_event_id on the source, as the other branch does. Add a test with a partial transfer into an existing resource that asserts the source keeps its accountable and custodian.
If moving ownership of the source is intended (for example, only for full transfers), it should be conditioned on the transfer emptying the resource, and documented.
The marketplace does not use toResourceInventoriedAs today: each sale creates a new resource for the buyer. Reusing the buyer's existing resource with N-unit sales (interfacerproject/interfacer-gui#962) would hit this. Read from the code at 91be858, not reproduced against a running instance.
Generated by Claude Code
- Lingua principale
- Elixir
- Stelle
- 18
- Fork
- 4
- Merge medio
- 22g 17h
- PR unite (30g)
- 1
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di interfacerproject/zenflows
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 78/100
-
bug workstream:authz-integration
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
-
workstream:authz-integration
Difficoltà 5/5 Più di una settimana Idoneità per principianti 5/100
interfacerproject/zenflows#74 · 12 commenti ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Allow users to register with email addressesForse di nuovo libera @protodeniz l’ha presa 1302 giorni fa e non c’è nessuna pull request aperta. Aperta
interfacerproject/zenflows#54 · 1 assegnatario ·
Tutte le issue di interfacerproject/zenflows
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
intellij-elixir/intellij-elixir#4938 ·
I maintainer di solito rispondono entro 1 giorno
-
Attribute selectors match elements without the attribute; [x^=''] matches everythingForse già presa @bardrop l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
expert-lsp/expert#1040 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
ash-project/ash_mysql#278 · 2 commenti ·
-
L: github:actions L: javascript
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
dependabot/dependabot-core#17100 ·
I maintainer di solito rispondono entro 2 giorni