From 6f78942176d5909349305db37b5424a1c6ceccef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Fri, 16 Jul 2021 11:02:02 +0800 Subject: Order functionality draft Not tested yet. Now the item object is still flattened as an array, initially to hurry the interfacing with the Perl module. But we were stuck with having to typemap char *** anyway, so we switch to SWIG because of the potential of ease. Still, we need to typemap char ***, but now that we're at SWIG, we might as well typemap a custom item struct. --- pikul.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pikul.h') diff --git a/pikul.h b/pikul.h index 4cd11f7..d88d218 100644 --- a/pikul.h +++ b/pikul.h @@ -25,6 +25,10 @@ void pikul_init(enum pikul_company company, char *provisions[]); struct pikul_services *pikul_services(const char *origin, const char *destination, double weight); void pikul_free_services(struct pikul_services *services); double pikul_cost(const char *origin, const char *destination, double weight, const char *service); +char *pikul_order(const char *trx_id, const char *service, const char *sender_name, + const char *sender_phone, const char *origin, const char *sender_address, + const char *receiver_name, const char *receiver_phone, const char *destination, + const char *receiver_address, int nitems, char **items[], double value); void pikul_cleanup(); #ifdef __cplusplus -- cgit v1.2.3 From abe673f9ae7d9d23e92a188ade187ec020b1f67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Fri, 16 Jul 2021 12:01:56 +0800 Subject: Update value parameter to subtotal --- pikul.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pikul.h') diff --git a/pikul.h b/pikul.h index d88d218..0bb4e23 100644 --- a/pikul.h +++ b/pikul.h @@ -28,7 +28,7 @@ double pikul_cost(const char *origin, const char *destination, double weight, co char *pikul_order(const char *trx_id, const char *service, const char *sender_name, const char *sender_phone, const char *origin, const char *sender_address, const char *receiver_name, const char *receiver_phone, const char *destination, - const char *receiver_address, int nitems, char **items[], double value); + const char *receiver_address, int nitems, char **items[], double subtotal); void pikul_cleanup(); #ifdef __cplusplus -- cgit v1.2.3 From 4482f46ee073110c7c52d73bc8a8006437eba6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Fri, 16 Jul 2021 23:02:24 +0800 Subject: use_insurance turns out to be required This one follows the example given for the boolean JSON value, which is written as true or false. The response is error 500, internal server error. Despite the example, it says max length is 1 in the middle part of the doc, so maybe it should be written as 1 or 0. Will be tried next. --- pikul.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pikul.h') diff --git a/pikul.h b/pikul.h index 0bb4e23..e2c6331 100644 --- a/pikul.h +++ b/pikul.h @@ -28,7 +28,7 @@ double pikul_cost(const char *origin, const char *destination, double weight, co char *pikul_order(const char *trx_id, const char *service, const char *sender_name, const char *sender_phone, const char *origin, const char *sender_address, const char *receiver_name, const char *receiver_phone, const char *destination, - const char *receiver_address, int nitems, char **items[], double subtotal); + const char *receiver_address, int nitems, char **items[], _Bool insurance, double subtotal); void pikul_cleanup(); #ifdef __cplusplus -- cgit v1.2.3 From dfa57092e26c242c2ab64dc1d029e5dff44eee67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sat, 17 Jul 2021 11:05:19 +0800 Subject: Rename trx_id to order_number --- pikul.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pikul.h') diff --git a/pikul.h b/pikul.h index e2c6331..623c87a 100644 --- a/pikul.h +++ b/pikul.h @@ -25,7 +25,7 @@ void pikul_init(enum pikul_company company, char *provisions[]); struct pikul_services *pikul_services(const char *origin, const char *destination, double weight); void pikul_free_services(struct pikul_services *services); double pikul_cost(const char *origin, const char *destination, double weight, const char *service); -char *pikul_order(const char *trx_id, const char *service, const char *sender_name, +char *pikul_order(const char *order_number, const char *service, const char *sender_name, const char *sender_phone, const char *origin, const char *sender_address, const char *receiver_name, const char *receiver_phone, const char *destination, const char *receiver_address, int nitems, char **items[], _Bool insurance, double subtotal); -- cgit v1.2.3 From b999dd2f128bcf209c62d3419a559e70222e7b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sat, 17 Jul 2021 15:29:20 +0800 Subject: Postal codes for both sender & receiver --- pikul.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pikul.h') diff --git a/pikul.h b/pikul.h index 623c87a..07db738 100644 --- a/pikul.h +++ b/pikul.h @@ -27,8 +27,9 @@ void pikul_free_services(struct pikul_services *services); double pikul_cost(const char *origin, const char *destination, double weight, const char *service); char *pikul_order(const char *order_number, const char *service, const char *sender_name, const char *sender_phone, const char *origin, const char *sender_address, - const char *receiver_name, const char *receiver_phone, const char *destination, - const char *receiver_address, int nitems, char **items[], _Bool insurance, double subtotal); + const char *sender_postal, const char *receiver_name, const char *receiver_phone, + const char *destination, const char *receiver_address, const char *receiver_postal, + int nitems, char **items[], _Bool insurance, double subtotal); void pikul_cleanup(); #ifdef __cplusplus -- cgit v1.2.3 From b53957a8fd25bcce8eb98f71b6e9e711b48ce605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sun, 18 Jul 2021 11:59:55 +0800 Subject: Insurance is not determined by user's decision It depends on some weight threshhold. --- pikul.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pikul.h') diff --git a/pikul.h b/pikul.h index 07db738..fde0483 100644 --- a/pikul.h +++ b/pikul.h @@ -29,7 +29,7 @@ char *pikul_order(const char *order_number, const char *service, const char *sen const char *sender_phone, const char *origin, const char *sender_address, const char *sender_postal, const char *receiver_name, const char *receiver_phone, const char *destination, const char *receiver_address, const char *receiver_postal, - int nitems, char **items[], _Bool insurance, double subtotal); + int nitems, char **items[], double subtotal); void pikul_cleanup(); #ifdef __cplusplus -- cgit v1.2.3