Add shared Manifest UI for delivery, quote, and order.
Wire quote/order API clients and routes, then unify list/create/edit behind ManifestList/Form tiles so Lieferungen and Auftrag share one stack.
This commit is contained in:
@@ -297,6 +297,8 @@ export class StorageManager extends ApiClient {
|
||||
this.#loadCustomergroups(),
|
||||
);
|
||||
const entityCache = createCache('GET /entity', () => this.#loadEntities());
|
||||
const quoteCache = createCache('GET /quote', () => this.#loadQuotes());
|
||||
const orderCache = createCache('GET /order', () => this.#loadOrders());
|
||||
|
||||
Object.defineProperties(this, {
|
||||
authMePromise: { get: () => authMeCache.promise },
|
||||
@@ -350,6 +352,16 @@ export class StorageManager extends ApiClient {
|
||||
/** Settled GET /entity list, or undefined. */
|
||||
entities: { get: () => entityCache.value },
|
||||
|
||||
quotePromise: { get: () => quoteCache.promise },
|
||||
updateQuote: { value: quoteCache.update },
|
||||
/** Settled GET /quote list, or undefined. */
|
||||
quotes: { get: () => quoteCache.value },
|
||||
|
||||
orderPromise: { get: () => orderCache.promise },
|
||||
updateOrder: { value: orderCache.update },
|
||||
/** Settled GET /order list, or undefined. */
|
||||
orders: { get: () => orderCache.value },
|
||||
|
||||
/** Close and reopen GET /api/events (required after selected-company change). */
|
||||
reconnectEvents: { value: () => this.#reconnectEvents() },
|
||||
});
|
||||
@@ -494,6 +506,18 @@ export class StorageManager extends ApiClient {
|
||||
return requireArray(data.entities, 'entities');
|
||||
}
|
||||
|
||||
async #loadQuotes() {
|
||||
const data = await this.quote.list();
|
||||
requireObject(data, 'GET /api/quote');
|
||||
return requireArray(data.quotes, 'quotes');
|
||||
}
|
||||
|
||||
async #loadOrders() {
|
||||
const data = await this.order.list();
|
||||
requireObject(data, 'GET /api/order');
|
||||
return requireArray(data.orders, 'orders');
|
||||
}
|
||||
|
||||
async doSearch({ target, filter, offset, maxCount, onUpdate }) {
|
||||
const articles = await this.articleIndexPromise;
|
||||
const query = target.trim().toLowerCase();
|
||||
|
||||
Reference in New Issue
Block a user