create submission

This commit is contained in:
Phuoc Nguyen
2025-11-27 16:56:01 +07:00
parent ba04576750
commit b6cb9e865a
18 changed files with 1445 additions and 138 deletions

View File

@@ -61,4 +61,81 @@ curl --location 'https://land.dbiz.com//api/method/building_material.building_ma
"status_color": "Success"
}
]
}
}
#get project progress
curl --location 'https://land.dbiz.com//api/method/frappe.client.get_list' \
--header 'X-Frappe-Csrf-Token: 6ff3be4d1f887dbebf86ba4502b05d94b30c0b0569de49b74a7171a9' \
--header 'Cookie: sid=a0cbe3ea6f9a7e9cf083bbe3139eada68d2357eac0167bcc66cda17d; full_name=Ha%20Duy%20Lam; sid=a0cbe3ea6f9a7e9cf083bbe3139eada68d2357eac0167bcc66cda17d; system_user=yes; user_id=lamhd%40gmail.com; user_image=/files/avatar_0986788766_1763627962.jpg' \
--header 'Content-Type: application/json' \
--data '{
"doctype": "Progress of construction",
"fields": ["name","status"],
"order_by": "number_of_display asc",
"limit_page_length": 0
}'
#response
{
"message": [
{
"name": "h6n0hat3o2",
"status": "Chưa khởi công"
},
{
"name": "k1mr565o91",
"status": "Khởi công móng"
},
{
"name": "2obpqokr8q",
"status": "Đang phần thô"
},
{
"name": "i5qkovb09j",
"status": "Đang hoàn thiện"
},
{
"name": "kdj1jjlr28",
"status": "Cất nóc"
},
{
"name": "254e3ealdf",
"status": "Hoàn thiện"
}
]
}
#create new project
curl --location 'https://land.dbiz.com//api/method/building_material.building_material.api.project.save' \
--header 'Cookie: sid=a0cbe3ea6f9a7e9cf083bbe3139eada68d2357eac0167bcc66cda17d; full_name=Ha%20Duy%20Lam; sid=a0cbe3ea6f9a7e9cf083bbe3139eada68d2357eac0167bcc66cda17d; system_user=yes; user_id=lamhd%40gmail.com; user_image=/files/avatar_0986788766_1763627962.jpg' \
--header 'X-Frappe-Csrf-Token: 6ff3be4d1f887dbebf86ba4502b05d94b30c0b0569de49b74a7171a9' \
--header 'Content-Type: application/json' \
--data '{
"name": "p9ti8veq2g",
"designed_area": "Sunrise Villa Phase 355",
"address_of_project": "123 Đường Võ Văn Kiệt, Quận 2, TP.HCM",
"project_owner": "Nguyễn Văn A",
"design_firm": "Studio Green",
"contruction_contractor": "CTCP Xây Dựng Minh Phú",
"design_area": 350.5,
"products_included_in_the_design": "Gạch ốp lát, sơn ngoại thất, \nkhóa thông minh",
"project_progress": "h6n0hat3o2",
"expected_commencement_date": "2026-01-15",
"description": "Yêu cầu phối màu mới cho khu vực hồ bơi",
"request_date": "2025-11-26 09:30:00"
}'
#upload image file for project
#docname is the project name returned from create new project
#file is the local path of the file to be uploaded
#other parameters can be kept as is
curl --location 'https://land.dbiz.com//api/method/upload_file' \
--header 'Cookie: sid=a0cbe3ea6f9a7e9cf083bbe3139eada68d2357eac0167bcc66cda17d; full_name=Ha%20Duy%20Lam; sid=a0cbe3ea6f9a7e9cf083bbe3139eada68d2357eac0167bcc66cda17d; system_user=yes; user_id=lamhd%40gmail.com; user_image=/files/avatar_0986788766_1763627962.jpg' \
--header 'X-Frappe-Csrf-Token: 6ff3be4d1f887dbebf86ba4502b05d94b30c0b0569de49b74a7171a9' \
--form 'file=@"/C:/Users/tiennld/Downloads/76369094c7604b3e1271.jpg"' \
--form 'is_private="1"' \
--form 'folder="Home/Attachments"' \
--form 'doctype="Architectural Project"' \
--form 'docname="p9ti8veq2g"' \
--form 'optimize="true"'