fix(client): lock CampaignStatusTag to escrow and derive in-production (Closes #146) - #219
Open
shinzoxD wants to merge 1 commit into
Open
Conversation
Keep CampaignStatusTag in lockstep with production_escrow CampaignStatus and treat Funded + released-tranche progress as a UI-only in-production state for the lifecycle stepper and status badge. Closes Cylo-Traders#146
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the client's on-chain
CampaignStatusTagwithcontracts/production_escrow/src/types.rsand treats in production as a presentational state for aFundedcampaign that has already released a tranche.Issue #146 was written against a snapshot where escrow had no
InProductionvariant. Master already emitsInProductionon firstrelease_tranche(PR #104). This PR:CampaignStatusTagas the on-chain union only (ON_CHAIN_CAMPAIGN_STATUS_TAGS), documented as distinct from UI-only derived statesstatus === 'Funded' && (tranches.some(t => t.released) || released > 0)so a mid-production Funded campaign is not stuck on the Funded stepACTIONABLE_STATUSESto real on-chain tags (Active,Funding,Funded,InProduction,Harvested,Disputed)pub enum CampaignStatusfromtypes.rsand fails if the client union driftsNo registry contract changes (those belong to #69 / PR #132). No overlap with #183.
Closes #146
Changes
client/src/lib/soroban/types.ts—ON_CHAIN_CAMPAIGN_STATUS_TAGSis the source ofCampaignStatusTagclient/src/lib/campaignStatus.ts—isDerivedInProduction/presentationalCampaignStatus/lifecycleStepIndex(status, progress);ACTIONABLE_STATUSESmoved hereclient/src/hooks/useAdminCampaigns.ts— uses the shared on-chain actionable listLifecycleStepper+CampaignAdminPanel— Funded + released amount advances to In ProductionTests
15 passed (7 parity/derivation + 4 stepper + 2 admin panel + 2 dashboard)
Scoped lint clean.
Payout wallet
GBVHELLD2JE235Y2NGTDT3MWI3T65ON6SY4N6FBHYVDAQ5FZC2CP5QXH