Data & evidence
Model partial refunds without deleting history
A restaurant can receive a refund request while an earlier refund is still unresolved. If the operator subtracts only completed refunds from the original payment, the screen can appear to have more capacity than is genuinely uncommitted. If an unclear network outcome is treated as failure, a new request may duplicate an instruction that later succeeds. A useful control distinguishes customer entitlement, refund approval, processing state and the remaining amount available for another instruction.
This workshop creates an original state ledger for fictional Pine Harbour Dining. A captured payment is 10,000 integer minor units. One refund of 2,500 succeeded, one of 3,000 has an unknown processing outcome, and one of 2,000 definitively failed under the invented evidence. The conservative capacity for another request is 4,500: original capture less successful refunds and unresolved reserved instructions.
The interactive tool lets you resolve the uncertain instruction, propose another amount and compare two requests that each fit an old snapshot but exceed capacity together. It also demonstrates replay identity, conflicting requests and terminal-state refusal. All records are synthetic. Nothing is sent to a provider, no customer money moves and the model does not decide whether a person is legally or commercially entitled to a refund.
The framework is intentionally narrower than a complete payment integration. Actual provider states, dispute processes, cancellation rights, currencies and processing guarantees need their own verified contract. The case teaches the evidence and conservation rules that prevent a local planning table from turning uncertainty into apparently free capacity.
TRY THE CASE
Unknown is reserved, not a failed refund
Fictional inputs and stated model boundaries. The worked calculations and downloadable records below remain available without JavaScript.
- Establish the exact accepted captured payment and native unit
- Reconcile all relevant refund-attempt identities and supported outcomes
- Reserve pending and unknown instructions without claiming completion
- Obtain authoritative evidence before resolving uncertainty
- Check a new request against successful plus reserved capacity
- Reuse exact supported operation identity for a replay and reject changed payload conflicts
- Apply an appropriate atomic production reservation design separately from this sequential simulation
- Reconcile outcomes and preserve entitlement, approval and settlement questions outside the capacity result
1. Separate the original capture from the restaurant order
The monetary ceiling in this exercise belongs to one accepted captured-payment identity, CAP-A. It does not belong automatically to an order total or a bank payout. An order can involve several payments, a payout can combine many orders, and an authorisation is not always a completed capture. Establish the actual payment relationship before calculating refund capacity.
CAP-A has a supported captured amount of 10,000 minor units in one fictional currency MU, with one hundred minor units per MU. That makes the amount 100 MU. The capture is assumed accepted and final for this bounded fixture. The model contains no additional capture, chargeback, currency conversion or transfer between payments.
The refund capacity is a processing constraint under the stated local policy. It is not a determination of customer rights, revenue recognition or remaining restaurant profit. A customer could have a valid claim that requires a different authorised settlement route, while a local payment can have capacity for a request that lacks refund authority. Those conditions need separate evidence.
Keep the source payment identifier and its namespace with every refund attempt. A familiar order reference is insufficient if it could refer to another captured charge. The teaching model rejects a request for another capture or currency instead of combining unlike balances. Production adaptation must establish the actual provider and account scope of those identities.
2. Read the three existing refund attempts
R1 is a refund instruction for 2,500 minor units. The fixture has a supported succeeded outcome. R2 is an instruction for 3,000 with an unknown outcome: the company cannot yet establish whether the provider completed, rejected or is still processing it. R3 is an instruction for 2,000 with a definitively failed outcome under the fictional evidence.
The sum of successful refunds is 2,500. The sum of pending or unknown reserved instructions is 3,000. The failed attempt reserves zero under this declared policy because its definitive failure is supported. The resulting uncommitted capacity is 10,000 less 2,500 less 3,000, which equals 4,500.
Do not add the failed 2,000 to successful refunds, and do not treat all three attempted amounts as money paid back. The attempted total is 7,500, but it mixes different processing states. The state ledger retains that history while presenting successful, reserved and failed populations separately.
The original attempt CSV and complete state and expected-answer dataset contain all values and evidence labels. They are not extracts from any real provider. The initial rows are an accepted snapshot of three attempts; the calculator does not claim to reconstruct the entire historical event stream from a table of current statuses.
3. Define the local conservation equation
The declared equation is captured amount equals successful refund amount plus unresolved reserved amount plus remaining uncommitted capacity. Definitively failed attempts remain in history but do not consume current capacity under the accepted evidence. In the baseline, 10,000 equals 2,500 plus 3,000 plus 4,500.
This equation should hold after every accepted local reservation or supported outcome change. It is a useful invariant because it makes double use of the same captured amount visible. A negative remaining amount is not a rounding inconvenience; it indicates that the current fixture or proposed combined instruction violates the declared capacity rule.
The equation is not a bank reconciliation. Successful processing status and actual customer-bank visibility can require separate evidence in a real integration. Provider fees, merchant settlement, dispute cash movements and accounting entries are outside this simple capacity equation. Do not add those unlike concepts merely because they share a currency symbol.
The model uses integer minor units, so no decimal tolerance is needed for its capacity boundary. A request of 4,500 exactly fits the baseline, while 4,501 exceeds it by one minor unit. Actual currencies do not all share this fixture's one-hundred scale; production systems must use the supported native currency unit rather than assume every amount is cents.
4. Preserve unknown outcomes as reserved capacity
R2's unknown status is not equivalent to definitively failed. A connection can break after an external service has received an instruction but before the local system receives a final acknowledgement. The business may know that an instruction was attempted without knowing its eventual effect. Freeing its amount simply because the screen timed out creates a duplicate-processing risk.
The local teaching rule therefore reserves the full 3,000 while R2 is pending or unknown. This is a conservative capacity policy, not a claim that every provider uses the same vocabulary or that the refund has already reached the customer. The record should display uncertainty explicitly so staff do not promise a completed result that has not been established.
Assign the unresolved attempt a specific evidence action. It may require checking the authoritative provider object, processing event, idempotency response or another supported reconciliation route. The correct source and timing depend on the actual integration. A local refresh or a new request identity does not prove that the old external instruction failed.
Keep the distinction near the amount. A report showing refunded 5,500 would be misleading because only 2,500 succeeded in the fixture. A report showing available 7,500 would also be misleading because it ignores the unresolved 3,000 reservation. The useful presentation is successful 2,500, unresolved reserved 3,000 and uncommitted 4,500.
5. Resolve the uncertain instruction with supported evidence
If R2 later succeeds, successful refunds become 5,500 and reserved unresolved amount becomes zero. Remaining capacity stays 4,500. The amount moved from a reserved state to a completed state; it did not become an additional refund on top of the same reservation. This transition must not subtract the 3,000 twice.
If R2 definitively fails, successful refunds remain 2,500 and unresolved reserved amount becomes zero. Remaining capacity rises to 7,500. The released 3,000 is newly uncommitted capacity under the local processing policy. It is not cash received from a customer, profit or proof that the customer no longer has a valid refund claim.
If R2 moves from unknown back to pending after authoritative evidence clarifies that it is still processing, the reservation remains 3,000 and capacity remains 4,500. The uncertainty description changes, but the conservative amount constraint does not. This is a useful example of a meaningful status change that does not change the numerical balance.
The model requires a nonblank evidence reference for a supported resolution. That checks the completeness of the teaching record; it does not authenticate the referenced document or provider response. A production process must establish which evidence can support each transition and who is authorised to rely on it.
Preserve the previous status, new status, evidence and sequence. Overwriting unknown with failed would lose the reason a later request became possible. A future reviewer should be able to reconstruct what was known when the company reserved another amount, rather than judge the original decision only from the final state visible today.
6. Test an additional request against current capacity
The default proposed request is 4,500 minor units. Under the baseline successful and unresolved states, it fits exactly. A local reservation for that distinct request would raise unresolved reserved amount from 3,000 to 7,500, leave successful amount at 2,500 and reduce remaining capacity to zero. The sum still equals the original capture of 10,000.
Proposing 5,000 exceeds baseline capacity by 500. The model reports the amount gap and does not create a reservation for a rejected request. It should not silently reduce the requested amount to 4,500 or split it into smaller requests. Any changed customer settlement or amount requires a separately valid decision and evidence under the real process.
After supported failure of R2, a 5,000 proposal fits the new 7,500 capacity and leaves 2,500. That is a changed information state, not evidence that the original rejection was wrong. Preserve which outcome evidence was available at each decision, so the organisation can explain why the same amount received different capacity results at different times.
A zero proposal is invalid in this teaching instruction mode. Zero can be a valid balance, but it is not a useful new monetary refund attempt here. Negative or fractional minor-unit amounts also fail. The validation message should explain the supported unit and range rather than convert an invalid input into an apparently successful request.
7. Expose the shared-capacity concurrency problem
Consider two independent new requests, X1 and X2, each for 3,500 minor units against the baseline remaining capacity of 4,500. Viewed separately from the same old snapshot, each appears to fit and would leave 1,000. Those two individual conclusions cannot be added together as if each had exclusive access to the full original capacity.
Together the requests require 7,000, exceeding available 4,500 by 2,500. A fresh combined capacity assessment must fail that batch. The calculator displays both individual hypothetical results and the combined amount, preserving the reason for the different conclusion. A report that only lists two green individual checks would conceal the shared constraint.
The sequential reservation demonstration applies X1 first and then recalculates for X2. X1 reserves 3,500 and leaves 1,000. X2 then fails by 2,500 and creates no new reservation. Reversing the order would change which request obtained the capacity, so the example is not a recommendation about customer priority or fairness.
A production multi-user system needs an appropriate atomic check-and-reserve design. Two independent read-then-write operations can both see 4,500 before either commits. A local browser calculation does not implement transaction isolation or guarantee that a provider and database agree. The architecture needs actual concurrency, retry and reconciliation tests in the authorised environment.
Do not solve the race by hiding one request after the fact. Preserve both intents, their evidence, the accepted reservation and the rejected or unresolved result. The actual business must determine priority and authorised next action. The mathematical control's job is to prevent the same capacity from being committed twice without a supported change.
8. Use stable request identities for retries
A retry of the same logical instruction should preserve its supported operation identity under the actual integration contract. Creating a new identifier merely because a response was unclear can turn one intended refund into two independently processed instructions. A request identity should be linked to its capture, amount, currency, purpose and relevant evidence.
The teaching reservation function treats an exact repeated request identity and identical amount as a replay of the same local reservation. It returns the existing state without reserving the amount again. Reusing that identity with a different amount is a conflict and causes refusal. This makes the distinction between a retry and a changed instruction inspectable.
An idempotency key does not establish refund authority or available capacity by itself. It helps a supported service recognise a repeated operation under its defined rules. The local business still needs to decide whether the instruction is valid and ensure that the capacity check and reservation are coherent. A well-deduplicated unauthorised request remains unauthorised.
Provider behaviour is specific. Stripe's idempotent-request documentation describes its own retry semantics and distinguishes API-version behaviour. That is an example of why an integration must verify the actual contract rather than assume one universal retry rule. The local teaching model does not reproduce every Stripe API feature or make a guarantee about another provider.
Preserve identity retention and expiry requirements from the real contract. A key that once identified an operation may not provide the same protection indefinitely. This guide deliberately supplies no universal retry duration or advice to resend after a fixed interval. Resolve the authoritative operation state and follow the supported provider and company process.
9. Distinguish an attempt from a customer entitlement
R3's definitive failure means its attempted 2,000 does not consume capacity in the accepted snapshot. It does not mean the restaurant no longer owes any response to the customer. The customer's underlying claim, approved amount and permitted settlement route require separate records and decisions. Processing failure should not silently close the service case.
Likewise, a successful partial refund does not automatically resolve every complaint related to the order. The evidence desk should connect the attempt to the approved case without treating the payment status as a complete customer outcome. A company may need to communicate the supported processing state and continue an unresolved service investigation through its authorised process.
If a failed attempt is legitimately retried, distinguish the new processing attempt from the same underlying approved entitlement. The actual system must prevent two successful attempts from satisfying the same obligation twice if both later complete. The bounded laboratory does not implement a multi-provider entitlement ledger; it identifies that additional requirement rather than pretend capacity alone solves it.
Refund capacity also does not settle recognition or tax questions. A provider's successful status, a customer-bank posting, a contractual entitlement and an accounting adjustment are related but distinct events. The correct treatment depends on the actual transaction and applicable framework. Keep the operational state machine narrow enough that its output is not mistaken for those broader conclusions.
10. Define permitted transitions and terminal states
The teaching state vocabulary is pending, unknown, succeeded and failed. Pending and unknown reserve the amount. Succeeded consumes the amount as a completed refund. Failed reserves nothing when definitive failure is supported. A pending or unknown attempt may move to another supported state with evidence, while a completed terminal outcome cannot simply be overwritten.
R1 is already succeeded. Attempting to change it to failed would be refused. That does not assert that real providers can never correct their records; it means such a correction requires an explicit supported reversal or correction model outside this simple transition mode. A status edit must not erase a previously completed amount without preserving the actual evidence and monetary effect.
R3 is already failed. The model refuses changing it directly to succeeded through the ordinary unresolved-resolution function. A real later correction or a new attempt needs its appropriate identity and evidence route. Otherwise an operator could repeatedly toggle terminal states to manufacture capacity or make the history fit a desired result.
The current state snapshot and the transition record serve different purposes. The snapshot supports a present capacity calculation. The transition record explains how the state changed. Preserve both when designing production controls, and define event order, evidence availability and duplicate handling explicitly rather than infer chronology from an arbitrary file sort.
The laboratory's transitions are sequential pure calculations on copied objects. It does not persist an append-only production ledger, authenticate actors or process external webhooks. Those capabilities need an appropriate implementation and tests. The simple model remains valuable because its allowed and refused behaviours are explicit and independently reproducible.
11. Separate webhook delivery from business outcome
An external status event can be delivered more than once, arrive later than another event or refer to an operation the local system has not yet linked. A delivery acknowledgement is not the same as the underlying refund completing. Preserve provider event identity, operation identity and the supported current-state relationship under the real integration contract.
A duplicated success message should not add the same successful refund amount twice. A stale pending message should not automatically overwrite a later supported success. Resolving such cases requires the actual provider's event and object semantics, not a universal highest-status ranking invented by an analyst. The teaching snapshot assumes the current statuses have already been reconciled.
An unknown local result can coexist with an authoritative completed provider object. The next reconciliation should establish that relationship and record the supported transition. Conversely, a local intent record is not proof that an instruction ever reached the provider. Treat intent, submission, acknowledgement and outcome as separate evidence where they matter to the actual process.
The original event-ledger pattern helps preserve replay identity and version conflicts, but the refund capacity policy adds another constraint: the amounts reserved and completed across related attempts must remain within the supported capture. A system can deduplicate every event correctly and still overcommit capacity if it ignores in-flight instructions or races between requests.
Production integration tests should therefore challenge both layers. Test duplicate deliveries, delayed outcomes, unknown identities, conflicting payloads, stale updates and concurrent reservations with the appropriate provider-supported environment. A successful calculator baseline is not evidence that those external message-handling properties have been verified.
12. Preserve money units and payment boundaries
All fixture amounts are integer minor units of MU. The model rejects unlike currencies or capture identities. It does not translate currencies, combine separate captures or assume that a fee can be refunded through the same amount ceiling. Those relationships need actual supported rules. A cross-currency accounting equivalent does not establish executable capacity in the original payment unit.
The capture amount must also be the supported captured amount, not an original basket estimate or an uncaptured authorisation. If capture changes through a valid additional event, the model needs a controlled revised capture basis and corresponding history. Do not edit the ceiling merely because a new request otherwise fails.
Existing successful refunds must be complete for the capacity question. A local table omitting a successful instruction from another authorised route can overstate remaining capacity even while its arithmetic is internally correct. Reconcile the full relevant operation population and preserve unresolved integration coverage before relying on the displayed available amount.
The model rejects a snapshot whose successful and reserved amounts already exceed the capture. It does not clip capacity to zero and hide the excess. Such a case requires investigation of source population, duplicate identities, capture basis or external operations. The invariant should expose the conflict rather than cosmetically repair it.
For fractional inputs, preserve the source and investigate the unit. A value of 45.50 in a field defined as minor units is not automatically 4,550. Converting without evidence can change the amount by a factor of one hundred. The teaching function accepts only whole minor units and leaves other representations to an explicitly reviewed conversion process.
13. Interpret provider documentation within its own scope
Stripe's refund documentation describes provider-specific refund states and the possibility of multiple partial refunds within an original charge amount. It also describes circumstances where processing can remain pending. These facts illustrate why an actual integration must track operation state and original payment relationships. They are not asserted as behaviour of every payment provider or restaurant platform.
Pine Harbour's unknown-state reservation and transition policy are original local teaching design. The document does not claim Stripe defines that exact local ledger or approves this calculator. A real implementation must verify supported endpoints, currencies, payment methods, account arrangements, event semantics and current documentation for its own integration.
For database concurrency, PostgreSQL's transaction-isolation documentation explains why concurrent operations can interact and how isolation semantics differ. That provides context for the shared-capacity race. The browser demonstration does not run PostgreSQL or implement a complete transaction pattern, external-service transaction or distributed refund protocol.
The three sources support narrow concepts. None determines customer refund rights, restaurant approval thresholds, employee authority or the complete accounting treatment. The fixture amounts, reservation equation, unknown-state scenarios and exact boundary tests are original educational cases. Their credibility comes from inspectable assumptions and reproducible answers rather than an implied provider endorsement.
14. Design the operator view around actionable evidence
Display the capture identity and unit first, then successful amount, unresolved reserved amount and uncommitted capacity. Keep the underlying attempts available with their identities and statuses. A single refunded percentage would hide the difference between money completed and instructions still uncertain. A single available field without its components would make reconciliation difficult.
For a rejected proposal, show requested amount, current capacity and excess. A 5,000 request against 4,500 should identify a 500 gap. It should also show the unresolved R2 amount that affects the boundary. This helps the operator seek the relevant outcome evidence rather than create another identifier or repeatedly edit the amount until the screen turns green.
Keep refund approval separate from the capacity result. The tool's pass can say amount fits under stated accepted capture and reserved attempts. It should not say refund approved, customer paid or legally compliant. Those broader claims would invite users to act on conclusions the calculator cannot establish.
The concurrency panel should label individual checks hypothetical and based on the same starting snapshot. It then shows the combined request and the sequential reservation result. This makes the resource conflict visible without implying that one customer deserves priority. Actual queue policy and authorised handling belong to the business process.
For unknown outcomes, provide a clear evidence owner and status route in a production adaptation. A decorative retry button can create risk if it conceals operation identity or bypasses reconciliation. The public laboratory contains no live retry action. Its purpose is to make the reason for careful identity and state handling understandable before a real integration is designed.
15. Test equality, release and replay behaviour
The baseline must return successful 2,500, reserved 3,000 and capacity 4,500. Resolving R2 to succeeded must return successful 5,500, reserved zero and the same 4,500 capacity. Resolving it to failed must return successful 2,500, reserved zero and capacity 7,500. Resolving it to pending must preserve the original capacity.
A 4,500 new request must fit exactly and leave zero after its local reservation. A 4,501 request must fail by one. A 5,000 request must fail by 500 in the baseline and fit with 2,500 remaining after supported failure of R2. Rejected proposals must not create new attempts or alter the original snapshot.
Two 3,500 requests must each pass a separate hypothetical check, fail the combined 7,000 batch by 2,500, and produce one accepted and one rejected reservation in the declared sequential demonstration. The result must preserve which identity was processed first. It should not report two accepted reservations or a negative capacity hidden behind a zero display.
Replaying an already reserved request identity with the same supported amount must not reserve it again. Reusing that identity with a changed amount must raise a conflict. A resolution of a terminal succeeded or failed attempt must be refused by the ordinary transition function, and an unresolved transition without evidence must fail rather than free capacity by default.
Test malformed snapshots: duplicated attempt identity, missing capture reference, wrong currency, unsupported status, non-integer amount and already-overcommitted totals. All require visible refusal. A valid calculation after silently dropping an invalid row would be misleading because the dropped row might represent an actual pending instruction that still consumes capacity.
16. Assess a correction without rewriting prior decisions
Suppose authoritative evidence eventually shows R2 failed. The updated capacity becomes 7,500, but the original baseline decision used an unresolved status. Preserve both states. The earlier rejection of a 5,000 request was correct under the declared conservative policy and information then available; it should not be retroactively relabelled an error simply because uncertainty later resolved favourably.
If the authoritative evidence instead shows R2 succeeded, the capacity remains 4,500 and the completed-refund total changes. Review any customer communication that previously described the result as unknown. The amount constraint may be unchanged while the service-case state requires an authorised update. A numerical no-change result does not mean no operational action is needed.
If a new source reveals an omitted refund, investigate the earlier population-completeness failure. Preserve the corrected snapshot and the effect on decisions made from the old capacity. Do not classify every late discovery as an ordinary pending transition; an omitted existing operation is a different control issue from an honestly tracked unknown outcome.
Use a correction bridge showing capture changes, newly discovered attempts, supported outcome changes and new reservations separately. These mechanisms can alter the same capacity number but require different preventive actions. A source reconciliation issue, an external timeout and a concurrent reservation race should not all receive the generic remedy tell staff to check carefully.
The correction record should identify affected operation identities and actual downstream uses. A staff training note alone does not prove that an existing duplicate instruction was resolved or a customer received the supported outcome. Follow the actual company's reconciliation, service and authority processes while retaining evidence proportionate to the claim being closed.
17. Maintain the control as integrations grow
Assign owners for capture acceptance, operation identity, refund approval, provider-state mapping, capacity reservation and settlement reconciliation. A small team can combine roles where appropriate, but the evidence questions remain distinct. A larger organisation needs consistent concepts without assuming that every provider or outlet exposes identical states and timing.
Review the state mapping after provider changes. A new status can require a deliberate policy decision about whether capacity remains reserved. Treating an unrecognised state as failed would be particularly dangerous because it frees capacity without evidence. The teaching model refuses unknown vocabulary, leaving the actual mapping decision explicit.
Retain representative tests for baseline, unknown-to-success, unknown-to-failure, exact capacity, one-unit excess, duplicate replay, changed-payload conflict and concurrent requests. Production features such as multiple captures, disputes, reversals or cross-provider entitlements need their own supported models and independently reconstructible cases. They should not inherit correctness merely because this simpler calculator passes.
Monitor meaningful unresolved populations rather than only total successful refunds. An old unknown instruction may need investigation even when aggregate capacity remains positive. A repeated source-mapping error can create uncertainty that staff eventually work around. Review evidence quality, unresolved age and actual decision consequences under a proportionate company process rather than invent a universal resolution deadline.
The framework is valuable when another authorised colleague can explain the original capture, each attempt's supported state, the current reservation and the reason a proposed amount fits or fails. It should make uncertainty visible early enough for the proper action, while preserving the identities and history needed to avoid paying or reserving the same instruction twice.
18. Challenge a group total with two separate captures
Add a second independent teaching capture, CAP-B, for 6,000 minor units in the same fictional currency. Assume it has no refund attempts and therefore has 6,000 uncommitted capacity. CAP-A still has 4,500. A consolidated display can correctly report 10,500 total uncommitted capacity while remaining unable to fund a 5,000 instruction against CAP-A through that capture's refund route.
The CAP-A request still exceeds its own supported ceiling by 500. CAP-B's capacity belongs to another payment relationship. The current model deliberately rejects adding CAP-B attempts to CAP-A or changing a CAP-A request's capture merely to use another available amount. A common currency and restaurant owner do not erase the payment-specific relationship.
This is a counterexample to group-total reasoning, not a claim about every possible authorised alternative payment route. A company may have legitimate ways to settle a customer claim through a different supported process. That route needs its actual authority, customer relationship, evidence and reconciliation. It should not be represented as a refund of CAP-A when the executed transaction actually belongs to another payment or another settlement method.
The two-capture example also helps test reporting. A dashboard may provide group capacity for an operational overview, but its request form must show the selected capture and applicable local balance. If users see only 10,500 while entering a CAP-A request, the interface can encourage an invalid conclusion even though every aggregate formula is correct. Scope belongs beside the action, not only in a distant dictionary.
Now suppose another source reveals a previously omitted successful CAP-A refund of 1,000. CAP-A's corrected capacity becomes 3,500 while CAP-B remains 6,000. Group capacity is 9,500. The original default proposal of 4,500 no longer fits CAP-A and exceeds corrected capacity by 1,000. This is an accepted-population correction, not an unknown-to-failed transition and not a new customer request.
Record the newly discovered attempt under a distinct supported identity and investigate why the earlier source population omitted it. The correction should identify decisions made from the old 4,500 capacity, preserve their information cutoff and establish the appropriate next action. Do not merely overwrite the displayed available amount, because that would hide the cause and the possible effect on already reserved instructions.
The downloadable fixture includes these separate-capture and omitted-attempt checks. They reinforce the same conservation rule at the correct grain: reconcile each supported captured payment first, then aggregate an appropriately labelled overview. A group total can be useful, but it cannot grant capacity to a particular instruction whose own payment relationship has already reached its boundary.
19. Complete the refund-capacity workshop
Reproduce the baseline conservation equation on paper. Identify why R2 reserves 3,000 while R3 reserves nothing under the accepted evidence. Compare resolving R2 to succeeded and failed, and explain why one changes only the state composition while the other also increases uncommitted capacity. State that neither result independently decides customer entitlement or accounting treatment.
Test the 4,500 and 5,000 proposals, then repeat after supported failure of R2. Write the exact amount boundary and evidence state for each conclusion. Next evaluate X1 and X2 separately and together. Explain why two individual passes against one old snapshot do not establish a valid combined reservation and why the sequential demonstration is not a priority recommendation.
Finally, replay one accepted local request, change its amount under the same identity and try to overwrite a terminal outcome. A useful reviewer can explain which operations are idempotent replays, which are conflicts and which need another supported correction route. Use the full fixture and expected cases to compare identifiers and amounts, keeping the original synthetic snapshot unchanged.
The completed workpaper should state the capture basis, money unit, accepted attempt population, state mapping, evidence cutoff, successful and reserved amounts, proposed request and remaining limitations. That is the practical value of a refund state machine: an explainable boundary for the next instruction, supported by preserved uncertainty rather than an attractive total that assumes every unanswered request failed.
Research sources and scope
- www.postgresql.org — primary reference ↗Composite unique keys, not-null and foreign-key constraints can enforce explicitly defined row relationships; row CHECK constraints do not establish arbitrary cross-row guarantees.
- www.postgresql.org — primary reference ↗Exact numeric arithmetic is appropriate when exact monetary representation is required; display rounding and business rounding policy remain separate decisions.
Build on the foundations
These introductory resources are already available in the existing website library.
