hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
181 stars 105 forks source link

[FEAT]: Order Invoice API Endpoint - Backend #92

Closed legacywebhub closed 4 months ago

legacywebhub commented 4 months ago

Description

Implement a feature to send an invoice email after successful order payment/purchase or when user access a completed order (history)

Acceptance Criteria

Expected Outcome

Users should be able to access payment information of an order and order-related information

Purpose

To ensure order and payment preview to users via invoice

Requirements

Invoice Email

Invoice Email Endpoint [GET] /api/v1/order/{orderID}/invoice

Request

Successful Response

[
   "invoiceDetails": {
        "invoiceNumber": "string",
        "dateOfIssue": "date",
        "dueDate": "date"
    },
    "orderSummary": {
        "items": [
            {
                "item": "string",
                "price": "float"
            },
            {
                "item": "string",
                "price": "float"
            }
        ],
        "vat": {
            "percentage": "int",
            "amount": "float"
        },
        "total": {
            "percentage": 100,
            "amount": "float"
        }

    },
    "paymentDetails": {
        "amount": "float",
        "paymentMethod": "string",
        "bankName": "string",
        "accountNumber": "string",
        "accountName": "string"
    }
]

Error Response

{
    "message": "string",
    "error": "string",
    "statusCode": "int"
}

Datebase Schema

Database Schema

markessien commented 4 months ago

this is not in the scope of this project