u
This commit is contained in:
42
src/api/quote.js
Normal file
42
src/api/quote.js
Normal file
@@ -0,0 +1,42 @@
|
||||
import { http } from './http.js';
|
||||
|
||||
/**
|
||||
* Sales quotes (manifest type = quote).
|
||||
* Summary = { id, number, type: 'quote', entityId, date }
|
||||
* Line = { id, articleId, sku, amount, net, rebate, tax, comment } — no transactedAmount
|
||||
* LineInput = { sku, amount, net, tax, rebate?, comment? }
|
||||
*/
|
||||
export const quote = {
|
||||
/** GET /api/quote → { quotes: QuoteSummary[] } */
|
||||
list() {
|
||||
return http('/api/quote');
|
||||
},
|
||||
|
||||
/** GET /api/quote/:id → { quote: Quote } */
|
||||
get(id) {
|
||||
return http(`/api/quote/${id}`);
|
||||
},
|
||||
|
||||
/**
|
||||
* POST /api/quote
|
||||
* Body: { number, date, entityId?, lines }
|
||||
* → 201 { quote: Quote }
|
||||
*/
|
||||
create(body) {
|
||||
return http('/api/quote', { method: 'POST', body });
|
||||
},
|
||||
|
||||
/**
|
||||
* PATCH /api/quote/:id
|
||||
* Body: partial { number?, date?, entityId?, lines? }
|
||||
* → 200 { quote: Quote }
|
||||
*/
|
||||
update(id, body) {
|
||||
return http(`/api/quote/${id}`, { method: 'PATCH', body });
|
||||
},
|
||||
|
||||
/** DELETE /api/quote/:id → 204 */
|
||||
delete(id) {
|
||||
return http(`/api/quote/${id}`, { method: 'DELETE' });
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user