Skip to content

[Expenses]: The user according to the selected category shall be able to input the relevant information and be allowed to upload pdf files or scanned images of the received bills #272

@nielsdrost7

Description

@nielsdrost7

Context


The user according to the selected category shall be able to input the relevant information and be allowed to upload pdf files or scanned images of the received bills


Specific:

As a user, I can upload bills in PDF or scanned image format after entering category-specific information.

Measurable:

The system will successfully process and store uploaded files with a 99% success rate, validated by log entries.

Achievable:

The file upload functionality will be implemented using existing cloud storage and file validation libraries.

Relevant:

This feature directly addresses the need to digitize and categorize bill submissions for efficient expense tracking.

Time-bound:

This user story will be completed and tested within a single sprint, ending two weeks from the start of development.


### Arrange:
// 1. Create a user.
// 2. Define the category-specific information as an array (e.g., ['vendor' => 'Example Vendor', 'date' => '2023-10-27', 'amount' => 100.00]).
// 3. Create a mock PDF file or a scanned image file and store it in the `storage/framework/testing/` directory.
// 4. Set the expected file path and filename based on the storage configuration.

### Act:
// 1. Authenticate the user.
// 2. Make a POST request to the file upload endpoint, including the category-specific information and the mock file.
// 3. Handle any exceptions thrown during the upload process.

### Assert:
// 1. Assert that the HTTP response status code is 201 (Created) or 200 (OK).
// 2. Assert that the response body contains the file's storage path.
// 3. Assert that the file exists in the cloud storage location.
// 4. Assert that a log entry exists confirming the successful upload.
// 5. Assert that the file size is within expected limits.
// 6. Assert that the stored file metadata (if applicable) is correct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions