Closed Fcmam5 closed 4 years ago
@xxKeefer this could be an issue you can work on 😄 !
Hey! This seems interesting. Could my friend @makeBread and I get assigned this?
Or could I work with @xxKeefer ?
@InternetRamen it would be great if you create a validation method (isValidZipCode
) and export it like we did with isValidWilayaCode
se we can either use it internally or as a utility function. see isValidWilayaCode.
Hey @Fcmam5 I did a bit a of research as I'm not familiar with the Algerian postal system (i'm from Australia :D) it looks like the function getWilayaByZipCode
takes a number, my research tells me that some of the zip codes like those with Adrar have a leading zero in the zip code. Does that mean that say if were looking at the zip code for Abani for example ('01027'
) its looking to receive the number 1027
?
Hey @Fcmam5 I did a bit a of research as I'm not familiar with the Algerian postal system (i'm from Australia :D) it looks like the function
getWilayaByZipCode
takes a number, my research tells me that some of the zip codes like those with Adrar have a leading zero in the zip code. Does that mean that say if were looking at the zip code for Abani for example ('01027'
) its looking to receive the number1027
?
Yes it make sense! So, the first two digits refers to the Wilaya (city code), and for Adrar it's 01
with the leading zero. But I think that we still need to verify if it's a valid number at least (even though the parameter can be a string).
So we'd expect:
zipCode='01027'
or zipCode=31000
to be valid, and we call our search functions.O(n^2)
search :/ Maybe we can for that only using Number.isNaN()
.
Glad to have you here helping us @xxKeefer ! That's an honour that our project reached Australia 😄 !
@InternetRamen it would be great if you create a validation method (
isValidZipCode
) and export it like we did withisValidWilayaCode
se we can either use it internally or as a utility function. see isValidWilayaCode.
Thank you for responding. I will try to create the method.
@InternetRamen @xxKeefer already started working on it in #26, would you help us there?
@Fcmam5 Got it
@Fcmam5 Got it
@InternetRamen I just created #27 , I'll add a description there, that one should be a bit challenging as well 😄
@Fcmam5 I'll try my best! Thanks for the opportunity.
In Algeria all ZIP codes are numeric in a form of
WILAYA_CODE_XXXX
. For example Oran city's code is 31, and it provinces have codes like31000
,310094
...In this line :
https://github.com/dzcode-io/leblad/blob/5837b9e613b414acf84d4bc8f4b9d0b567f84dbc/src/api/getWilayaByZipCode.js#L18
We are directly looking for the given zip code even if it's not a valid number. I suggest at least checking if the parameter is a number before searching.