Scaler-Community-Projects / NGO-Farmer-Analysis

A Website/Webapp to help SS-SWERA Project under PANI NGO to capture, store and analyze farmer's crop yield and methods used. Previously these things were done manually. The main aim of the App is to make this process seamless and fast.
MIT License
9 stars 21 forks source link

Implement Create Adoption #55

Open krishnanvignesh opened 4 years ago

krishnanvignesh commented 4 years ago

Implement Create adoption wish for a farmer using the below form

- Adoption Form
    Name of farmer
    Father's/Husband's name
    Collectives name
    Village name
    Video name (this is a video through which farmers are educated)
    Date of adoption
    Area (land farmer owns)
    Date of verification
    Adoption by video or Meeting (checkbox)

Note: Please go through the created endpoints before you start working on this.

Refer: issue #36 https://github.com/Scaler-Community-Projects/NGO-Farmer-Analysis/wiki/Adoption-Form

Medha08 commented 4 years ago

I would like to work on this

Medha08 commented 4 years ago

I want to confirm what will be the information I will get in POST request? There is a farmer table and adoption table both so below are my confusions on the issue

mephi007 commented 4 years ago

I would like to contribute! @krishnanvignesh @ritesh-pandey

ritesh-pandey commented 4 years ago

Let us define a data contract - how will the client and API talk to each other.

Sample:

farmer_name='string',
care_of='string',
collective_name='string'
village_name='string'
...

This will help both teams - frontend and backed - to understand what needs to be built.

ritesh-pandey commented 4 years ago

I want to confirm what will be the information I will get in POST request? There is a farmer table and adoption table both so below are my confusions on the issue

* Can we get farmer details from farmer table as well, is there is a separate form for it

* Are  we saving farmer details in farmer table from this adoption form

* Will this form data  be saved in the adoption table alone

Let us have a single table as of now - adoption table. All fields will be stored in it.

krishnanvignesh commented 4 years ago

I would like to contribute! @krishnanvignesh @ritesh-pandey

Adding @mephi007 to this issue after confirming with @Medha08

bhatiaPankaj commented 4 years ago

I want to confirm what will be the information I will get in POST request? There is a farmer table and adoption table both so below are my confusions on the issue

* Can we get farmer details from farmer table as well, is there is a separate form for it

* Are  we saving farmer details in farmer table from this adoption form

* Will this form data  be saved in the adoption table alone

Let us have a single table as of now - adoption table. All fields will be stored in it.

Just adding my thoughts.

Wouldnt using a single table give us anomalies in case when a farmer has multiple adoptions or vice versa? Adoption and Farmer table look to have n x n mapping , so perhaps a different mapping table could be of help as follows:

Adoption table -Adoption id -Adoption/Video name

Adoption_farmer_mapping -farmer_id (refers Farmer table) -adoption_id (refers Adoption table) -Date of adoption

We can refer the farmer id to fetch Name of farmer, Father's name,Village name,collective name.

@ritesh-pandey thoughts please?