-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Added Credential Schema Service #219
Conversation
|
||
} | ||
|
||
async verify(template: string, schemaID: string): Promise<boolean> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better name instead of verify
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to a more descriptive name, please verify that it is appropriate.
}); | ||
}*/ | ||
|
||
async credentialSchema( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be getCredentialSchema
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks for pointing that out!
if (templateToBeDeleted.deleted == true) { | ||
throw new NotFoundException('Record not found'); | ||
} | ||
const template = await this.prisma.template.update({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
findUnique can be avoided right? directly update without fetching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is a soft delete, changing a property called 'deleted' to signify that the template is deleted.
The first 'findUnique' is looking up whether the 'deleted' property is already true, before carrying out the soft delete.
Let me know if we should remove the findUnique function anyway.
|
||
async verify(template: string, schemaID: string): Promise<boolean> { | ||
try{ | ||
let HBSfields: Array<string> = this.parseHBS(template); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
variable can start with lower case
status: data.status, | ||
// updatedBy: | ||
|
||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only the data to query is changing, can only that be extracted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Migrations are very specific to SQL. How to handle for other datasources?
} | ||
|
||
datasource db { | ||
provider = "postgresql" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to environment variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the solution for this will be raised as a separate PR for all three services
fix: Refactor tests to run dependents services first
fix: generate did in tests
…to refactor-schema
Refactor schema
author: string; | ||
authored: Date; | ||
schema: any; //VCSchema | ||
// proof?: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove commented code.
@techsavvyash @tushar5526 can you add test coverage screenshot like identity service. This PR is approved. Once coverage snapshot is added, I will merge it in. |
…to refactor-schema
fix: updation logic
fix: add error on invalid status type
No description provided.