Skip to content

Commit

Permalink
chore: set project to in progress on proposal enactment
Browse files Browse the repository at this point in the history
  • Loading branch information
1emu committed Jun 3, 2024
1 parent 70bbc32 commit c0e5e36
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/services/ProjectService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,4 +272,10 @@ export class ProjectService {
static async isAuthorOrCoauthor(user: string, projectId: string) {
return await ProjectModel.isAuthorOrCoauthor(user, projectId)
}

static async startProject(id: string) {
//TODO: when project is updated again (for example, another vesting is added) is the same method used?
//TODO: should validate that it goes into InProgress status only from Pending/Paused status?
await ProjectModel.update({ status: ProjectStatus.InProgress }, { proposal_id: id })
}
}
2 changes: 2 additions & 0 deletions src/services/ProposalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { getProfile } from '../utils/Catalyst'
import Time from '../utils/date/Time'

import { DiscourseService } from './DiscourseService'
import { ProjectService } from './ProjectService'
import { SnapshotService } from './SnapshotService'

export type ProposalInCreation = {
Expand Down Expand Up @@ -296,6 +297,7 @@ export class ProposalService {
const latestVesting = vesting_addresses![vesting_addresses!.length - 1]
const vestingContractData = await getVestingContractData(latestVesting, proposal.id)
await UpdateModel.createPendingUpdates(proposal.id, vestingContractData)
await ProjectService.startProject(proposal.id)
NotificationService.projectProposalEnacted(proposal)
}

Expand Down

0 comments on commit c0e5e36

Please sign in to comment.