Skip to content

Commit

Permalink
refactor: split changeset type
Browse files Browse the repository at this point in the history
  • Loading branch information
0xnigir1 committed Oct 29, 2024
1 parent 2147d4e commit 3d4df7b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/repository/src/types/changeset.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ import {
RoundRole,
} from "./round.types.js";

export type Changeset =
//TODO: see if in the future we move out of inline object types for changesets

type ProjectChangeset =
| {
type: "InsertProject";
args: {
Expand Down Expand Up @@ -60,7 +62,9 @@ export type Changeset =
args: {
projectRole: Pick<ProjectRole, "chainId" | "projectId" | "role" | "address">;
};
}
};

type RoundChangeset =
| {
type: "InsertRound";
args: {
Expand Down Expand Up @@ -123,7 +127,9 @@ export type Changeset =
args: {
roundRole: Pick<RoundRole, "chainId" | "roundId" | "role" | "address">;
};
}
};

type ApplicationChangeset =
| {
type: "InsertApplication";
args: NewApplication;
Expand All @@ -137,3 +143,7 @@ export type Changeset =
application: PartialApplication;
};
};

//TODO: add changeset for Donation and Payout tables

export type Changeset = ProjectChangeset | RoundChangeset | ApplicationChangeset;

0 comments on commit 3d4df7b

Please sign in to comment.