roos-fs tasks #515
Updated by Vadim Pariev 7 months ago
**Description:** Currently, the invoicing data flow between the OMS system and EASY Bill is handled manually. After service data (including pricing, service details, and cancellation fees) is collected in the OMS, it is manually exported as a CSV per customer for a one-month period and then imported into EASY Bill via their “Import” function to generate an invoice template. The goal is to automate this process so that on the first day of each month, a CSV report per customer is automatically generated for the previous month and sent directly to EASY Bill using their API. This will eliminate manual export and import steps while maintaining compatibility with EASY Bill’s CSV import format. **Business Logic:** **OMS gathers all data related to:** * Services provided per customer * Service name * Service prices and cancellation fees **At the end of each month (the first day of the next month):** month:** * A CSV file is generated per customer containing all services rendered during that month. * The CSV follows the EASY Bill import format (attached layout). **On the first day of the following month:** * The system automatically sends the generated CSV file to EASY Bill using their API. * If a customer has no services for that month, no API call should be made. * EASY Bill automatically creates an invoice template based on the imported data. The accountant can then review and finalize it before sending it to the customer. **Acceptance Criteria:** 1. The system can connect to the EASY Bill API using the available test account. 2. A CSV file is generated monthly (on the 1st of the following month) per customer. The CSV file includes: * Customer identifier (name and other data need for the API) * Service names and descriptions * Service prices * Cancellation fees are also in place and have their type and etnry in the table * If no services exist for a customer within the month, no CSV and no API call are created. * The generated CSV fully matches the EASY Bill import layout (attached). * Successful CSV upload triggers EASY Bill’s invoice template creation process. * Logs are created for each export and API interaction (success/failure, timestamp, customer ID). * Error handling is implemented for failed uploads or invalid CSV formats. API documentation https://www.easybill.de/api/?srsltid=AfmBOorZTMGd4eLZXBQftBiLRElzkm9BRisqUQ9emW_o3YKObNeVUgZA