close war and manage tie
This commit is contained in:
parent
d766befd31
commit
71e987304b
7 changed files with 185 additions and 55 deletions
|
|
@ -50,3 +50,20 @@ class CampaignClosureWorkflow(ClosureWorkflow):
|
|||
)
|
||||
ties = TieResolver.find_campaign_ties(war, campaign.id)
|
||||
ClosureService.finalize_campaign(campaign)
|
||||
|
||||
|
||||
class WarClosureWorkflow(ClosureWorkflow):
|
||||
|
||||
def start(self, war: War) -> None:
|
||||
ClosureService.check_war_closable(war)
|
||||
ties = TieResolver.find_war_ties(war)
|
||||
while ties:
|
||||
bids_map = self.app.wars.resolve_ties(war, ties)
|
||||
for tie in ties:
|
||||
bids = bids_map[tie.context_id]
|
||||
TieResolver.apply_bids(war, tie.context_type, tie.context_id, bids)
|
||||
TieResolver.resolve_tie_state(
|
||||
war, tie.context_type, tie.context_id, tie.participants, bids
|
||||
)
|
||||
ties = TieResolver.find_war_ties(war)
|
||||
ClosureService.finalize_war(war)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue