-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #186 from lahirulakruwan/main
Student File upload changes added
- Loading branch information
Showing
6 changed files
with
812 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
public isolated service class DocumentsData { | ||
private UserDocument document_list; | ||
|
||
isolated function init(int? id = 0, UserDocument? documentList = null) returns error? { | ||
|
||
if (documentList != null) { | ||
self.document_list = documentList.cloneReadOnly(); | ||
return; | ||
} | ||
lock { | ||
|
||
UserDocument documents_raw; | ||
|
||
if (id > 0) { | ||
|
||
documents_raw = check db_client->queryRow( | ||
`SELECT * | ||
FROM user_documents | ||
WHERE id = ${id};`); | ||
|
||
}else{ | ||
return error("No id provided"); | ||
} | ||
self.document_list = documents_raw.cloneReadOnly(); | ||
} | ||
} | ||
|
||
isolated resource function get id() returns int?|error { | ||
lock { | ||
return self.document_list.id; | ||
} | ||
} | ||
|
||
isolated resource function get folder_id() returns string?|error { | ||
lock{ | ||
return self.document_list.folder_id; | ||
} | ||
} | ||
|
||
isolated resource function get nic_front_id() returns string?|error { | ||
lock { | ||
return self.document_list.nic_front_id; | ||
} | ||
} | ||
|
||
isolated resource function get nic_back_id() returns string?|error { | ||
lock { | ||
return self.document_list.nic_back_id; | ||
} | ||
} | ||
|
||
isolated resource function get birth_certificate_front_id() returns string?|error { | ||
lock { | ||
return self.document_list.birth_certificate_front_id; | ||
} | ||
} | ||
|
||
isolated resource function get birth_certificate_back_id() returns string?|error { | ||
lock { | ||
return self.document_list.birth_certificate_back_id; | ||
} | ||
} | ||
|
||
isolated resource function get ol_certificate_id() returns string?|error { | ||
lock { | ||
return self.document_list.ol_certificate_id; | ||
} | ||
} | ||
|
||
isolated resource function get al_certificate_id() returns string?|error { | ||
lock { | ||
return self.document_list.al_certificate_id; | ||
} | ||
} | ||
|
||
isolated resource function get additional_certificate_01_id() returns string?|error { | ||
lock { | ||
return self.document_list.additional_certificate_01_id; | ||
} | ||
} | ||
|
||
isolated resource function get additional_certificate_02_id() returns string?|error { | ||
lock { | ||
return self.document_list.additional_certificate_02_id; | ||
} | ||
} | ||
|
||
isolated resource function get additional_certificate_03_id() returns string?|error { | ||
lock { | ||
return self.document_list.additional_certificate_03_id; | ||
} | ||
} | ||
|
||
isolated resource function get additional_certificate_04_id() returns string?|error { | ||
lock { | ||
return self.document_list.additional_certificate_04_id; | ||
} | ||
} | ||
|
||
isolated resource function get additional_certificate_05_id() returns string?|error { | ||
lock { | ||
return self.document_list.additional_certificate_05_id; | ||
} | ||
} | ||
|
||
isolated resource function get document_type() returns string?|error { | ||
lock { | ||
return self.document_list.document_type; | ||
} | ||
} | ||
|
||
isolated resource function get document() returns string?|error { | ||
lock { | ||
return self.document_list.document; | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.