create-protobase 0.63.5 → 0.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/templates/erp/config/categories/ui.ts +1 -0
- package/dist/templates/erp/config/companies/ui.ts +4 -1
- package/dist/templates/erp/config/countries/ui.ts +1 -0
- package/dist/templates/erp/config/currencies/ui.ts +1 -0
- package/dist/templates/erp/config/invoice_lines/ui.ts +1 -1
- package/dist/templates/erp/config/invoices/ui.ts +7 -4
- package/dist/templates/erp/config/locations/ui.ts +1 -0
- package/dist/templates/erp/config/order_lines/ui.ts +1 -0
- package/dist/templates/erp/config/orders/ui.ts +5 -2
- package/dist/templates/erp/config/organizations/ui.ts +1 -0
- package/dist/templates/erp/config/people/ui.ts +1 -0
- package/dist/templates/erp/config/products/ui.ts +2 -0
- package/dist/templates/erp/config/stock_levels/ui.ts +1 -0
- package/dist/templates/erp/config/stock_moves/ui.ts +6 -3
- package/dist/templates/erp/config/tags/ui.ts +1 -0
- package/dist/templates/erp/config/users/ui.ts +1 -0
- package/dist/templates/erp/config/warehouses/ui.ts +2 -0
- package/dist/templates/erp/package.json +6 -6
- package/dist/templates/property-portal/config/listings/ui.ts +3 -3
- package/dist/templates/property-portal/package.json +6 -6
- package/dist/templates/real-estate/config/arrears/ui.ts +1 -1
- package/dist/templates/real-estate/config/deposits/ui.ts +2 -2
- package/dist/templates/real-estate/config/leases/ui.ts +2 -2
- package/dist/templates/real-estate/config/organizations/ui.ts +1 -0
- package/dist/templates/real-estate/config/payments/ui.ts +2 -1
- package/dist/templates/real-estate/config/rent_charges/ui.ts +3 -3
- package/dist/templates/real-estate/config/tenants/ui.ts +1 -1
- package/dist/templates/real-estate/config/tickets/ui.ts +3 -1
- package/dist/templates/real-estate/config/units/ui.ts +1 -1
- package/dist/templates/real-estate/config/users/ui.ts +1 -0
- package/dist/templates/real-estate/config/valuations/ui.ts +1 -1
- package/dist/templates/real-estate/config/vendors/ui.ts +1 -1
- package/dist/templates/real-estate/config/work_orders/ui.ts +1 -1
- package/dist/templates/real-estate/package.json +6 -6
- package/dist/templates/scratch/package.json +6 -6
- package/package.json +2 -2
|
@@ -3,6 +3,7 @@ import type { categories } from './data'
|
|
|
3
3
|
|
|
4
4
|
export const categoriesView = view<typeof categories>('categories')
|
|
5
5
|
.names({ singular: 'Category', plural: 'Categories' })
|
|
6
|
+
.icon('tags')
|
|
6
7
|
.list((r) => ({ columns: [r.name, r.slug, r.position] }))
|
|
7
8
|
.layout((r) => [
|
|
8
9
|
l.section('Category', [r.name, r.slug, r.parent_id, r.position]),
|
|
@@ -4,9 +4,12 @@ import type { companies } from './data'
|
|
|
4
4
|
export const companiesView = view<typeof companies>('companies')
|
|
5
5
|
.title((r) => r.name)
|
|
6
6
|
.names({ singular: 'Company', plural: 'Companies' })
|
|
7
|
+
.icon('building')
|
|
7
8
|
.fields((r) => ({
|
|
8
9
|
name: r.name.help('The registered name, as it should appear on invoices.'),
|
|
9
|
-
status: r.status.help('Leads have not ordered yet; dormant companies have not ordered in a year.').format('badge')
|
|
10
|
+
status: r.status.help('Leads have not ordered yet; dormant companies have not ordered in a year.').format('badge')
|
|
11
|
+
.valueLabels({ lead: 'Lead', active: 'Active', dormant: 'Dormant' })
|
|
12
|
+
.valueColors({ lead: 'blue', active: 'green' }),
|
|
10
13
|
country_code: r.country_code.label('Country'),
|
|
11
14
|
vat_number: r.vat_number.label('VAT number').help('Required for invoices to other EU countries.').format('code'),
|
|
12
15
|
created_at: r.created_at.label('Created').format('absolute'),
|
|
@@ -4,5 +4,5 @@ import type { invoiceLines } from './data'
|
|
|
4
4
|
export const invoiceLinesView = view<typeof invoiceLines>('invoice_lines')
|
|
5
5
|
.nav({ hidden: true })
|
|
6
6
|
.names({ singular: 'Invoice line', plural: 'Invoice lines' })
|
|
7
|
-
.fields((r) => ({ product_id: r.product_id.label('Product'), unit_price: r.unit_price.prefix('€').decimals(2), line_total: r.line_total.prefix('€').decimals(2) }))
|
|
7
|
+
.fields((r) => ({ product_id: r.product_id.label('Product'), quantity: r.quantity.format('signed'), unit_price: r.unit_price.prefix('€').currency('EUR').decimals(2), line_total: r.line_total.prefix('€').currency('EUR').decimals(2) }))
|
|
8
8
|
.list((r) => ({ columns: [r.position, r.product_id, r.description, r.quantity, r.unit_price, r.line_total] }))
|
|
@@ -4,18 +4,21 @@ import type { invoices } from './data'
|
|
|
4
4
|
export const invoicesView = view<typeof invoices>('invoices')
|
|
5
5
|
.title((r) => r.number)
|
|
6
6
|
.names({ singular: 'Invoice', plural: 'Invoices' })
|
|
7
|
+
.icon('file-text')
|
|
7
8
|
.nav({ recent: { status: 'status', tones: { draft: 'neutral', sent: 'info', overdue: 'danger' }, filter: 'status != "paid"', orderBy: 'issued_at desc', limit: 3 } })
|
|
8
9
|
.fields((r) => ({
|
|
9
10
|
number: r.number.help('Assigned when the invoice is created.').format('code'),
|
|
10
11
|
company_id: r.company_id.label('Customer').help('The company that receives the invoice.'),
|
|
11
12
|
order_id: r.order_id.label('Order').help('The sales order this invoice bills, if any.'),
|
|
12
|
-
status: r.status.help('Sent invoices are emailed to the customer; overdue ones trigger reminders.').format('badge')
|
|
13
|
+
status: r.status.help('Sent invoices are emailed to the customer; overdue ones trigger reminders.').format('badge')
|
|
14
|
+
.valueLabels({ draft: 'Draft', sent: 'Sent', paid: 'Paid', overdue: 'Overdue' })
|
|
15
|
+
.valueColors({ sent: 'blue', paid: 'green', overdue: 'red' }),
|
|
13
16
|
issued_at: r.issued_at.label('Issue date').help('The date printed on the invoice.'),
|
|
14
17
|
due_at: r.due_at.label('Due date').help('Usually the issue date plus the payment terms.'),
|
|
15
18
|
vat_rate: r.vat_rate.label('VAT rate').help('Percentage added to the subtotal.').format('percent'),
|
|
16
|
-
subtotal: r.subtotal.prefix('€').decimals(2),
|
|
17
|
-
vat: r.vat.label('VAT').prefix('€').decimals(2),
|
|
18
|
-
total: r.total.help('Subtotal plus VAT.').prefix('€').decimals(2),
|
|
19
|
+
subtotal: r.subtotal.prefix('€').currency('EUR').decimals(2),
|
|
20
|
+
vat: r.vat.label('VAT').prefix('€').currency('EUR').decimals(2),
|
|
21
|
+
total: r.total.help('Subtotal plus VAT.').prefix('€').currency('EUR').decimals(2),
|
|
19
22
|
}))
|
|
20
23
|
.list((r) => ({
|
|
21
24
|
columns: [r.number, r.company_id, r.status, r.issued_at, r.due_at, r.total],
|
|
@@ -4,4 +4,5 @@ import type { orderLines } from './data'
|
|
|
4
4
|
export const orderLinesView = view<typeof orderLines>('order_lines')
|
|
5
5
|
.nav({ hidden: true })
|
|
6
6
|
.names({ singular: 'Order line', plural: 'Order lines' })
|
|
7
|
+
.fields((r) => ({ quantity: r.quantity.format('signed') }))
|
|
7
8
|
.list((r) => ({ columns: [r.quantity, r.unit_price, r.product_id] }))
|
|
@@ -4,6 +4,7 @@ import type { orders } from './data'
|
|
|
4
4
|
export const ordersView = view<typeof orders>('orders')
|
|
5
5
|
.title((r) => r.number)
|
|
6
6
|
.names({ singular: 'Order', plural: 'Orders' })
|
|
7
|
+
.icon('shopping-cart')
|
|
7
8
|
.nav({
|
|
8
9
|
recent: {
|
|
9
10
|
status: 'status',
|
|
@@ -14,9 +15,11 @@ export const ordersView = view<typeof orders>('orders')
|
|
|
14
15
|
},
|
|
15
16
|
})
|
|
16
17
|
.fields((r) => ({
|
|
18
|
+
number: r.number.format('code'),
|
|
17
19
|
status: r.status.help('Where the order is in its life. Moving it forward can notify the customer.').format('badge')
|
|
18
|
-
.valueLabels({ draft: 'Draft', confirmed: 'Confirmed', picking: 'Picking', shipped: 'Shipped', delivered: 'Delivered', cancelled: 'Cancelled' })
|
|
19
|
-
|
|
20
|
+
.valueLabels({ draft: 'Draft', confirmed: 'Confirmed', picking: 'Picking', shipped: 'Shipped', delivered: 'Delivered', cancelled: 'Cancelled' })
|
|
21
|
+
.valueColors({ confirmed: 'blue', picking: 'amber', shipped: 'violet', delivered: 'green', cancelled: 'red' }),
|
|
22
|
+
total: r.total.help('Order total including VAT.').prefix('€').currency('EUR').decimals(2),
|
|
20
23
|
discount_percent: r.discount_percent.label('Discount').help('Percentage taken off the order total.').format('percent'),
|
|
21
24
|
paid: r.paid.help('Set when the payment has been received.'),
|
|
22
25
|
created_at: r.created_at.label('Created').format('absolute'),
|
|
@@ -3,4 +3,5 @@ import type { organizations } from './data'
|
|
|
3
3
|
|
|
4
4
|
export const organizationsView = view<typeof organizations>('organizations')
|
|
5
5
|
.names({ singular: 'Organization', plural: 'Organizations' })
|
|
6
|
+
.icon('settings')
|
|
6
7
|
.list((r) => ({ columns: [r.name, r.slug, r.country_code, r.currency_code] }))
|
|
@@ -3,4 +3,6 @@ import type { products } from './data'
|
|
|
3
3
|
|
|
4
4
|
export const productsView = view<typeof products>('products')
|
|
5
5
|
.names({ singular: 'Product', plural: 'Products' })
|
|
6
|
+
.icon('package')
|
|
7
|
+
.fields((r) => ({ sku: r.sku.format('code') }))
|
|
6
8
|
.list((r) => ({ columns: [r.sku, r.name, r.price, r.active] }))
|
|
@@ -3,4 +3,5 @@ import type { stockLevels } from './data'
|
|
|
3
3
|
|
|
4
4
|
export const stockLevelsView = view<typeof stockLevels>('stock_levels')
|
|
5
5
|
.names({ singular: 'Stock level', plural: 'Stock levels' })
|
|
6
|
+
.fields((r) => ({ quantity: r.quantity.format('signed') }))
|
|
6
7
|
.list((r) => ({ columns: [r.quantity] }))
|
|
@@ -6,10 +6,13 @@ export const stockMovesView = view<typeof stockMoves>('stock_moves')
|
|
|
6
6
|
.fields((r) => ({
|
|
7
7
|
moved_at: r.moved_at.label('Moved at').format('absolute'),
|
|
8
8
|
product_id: r.product_id.label('Product'),
|
|
9
|
-
kind: r.kind.label('Type').help('Receipts add stock, issues remove it, transfers move it between locations.').format('badge')
|
|
10
|
-
|
|
9
|
+
kind: r.kind.label('Type').help('Receipts add stock, issues remove it, transfers move it between locations.').format('badge')
|
|
10
|
+
.valueLabels({ receipt: 'Receipt', issue: 'Issue', transfer: 'Transfer', adjustment: 'Adjustment' })
|
|
11
|
+
.valueColors({ receipt: 'green', issue: 'blue', transfer: 'violet', adjustment: 'amber' }),
|
|
12
|
+
quantity: r.quantity.help('Negative for issues.').format('signed'),
|
|
11
13
|
warehouse_id: r.warehouse_id.label('Warehouse'),
|
|
12
|
-
unit_cost: r.unit_cost.label('Unit cost').prefix('€').decimals(2),
|
|
14
|
+
unit_cost: r.unit_cost.label('Unit cost').prefix('€').currency('EUR').decimals(2),
|
|
15
|
+
reference: r.reference.format('code'),
|
|
13
16
|
user_id: r.user_id.label('By'),
|
|
14
17
|
}))
|
|
15
18
|
.list((r) => ({
|
|
@@ -3,6 +3,7 @@ import type { users } from './data'
|
|
|
3
3
|
|
|
4
4
|
export const usersView = view<typeof users>('users')
|
|
5
5
|
.names({ singular: 'User', plural: 'Users' })
|
|
6
|
+
.icon('users')
|
|
6
7
|
// Reached from the records that name a user; the profile menu's Users is the accounts page.
|
|
7
8
|
.nav({ hidden: true })
|
|
8
9
|
.fields((r) => ({ role: r.role.valueLabels({ admin: 'Admin', sales: 'Sales', finance: 'Finance', warehouse: 'Warehouse' }) }))
|
|
@@ -3,4 +3,6 @@ import type { warehouses } from './data'
|
|
|
3
3
|
|
|
4
4
|
export const warehousesView = view<typeof warehouses>('warehouses')
|
|
5
5
|
.names({ singular: 'Warehouse', plural: 'Warehouses' })
|
|
6
|
+
.icon('warehouse')
|
|
7
|
+
.fields((r) => ({ code: r.code.format('code') }))
|
|
6
8
|
.list((r) => ({ columns: [r.code, r.name, r.city] }))
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"zod": "^4.6.5"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@protobase/cli": "^0.
|
|
31
|
-
"@protobase/config": "^0.
|
|
32
|
-
"@protobase/layout": "^0.
|
|
33
|
-
"@protobase/schema": "^0.
|
|
34
|
-
"@protobase/server": "^0.
|
|
35
|
-
"@protobase/ui": "^0.
|
|
30
|
+
"@protobase/cli": "^0.65.0",
|
|
31
|
+
"@protobase/config": "^0.65.0",
|
|
32
|
+
"@protobase/layout": "^0.65.0",
|
|
33
|
+
"@protobase/schema": "^0.65.0",
|
|
34
|
+
"@protobase/server": "^0.65.0",
|
|
35
|
+
"@protobase/ui": "^0.65.0",
|
|
36
36
|
"@types/node": "^22.20.5",
|
|
37
37
|
"@types/pg": "^8.23.1",
|
|
38
38
|
"@types/react": "^19.3.0",
|
|
@@ -25,11 +25,11 @@ export const listingsView = view<typeof listings>('listings')
|
|
|
25
25
|
place_id: r.place_id.label('Place'),
|
|
26
26
|
property_type: r.property_type.label('Type').valueLabels(propertyTypeLabels).icon('house'),
|
|
27
27
|
status: r.status.format('badge').valueLabels({ available: 'Available', under_offer: 'Under offer', sold: 'Sold', let: 'Let' }),
|
|
28
|
-
purchase_price: r.purchase_price.label('Purchase price').prefix('€').decimals(0).help('The asking price. Empty when the home is not for sale.').icon('tag'),
|
|
29
|
-
rent_price: r.rent_price.label('Rent').prefix('€').suffix(' /month').decimals(0).help('The rent per month. Empty when the home is not for rent.').icon('key'),
|
|
28
|
+
purchase_price: r.purchase_price.label('Purchase price').prefix('€').currency('EUR').decimals(0).help('The asking price. Empty when the home is not for sale.').icon('tag'),
|
|
29
|
+
rent_price: r.rent_price.label('Rent').prefix('€').currency('EUR').suffix(' /month').decimals(0).help('The rent per month. Empty when the home is not for rent.').icon('key'),
|
|
30
30
|
for_sale: r.for_sale.label('For sale'),
|
|
31
31
|
for_rent: r.for_rent.label('For rent'),
|
|
32
|
-
price_per_m2: r.price_per_m2.label('Price per m²').prefix('€').decimals(0).help('From the purchase price.'),
|
|
32
|
+
price_per_m2: r.price_per_m2.label('Price per m²').prefix('€').currency('EUR').decimals(0).help('From the purchase price.'),
|
|
33
33
|
living_area: r.living_area.label('Living area').suffix(' m²').icon('ruler'),
|
|
34
34
|
plot_area: r.plot_area.label('Plot').suffix(' m²').icon('land-plot'),
|
|
35
35
|
rooms: r.rooms.icon('door-open'),
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"zod": "^4.6.5"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@protobase/cli": "^0.
|
|
31
|
-
"@protobase/config": "^0.
|
|
32
|
-
"@protobase/layout": "^0.
|
|
33
|
-
"@protobase/schema": "^0.
|
|
34
|
-
"@protobase/server": "^0.
|
|
35
|
-
"@protobase/ui": "^0.
|
|
30
|
+
"@protobase/cli": "^0.65.0",
|
|
31
|
+
"@protobase/config": "^0.65.0",
|
|
32
|
+
"@protobase/layout": "^0.65.0",
|
|
33
|
+
"@protobase/schema": "^0.65.0",
|
|
34
|
+
"@protobase/server": "^0.65.0",
|
|
35
|
+
"@protobase/ui": "^0.65.0",
|
|
36
36
|
"@types/node": "^22.20.5",
|
|
37
37
|
"@types/pg": "^8.23.1",
|
|
38
38
|
"@types/react": "^19.3.0",
|
|
@@ -7,7 +7,7 @@ export const arrearsView = view<typeof arrears>('arrears')
|
|
|
7
7
|
.fields((r) => ({
|
|
8
8
|
lease_id: r.lease_id.label('Lease'),
|
|
9
9
|
open_charges: r.open_charges.label('Open months').help('Charges not yet paid in full.'),
|
|
10
|
-
balance: r.balance.label('Outstanding').prefix('€').decimals(2),
|
|
10
|
+
balance: r.balance.label('Outstanding').prefix('€').currency('EUR').decimals(2),
|
|
11
11
|
oldest_due_on: r.oldest_due_on.label('Oldest due'),
|
|
12
12
|
}))
|
|
13
13
|
.list((r) => ({ columns: [r.lease_id, r.balance, r.open_charges, r.oldest_due_on], sort: [[r.balance, 'desc']] }))
|
|
@@ -5,9 +5,9 @@ export const depositsView = view<typeof deposits>('deposits')
|
|
|
5
5
|
.names({ singular: 'Deposit', plural: 'Deposits' })
|
|
6
6
|
.fields((r) => ({
|
|
7
7
|
lease_id: r.lease_id.label('Lease'),
|
|
8
|
-
amount: r.amount.help('Usually two months of the first rent.').prefix('€').decimals(2),
|
|
8
|
+
amount: r.amount.help('Usually two months of the first rent.').prefix('€').currency('EUR').decimals(2),
|
|
9
9
|
status: r.status.help('Held while the lease runs; settled after the move-out inspection.').format('badge').valueLabels({ held: 'Held', returned: 'Returned', partially_returned: 'Partially returned', withheld: 'Withheld' }),
|
|
10
|
-
returned_amount: r.returned_amount.prefix('€').decimals(2),
|
|
10
|
+
returned_amount: r.returned_amount.prefix('€').currency('EUR').decimals(2),
|
|
11
11
|
}))
|
|
12
12
|
.list((r) => ({ columns: [r.lease_id, r.amount, r.status, r.received_on, r.returned_on, r.returned_amount] }))
|
|
13
13
|
.filters((r, w) => [w.facets(r.status)])
|
|
@@ -10,8 +10,8 @@ export const leasesView = view<typeof leases>('leases')
|
|
|
10
10
|
term: r.term.help('Indefinite leases run until notice; fixed ones end on their end date.').format('badge').valueLabels({ indefinite: 'Indefinite', fixed: 'Fixed' }),
|
|
11
11
|
start_date: r.start_date.label('Start'),
|
|
12
12
|
end_date: r.end_date.label('End').help('The last day of the tenancy. Empty while an indefinite lease runs.'),
|
|
13
|
-
monthly_rent: r.monthly_rent.help('Current rent; it rises every 1 July.').prefix('€').decimals(2),
|
|
14
|
-
service_costs: r.service_costs.help('Monthly advance for shared services, billed with the rent.').prefix('€').decimals(2),
|
|
13
|
+
monthly_rent: r.monthly_rent.help('Current rent; it rises every 1 July.').prefix('€').currency('EUR').decimals(2),
|
|
14
|
+
service_costs: r.service_costs.help('Monthly advance for shared services, billed with the rent.').prefix('€').currency('EUR').decimals(2),
|
|
15
15
|
notice_given_on: r.notice_given_on.label('Notice given'),
|
|
16
16
|
}))
|
|
17
17
|
.list((r) => ({ columns: [r.number, r.unit_id, r.term, r.start_date, r.end_date, r.monthly_rent], sort: [[r.start_date, 'desc']], search: [r.number] }))
|
|
@@ -3,5 +3,6 @@ import type { organizations } from './data'
|
|
|
3
3
|
|
|
4
4
|
export const organizationsView = view<typeof organizations>('organizations')
|
|
5
5
|
.names({ singular: 'Organization', plural: 'Organizations' })
|
|
6
|
+
.icon('settings')
|
|
6
7
|
.fields((r) => ({ kvk_number: r.kvk_number.label('KvK number').help('Chamber of Commerce registration.').format('code') }))
|
|
7
8
|
.list((r) => ({ columns: [r.name, r.slug, r.city, r.kvk_number] }))
|
|
@@ -6,8 +6,9 @@ export const paymentsView = view<typeof payments>('payments')
|
|
|
6
6
|
.fields((r) => ({
|
|
7
7
|
charge_id: r.charge_id.label('Charge'),
|
|
8
8
|
paid_on: r.paid_on.label('Paid on'),
|
|
9
|
-
amount: r.amount.prefix('€').decimals(2),
|
|
9
|
+
amount: r.amount.prefix('€').currency('EUR').decimals(2),
|
|
10
10
|
method: r.method.help('Direct debit is collected on the first; transfers and iDEAL come in when the tenant pays.').format('badge').valueLabels({ direct_debit: 'Direct debit', bank_transfer: 'Bank transfer', ideal: 'iDEAL' }),
|
|
11
|
+
reference: r.reference.format('code'),
|
|
11
12
|
}))
|
|
12
13
|
.list((r) => ({ columns: [r.charge_id, r.paid_on, r.amount, r.method, r.reference], sort: [[r.paid_on, 'desc']] }))
|
|
13
14
|
.filters((r, w) => [w.facets(r.method), w.dateRange(r.paid_on, { presets: ['7d', '30d', '90d', 'year'] })])
|
|
@@ -8,9 +8,9 @@ export const rentChargesView = view<typeof rentCharges>('rent_charges')
|
|
|
8
8
|
lease_id: r.lease_id.label('Lease'),
|
|
9
9
|
period: r.period.help('The month the charge is for.'),
|
|
10
10
|
due_on: r.due_on.label('Due'),
|
|
11
|
-
amount: r.amount.help('Rent plus service costs for the month.').prefix('€').decimals(2),
|
|
12
|
-
paid_amount: r.paid_amount.label('Paid').help('The sum of the payments on this charge.').prefix('€').decimals(2),
|
|
13
|
-
outstanding: r.outstanding.help('What is still owed: the amount minus the payments.').prefix('€').decimals(2),
|
|
11
|
+
amount: r.amount.help('Rent plus service costs for the month.').prefix('€').currency('EUR').decimals(2),
|
|
12
|
+
paid_amount: r.paid_amount.label('Paid').help('The sum of the payments on this charge.').prefix('€').currency('EUR').decimals(2),
|
|
13
|
+
outstanding: r.outstanding.help('What is still owed: the amount minus the payments.').prefix('€').currency('EUR').decimals(2),
|
|
14
14
|
}))
|
|
15
15
|
.list((r) => ({ columns: [r.description, r.lease_id, r.due_on, r.amount, r.paid_amount, r.outstanding], sort: [[r.period, 'desc']] }))
|
|
16
16
|
.filters((r, w) => [w.dateRange(r.period, { presets: ['90d', 'quarter', 'year'] }), w.range(r.amount, { histogram: true })])
|
|
@@ -7,7 +7,7 @@ export const tenantsView = view<typeof tenants>('tenants')
|
|
|
7
7
|
.names({ singular: 'Tenant', plural: 'Tenants' })
|
|
8
8
|
.fields((r) => ({
|
|
9
9
|
iban: r.iban.label('IBAN').format('code'),
|
|
10
|
-
monthly_income: r.monthly_income.help('Gross income per month, checked when the lease was signed.').prefix('€').decimals(2),
|
|
10
|
+
monthly_income: r.monthly_income.help('Gross income per month, checked when the lease was signed.').prefix('€').currency('EUR').decimals(2),
|
|
11
11
|
}))
|
|
12
12
|
.list((r) => ({ columns: [r.last_name, r.first_name, r.email, r.phone, r.created_at], sort: [[r.created_at, 'desc']], search: [r.last_name, r.email] }))
|
|
13
13
|
.filters((r, w) => [w.dateRange(r.created_at, { presets: ['30d', '90d', 'year'] })])
|
|
@@ -32,7 +32,9 @@ export const ticketsView = view<typeof tickets>('tickets')
|
|
|
32
32
|
reported_by: r.reported_by.label('Reported by'),
|
|
33
33
|
assigned_to: r.assigned_to.label('Assigned to').help('The maintenance coordinator who plans the work.'),
|
|
34
34
|
priority: r.priority.format('badge').valueLabels({ low: 'Low', normal: 'Normal', high: 'High', urgent: 'Urgent' }),
|
|
35
|
-
status: r.status.help('Reported, then scheduled once a vendor visit is planned, then done or cancelled.').format('badge')
|
|
35
|
+
status: r.status.help('Reported, then scheduled once a vendor visit is planned, then done or cancelled.').format('badge')
|
|
36
|
+
.valueLabels({ reported: 'Reported', scheduled: 'Scheduled', done: 'Done', cancelled: 'Cancelled' })
|
|
37
|
+
.valueColors({ cancelled: 'red' }),
|
|
36
38
|
reported_at: r.reported_at.label('Reported'),
|
|
37
39
|
closed_at: r.closed_at.label('Closed'),
|
|
38
40
|
}))
|
|
@@ -12,7 +12,7 @@ export const unitsView = view<typeof units>('units')
|
|
|
12
12
|
property_id: r.property_id.label('Property'),
|
|
13
13
|
area_m2: r.area_m2.label('Area').help('Living area in m².').suffix(' m²'),
|
|
14
14
|
energy_label: r.energy_label.format('badge'),
|
|
15
|
-
base_rent: r.base_rent.label('Market rent').help('What a new lease would ask today, per month.').prefix('€').decimals(2),
|
|
15
|
+
base_rent: r.base_rent.label('Market rent').help('What a new lease would ask today, per month.').prefix('€').currency('EUR').decimals(2),
|
|
16
16
|
status: r.status.help('Let while a lease runs; vacant or under renovation between leases.').format('badge').valueLabels({ let: 'Let', vacant: 'Vacant', renovation: 'Renovation' }),
|
|
17
17
|
}))
|
|
18
18
|
.list((r) => ({ columns: [r.label, r.property_id, r.status, r.bedrooms, r.area_m2, r.energy_label, r.base_rent], search: [r.label] }))
|
|
@@ -4,6 +4,7 @@ import type { users } from './data'
|
|
|
4
4
|
export const usersView = view<typeof users>('users')
|
|
5
5
|
.title((r) => r.name)
|
|
6
6
|
.names({ singular: 'User', plural: 'Users' })
|
|
7
|
+
.icon('users')
|
|
7
8
|
// Reached from the records that name a user; the profile menu's Users is the accounts page.
|
|
8
9
|
.nav({ hidden: true })
|
|
9
10
|
.fields((r) => ({ role: r.role.format('badge').valueLabels({ admin: 'Admin', manager: 'Manager', finance: 'Finance', maintenance: 'Maintenance' }) }))
|
|
@@ -6,7 +6,7 @@ export const valuationsView = view<typeof valuations>('valuations')
|
|
|
6
6
|
.fields((r) => ({
|
|
7
7
|
property_id: r.property_id.label('Property'),
|
|
8
8
|
valued_on: r.valued_on.label('Valuation date'),
|
|
9
|
-
value: r.value.prefix('€').decimals(0),
|
|
9
|
+
value: r.value.prefix('€').currency('EUR').decimals(0),
|
|
10
10
|
source: r.source.help('WOZ is the municipal value set every year; an appraisal is a valuer\'s report.').format('badge').valueLabels({ woz: 'WOZ', appraisal: 'Appraisal' }),
|
|
11
11
|
}))
|
|
12
12
|
.list((r) => ({ columns: [r.property_id, r.valued_on, r.source, r.value], sort: [[r.valued_on, 'desc']] }))
|
|
@@ -13,6 +13,6 @@ export const vendorsView = view<typeof vendors>('vendors')
|
|
|
13
13
|
locksmith: 'Locksmith',
|
|
14
14
|
pest_control: 'Pest control',
|
|
15
15
|
general: 'General',
|
|
16
|
-
}), hourly_rate: r.hourly_rate.prefix('€').decimals(2) }))
|
|
16
|
+
}), hourly_rate: r.hourly_rate.prefix('€').currency('EUR').decimals(2) }))
|
|
17
17
|
.list((r) => ({ columns: [r.name, r.trade, r.phone, r.hourly_rate, r.active] }))
|
|
18
18
|
.filters((r, w) => [w.facets(r.trade)])
|
|
@@ -8,7 +8,7 @@ export const workOrdersView = view<typeof workOrders>('work_orders')
|
|
|
8
8
|
vendor_id: r.vendor_id.label('Vendor'),
|
|
9
9
|
scheduled_for: r.scheduled_for.label('Visit'),
|
|
10
10
|
completed_on: r.completed_on.label('Completed'),
|
|
11
|
-
cost: r.cost.help('Labour and materials, as invoiced by the vendor.').prefix('€').decimals(2),
|
|
11
|
+
cost: r.cost.help('Labour and materials, as invoiced by the vendor.').prefix('€').currency('EUR').decimals(2),
|
|
12
12
|
}))
|
|
13
13
|
.list((r) => ({ columns: [r.ticket_id, r.vendor_id, r.scheduled_for, r.completed_on, r.cost], sort: [[r.scheduled_for, 'desc']] }))
|
|
14
14
|
.filters((r, w) => [w.facets(r.vendor_id), w.dateRange(r.scheduled_for, { presets: ['7d', '30d', '90d'] })])
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"zod": "^4.6.5"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@protobase/cli": "^0.
|
|
31
|
-
"@protobase/config": "^0.
|
|
32
|
-
"@protobase/layout": "^0.
|
|
33
|
-
"@protobase/schema": "^0.
|
|
34
|
-
"@protobase/server": "^0.
|
|
35
|
-
"@protobase/ui": "^0.
|
|
30
|
+
"@protobase/cli": "^0.65.0",
|
|
31
|
+
"@protobase/config": "^0.65.0",
|
|
32
|
+
"@protobase/layout": "^0.65.0",
|
|
33
|
+
"@protobase/schema": "^0.65.0",
|
|
34
|
+
"@protobase/server": "^0.65.0",
|
|
35
|
+
"@protobase/ui": "^0.65.0",
|
|
36
36
|
"@types/node": "^22.20.5",
|
|
37
37
|
"@types/pg": "^8.23.1",
|
|
38
38
|
"@types/react": "^19.3.0",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"zod": "^4.6.5"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@protobase/cli": "^0.
|
|
28
|
-
"@protobase/config": "^0.
|
|
29
|
-
"@protobase/layout": "^0.
|
|
30
|
-
"@protobase/schema": "^0.
|
|
31
|
-
"@protobase/server": "^0.
|
|
32
|
-
"@protobase/ui": "^0.
|
|
27
|
+
"@protobase/cli": "^0.65.0",
|
|
28
|
+
"@protobase/config": "^0.65.0",
|
|
29
|
+
"@protobase/layout": "^0.65.0",
|
|
30
|
+
"@protobase/schema": "^0.65.0",
|
|
31
|
+
"@protobase/server": "^0.65.0",
|
|
32
|
+
"@protobase/ui": "^0.65.0",
|
|
33
33
|
"@types/node": "^22.20.5",
|
|
34
34
|
"@types/pg": "^8.23.1",
|
|
35
35
|
"@types/react": "^19.3.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-protobase",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.65.0",
|
|
4
4
|
"description": "npm create protobase: starts a new Protobase project from one of its presets, or on an existing Postgres database.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"postgres": "^3.4.9"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@protobase/cli": "0.
|
|
31
|
+
"@protobase/cli": "0.65.0"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|