africas-talking #50

Merged
lash merged 8 commits from africas-talking into lash/async-driver 2024-09-14 16:28:06 +02:00
Member

Adding Africa's Taking (AT) specific functionality

  • Process requests and get the correct phoneNumber as sessionId and text as input
  • Respond and append the "CON " and "END " to the output as per AT's USSD requirements
Adding Africa's Taking (AT) specific functionality * Process requests and get the correct phoneNumber as sessionId and text as input * Respond and append the "CON " and "END " to the output as per AT's USSD requirements
Alfred-mk added 6 commits 2024-09-12 22:03:01 +02:00
Alfred-mk added 1 commit 2024-09-12 22:53:19 +02:00
Alfred-mk added 2 commits 2024-09-13 15:03:48 +02:00
lash requested changes 2024-09-13 16:33:27 +02:00
Dismissed
@ -0,0 +232,4 @@
rp := &atRequestParser{}
bsh := handlers.NewBaseSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)
sh := httpserver.ToSessionHandler(bsh, httpserver.WithAtOutput())
Owner

In general, chainable functions should be called ON the object instead of being an argument TO The object.

In general, chainable functions should be called ON the object instead of being an argument TO The object.
Alfred-mk marked this conversation as resolved
@ -192,2 +194,3 @@
//sh := httpserver.NewSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl.Init)
sh := httpserver.NewSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)
bsh := handlers.NewBaseSessionHandler(cfg, rs, stateStore, userdataStore, rp, hl)
sh := httpserver.ToSessionHandler(bsh)
Owner

In fact, I should have implemented this as chainable, too. My bad.

In fact, I should have implemented this as chainable, too. My bad.
@ -0,0 +1,123 @@
package handlers
Owner

It would be better to have this PR against my async branch, because here we cannot see the differences....

It would be better to have this PR against my async branch, because here we cannot see the differences....
Author
Member

I've updated the PR to reflect this

I've updated the PR to reflect this
lash marked this conversation as resolved
@ -0,0 +90,4 @@
return rqs, err
}
func (f *BaseSessionHandler) AtOutput(rqs RequestSession) (RequestSession, error) {
Owner

This method should not exist in the base handler. Please EXTEND the handler to adapt it to your needs.

In fact, you probably need to extend the internal/http/server.go SessionHandler instead, since it in turn extends this, and also provides other functionality you need.

BaseSessionHandler -> http.SessionHandler -> at.SessionHandler

This method should not exist in the base handler. Please EXTEND the handler to adapt it to your needs. In fact, you probably need to extend the internal/http/server.go SessionHandler instead, since it in turn extends this, and also provides other functionality you need. BaseSessionHandler -> http.SessionHandler -> at.SessionHandler
Alfred-mk marked this conversation as resolved
@ -133,3 +127,1 @@
if err != nil {
f.writeError(w, 500, "Write result fail", err)
return
if f.useAtOutput {
Owner

Similary here, Please do not put AT speicifc code in the generic http code. Please use your own extension of the class.

Similary here, Please do not put AT speicifc code in the generic http code. Please use your own extension of the class.
Alfred-mk marked this conversation as resolved
Alfred-mk changed target branch from master to lash/async-driver 2024-09-13 21:51:09 +02:00
Alfred-mk added 2 commits 2024-09-14 14:57:31 +02:00
Alfred-mk requested review from lash 2024-09-14 14:59:24 +02:00
Alfred-mk changed title from WIP: africas-talking to africas-talking 2024-09-14 15:55:08 +02:00
Alfred-mk added 1 commit 2024-09-14 16:01:20 +02:00
Signed-off-by: Alfred Kamanda <alfredkamandamw@gmail.com>
lash approved these changes 2024-09-14 16:27:59 +02:00
lash merged commit f4f475bd45 into lash/async-driver 2024-09-14 16:28:06 +02:00
Alfred-mk deleted branch africas-talking 2024-09-20 11:11:08 +02:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: urdt/ussd#50
No description provided.