Commit graph

60 commits

Author SHA1 Message Date
5cfe9b4169
refactor(stripe): remove support for Stripe Connect account
Eliminated all references to the Stripe Connect account configuration
and
option handling. This includes removing the related environment
variable,
config struct field, client option, and usage in Stripe client setup.
Stripe integration now only uses the main secret key and webhook secret.
2025-10-30 17:03:55 +01:00
aa9f46a222
feat/stripe integration (#48) 2025-10-19 15:48:59 +02:00
5d42a5aefe
refactor: simplify main entry and improve logging
Refactors main.go to streamline context and logger initialization.
Moves signal handling directly into main, sets up a base logger for
early errors, and updates error handling to use structured logging.
No functional changes to application logic.
2025-10-03 20:09:27 +02:00
ac94faedb0
refactor: unify ID and API key naming conventions
This commit standardizes the naming of identifier and API key fields
across the codebase to use consistent camel case (e.g., `ID`, `APIKey`,
`DatabaseURL`). This includes updates to struct fields, method names,
function parameters, and environment variable references. The changes
improve code clarity and maintainability by reducing ambiguity and
aligning with Go naming conventions. No functional behavior is changed.
2025-10-03 19:47:41 +02:00
40d2338c0f
feat(logging): add slog-based structured logging
Introduce slog-based structured logging throughout the booking service
and
server handlers. Add configurable log level via LOG_LEVEL environment
variable. Replace legacy log usage with slog and propagate logger to
booking service for improved observability.
2025-09-12 12:17:22 -04:00
f836822ff0
upgrade dependencies and remove dead code 2025-05-04 23:48:12 +02:00
9e2cef07e1
feat(parser): refactor BookingAgentParser to use OpenAI client and add parsing tests
- Update BookingAgentParser to utilize OpenAI's client for parsing booking data.
- Remove base URL dependency and streamline the initialization process.
- Introduce ResponseData struct to define expected JSON structure from the LLM.
- Add unit tests for BookingAgentParser to validate parsing logic and expected output.
2025-05-04 23:18:42 +02:00
75eb3b8502
use COnfig struct to parse env variables 2025-03-23 22:57:22 +01:00
bddc4bb0fc
embed html template (#40)
### TL;DR

Implemented embedded file system for static assets using Go's `embed` package.

### What changed?

- Created a new `assets.go` file to define an embedded filesystem for static assets
- Moved all static assets (HTML, icons, images, JS) under a nested `assets` directory
- Updated PDF generation to use the embedded filesystem when parsing HTML templates
- Modified main application to use the embedded filesystem for serving static files
- Added logging statements for invoice generation

### How to test?

1. Run the application and verify static assets are served correctly
2. Generate a PDF invoice and confirm it renders properly
3. Check that all HTML error pages (400, 401, 403, 404, 500) are accessible
4. Verify images and icons load correctly throughout the application

### Why make this change?

Using an embedded filesystem ensures all static assets are compiled into the binary, making deployment simpler and more reliable. This eliminates the need to manage separate asset files and ensures the application has all required resources available at runtime.
2025-02-04 18:49:20 +01:00
cf1620592a
create invoice (#39)
### TL;DR

Enhanced invoice generation with improved formatting and Euro symbol display

### What changed?

- Added Euro symbol (€) to monetary values in the invoice template
- Implemented new invoice data structure with dedicated types for lines and payments
- Created ToInvoice method to properly format booking data for invoice generation
- Added HTML template parsing and rendering functionality
- Improved date formatting for consistency
- Added new API endpoint for booking creation

### How to test?

1. Create a new booking through the API
2. Navigate to the PDF generation endpoint
3. Verify that monetary values display with Euro symbol
4. Check that dates are properly formatted
5. Confirm that payment history and totals are correctly calculated
6. Validate that the generated HTML maintains proper formatting

### Why make this change?

To improve invoice readability and consistency by standardizing monetary value display and providing better data structure for invoice generation. This change also makes the system more maintainable by separating concerns between data transformation and presentation.
2025-02-04 11:34:14 +01:00
bfde4eb601
fix bugs (#37)
### TL;DR
Reorganized booking service code and removed unused BookingRequest model

### What changed?
- Moved Payment model from payment.go to models.go
- Relocated payment-related service methods from service.go to payment.go
- Removed unused BookingRequest struct
- Updated dependencies to their latest versions

### How to test?
1. Run database migrations to verify removal of BookingRequest model
2. Test all payment-related endpoints to ensure functionality remains intact:
   - GET /payments/{id}
   - POST /payments
   - PUT /payments/{id}

### Why make this change?
- Improves code organization by grouping payment-related code together
- Removes unused BookingRequest model to reduce technical debt
- Keeps dependencies up to date for security and performance improvements
2025-01-25 00:41:32 +01:00
541c813be0
Raw 34 enable payments (#35)
Closes #34
2025-01-24 17:30:35 +01:00
49c49f4098
feat: add client parser to get response from LLM 2025-01-12 21:29:59 +01:00
04d9e8c284
chore: upgrade dependencies 2025-01-04 13:19:01 +01:00
c9380481cf
create a booking repo 2024-12-07 12:48:43 +01:00
3e7a07dc2a
improve month sync again 2024-09-28 09:01:48 +02:00
d7e6b7891d
error message consistency 2024-09-15 11:03:40 +02:00
9c6e5ff76e
cleanup 2024-09-13 18:55:35 +02:00
34ce10ff86
move booking to service layer 2024-09-12 22:18:12 +02:00
b073844772
move auth to service layer 2024-09-12 22:11:01 +02:00
876d54d7bb
move pdf to driver layer 2024-09-11 11:04:34 +02:00
916f2b1c47
move database to driver layer 2024-09-11 09:40:39 +02:00
78ca637807
call calendar driver from the booking service 2024-09-11 09:38:22 +02:00
4c209da0f6
move calendar to driver layer 2024-09-11 09:09:23 +02:00
aa5dd17d07
move config and constant packages to internal 2024-09-08 21:34:36 +02:00
280470c385
up deps and add database package 2024-09-08 21:16:04 +02:00
d4e6b35a96
Create taxes for taxable items automatically (#16)
* refactor return error when building booking service

* fix the description

* set taxable item by amount

* auto create tax items if the item is taxable

* fix linter

* remove legacy tax entry

* display multiple items

* use the price from the form

* improve item sorting

* lintfix
2024-08-26 21:44:31 +02:00
f90b8a1c67
improve config setup
improve config setup
2024-08-21 09:49:31 +02:00
1d1c871b8a
remove unused code 2024-08-19 14:27:04 +02:00
ac10e65097
Refactor service (#14)
* add comments to main file

* create health check handler

health check

* use naming convention for booking handler

* use naming convention for hamndlers

naming convention

* clean up
2024-08-07 09:12:50 +02:00
4409facd34
create calendar service at startup 2024-08-05 20:19:25 +02:00
22175a9b39
fix linter errors 2024-07-14 23:43:14 +02:00
cd61bdf2f1
add CI 2024-07-14 23:39:31 +02:00
0dc9bee3f7
add api_key to config 2024-06-16 16:20:55 +02:00
eda38b52a0
clean main function 2024-06-03 11:21:46 +02:00
8c4a1554ca
make origin a config change api sync url 2024-06-02 11:59:07 +02:00
e1766812c4
session login 2024-05-25 16:38:25 +02:00
8f4f1638a4
add google login 2024-05-19 21:04:05 +02:00
fee3f660ed
add login page 2024-05-10 12:45:08 +02:00
e1be7b3a88
cleanup 2024-04-19 15:01:09 +02:00
691b724189
set debug 2024-04-13 19:15:42 +02:00
efccace761
use getenv function 2024-04-13 19:04:57 +02:00
f764e1007c
add transport 2024-04-06 13:34:33 +02:00
b537d03777
profiling 2024-03-11 21:01:04 +01:00
4ae233f9a3
set tracing 2024-03-11 20:49:55 +01:00
f4870cbb4c
sentry 2024-03-11 20:41:45 +01:00
1daa3eb7b8
add request booking feature 2024-03-10 10:45:30 +01:00
3078bac637
func opt pattern 2024-03-03 21:40:17 +01:00
d5654f808c
invoice number in place of db id 2024-02-26 17:17:29 +01:00
a31a1f6350
force to set pdf service 2024-02-25 00:17:49 +01:00