Skip to content

Commit 06294d9

Browse files
chore: add enum for in_review (#119)
# 🤖 Linear Closes PAR-XXX ## Description ## Checklist before requesting a review - [ ] I have conducted a self-review of my code. - [ ] I have conducted a QA. - [ ] If it is a core feature, I have included comprehensive tests. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added two new application statuses: "CANCELLED" and "IN_REVIEW", allowing for more detailed tracking of application progress. - **Bug Fixes** - Improved validation to support the new application statuses. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents 37ebd66 + cfed17f commit 06294d9

6 files changed

Lines changed: 8 additions & 6 deletions

File tree

packages/processors/src/constants/enums.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@ export enum ApplicationStatus {
33
PENDING,
44
APPROVED,
55
REJECTED,
6+
CANCELLED,
7+
IN_REVIEW,
68
}

packages/processors/src/processors/strategy/helpers/applicationStatus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Application } from "@grants-stack-indexer/repository";
22

33
/**
4-
* Checks if an application status index is valid (between 1 and 3)
4+
* Checks if an application status index is valid (between 1 and 5)
55
* @see ApplicationStatus
66
*/
77
export function isValidApplicationStatus(status: number): boolean {
8-
return status >= 1 && status <= 3;
8+
return status >= 1 && status <= 5;
99
}
1010

1111
type StatusUpdateParams = {

packages/processors/test/strategy/directGrantsLite/handlers/updatedRegistration.handler.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ describe("DGLiteUpdatedRegistrationHandler", () => {
118118

119119
it("returns empty array for invalid status", async () => {
120120
mockEvent = createMockEvent(eventName, defaultParams, defaultStrategyId, {
121-
params: { status: "4" },
121+
params: { status: "10" },
122122
}); // Invalid status
123123

124124
handler = new DGLiteUpdatedRegistrationHandler(mockEvent, chainId, {

packages/processors/test/strategy/donationVotingMerkleDistributionDirectTransfer/handlers/updatedRegistration.handler.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe("DVMDUpdatedRegistrationHandler", () => {
121121
});
122122

123123
it("returns empty array if status is invalid", async () => {
124-
const invalidStatuses = ["0", "4", "10"];
124+
const invalidStatuses = ["0", "6", "10"];
125125
for (const status of invalidStatuses) {
126126
mockEvent = createMockEvent(eventName, defaultParams, defaultStrategyId, {
127127
params: { status },

packages/processors/test/strategy/easyRetroFunding/handlers/updatedRegistration.handler.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe("ERFUpdatedRegistrationHandler", () => {
121121
});
122122

123123
it("returns empty array if status is invalid", async () => {
124-
const invalidStatuses = ["0", "4", "10"];
124+
const invalidStatuses = ["0", "6", "10"];
125125
for (const status of invalidStatuses) {
126126
mockEvent = createMockEvent(eventName, defaultParams, defaultStrategyId, {
127127
params: { status },

packages/repository/src/types/application.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Address, ChainId } from "@grants-stack-indexer/shared";
22

3-
export type ApplicationStatus = "PENDING" | "REJECTED" | "APPROVED";
3+
export type ApplicationStatus = "PENDING" | "REJECTED" | "APPROVED" | "CANCELLED" | "IN_REVIEW";
44

55
export type StatusSnapshot = {
66
status: ApplicationStatus;

0 commit comments

Comments
 (0)