Skip to content
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

Merged
merged 76 commits into from
Jul 11, 2023
Merged

Feat: Added Credential Schema Service #219

merged 76 commits into from
Jul 11, 2023

Conversation

KDwevedi
Copy link
Contributor

No description provided.

services/credential-schema/dist/samples/marksheet.json Outdated Show resolved Hide resolved

}

async verify(template: string, schemaID: string): Promise<boolean> {
Copy link
Member

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

Copy link
Contributor Author

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(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be getCredentialSchema

Copy link
Contributor Author

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({
Copy link
Member

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

Copy link
Contributor Author

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);
Copy link
Member

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:

},
Copy link
Member

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

@KDwevedi KDwevedi marked this pull request as ready for review June 15, 2023 09:14
@techsavvyash
Copy link
Contributor

Copy link
Collaborator

@srprasanna srprasanna left a 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"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to environment variable.

Copy link
Contributor

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

author: string;
authored: Date;
schema: any; //VCSchema
// proof?: {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented code.

@srprasanna
Copy link
Collaborator

@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.

@tushar5526
Copy link
Contributor

Screenshot 2023-07-11 at 11 34 47 AM

@srprasanna srprasanna merged commit c41f19c into Sunbird-RC:release-2.0.0 Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Released
Development

Successfully merging this pull request may close these issues.

5 participants