classDiagram
class Invoice {
+Integer id
+Integer organisation_id
+Integer contact_id
+String status
+String currency_code
+Date due_date
+Money sub_total
+LineItem[] line_items
+Time deleted_at
+Time created_at
+Time updated_at
<<Aggregate>>
}
class Organisation {
+Integer id
+String name
+Time deleted_at
+Time created_at
+Time updated_at
<<Aggregate>>
}
class Contact {
+Integer id
+Integer organisation_id
+String first_name
+String last_name
+String email
+Time deleted_at
+Time created_at
+Time updated_at
<<Aggregate>>
}
class Money {
+BigDecimal amount
+String currency_code
<<ValueObject>>
}
class LineItem {
+Integer id
+String description
+Integer quantity
+Money unit_amount
<<Entity>>
}
Invoice "1" -- "1" Organisation : references
Invoice "1" -- "1" Contact : references
Contact "1" -- "1" Organisation : references
Invoice "1" -- "1..*" LineItem : contains
curl -X POST http://localhost:3000/accountify/organisation \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1" \
-d '{"name": "New Organisation"}'
curl -X GET http://localhost:3000/accountify/organisation/1 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1"
curl -X PUT http://localhost:3000/accountify/organisation/1 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1" \
-d '{"name": "Updated Organisation Name"}'
curl -X DELETE http://localhost:3000/accountify/organisation/1 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1"
curl -X POST http://localhost:3000/accountify/contact \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1" \
-d '{
"organisation_id": 2,
"first_name": "John",
"last_name": "Doe",
"email": "[email protected]"
}'
curl -X GET http://localhost:3000/accountify/contact/1 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1"
curl -X PUT http://localhost:3000/accountify/contact/3 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1" \
-d '{
"first_name": "Jane",
"last_name": "Doe",
"email": "[email protected]"
}'
curl -X DELETE http://localhost:3000/accountify/contact/3 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1"
curl -X POST http://localhost:3000/accountify/invoice \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1" \
-d '{
"organisation_id": 2,
"contact_id": 3,
"currency_code": "AUD",
"due_date": "2024-12-31",
"line_items": [
{
"description": "Service Fee",
"unit_amount": {"amount": 200, "currency_code": "AUD"},
"quantity": 3
},
{
"description": "Maintenance Fee",
"unit_amount": {"amount": 150, "currency_code": "AUD"},
"quantity": 5
}
]
}'
curl -X GET http://localhost:3000/accountify/invoice/1 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1"
curl -X PUT http://localhost:3000/accountify/invoice/1 \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1" \
-d '{
"organisation_id": 2,
"contact_id": 3,
"due_date": "2025-01-31", // New due date
"line_items": [
{
"description": "Service Fee",
"unit_amount": {"amount": 210, "currency_code": "AUD"},
"quantity": 2 // Updated quantity
},
{
"description": "Maintenance Fee",
"unit_amount": {"amount": 150, "currency_code": "AUD"},
"quantity": 4 // Updated quantity
}
]
}'
curl -X PATCH http://localhost:3000/accountify/invoice/1/approve \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1"
curl -X PATCH http://localhost:3000/accountify/invoice/1/void \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1"
curl -X DELETE http://localhost:3000/accountify/invoice/1 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "X-Tenant-id: 1"