-
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
add bulk issuance service #213
add bulk issuance service #213
Conversation
} | ||
}{} | ||
|
||
func updatePublicKeyFromKeycloak() error { |
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.
function name needs to be modified
services/bulk_issuance/db/db.go
Outdated
|
||
var db *gorm.DB | ||
|
||
type DBFiles struct { |
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.
what is DBFiles?
services/bulk_issuance/db/db.go
Outdated
Date string | ||
} | ||
|
||
type DBFileData struct { |
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.
what is DBFileData?
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.
is it a good name for table?
security: | ||
- hasRole: [] | ||
securityDefinitions: | ||
hasRole: |
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.
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}: |
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 /v1/{schema-name}/sample-csv
description: Not found | ||
schema: | ||
type: string | ||
/v1/uploadFiles/{VCName}: |
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.
v1/[entityname]/upload
description: Internal Server Error | ||
schema: | ||
type: string | ||
/v1/download/{id}: |
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.
v1/{id}/report?
return response | ||
} | ||
|
||
func addEntryForDbFilesToDatabase(rows [][]string, fileName string, data Scanner, principal *models.JWTClaimBody) (uint, error) { |
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 function name
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 the below functionalities to service layer
return false | ||
} | ||
|
||
func GetSchemaProperties(key string) ([]string, error) { |
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.
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 { |
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.
add tests
RealmAccess map[string][]string `json:"realm_access"` | ||
Scope string `json:"scope"` | ||
PreferredUsername string `json:"preferred_username"` | ||
FacilityCode string `json:"facility_code"` |
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.
we dont need facility code right?
services/bulk_issuance/db/db.go
Outdated
db.AutoMigrate(&FileData{}) | ||
} | ||
|
||
func GetFileDataByIdAndUser(id int, userId string) (*FileData, error) { |
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.
you can apply the userId check in the query itself
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
No description provided.