dzcode-io / leblad

A JS library providing a list of Algerian administrative areas with many useful APIs.
https://www.npmjs.com/package/@dzcode-io/leblad
MIT License
63 stars 20 forks source link

Baladiya ( commune ) Fetch #36

Closed Redaloukil closed 4 years ago

Redaloukil commented 4 years ago

As I see in the api https://github.com/Fcmam5/algeria-api/blob/develop/data/WilayaList.json , Baladiya list is attached to each Daira, Can anyone confirm ?

If it's the case, I suggest we add the following functionalities :

Get All Baladiya's attached to a Daira By a given Daira, retrieve baladiya's List.

Get All Baladiya's attached to a Wilaya By a given wilaya, retrieve baladya's List.

Get Wilaya and Daira in which the baladiya is located By a given baladiya, Retrive the WIlaya and Daira.

Fcmam5 commented 4 years ago

I like the idea, sure thing let's work on:

Would you like to work on this? We'd like to have each feature by PR

Redaloukil commented 4 years ago

Yes, I would like to work on this. assign me to this issue please.

Fcmam5 commented 4 years ago

@Redaloukil please, which feature of the 3 I mentioned are you working on ATM? I'm just asking so we can create more issues to track the other ones separately

Redaloukil commented 4 years ago

@Fcmam5 I'm working on getBaladyiatsForWilaya currently.

Redaloukil commented 4 years ago

@Fcmam5 I have few doubts about projectWilayafunction : The name of the function seems confusing because it seems like it's applicable only for Wilaya object but I saw that it was applied for Dairats and could be applied for Baladyia. ( As my understanding, the function maps the input (object/array of objects) to return (object/array of objects) with corresponding attribute array introduced in the project array. Should we rename the function projectWilaya and re document it ?

Fcmam5 commented 4 years ago

@Fcmam5 I have few doubts about projectWilayafunction : The name of the function seems confusing because it seems like it's applicable only for Wilaya object but I saw that it was applied for Dairats and could be applied for Baladyia. ( As my understanding, the function maps the input (object/array of objects) to return (object/array of objects) with corresponding attribute array introduced in the project array. Should we rename the function projectWilaya and re document it ?

I totally agree and I even raised something related to it in #27. Let's just keep it as it is for now and we work on it later. Just import it and use a different name for you variable as it's confusing as you said.

Thank you again for raising it.

Fcmam5 commented 4 years ago

Also, I created #42 and #43 for the other features you suggested. Thank you very much 🙏 !

Fcmam5 commented 4 years ago

@all-contributors add @Redaloukil for ideas

allcontributors[bot] commented 4 years ago

@Fcmam5

I've put up a pull request to add @Redaloukil! :tada: