Skip to content

Commit

Permalink
Removed redundant isNote boolean type
Browse files Browse the repository at this point in the history
  • Loading branch information
Atharva-Kanherkar committed Apr 19, 2024
1 parent 200066a commit 670ce1c
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 23 deletions.
2 changes: 0 additions & 2 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ type AgendaItem {
createdBy: User!
description: String
duration: String!
isNote: Boolean!
itemType: ItemType!
organization: Organization!
relatedEvent: Event
Expand Down Expand Up @@ -290,7 +289,6 @@ input CreateAgendaItemInput {
categories: [ID]
description: String
duration: String!
isNote: Boolean!
itemType: ItemType!
organizationId: ID!
relatedEventId: ID
Expand Down
9 changes: 2 additions & 7 deletions src/models/AgendaItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export interface InterfaceAgendaItem {
itemType: ItemType; // Type of the agenda item (Regular or Note).
createdAt: Date; // Date when the agenda item was created.
updatedAt: Date; // Date when the agenda item was last updated.
isNote: boolean; // Indicates whether the agenda item is a note.
organization: PopulatedDoc<InterfaceOrganization & Document>; // Reference to the organization associated with the agenda item.
}

Expand All @@ -45,8 +44,8 @@ export enum ItemType {
* @param attachments - Optional array of attachment URLs.
* @param createdBy - Reference to the user who created the agenda item.
* @param updatedBy - Reference to the user who last updated the agenda item.
* @param urls - Optional array of URLs related to the agenda item.
* @param user - Optional user associated with the agenda item.
* @param urls - Optional users array indicating key note users for the agenda item.
* @param users - Optional user associated with the agenda item.
* @param categories - Optional array of agenda categories associated with the agenda item.
* @param sequence - Sequence number of the agenda item.
* @param itemType - Type of the agenda item (Regular or Note).
Expand Down Expand Up @@ -112,10 +111,6 @@ export const AgendaItemSchema = new Schema({
type: Date,
// required: true,
},
isNote: {
type: Boolean,
default: false,
},
organization: {
type: Schema.Types.ObjectId,
ref: "Organization",
Expand Down
1 change: 0 additions & 1 deletion src/typeDefs/inputs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export const inputs = gql`
sequence: Int!
itemType: ItemType!
organizationId: ID!
isNote: Boolean!
}
input UpdateAgendaItemInput {
Expand Down
1 change: 0 additions & 1 deletion src/typeDefs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export const types = gql`
itemType: ItemType!
createdAt: Date!
updatedAt: Date!
isNote: Boolean!
organization: Organization!
relatedEvent: Event
}
Expand Down
3 changes: 0 additions & 3 deletions src/types/generatedGraphQLTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ export type AgendaItem = {
createdBy: User;
description?: Maybe<Scalars['String']['output']>;
duration: Scalars['String']['output'];
isNote: Scalars['Boolean']['output'];
itemType: ItemType;
organization: Organization;
relatedEvent?: Maybe<Event>;
Expand Down Expand Up @@ -366,7 +365,6 @@ export type CreateAgendaItemInput = {
categories?: InputMaybe<Array<InputMaybe<Scalars['ID']['input']>>>;
description?: InputMaybe<Scalars['String']['input']>;
duration: Scalars['String']['input'];
isNote: Scalars['Boolean']['input'];
itemType: ItemType;
organizationId: Scalars['ID']['input'];
relatedEventId?: InputMaybe<Scalars['ID']['input']>;
Expand Down Expand Up @@ -3620,7 +3618,6 @@ export type AgendaItemResolvers<ContextType = any, ParentType extends ResolversP
createdBy?: Resolver<ResolversTypes['User'], ParentType, ContextType>;
description?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
duration?: Resolver<ResolversTypes['String'], ParentType, ContextType>;
isNote?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
itemType?: Resolver<ResolversTypes['ItemType'], ParentType, ContextType>;
organization?: Resolver<ResolversTypes['Organization'], ParentType, ContextType>;
relatedEvent?: Resolver<Maybe<ResolversTypes['Event']>, ParentType, ContextType>;
Expand Down
2 changes: 1 addition & 1 deletion tests/resolvers/AgendaItem/Users.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ afterAll(async () => {
await disconnect(MONGOOSE_INSTANCE);
});

describe("AgendaItem.Users", () => {
describe("resolvers -> AgendaItem -> Users", () => {
it("Should return the users of the agenda item", async () => {
const users = await usersResolver?.(testAgendaItem, {}, {});
expect(users).toEqual([testUser1, testUser2]);
Expand Down
8 changes: 0 additions & 8 deletions tests/resolvers/Mutation/createAgendaItem.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ describe("resolvers -> Mutation -> createAgendaItem", () => {
sequence: 1,
itemType: "Regular",
organizationId: testOrganization?._id,
isNote: false,
},
};

Expand Down Expand Up @@ -151,7 +150,6 @@ describe("resolvers -> Mutation -> createAgendaItem", () => {
sequence: 1,
itemType: "Regular",
organizationId: testOrganization?._id, // A random ID that does not exist in the database,
isNote: false,
},
};

Expand Down Expand Up @@ -184,7 +182,6 @@ describe("resolvers -> Mutation -> createAgendaItem", () => {
sequence: 1,
itemType: "Regular",
organizationId: new Types.ObjectId().toString(), // A random ID that does not exist in the database
isNote: false,
},
};

Expand Down Expand Up @@ -217,7 +214,6 @@ describe("resolvers -> Mutation -> createAgendaItem", () => {
sequence: 1,
itemType: "Regular",
organizationId: testOrganization?._id,
isNote: false,
},
};

Expand Down Expand Up @@ -250,7 +246,6 @@ describe("resolvers -> Mutation -> createAgendaItem", () => {
sequence: 1,
itemType: "Regular",
organizationId: testOrganization?._id,
isNote: false,
},
};

Expand Down Expand Up @@ -282,7 +277,6 @@ describe("resolvers -> Mutation -> createAgendaItem", () => {
sequence: 1,
itemType: "Regular",
organizationId: testOrganization?._id,
isNote: false,
},
};
const context = {
Expand All @@ -309,7 +303,6 @@ describe("resolvers -> Mutation -> createAgendaItem", () => {
sequence: 1,
itemType: "Regular",
organizationId: testOrganization?._id,
isNote: false,
},
};
const context = {
Expand Down Expand Up @@ -340,7 +333,6 @@ describe("resolvers -> Mutation -> createAgendaItem", () => {
sequence: 1,
itemType: "Regular",
organizationId: testOrganization?._id,
isNote: false,
},
};
const context = {
Expand Down

0 comments on commit 670ce1c

Please sign in to comment.