Skip to content
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

Fast buy functionality #18

Closed
cbetta opened this issue May 10, 2016 · 7 comments
Closed

Fast buy functionality #18

cbetta opened this issue May 10, 2016 · 7 comments

Comments

@cbetta
Copy link
Contributor

cbetta commented May 10, 2016

Currently the API allows for searching of numbers by certain specifications and then buying the number.

> nexmo number:search NL --pattern *007
31635251007
31635252007
31635253007
31635254007
31635255007
31635256007
31635257007
31635258007
31635259007

>  nexmo number:buy 31635251007
This is operation will charge your account.

Please type "confirm" to continue: confirm

Number purchased

It would be interesting if we could achieve this all in 1 step:

> nexmo number:buy NL --pattern *007 --confirm
Number purchased: 31635251007

# or
> nexmo number:search NL --pattern *007 --buy --confirm
Number purchased: 31635251007

# or
> nexmo number:smartbuy NL --pattern *007 --confirm
Number purchased: 31635251007

The first 2 options have the downside of overcomplicating the now relatively simple number:buy and number:search. The latter has the downside of being a new command.

@sammachin
Copy link
Contributor

sammachin commented May 11, 2016

the original intention was to have pattern matching on the buy without the --pattern flag

nexmo number:buy 447520615600 would buy that specific number
nexmo number:buy 447520* would find and buy the first number that matched

@cbetta
Copy link
Contributor Author

cbetta commented May 11, 2016

@sammachin OK let me look into this

@cbetta
Copy link
Contributor Author

cbetta commented May 11, 2016

@sammachin I assume you only see this working with trailing wildcards? I cant see this work with leading *'s as we wont know what country you want.

@sammachin
Copy link
Contributor

yeah that the issue with leading *'s I guess you could optionally specify a
country?

On Wed, May 11, 2016 at 3:36 PM, Cristiano Betta notifications@github.com
wrote:

@sammachin https://github.com/sammachin I assume you only see this
working with trailing wildcards? I cant see this work with leading *'s as
we wont know what country you want.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#18 (comment)

@cbetta
Copy link
Contributor Author

cbetta commented May 11, 2016

Actually, just thinking about this, not sure if this works.

Currently number:buy uses NI Basic to look up the country ID, seeing as the API needs the country ID and the msisdn. If we'd drop to just a pattern (e.g. 45555*) how are we to determine the country code. Does NI basic allow for this?

If it doesn't then maybe we should do this instead:

nexmo number:buy GB 44555*

I can then internally simply look at the number of options provided and pass it to the right handler. Ok?

@cbetta
Copy link
Contributor Author

cbetta commented May 11, 2016

@sammachin This has now been implemented in #30.

@cbetta cbetta closed this as completed May 11, 2016
@cbetta
Copy link
Contributor Author

cbetta commented May 11, 2016

FYI released v0.0.5 with some of the latest changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants