feat: Migrate to ultrathin monolith architecture
Consolidate 3 separate applications (reports-app, data-entry-app, telegram-bot) into a unified
architecture with single backend and frontend:
Backend Changes:
- Unified FastAPI backend at backend/ with modular structure
- Modules: reports, data_entry, telegram in backend/modules/
- Centralized config.py and main.py with all routers registered
- Single worker mode (--workers 1) for Telegram bot compatibility
- Shared Oracle connection pool and JWT authentication
- Unified requirements.txt and environment configuration
Frontend Changes:
- Single Vue.js SPA with module-based routing
- Unified frontend at src/ with modules in src/modules/{reports,data-entry}/
- Shared components and stores in src/shared/
- Error boundaries for module isolation
- Dual API proxy in Vite for module communication
Infrastructure:
- New unified startup scripts: start-prod.sh, start-test.sh, start-backend.sh
- Environment templates: .env.dev.example, .env.test.example, .env.prod.example
- Updated deployment scripts for Windows IIS
- Simplified SSH tunnel management
Documentation:
- Comprehensive CLAUDE.md with architecture overview
- Module-specific docs in docs/{data-entry,telegram}/
- Architecture decision records in docs/ARCHITECTURE-DECISIONS.md
- Deployment guides consolidated in deployment/windows/docs/
This migration reduces complexity, improves maintainability, and enables easier
deployment while maintaining all existing functionality.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -29,68 +29,122 @@
|
||||
</template>
|
||||
</Dialog>
|
||||
|
||||
<!-- Main Card -->
|
||||
<!-- Page Header (centered, no icon) -->
|
||||
<div class="page-header">
|
||||
<h1 class="page-title">Lista Bonuri Fiscale</h1>
|
||||
</div>
|
||||
|
||||
<!-- Main Card -->
|
||||
<div class="roa-card">
|
||||
<div class="roa-card-header">
|
||||
<h2 class="roa-card-title">
|
||||
<i class="pi pi-list"></i>
|
||||
Lista Bonuri Fiscale
|
||||
</h2>
|
||||
<!-- Status Filters Row (desktop only - mobile uses dropdown) -->
|
||||
<div class="status-actions-row" v-if="stats && !isMobile">
|
||||
<div class="status-chips">
|
||||
<span
|
||||
class="status-chip"
|
||||
:class="{ active: !filters.status }"
|
||||
@click="filterByStatus(null)"
|
||||
>
|
||||
Toate <Badge :value="stats.total?.count || 0" />
|
||||
</span>
|
||||
<span
|
||||
class="status-chip status-draft"
|
||||
:class="{ active: filters.status === 'draft' }"
|
||||
@click="filterByStatus('draft')"
|
||||
>
|
||||
Ciorne <Badge :value="stats.draft?.count || 0" severity="info" />
|
||||
</span>
|
||||
<span
|
||||
class="status-chip status-pending"
|
||||
:class="{ active: filters.status === 'pending_review' }"
|
||||
@click="filterByStatus('pending_review')"
|
||||
>
|
||||
În așteptare <Badge :value="stats.pending_review?.count || 0" severity="warning" />
|
||||
</span>
|
||||
<span
|
||||
class="status-chip status-approved"
|
||||
:class="{ active: filters.status === 'approved' }"
|
||||
@click="filterByStatus('approved')"
|
||||
>
|
||||
Validate <Badge :value="stats.approved?.count || 0" severity="success" />
|
||||
</span>
|
||||
<span
|
||||
class="status-chip status-rejected"
|
||||
:class="{ active: filters.status === 'rejected' }"
|
||||
@click="filterByStatus('rejected')"
|
||||
>
|
||||
Respinse <Badge :value="stats.rejected?.count || 0" severity="danger" />
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<!-- Bon Nou Button (desktop only) -->
|
||||
<Button
|
||||
v-if="!isMobile"
|
||||
label="Bon Nou"
|
||||
icon="pi pi-plus"
|
||||
size="small"
|
||||
@click="$router.push('/create')"
|
||||
severity="success"
|
||||
raised
|
||||
@click="goToCreate"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- Status Filters Row -->
|
||||
<div class="status-row" v-if="stats">
|
||||
<span
|
||||
class="status-chip"
|
||||
:class="{ active: !filters.status }"
|
||||
@click="filterByStatus(null)"
|
||||
>
|
||||
Toate <Badge :value="stats.total?.count || 0" />
|
||||
</span>
|
||||
<span
|
||||
class="status-chip status-draft"
|
||||
:class="{ active: filters.status === 'draft' }"
|
||||
@click="filterByStatus('draft')"
|
||||
>
|
||||
Ciorne <Badge :value="stats.draft?.count || 0" severity="info" />
|
||||
</span>
|
||||
<span
|
||||
class="status-chip status-pending"
|
||||
:class="{ active: filters.status === 'pending_review' }"
|
||||
@click="filterByStatus('pending_review')"
|
||||
>
|
||||
În așteptare <Badge :value="stats.pending_review?.count || 0" severity="warning" />
|
||||
</span>
|
||||
<span
|
||||
class="status-chip status-approved"
|
||||
:class="{ active: filters.status === 'approved' }"
|
||||
@click="filterByStatus('approved')"
|
||||
>
|
||||
Validate <Badge :value="stats.approved?.count || 0" severity="success" />
|
||||
</span>
|
||||
<span
|
||||
class="status-chip status-rejected"
|
||||
:class="{ active: filters.status === 'rejected' }"
|
||||
@click="filterByStatus('rejected')"
|
||||
>
|
||||
Respinse <Badge :value="stats.rejected?.count || 0" severity="danger" />
|
||||
</span>
|
||||
<!-- Mobile Toolbar (action buttons + Bon Nou) -->
|
||||
<div v-if="isMobile" class="mobile-toolbar-container">
|
||||
<div class="mobile-toolbar-buttons">
|
||||
<Button
|
||||
icon="pi pi-filter"
|
||||
label="Filtre"
|
||||
:class="{ 'filter-active': hasActiveFilters }"
|
||||
severity="secondary"
|
||||
outlined
|
||||
size="small"
|
||||
@click="showFilters = !showFilters"
|
||||
/>
|
||||
<Button
|
||||
icon="pi pi-refresh"
|
||||
label="Resetează"
|
||||
severity="secondary"
|
||||
outlined
|
||||
size="small"
|
||||
:loading="loading"
|
||||
@click="clearFilters"
|
||||
/>
|
||||
<Button
|
||||
label="Bon Nou"
|
||||
icon="pi pi-plus"
|
||||
severity="success"
|
||||
size="small"
|
||||
raised
|
||||
@click="goToCreate"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Search and Filters Row -->
|
||||
<div class="filters-row">
|
||||
<div v-if="!isMobile || showFilters" class="filters-row">
|
||||
<!-- Mobile: Status Dropdown (instead of chips) -->
|
||||
<Dropdown
|
||||
v-if="isMobile"
|
||||
v-model="filters.status"
|
||||
:options="statusOptions"
|
||||
optionLabel="label"
|
||||
optionValue="value"
|
||||
placeholder="Status"
|
||||
class="filter-status"
|
||||
@change="onFilterChange"
|
||||
/>
|
||||
|
||||
<InputText
|
||||
v-model="filters.search"
|
||||
placeholder="Caută..."
|
||||
placeholder="Caută furnizor, CUI, nr. bon..."
|
||||
class="filter-search"
|
||||
@keyup.enter="onFilterChange"
|
||||
/>
|
||||
>
|
||||
<template #prefix>
|
||||
<i class="pi pi-search" />
|
||||
</template>
|
||||
</InputText>
|
||||
|
||||
<Dropdown
|
||||
v-model="filters.direction"
|
||||
:options="directionOptions"
|
||||
@@ -116,8 +170,26 @@
|
||||
class="filter-date"
|
||||
@date-select="onFilterChange"
|
||||
/>
|
||||
<Button icon="pi pi-search" label="Filtrează" size="small" @click="onFilterChange" />
|
||||
<Button icon="pi pi-refresh" label="Resetează" size="small" severity="secondary" @click="clearFilters" />
|
||||
|
||||
<!-- Desktop filter action buttons -->
|
||||
<div v-if="!isMobile" class="filter-actions">
|
||||
<Button
|
||||
icon="pi pi-search"
|
||||
label="Filtrează"
|
||||
severity="primary"
|
||||
outlined
|
||||
size="small"
|
||||
@click="onFilterChange"
|
||||
/>
|
||||
<Button
|
||||
icon="pi pi-times"
|
||||
label="Resetează"
|
||||
severity="secondary"
|
||||
outlined
|
||||
size="small"
|
||||
@click="clearFilters"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Loading -->
|
||||
@@ -343,7 +415,6 @@
|
||||
rounded
|
||||
size="small"
|
||||
@click="viewReceipt(data.id)"
|
||||
v-tooltip="'Vizualizează'"
|
||||
/>
|
||||
<Button
|
||||
icon="pi pi-ellipsis-v"
|
||||
@@ -351,7 +422,6 @@
|
||||
rounded
|
||||
size="small"
|
||||
@click="toggleMenu($event, data)"
|
||||
v-tooltip="'Acțiuni'"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -392,6 +462,7 @@ const bulkApproving = ref(false)
|
||||
|
||||
// Mobile detection
|
||||
const isMobile = ref(window.innerWidth < 768)
|
||||
const showFilters = ref(false)
|
||||
const handleResize = () => {
|
||||
isMobile.value = window.innerWidth < 768
|
||||
}
|
||||
@@ -469,11 +540,31 @@ const directionOptions = [
|
||||
{ value: 'incasare', label: 'Încasări' },
|
||||
]
|
||||
|
||||
// Status filter options (for mobile dropdown)
|
||||
const statusOptions = [
|
||||
{ value: null, label: 'Toate' },
|
||||
{ value: 'draft', label: 'Ciorne' },
|
||||
{ value: 'pending_review', label: 'În așteptare' },
|
||||
{ value: 'approved', label: 'Validate' },
|
||||
{ value: 'rejected', label: 'Respinse' },
|
||||
]
|
||||
|
||||
const receipts = computed(() => store.receipts)
|
||||
const loading = computed(() => store.loading)
|
||||
const pagination = computed(() => store.pagination)
|
||||
const stats = computed(() => store.stats)
|
||||
|
||||
// Check if any filters are active (for mobile filter indicator)
|
||||
const hasActiveFilters = computed(() => {
|
||||
return (
|
||||
filters.value.status !== null ||
|
||||
filters.value.search !== '' ||
|
||||
filters.value.direction !== null ||
|
||||
filters.value.dateFrom !== null ||
|
||||
filters.value.dateTo !== null
|
||||
)
|
||||
})
|
||||
|
||||
const formatDate = (dateStr) => {
|
||||
if (!dateStr) return '-'
|
||||
const date = new Date(dateStr)
|
||||
@@ -570,6 +661,18 @@ const clearFilters = async () => {
|
||||
await store.fetchReceipts()
|
||||
}
|
||||
|
||||
// Refresh data (for mobile toolbar)
|
||||
const refreshData = async () => {
|
||||
await store.fetchReceipts()
|
||||
await store.fetchStats()
|
||||
toast.add({
|
||||
severity: 'success',
|
||||
summary: 'Actualizare reușită',
|
||||
detail: 'Datele au fost actualizate',
|
||||
life: 3000
|
||||
})
|
||||
}
|
||||
|
||||
const onPageChange = async (event) => {
|
||||
selectedReceipts.value = [] // Clear selection on page change
|
||||
store.setPage(event.page + 1)
|
||||
@@ -591,12 +694,19 @@ const nextPage = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const goToCreate = () => {
|
||||
console.log('[ReceiptsList] Navigating to create...')
|
||||
router.push('/data-entry/create').catch(err => {
|
||||
console.error('[ReceiptsList] Navigation error:', err)
|
||||
})
|
||||
}
|
||||
|
||||
const viewReceipt = (id) => {
|
||||
router.push(`/receipt/${id}`)
|
||||
router.push(`/data-entry/${id}`)
|
||||
}
|
||||
|
||||
const editReceipt = (id) => {
|
||||
router.push(`/receipt/${id}/edit`)
|
||||
router.push(`/data-entry/${id}/edit`)
|
||||
}
|
||||
|
||||
const confirmDelete = (receipt) => {
|
||||
@@ -830,14 +940,23 @@ const approveSelected = async () => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* Status Filters Row */
|
||||
.status-row {
|
||||
/* Status Filters + Action Button Row */
|
||||
.status-actions-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 1rem;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 0.75rem;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.status-chips {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 0.75rem;
|
||||
padding-bottom: 0.5rem;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.status-chip {
|
||||
@@ -901,16 +1020,26 @@ const approveSelected = async () => {
|
||||
}
|
||||
|
||||
.filter-search {
|
||||
flex: 1;
|
||||
min-width: 150px;
|
||||
flex: 1 1 200px;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.filter-date {
|
||||
width: 120px;
|
||||
width: 130px;
|
||||
}
|
||||
|
||||
.filter-direction {
|
||||
width: 100px;
|
||||
width: 110px;
|
||||
}
|
||||
|
||||
.filter-status {
|
||||
width: 140px;
|
||||
}
|
||||
|
||||
.filter-actions {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
/* Compact DataTable */
|
||||
@@ -939,20 +1068,23 @@ const approveSelected = async () => {
|
||||
.receipt-cards {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem;
|
||||
gap: 0.625rem;
|
||||
}
|
||||
|
||||
.receipt-card {
|
||||
background: white;
|
||||
border-radius: 6px;
|
||||
padding: 0.625rem 0.75rem;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
|
||||
border-radius: 8px;
|
||||
padding: 0.75rem;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
cursor: pointer;
|
||||
border: 1px solid #e2e8f0;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.receipt-card:active {
|
||||
background: #f8fafc;
|
||||
transform: scale(0.99);
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.card-row-1 {
|
||||
@@ -1091,20 +1223,84 @@ const approveSelected = async () => {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
padding: 0.75rem 0;
|
||||
padding: 1rem 0 0.5rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.page-info {
|
||||
font-size: 0.875rem;
|
||||
color: #64748b;
|
||||
font-weight: 500;
|
||||
color: #475569;
|
||||
min-width: 60px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/* Mobile Toolbar */
|
||||
.mobile-toolbar-container {
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
.mobile-toolbar-buttons {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
/* Action buttons (Filtre, Resetează) - equal width */
|
||||
.mobile-toolbar-buttons .p-button-outlined {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* Bon Nou button - highlighted, takes more space */
|
||||
.mobile-toolbar-buttons .p-button-success {
|
||||
flex: 1.2;
|
||||
min-width: 0;
|
||||
justify-content: center;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Active filter indicator */
|
||||
.filter-active {
|
||||
border-color: var(--primary-color, #2563eb) !important;
|
||||
background: rgba(37, 99, 235, 0.05) !important;
|
||||
color: var(--primary-color, #2563eb) !important;
|
||||
}
|
||||
|
||||
/* Force green background for Bon Nou button (desktop) */
|
||||
.status-actions-row .p-button.p-button-success {
|
||||
background: var(--green-600, #16a34a) !important;
|
||||
border-color: var(--green-600, #16a34a) !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.status-actions-row .p-button.p-button-success:hover {
|
||||
background: var(--green-700, #15803d) !important;
|
||||
border-color: var(--green-700, #15803d) !important;
|
||||
}
|
||||
|
||||
/* Mobile responsive */
|
||||
@media (max-width: 768px) {
|
||||
/* Status row mobile */
|
||||
.status-row {
|
||||
.receipts-list-view {
|
||||
padding: 0.75rem;
|
||||
}
|
||||
|
||||
/* Status + Action Row mobile */
|
||||
.status-actions-row {
|
||||
gap: 0.75rem;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.status-chips {
|
||||
width: 100%;
|
||||
gap: 0.25rem;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.status-actions-row .p-button {
|
||||
flex: 0 0 auto;
|
||||
min-width: 140px;
|
||||
}
|
||||
|
||||
.status-chip {
|
||||
@@ -1112,25 +1308,35 @@ const approveSelected = async () => {
|
||||
padding: 0.2rem 0.4rem;
|
||||
}
|
||||
|
||||
/* Filters row mobile - grid layout */
|
||||
/* Filters row mobile - compact grid layout */
|
||||
.filters-row {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 0.5rem;
|
||||
padding-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
/* Search field - full width at top */
|
||||
.filters-row .filter-search {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.filter-search,
|
||||
/* Status dropdown - full width below search */
|
||||
.filters-row .filter-status {
|
||||
grid-column: 1 / -1;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
/* Direction and dates - 2 columns */
|
||||
.filter-direction,
|
||||
.filter-date {
|
||||
width: 100% !important;
|
||||
min-width: unset !important;
|
||||
}
|
||||
|
||||
.filters-row .p-button {
|
||||
flex: 1;
|
||||
/* Remove desktop filter action buttons on mobile */
|
||||
.filter-actions {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user