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

add bulk issuance service #213

Merged
merged 27 commits into from
May 24, 2023

Conversation

varadeth
Copy link
Contributor

No description provided.

@varadeth varadeth marked this pull request as draft April 10, 2023 11:55
@varadeth varadeth marked this pull request as ready for review April 13, 2023 05:04
}
}{}

func updatePublicKeyFromKeycloak() error {
Copy link
Member

Choose a reason for hiding this comment

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

function name needs to be modified


var db *gorm.DB

type DBFiles struct {
Copy link
Member

Choose a reason for hiding this comment

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

what is DBFiles?

Date string
}

type DBFileData struct {
Copy link
Member

Choose a reason for hiding this comment

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

what is DBFileData?

Copy link
Member

Choose a reason for hiding this comment

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

is it a good name for table?

security:
- hasRole: []
securityDefinitions:
hasRole:
Copy link
Member

Choose a reason for hiding this comment

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

we can use this right? instead of custom implementation,
https://github.com/egovernments/DIVOC/blob/main/interfaces/vaccination-api.yaml#L17

produces:
- application/json
paths:
/v1/sample/{schemaName}:
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 /v1/{schema-name}/sample-csv

description: Not found
schema:
type: string
/v1/uploadFiles/{VCName}:
Copy link
Member

Choose a reason for hiding this comment

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

v1/[entityname]/upload

description: Internal Server Error
schema:
type: string
/v1/download/{id}:
Copy link
Member

Choose a reason for hiding this comment

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

v1/{id}/report?

return response
}

func addEntryForDbFilesToDatabase(rows [][]string, fileName string, data Scanner, principal *models.JWTClaimBody) (uint, error) {
Copy link
Member

Choose a reason for hiding this comment

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

better function name

Copy link
Member

Choose a reason for hiding this comment

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

move the below functionalities to service layer

return false
}

func GetSchemaProperties(key string) ([]string, error) {
Copy link
Member

Choose a reason for hiding this comment

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

is this a util function? can it be part of registry service

return totalSuccess, totalErrors, rows, nil
}

func appendErrorsToCurrentRow(res *http.Response, data *Scanner, lastColIndex int, currRow []string) []string {
Copy link
Member

Choose a reason for hiding this comment

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

add tests

RealmAccess map[string][]string `json:"realm_access"`
Scope string `json:"scope"`
PreferredUsername string `json:"preferred_username"`
FacilityCode string `json:"facility_code"`
Copy link
Member

Choose a reason for hiding this comment

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

we dont need facility code right?

db.AutoMigrate(&FileData{})
}

func GetFileDataByIdAndUser(id int, userId string) (*FileData, error) {
Copy link
Member

Choose a reason for hiding this comment

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

you can apply the userId check in the query itself

varadeth and others added 16 commits May 2, 2023 15:52
Use userId to filter files for the same user in query itself rather than outside and Remove FacilityCode from the parsing of JWTClaim token
- update API specs
- move custom implementation from swagger_gen resources to external class
- remove unused code
- fix test cases

The custom implementation has been moved out of swagger_gen directory mainly because modifying existing specs will be more easier. JWTClaimBody is also autogenerated via swagger spec.
The above change is made to get to know if controllers object is directly used instead of using the reference variable
- update parsing schema properties from map to struct
- update getUploadItems to return only required data
- Update error payload to be json object
@tejash-jl tejash-jl merged commit a7c374b into Sunbird-RC:main May 24, 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.

2 participants