K-Tax เป็น Application คำนวนภาษี ที่ให้ผู้ใช้งานสามารถคำนวนภาษีบุคคลธรรมดา ตามขั้นบันใดภาษี พร้อมกับคำนวนค่าลดหย่อน และภาษีที่ต้องได้รับคืน
git clone https://github.com/LGROW101/assessment-tax.git
cd assessment-tax
docker compose up
http://localhost:3000/admin/login
ADMIN_USERNAME=adminTax
ADMIN_PASSWORD=admin!
ผมได้เพิ่มในส่วนของ IncludeTaxLevel เพื่อดู รายละเอียดของขั้นบันใดภาษี
เช่น "IncludeTaxLevel": true ก็จะแสดง รายละเอียดของขั้นบันใดภาษี
ถ้า "IncludeTaxLevel": false ก็จะแสดง tax อย่างเดียว หรือไม่ต้องไส่ "IncludeTaxLevel": false ก็ได้สามารถแสดง tax
ตัวอย่าง
{
"totalIncome": 500000.0,
"wht": 0.0,
"allowances": [
{
"allowanceType": "donation",
"amount": 200000.0
}
],
"IncludeTaxLevel": true
}
ผมได้เพิ่มในส่วนของ Method GET เพิื่อดึงข้อมูลมาแสดงผล
GET: /admin/deductions แสดงข้อมูล admin
GET /tax/calculations แสดงข้อมูลคำนวณภาษีทั้งหมด
POST: tax/calculations
{
"totalIncome": 500000.0,
"wht": 0.0,
"allowances": [
{
"allowanceType": "donation",
"amount": 0.0
}
]
}Response body
{
"tax": 29000
}POST: tax/calculations
{
"totalIncome": 500000.0,
"wht": 25000.0,
"allowances": [
{
"allowanceType": "donation",
"amount": 0.0
}
]
}Response body
{
"tax": 4000
}POST: tax/calculations
{
"totalIncome": 500000.0,
"wht": 0.0,
"allowances": [
{
"allowanceType": "donation",
"amount": 200000.0
}
]
}Response body
{
"tax": 19000
}POST: tax/calculations
{
"totalIncome": 500000.0,
"wht": 0.0,
"allowances": [
{
"allowanceType": "donation",
"amount": 200000.0
}
],
"IncludeTaxLevel": true
}Response body
{
"tax": 19000,
"taxLevel": [
{
"level": "0-150,000",
"tax": 0.0
},
{
"level": "150,001-500,000",
"tax": 19000
},
{
"level": "500,001-1,000,000",
"tax": 0
},
{
"level": "1,000,001-2,000,000",
"tax": 0
},
{
"level": "2,000,001 ขึ้นไป",
"tax": 0
}
]
}POST: /admin/deductions
{
"personalDeduction": 70000
}Response body
{
"personalDeduction": 70000
}POST: tax/calculations/upload-csv
totalIncome,wht,donation
500000,0,0
600000,40000,20000
750000,50000,15000
Response body
{
"taxes": [
{
"tax": 29000,
"totalIncome": 500000
},
{
"taxRefund": 2000,
"totalIncome": 600000
},
{
"tax": 11250,
"totalIncome": 750000
}
]
}POST: tax/calculations
{
"totalIncome": 500000.0,
"wht": 0.0,
"allowances": [
{
"allowanceType": "k-receipt",
"amount": 200000.0
},
{
"allowanceType": "donation",
"amount": 100000.0
}
],
"IncludeTaxLevel": true
}Response body
{
"tax": 14000,
"taxLevel": [
{
"level": "0-150,000",
"tax": 0
},
{
"level": "150,001-500,000",
"tax": 14000
},
{
"level": "500,001-1,000,000",
"tax": 0
},
{
"level": "1,000,001-2,000,000",
"tax": 0
},
{
"level": "2,000,001 ขึ้นไป",
"tax": 0
}
]
}POST: /admin/deductions
{
"k_receipt": 70000
}Response body
{
"KReceipt": 70000
}