Skip to content

Commit

Permalink
Merge pull request #188 from avinyafoundation/main
Browse files Browse the repository at this point in the history
duty attendance bug fixed
  • Loading branch information
YujithIsura authored Jan 9, 2025
2 parents 03386c7 + 174d2d6 commit 14f8fe3
Show file tree
Hide file tree
Showing 6 changed files with 838 additions and 27 deletions.
4 changes: 4 additions & 0 deletions api/Config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@ HOST="localhost"
PASSWORD="Admin@#123"
PORT=3306
USER="root"
GOOGLEDRIVECLIENTID=""
GOOGLEDRIVECLIENTSECRET=""
GOOGLEDRIVEREFRESHTOKEN=""
GOOGLEDRIVEREFRESHURL= ""
32 changes: 32 additions & 0 deletions api/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ dependencies = [
{org = "ballerina", name = "graphql"},
{org = "ballerina", name = "io"},
{org = "ballerina", name = "log"},
{org = "ballerina", name = "mime"},
{org = "ballerina", name = "regex"},
{org = "ballerina", name = "sql"},
{org = "ballerina", name = "test"},
{org = "ballerina", name = "time"},
{org = "ballerinai", name = "observe"},
{org = "ballerinai", name = "transaction"},
{org = "ballerinax", name = "googleapis.drive"},
{org = "ballerinax", name = "mysql"},
{org = "ballerinax", name = "mysql.driver"}
]
Expand Down Expand Up @@ -283,6 +285,9 @@ dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.int"}
]
modules = [
{org = "ballerina", packageName = "mime", moduleName = "mime"}
]

[[package]]
org = "ballerina"
Expand Down Expand Up @@ -445,6 +450,33 @@ modules = [
{org = "ballerinai", packageName = "transaction", moduleName = "transaction"}
]

[[package]]
org = "ballerinax"
name = "client.config"
version = "1.0.1"
dependencies = [
{org = "ballerina", name = "http"},
{org = "ballerina", name = "oauth2"}
]

[[package]]
org = "ballerinax"
name = "googleapis.drive"
version = "3.3.0"
dependencies = [
{org = "ballerina", name = "file"},
{org = "ballerina", name = "http"},
{org = "ballerina", name = "io"},
{org = "ballerina", name = "log"},
{org = "ballerina", name = "os"},
{org = "ballerina", name = "url"},
{org = "ballerinai", name = "observe"},
{org = "ballerinax", name = "client.config"}
]
modules = [
{org = "ballerinax", packageName = "googleapis.drive", moduleName = "googleapis.drive"}
]

[[package]]
org = "ballerinax"
name = "mysql"
Expand Down
118 changes: 118 additions & 0 deletions api/documents_data.bal
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;
}
}
}

Loading

0 comments on commit 14f8fe3

Please sign in to comment.