Skip to content

Commit

Permalink
remove the updatedBy field
Browse files Browse the repository at this point in the history
  • Loading branch information
meetulr committed Jan 8, 2024
1 parent bd6833f commit eddf670
Show file tree
Hide file tree
Showing 18 changed files with 0 additions and 127 deletions.
7 changes: 0 additions & 7 deletions src/models/ActionItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export interface InterfaceActionItem {
completed: boolean;
event: PopulatedDoc<InterfaceEvent & Document>;
createdBy: PopulatedDoc<InterfaceUser & Document>;
updatedBy: PopulatedDoc<InterfaceUser & Document>;
createdAt: Date;
updatedAt: Date;
}
Expand All @@ -39,7 +38,6 @@ export interface InterfaceActionItem {
* @param completed - Whether the ActionItem has been completed.
* @param event - Event to which the ActionItem is related, refer to the `Event` model.
* @param createdBy - User who created the ActionItem, refer to the `User` model.
* @param updatedBy - User who last updated the ActionItem, refer to the `User` model.
* @param createdAt - Timestamp when the ActionItem was created.
* @param updatedAt - Timestamp when the ActionItem was last updated.
*/
Expand Down Expand Up @@ -92,11 +90,6 @@ const actionItemSchema = new Schema(
ref: "User",
required: true,
},
updatedBy: {
type: Schema.Types.ObjectId,
ref: "User",
required: true,
},
},
{ timestamps: true }
);
Expand Down
7 changes: 0 additions & 7 deletions src/models/Category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export interface InterfaceCategory {
orgId: PopulatedDoc<InterfaceOrganization & Document>;
disabled: boolean;
createdBy: PopulatedDoc<InterfaceUser & Document>;
updatedBy: PopulatedDoc<InterfaceUser & Document>;
createdAt: Date;
updatedAt: Date;
}
Expand All @@ -24,7 +23,6 @@ export interface InterfaceCategory {
* @param orgId - Organization the category belongs to, refer to the `Organization` model.
* @param disabled - Whether category is disabled or not.
* @param createdBy - Task creator, refer to `User` model.
* @param updatedBy - Task creator, refer to `User` model.
* @param createdAt - Time stamp of data creation.
* @param updatedAt - Time stamp of data updation.
*/
Expand All @@ -49,11 +47,6 @@ const categorySchema = new Schema(
ref: "User",
required: true,
},
updatedBy: {
type: Schema.Types.ObjectId,
ref: "User",
required: true,
},
},
{ timestamps: true }
);
Expand Down
2 changes: 0 additions & 2 deletions src/resolvers/ActionItem/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ import { assignedBy } from "./assignedBy";
import { category } from "./category";
import { event } from "./event";
import { createdBy } from "./createdBy";
import { updatedBy } from "./updatedBy";

export const ActionItem: ActionItemResolvers = {
assignedTo,
assignedBy,
category,
event,
createdBy,
updatedBy,
};
8 changes: 0 additions & 8 deletions src/resolvers/ActionItem/updatedBy.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/resolvers/Category/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import type { CategoryResolvers } from "../../types/generatedGraphQLTypes";
import { org } from "./org";
import { createdBy } from "./createdBy";
import { updatedBy } from "./updatedBy";

export const Category: CategoryResolvers = {
org,
createdBy,
updatedBy,
};
8 changes: 0 additions & 8 deletions src/resolvers/Category/updatedBy.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/resolvers/Mutation/createActionItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ export const createActionItem: MutationResolvers["createActionItem"] = async (
completionDate: args.data.completionDate,
event: args.data.event,
createdBy: context.userId,
updatedBy: context.userId,
});

if (args.data.event) {
Expand Down
1 change: 0 additions & 1 deletion src/resolvers/Mutation/createCategory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export const createCategory: MutationResolvers["createCategory"] = async (
category: args.category,
orgId: args.orgId,
createdBy: context.userId,
updatedBy: context.userId,
});

await Organization.findOneAndUpdate(
Expand Down
1 change: 0 additions & 1 deletion src/resolvers/Mutation/createOrganization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export const createOrganization: MutationResolvers["createOrganization"] =
category: "Default",
orgId: createdOrganization._id,
createdBy: context.userId,
updatedBy: context.userId,
});

// Adding the default category to the createdOrganization
Expand Down
1 change: 0 additions & 1 deletion src/resolvers/Mutation/updateActionItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,6 @@ export const updateActionItem: MutationResolvers["updateActionItem"] = async (
{
...(args.data as UpdateActionItemInputType),
assignmentDate: updatedAssignmentDate,
updatedBy: context.userId,
assignedBy: updatedAssignedBy,
},
{
Expand Down
1 change: 0 additions & 1 deletion src/resolvers/Mutation/updateCategory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ export const updateCategory: MutationResolvers["updateCategory"] = async (
},
{
...(args.data as UpdateCategoryInputType),
updatedBy: context.userId,
},
{
new: true,
Expand Down
2 changes: 0 additions & 2 deletions src/typeDefs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const types = gql`
completed: Boolean
event: Event
createdBy: User!
updatedBy: User!
createdAt: Date!
updatedAt: Date!
}
Expand Down Expand Up @@ -369,7 +368,6 @@ export const types = gql`
org: Organization!
disabled: Boolean!
createdBy: User!
updatedBy: User!
createdAt: Date!
updatedAt: Date!
}
Expand Down
4 changes: 0 additions & 4 deletions src/types/generatedGraphQLTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ export type ActionItem = {
postCompletionNotes?: Maybe<Scalars['String']>;
preCompletionNotes?: Maybe<Scalars['String']>;
updatedAt: Scalars['Date'];
updatedBy: User;
};

export type Address = {
Expand Down Expand Up @@ -132,7 +131,6 @@ export type Category = {
disabled: Scalars['Boolean'];
org: Organization;
updatedAt: Scalars['Date'];
updatedBy: User;
};

export type CheckIn = {
Expand Down Expand Up @@ -2392,7 +2390,6 @@ export type ActionItemResolvers<ContextType = any, ParentType extends ResolversP
postCompletionNotes?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
preCompletionNotes?: Resolver<Maybe<ResolversTypes['String']>, ParentType, ContextType>;
updatedAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>;
updatedBy?: Resolver<ResolversTypes['User'], ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

Expand Down Expand Up @@ -2448,7 +2445,6 @@ export type CategoryResolvers<ContextType = any, ParentType extends ResolversPar
disabled?: Resolver<ResolversTypes['Boolean'], ParentType, ContextType>;
org?: Resolver<ResolversTypes['Organization'], ParentType, ContextType>;
updatedAt?: Resolver<ResolversTypes['Date'], ParentType, ContextType>;
updatedBy?: Resolver<ResolversTypes['User'], ParentType, ContextType>;
__isTypeOf?: IsTypeOfResolverFn<ParentType, ContextType>;
};

Expand Down
5 changes: 0 additions & 5 deletions tests/helpers/actionItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@ export const createTestActionItem = async (): Promise<

const testCategory = await Category.create({
createdBy: testUser?._id,
updatedBy: testUser?._id,
orgId: testOrganization?._id,
category: "Default",
});

const testActionItem = await ActionItem.create({
createdBy: testUser?._id,
updatedBy: testUser?._id,
assignedTo: randomUser?._id,
assignedBy: testUser?._id,
categoryId: testCategory?._id,
Expand All @@ -57,7 +55,6 @@ export const createNewTestActionItem = async ({
}: InterfaceCreateNewTestAction): Promise<TestActionItemType> => {
const newTestActionItem = await ActionItem.create({
createdBy: currUserId,
updatedBy: currUserId,
assignedTo: assignedUserId,
assignedBy: currUserId,
categoryId: categoryId,
Expand All @@ -74,15 +71,13 @@ export const createTestActionItems = async (): Promise<

const testActionItem1 = await ActionItem.create({
createdBy: testUser?._id,
updatedBy: testUser?._id,
assignedTo: randomUser?._id,
assignedBy: testUser?._id,
categoryId: testCategory?._id,
});

const testActionItem2 = await ActionItem.create({
createdBy: testUser?._id,
updatedBy: testUser?._id,
assignedTo: randomUser?._id,
assignedBy: testUser?._id,
categoryId: testCategory?._id,
Expand Down
3 changes: 0 additions & 3 deletions tests/helpers/category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export const createTestCategory = async (): Promise<
const [testUser, testOrganization] = await createTestUserAndOrganization();
const testCategory = await Category.create({
createdBy: testUser?._id,
updatedBy: testUser?._id,
orgId: testOrganization?._id,
category: "Default",
});
Expand All @@ -30,14 +29,12 @@ export const createTestCategories = async (): Promise<

const testCategory1 = await Category.create({
createdBy: testUser?._id,
updatedBy: testUser?._id,
orgId: testOrganization?._id,
category: "Default",
});

const testCategory2 = await Category.create({
createdBy: testUser?._id,
updatedBy: testUser?._id,
orgId: testOrganization?._id,
category: "Default2",
});
Expand Down
36 changes: 0 additions & 36 deletions tests/resolvers/ActionItem/updatedBy.spec.ts

This file was deleted.

36 changes: 0 additions & 36 deletions tests/resolvers/Category/updatedBy.spec.ts

This file was deleted.

2 changes: 0 additions & 2 deletions tests/resolvers/Mutation/removeOrganization.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,12 @@ beforeAll(async () => {

testCategory = await Category.create({
createdBy: testUsers[0]?._id,
updatedBy: testUsers[0]?._id,
orgId: testOrganization?._id,
category: "Default",
});

testActionItem = await ActionItem.create({
createdBy: testUsers[0]?._id,
updatedBy: testUsers[0]?._id,
assignedTo: testUsers[1]?._id,
assignedBy: testUsers[0]?._id,
categoryId: testCategory?._id,
Expand Down

0 comments on commit eddf670

Please sign in to comment.