Skip to content

Commit

Permalink
removed submission-related code
Browse files Browse the repository at this point in the history
  • Loading branch information
KShervington committed Dec 10, 2024
1 parent aa6a74f commit 6064c27
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 125 deletions.
36 changes: 0 additions & 36 deletions apps/backend/src/controllers/submission.controller.ts

This file was deleted.

9 changes: 0 additions & 9 deletions apps/backend/src/interfaces/submission.interface.ts

This file was deleted.

18 changes: 0 additions & 18 deletions apps/backend/src/routes/submission.route.ts

This file was deleted.

3 changes: 1 addition & 2 deletions apps/backend/src/server.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { App } from '@/app';
import { ValidateEnv } from '@utils/validateEnv';
import { initializeOpenAI } from './utils/initializeOpenAI';
import { SubmissionRoute } from './routes/submission.route';
import { UserRoute } from './routes/users.route';
import { ProductRoute } from './routes/products.route';
import { WalletRoute } from './routes/wallet.route';
Expand All @@ -11,6 +10,6 @@ ValidateEnv();

export const openAIHelper = initializeOpenAI();

const app = new App([new SubmissionRoute(), new UserRoute(), new ProductRoute(), new WalletRoute(), new PurchaseRoute()]);
const app = new App([new UserRoute(), new ProductRoute(), new WalletRoute(), new PurchaseRoute()]);

app.listen();
60 changes: 0 additions & 60 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -900,63 +900,3 @@ Response:
"message": "Purchase history retrieved"
}
```

---

## Submissions

**POST** _/submitReceipt_

Submit a receipt for processing and validation.

| Parameter | Type | Description |
| --------- | :------: | ------------------------------------------------------- |
| image | `string` | Base64 encoded image of the receipt |
| captcha | `string` | Captcha verification token |
| timestamp | `number` | Automatically added server-side timestamp of submission |

**Response**

Returns the validation result for the submitted receipt.

| Key | Type | Description |
| ---------- | :------: | ---------------------------------------- |
| validation | `object` | Object containing the validation results |

**Example**

Request:

```http
POST /submitReceipt
```

Request Body:

```json
{
"image": "base64_encoded_image_data",
"captcha": "captcha_verification_token"
}
```

Response:

```json
{
"validation": {
"validityFactor": 0.95,
"details": {
"isValid": true,
"confidence": "high"
}
}
}
```

**Error Responses**

| Status Code | Description |
| ----------- | ---------------------- |
| 400 | Invalid captcha |
| 500 | Error validating image |

0 comments on commit 6064c27

Please sign in to comment.