feat: user request module with re-ordering (HBE-78) (#11)
* feat: added user-request schema in prisma * feat: basic mutation and queries implementation * fix: enum registration in graphql * feat: user resolver added for user requests * chore: refactor codes * feat: transaction added in request reordering operation * feat: pubsub added in user request * refactor: user request service * chore: feedback added * chore: code improvement * fix: bug fix * feat: request type update in schema and JSDoc added * test: fetchUserRequests and fetchUserRequest unit test added * chore: refactor two functions * test: unit test added for more functions * chore: code readability improved * test: added unit test for reorderRequests function * feat: subscriptions added * fix: User reference to AuthUser * fix: User to AuthUser in test file * chore: update dto file extensions * feat: relation added in schema level * chore: add function for db to model type casting * feat: filter with title and collectionID add in userRequest resolver * feat: resolvers added for userCollection in request module, and move inputTypes in a single file * test: test file updated * docs: description updated * feat: createdOn, updatedOn added in user request schema * chore: (delete in future) user collection module add for testing purpose * feat: separate resolvers for create, update, delete user request based on req type * feat: used paginationArgs from common types * fix: shift InputTypes to ArgsTypes * docs: update docs * feat: avoid destructuring * test: fix test cases for create and update * docs: update JS doc * feat: separate object variables for moveRequest function * test: fix test case for moveRequest function * feat: saperate parameters for fetchUserRequest * test: fix test cases for fetchUserRequests * feat: update some query names and made review changes * test: fix test cases * feat: remove filtering with title * test: fix text cases for fetchUserRequests func * feat: update subscription key * feat: edge case handled for user request creation * test: fix test case * fix: user field resolver * fix: fetch user req issue * fix: update with type check * test: fix test cases * feat: type checked on move request * test: add test case for typeValidity check func * fix: edge condition added in if statement * fix: error message * chore: removed user collection from this branch * fix: typos
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
import { Field, ID, ObjectType } from '@nestjs/graphql';
|
||||
import { ReqType } from 'src/user-history/user-history.model';
|
||||
|
||||
@ObjectType()
|
||||
export class UserRequest {
|
||||
@Field(() => ID, {
|
||||
description: 'ID of the user request',
|
||||
})
|
||||
id: string;
|
||||
|
||||
@Field(() => ID, {
|
||||
description: 'ID of the parent collection ID',
|
||||
})
|
||||
collectionID: string;
|
||||
|
||||
@Field({
|
||||
description: 'Title of the user request',
|
||||
})
|
||||
title: string;
|
||||
|
||||
@Field({
|
||||
description: 'Content/Body of the user request',
|
||||
})
|
||||
request: string;
|
||||
|
||||
@Field(() => ReqType, {
|
||||
description: 'Type (GRAPHQL/REST) of the user request',
|
||||
})
|
||||
type: ReqType;
|
||||
|
||||
@Field(() => Date, {
|
||||
description: 'Date of the user request creation',
|
||||
})
|
||||
createdOn: Date;
|
||||
}
|
||||
Reference in New Issue
Block a user