nervatura 5.0.0-beta.9 → 5.0.2

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/api.proto DELETED
@@ -1,1157 +0,0 @@
1
- syntax = "proto3";
2
-
3
- option go_package = "github.com/nervatura/nervatura-service/pkg/proto";
4
-
5
- package nervatura;
6
-
7
- /*
8
- Nervatura gRPC API
9
- */
10
- service API {
11
- // Logs in user by username and password
12
- rpc UserLogin (RequestUserLogin) returns (ResponseUserLogin) {}
13
- // User (employee or customer) password change.
14
- rpc UserPassword (RequestUserPassword) returns (ResponseEmpty) {}
15
- // JWT token auth.
16
- rpc TokenLogin (RequestEmpty) returns (ResponseTokenLogin) {}
17
- // Refreshes JWT token by checking at database whether refresh token exists.
18
- rpc TokenRefresh (RequestEmpty) returns (ResponseTokenRefresh) {}
19
- // Decoded JWT token but doesn't validate the signature.
20
- rpc TokenDecode (RequestTokenDecode) returns (ResponseTokenDecode) {}
21
- // Get returns one or more records
22
- rpc Get (RequestGet) returns (ResponseGet) {}
23
- // Add/update one or more items
24
- rpc Update (RequestUpdate) returns (ResponseUpdate) {}
25
- // Delete an item
26
- rpc Delete (RequestDelete) returns (ResponseEmpty) {}
27
- // Run raw SQL queries in safe mode
28
- rpc View (RequestView) returns (ResponseView) {}
29
- // Call a server-side function
30
- rpc Function (RequestFunction) returns (ResponseFunction) {}
31
- // Create and download a Nervatura Report
32
- rpc Report (RequestReport) returns (ResponseReport) {}
33
- // List all available Nervatura Report. Admin user group membership required.
34
- rpc ReportList (RequestReportList) returns (ResponseReportList) {}
35
- // Install a report to the database. Admin user group membership required.
36
- rpc ReportInstall (RequestReportInstall) returns (ResponseReportInstall) {}
37
- // Delete a report from the database. Admin user group membership required.
38
- rpc ReportDelete (RequestReportDelete) returns (ResponseEmpty) {}
39
- // Create a new Nervatura database
40
- rpc DatabaseCreate (RequestDatabaseCreate) returns (ResponseDatabaseCreate) {}
41
- }
42
-
43
- enum DataType {
44
- address = 0; // Address
45
- barcode = 1; // Barcode
46
- contact = 2; // Contact
47
- currency = 3; // Currency
48
- customer = 4; // Customer
49
- deffield = 5; // Deffield
50
- employee = 6; // Employee
51
- event = 7; // Event
52
- fieldvalue = 8; // Fieldvalue
53
- groups = 9; // Groups
54
- item = 10; // Item
55
- link = 11; // Link
56
- log = 12; // Log
57
- movement = 13; // Movement
58
- numberdef = 14; // Numberdef
59
- pattern = 15; // Pattern
60
- payment = 16; // Payment
61
- place = 17; // Place
62
- price = 18; // Price
63
- product = 19; // Product
64
- project = 20; // Project
65
- rate = 21; // Rate
66
- tax = 22; // Tax
67
- tool = 23; // Tool
68
- trans = 24; // Trans
69
- ui_audit = 25; // UiAudit
70
- ui_menu = 26; // UiMenu
71
- ui_menufields = 27; // UiMenufields
72
- ui_message = 28; // UiMessage
73
- ui_printqueue = 29; // UiPrintqueue
74
- ui_report = 30; // UiReport
75
- ui_userconfig = 31; // UiUserconfig
76
- }
77
-
78
- message Value {
79
- oneof value {
80
- bool boolean = 1;
81
- double number = 2;
82
- string text = 3;
83
- //google.protobuf.NullValue null = 4;
84
- }
85
- }
86
-
87
- message ResponseRows {
88
- message Item {
89
- map<string, Value> values = 1;
90
- }
91
- repeated Item items = 1;
92
- }
93
-
94
- // No parameters
95
- message RequestEmpty {}
96
-
97
- // Does not return content.
98
- message ResponseEmpty {}
99
-
100
- message RequestUserLogin {
101
- // Employee username or Customer custnumber (email or phone number)
102
- string username = 1;
103
- string password = 2;
104
- // Optional. Default value: NT_DEFAULT_ALIAS
105
- string database = 3;
106
- }
107
-
108
- message ResponseUserLogin {
109
- string token = 1; // Access JWT token
110
- string engine = 2; // Type of database
111
- string version = 3; // Service version
112
- }
113
-
114
- message RequestTokenDecode {
115
- string value = 1; // Access token code.
116
- }
117
-
118
- // Access token claims.
119
- message ResponseTokenDecode {
120
- string username = 1;
121
- string database = 2;
122
- double exp = 3; // JWT expiration time
123
- string iss = 4;
124
- }
125
-
126
- message ResponseTokenRefresh {
127
- string value = 1; // Access token code.
128
- }
129
-
130
- // Token user properties
131
- message ResponseTokenLogin {
132
- int64 id = 1;
133
- string username = 2;
134
- string empnumber = 3;
135
- int64 usergroup = 4;
136
- string scope = 5;
137
- string department = 6;
138
- }
139
-
140
- message RequestUserPassword {
141
- // New password
142
- string password = 1;
143
- // New password confirmation
144
- string confirm = 2;
145
- // Optional. Only if different from the logged in user. Admin user group membership required.
146
- string username = 3;
147
- // Optional. Only if different from the logged in user. Admin user group membership required.
148
- string custnumber = 4;
149
- }
150
-
151
- // New database props.
152
- message RequestDatabaseCreate {
153
- // Alias name of the database
154
- string alias = 1;
155
- // Create a DEMO database
156
- bool demo = 2;
157
- }
158
-
159
- // Result log data
160
- message ResponseDatabaseCreate {
161
- ResponseRows details = 1;
162
- }
163
-
164
- // Delete parameters
165
- message RequestDelete {
166
- DataType nervatype = 1;
167
- // The object ID
168
- int64 id = 36;
169
- // Use Key instead of ID
170
- string key = 37;
171
- }
172
-
173
- // Only "select" queries and functions can be executed. Changes to the data are not saved in the database.
174
- message RequestView {
175
- message Query {
176
- // Give the query a unique name
177
- string key = 1;
178
- // The SQL query as a string
179
- string text = 2;
180
- // The array of parameter values
181
- repeated Value values = 3;
182
- }
183
- // The array of Query object
184
- repeated Query options = 1;
185
- }
186
-
187
- message ResponseView {
188
- // key - results map
189
- map<string, ResponseRows> values = 1;
190
- }
191
-
192
- message RequestFunction {
193
- // Server function name
194
- string key = 1;
195
- // The array of parameter values
196
- map<string, Value> values = 2;
197
- }
198
-
199
- message ResponseFunction {
200
- bytes value = 1;
201
- }
202
-
203
- message RequestReportList {
204
- string label = 1;
205
- }
206
-
207
- // Returns all installable files from the NT_REPORT_DIR directory (empty value: all available built-in Nervatura Reports)
208
- message ResponseReportList {
209
- message Info {
210
- string reportkey = 1;
211
- string repname = 2;
212
- string description = 3;
213
- string label = 4;
214
- string reptype = 5;
215
- string filename = 6;
216
- bool installed = 7;
217
- }
218
- repeated Info items = 1;
219
- }
220
-
221
- /*
222
- Admin user group membership required.
223
- */
224
- message RequestReportInstall {
225
- // Example : ntr_invoice_en
226
- string reportkey = 1;
227
- }
228
-
229
- message ResponseReportInstall {
230
- // Returns a new report ID.
231
- int64 id = 1;
232
- }
233
-
234
- message RequestReportDelete {
235
- // Example : ntr_invoice_en
236
- string reportkey = 1;
237
- }
238
-
239
- enum ReportOrientation {
240
- portrait = 0;
241
- landscape = 1;
242
- }
243
-
244
- enum ReportSize {
245
- a3 = 0;
246
- a4 = 1;
247
- a5 = 2;
248
- letter = 3;
249
- legal = 4;
250
- }
251
-
252
- enum ReportOutput {
253
- auto = 0;
254
- xml = 1;
255
- data = 2;
256
- base64 = 3;
257
- }
258
-
259
- enum ReportType {
260
- report_none = 0;
261
- report_customer = 1;
262
- report_employee = 2;
263
- report_event = 3;
264
- report_place = 4;
265
- report_product = 5;
266
- report_project = 6;
267
- report_tool = 7;
268
- report_trans = 8;
269
- }
270
-
271
- message RequestReport {
272
- // Example : ntr_invoice_en
273
- string reportkey = 1;
274
- ReportOrientation orientation = 2;
275
- ReportSize size = 3;
276
- ReportOutput output = 4;
277
- ReportType type = 5;
278
- // Example : DMINV/00001
279
- string refnumber = 6;
280
- // Custom report JSON template
281
- string template = 7;
282
- map<string, Value> filters = 8;
283
- }
284
-
285
- message ResponseReport {
286
- bytes value = 1;
287
- }
288
-
289
- message RequestUpdate {
290
- message Item {
291
- map<string, Value> values = 1;
292
- map<string, Value> keys = 2;
293
- }
294
- DataType nervatype = 1;
295
- repeated Item items = 2;
296
- }
297
-
298
- // If the ID (or Key) value is missing, it creates a new item.
299
- message ResponseUpdate {
300
- // Returns the all new/updated IDs values.
301
- repeated int64 values = 1;
302
- }
303
-
304
- message RequestGet {
305
- DataType nervatype = 1;
306
- bool metadata = 2;
307
- repeated int64 ids = 3;
308
- repeated string filter = 7;
309
- }
310
-
311
- message ResponseGet {
312
- message Value {
313
- oneof value {
314
- Address address = 1;
315
- Barcode barcode = 2;
316
- Contact contact = 3;
317
- Currency currency = 4;
318
- Customer customer = 5;
319
- Deffield deffield = 6;
320
- Employee employee = 7;
321
- Event event = 8;
322
- Fieldvalue fieldvalue = 9;
323
- Groups groups = 10;
324
- Item item = 11;
325
- Link link = 12;
326
- Log log = 13;
327
- Movement movement = 14;
328
- Numberdef numberdef = 15;
329
- Pattern pattern = 16;
330
- Payment payment = 17;
331
- Place place = 18;
332
- Price price = 19;
333
- Product product = 20;
334
- Project project = 21;
335
- Rate rate = 22;
336
- Tax tax = 23;
337
- Tool tool = 24;
338
- Trans trans = 25;
339
- UiAudit ui_audit = 26;
340
- UiMenu ui_menu = 27;
341
- UiMenufields ui_menufields = 28;
342
- UiMessage ui_message = 29;
343
- UiPrintqueue ui_printqueue = 30;
344
- UiReport ui_report = 31;
345
- UiUserconfig ui_userconfig = 32;
346
- }
347
- }
348
- repeated Value values = 1;
349
- }
350
-
351
- message MetaData {
352
- int64 id = 1;
353
- // Reference to [Deffield](#deffield).fieldname.
354
- string fieldname = 2;
355
- // Reference to [Deffield](#deffield).fieldtype.
356
- string fieldtype = 3;
357
- string value = 4;
358
- string notes = 5;
359
- }
360
-
361
- /*
362
- RequestUpdate Key->ID keys:
363
-
364
- - ```id```: Value is a generated unique key identifier: *{nervatype}/{refnumber}~{rownumber}*. The *rownumber* is the order of multiple *{nervatype}/{refnumber}* keys. For example: ```customer/DMCUST/00001~1```
365
-
366
- - ```nervatype```: Valid values: *customer, employee, event, place, product, project, tool, trans*
367
-
368
- - ```ref_id```: Valid values: *customer/{custnumber}, employee/{empnumber}, event/{calnumber}, place/{planumber}, product/{partnumber},
369
- project/{pronumber}, tool/{serial}, trans/{transnumber}*
370
-
371
- */
372
- message Address {
373
- int64 id = 1;
374
- // Reference to [Groups](#groups).id (only where groupname = 'nervatype')
375
- int64 nervatype = 2;
376
- // Reference to [Customer](#customer).id, [Employee](#employee).id, [Event](#event).id, [Place](#place).id, [Product](#product).id, [Project](#project).id, [Tool](#tool).id, [Trans](#trans).id
377
- int64 ref_id = 3;
378
- string country = 4;
379
- string state = 5;
380
- string zipcode = 6;
381
- string city = 7;
382
- string street = 8;
383
- string notes = 9;
384
- // Address meta data
385
- repeated MetaData metadata = 10;
386
- }
387
-
388
- /*
389
- RequestUpdate Key->ID keys:
390
-
391
- - ```id```: Barcode *code*
392
-
393
- - ```barcodetype```: Valid values: *CODE_128, CODE_39, EAN_13, EAN_8, QR*
394
-
395
- - ```product_id```: Product *partnumber*
396
- */
397
- message Barcode {
398
- int64 id = 1;
399
- // Each product can be connected to any number of bar codes, but the code must remain unique to ensure that the product is clearly identifiable.
400
- string code = 2;
401
- // Reference to [Product](#product).id
402
- int64 product_id = 3;
403
- // Comment related to the barcode. Informal, has no role in identification.
404
- string description = 4;
405
- // Reference to [Groups](#groups).id (only where groupname = 'barcodetype').
406
- int64 barcodetype = 5;
407
- // The actual amount of the products identified by the barcode. For example can be used for packaged goods, tray packaging.
408
- double qty = 6;
409
- // If more than one bar code is assigned, this will be the default. Because of the uniqueness of the barcode the product is always clearly identifiable, but in reverse case (eg. in case the barcode should be printed on a document) we must assign one being the default for that product.
410
- bool defcode = 7;
411
- }
412
-
413
- /*
414
- RequestUpdate Key->ID keys:
415
-
416
- - ```id```: The value is a generated constant key identifier: *{nervatype}/{refnumber}~{rownumber}*. The rownumber is the order of multiple *{nervatype}/{refnumber}* keys.
417
-
418
- - ```nervatype```: Valid values: *customer, employee, event, place, product, project, tool, trans*
419
-
420
- - ```ref_id```: Valid values: *customer/{custnumber}, employee/{empnumber}, event/{calnumber}, place/{planumber}, product/{partnumber}, project/{pronumber}, tool/{serial}, trans/{transnumber}*
421
- */
422
- message Contact {
423
- int64 id = 1;
424
- // Reference to [Groups](#groups).id (only where groupname = 'nervatype')
425
- int64 nervatype = 2;
426
- // Reference to [Customer](#customer).id, [Employee](#employee).id, [Event](#event).id, [Place](#place).id, [Product](#product).id, [Project](#project).id, [Tool](#tool).id, [Trans](#trans).id
427
- int64 ref_id = 3;
428
- string firstname = 4;
429
- string surname = 5;
430
- string status = 6;
431
- string phone = 7;
432
- string fax = 8;
433
- string mobil = 9;
434
- string email = 10;
435
- string notes = 11;
436
- // Contact meta data
437
- repeated MetaData metadata = 12;
438
- }
439
-
440
- /*
441
- RequestUpdate Key->ID keys:
442
-
443
- - ```id```: Currency *curr*
444
- */
445
- message Currency {
446
- int64 id = 1;
447
- // The ISO 4217 code of the currency.
448
- string curr = 2;
449
- // The name of the currency.
450
- string description = 3;
451
- // The number of decimal places used for recording and rounding by the program. Default: 2
452
- int64 digit = 4;
453
- // Default Rate. You can specify an exchange rate vs. the default currency, which will be used by the reports.
454
- double defrate = 5;
455
- // Rounding value for cash. Could be used in case the smallest banknote in circulation for that certain currency is not 1.
456
- int64 cround = 6;
457
- // Currency meta data
458
- repeated MetaData metadata = 7;
459
- }
460
-
461
- /*
462
- RequestUpdate Key->ID keys:
463
-
464
- - ```id```: Customer *custnumber*
465
-
466
- - ```custtype```: Valid values: *own, company, private, other*
467
- */
468
- message Customer {
469
- int64 id = 1;
470
- // Reference to [Groups](#groups).id (only where groupname = 'custtype')
471
- int64 custtype = 2;
472
- // Unique ID. If you set it to numberdef, it will be generated at the first data save. The format and value of the next data in row is taken from the numberdef (numberkey = custnumber) data series.
473
- string custnumber = 3;
474
- // Full name of the customer
475
- string custname = 4;
476
- string taxnumber = 5;
477
- string account = 6;
478
- // Tax-free
479
- bool notax = 7;
480
- // Payment per.
481
- int64 terms = 8;
482
- // Customer's credit limit. Data is used by financial reports.
483
- double creditlimit = 9;
484
- // If new product line is added (offer, order, invoice etc.) all products will receive the discount percentage specified in this field. If the product has a separate customer price, the value specified here will not be considered by the program.
485
- double discount = 10;
486
- string notes = 11;
487
- bool inactive = 12;
488
- // Customer meta data
489
- repeated MetaData metadata = 13;
490
- }
491
-
492
- /*
493
- RequestUpdate Key->ID keys:
494
-
495
- - ```id```: Deffield *fieldname*
496
-
497
- - ```nervatype```: Valid values: *address, barcode, contact, currency, customer, employee, event, item, link, log, movement, payment, price, place, product, project, rate, tax, tool, trans, setting*
498
-
499
- - ```subtype```: All groupvalue from Groups, where groupname equal *custtype, placetype, protype, toolgroup, transtype*
500
-
501
- - ```fieldtype```: Valid values: *bool, date, time, float, integer, string, valuelist, notes, urlink, password, customer, tool, transitem, transmovement, transpayment, product, project, employee, place*
502
- */
503
- message Deffield {
504
- int64 id = 1;
505
- string fieldname = 2;
506
- // Reference to [Groups](#groups).id (only where groupname = 'nervatype')
507
- int64 nervatype = 3;
508
- // Reference to [Groups](#groups).id (where groupname in ('custtype','placetype',' protype','toolgroup','transtype'))
509
- optional int64 subtype = 4;
510
- // Reference to [Groups](#groups).id (only where groupname = 'fieldtype')
511
- int64 fieldtype = 5;
512
- string description = 6;
513
- // If fieldtype=valuelist: valid values are listed, separated by ~
514
- string valuelist = 7;
515
- // When selected, the attribute in case of adding a new element (eg a new customer or employee is created) will automatically be created with the default value according to its type and also will be attached to the new element.
516
- bool addnew = 8;
517
- // Can appear or not (hidden value) on the entry forms
518
- bool visible = 9;
519
- // The value of the attribute can not be changed in the program interface
520
- bool readonly = 10;
521
- }
522
-
523
- /*
524
- RequestUpdate Key->ID keys:
525
-
526
- - ```id```: Employee *empnumber*
527
-
528
- - ```usergroup```: All groupvalue from Groups, where groupname equal usergroup
529
-
530
- - ```department```: All groupvalue from Groups, where groupname equal department
531
- */
532
- message Employee {
533
- int64 id = 1;
534
- // Unique ID. If you set it to numberdef, it will be generated at the first data save. The format and value of the next data in row is taken from the numberdef (numberkey = empnumber) data series.
535
- string empnumber = 2;
536
- // Database login name. Should be unique on database level.
537
- optional string username = 3;
538
- // Reference to [Groups](#groups).id (only where groupname = 'usergroup')
539
- int64 usergroup = 4;
540
- optional string startdate = 5;
541
- optional string enddate = 6;
542
- // Reference to [Groups](#groups).id (only where groupname = 'department')
543
- optional int64 department = 7;
544
- string registration_key = 8;
545
- bool inactive = 9;
546
- // Employee meta data
547
- repeated MetaData metadata = 13;
548
- }
549
-
550
- /*
551
- RequestUpdate Key->ID keys:
552
-
553
- - ```id```: Event *calnumber*
554
-
555
- - ```nervatype```: Valid values: *customer, employee, place, product, project, tool, trans*
556
-
557
- - ```ref_id```: Valid values: *customer/{custnumber}, employee/{empnumber}, place/{planumber}, product/{partnumber}, project/{pronumber}, tool/{serial}, trans/{transnumber}*
558
-
559
- - ```eventgroup```: All groupvalue from Groups, where groupname equal eventgroup
560
- */
561
- message Event {
562
- int64 id = 1;
563
- // Unique ID. If you set it to numberdef, it will be generated at the first data save. The format and value of the next data in row is taken from the numberdef (numberkey = calnumber) data series.
564
- string calnumber = 2;
565
- // Reference to [Groups](#groups).id (only where groupname = 'nervatype')
566
- int64 nervatype = 3;
567
- // Reference to [Customer](#customer).id, [Employee](#employee).id, [Place](#place).id, [Product](#product).id, [Project](#project).id, [Tool](#tool).id, [Trans](#trans).id
568
- int64 ref_id = 4;
569
- string uid = 5;
570
- // Reference to [Groups](#groups).id (only where groupname = 'eventgroup')
571
- optional int64 eventgroup = 6;
572
- // Datetime
573
- string fromdate = 7;
574
- // Datetime
575
- optional string todate = 8;
576
- string subject = 9;
577
- string place = 10;
578
- string description = 11;
579
- // Event meta data
580
- repeated MetaData metadata = 12;
581
- }
582
-
583
- /*
584
- RequestUpdate Key->ID keys:
585
-
586
- - ```id```: The value is a generated constant key identifier: *{refnumber}~~{fieldname}~{rownumber}*. The rownumber is the order of multiple *{refnumber}~~{fieldname}* keys.
587
-
588
- - ```ref_id```: Valid values: *{nervatype}/{refnumber}*
589
- */
590
- message Fieldvalue {
591
- int64 id = 1;
592
- // Reference to [Deffield](#deffield).fieldname.
593
- string fieldname = 2;
594
- // Reference to any type.id where type = [Deffield](#deffield).nervatype. If it is null then nervatype = setting.
595
- optional int64 ref_id = 3;
596
- string value = 4;
597
- string notes = 5;
598
- }
599
-
600
- /*
601
- RequestUpdate Key->ID keys:
602
-
603
- - ```id```: Group *groupname~groupvalue*
604
- */
605
- message Groups {
606
- int64 id = 1;
607
- string groupname = 2;
608
- string groupvalue = 3;
609
- string description = 4;
610
- bool inactive = 5;
611
- }
612
-
613
- /*
614
- RequestUpdate Key->ID keys:
615
-
616
- - ```id```: Trans and Item *transnumber~rownumber*
617
-
618
- - ```trans_id```: Trans *transnumber*
619
-
620
- - ```product_id```: Product *partnumber*
621
-
622
- - ```tax_id```: Tax *taxcode*
623
- */
624
- message Item {
625
- int64 id = 1;
626
- // Reference to [trans](#trans).id
627
- int64 trans_id = 2;
628
- // Reference to [product](#product).id
629
- int64 product_id = 3;
630
- string unit = 4;
631
- double qty = 5;
632
- double fxprice = 6;
633
- double netamount = 7;
634
- double discount = 8;
635
- // Reference to [Tax](#tax).id
636
- int64 tax_id = 9;
637
- double vatamount = 10;
638
- double amount = 11;
639
- string description = 12;
640
- bool deposit = 13;
641
- double ownstock = 14;
642
- bool actionprice = 15;
643
- // Item meta data
644
- repeated MetaData metadata = 16;
645
- }
646
-
647
- /*
648
- RequestUpdate Key->ID keys:
649
-
650
- - ```id```: *{nervatype_1}~{refnumber_1}~~{nervatype_2}~{refnumber_2}*
651
-
652
- - ```nervatype_1```: All groupvalue from Groups, where groupname equal nervatype
653
-
654
- - ```ref_id_1```: *{nervatype_1}/{refnumber_1}*
655
-
656
- - ```nervatype_2```: All groupvalue from Groups, where groupname equal nervatype
657
- */
658
- message Link {
659
- int64 id = 1;
660
- // Reference to [Groups](#groups).id (only where groupname = 'nervatype')
661
- int64 nervatype_1 = 2;
662
- // Reference to {nervatype}.id
663
- int64 ref_id_1 = 3;
664
- // Reference to [Groups](#groups).id (only where groupname = 'nervatype')
665
- int64 nervatype_2 = 4;
666
- // Reference to {nervatype}.id
667
- int64 ref_id_2 = 5;
668
- // Link meta data
669
- repeated MetaData metadata = 16;
670
- }
671
-
672
- /*
673
- RequestUpdate Key->ID keys:
674
-
675
- - ```id```: *{empnumber}~{crdate}'*
676
-
677
- - ```employee_id```: Employee *empnumber*
678
-
679
- - ```ref_id```: *{nervatype}/{refnumber}*
680
-
681
- - ```nervatype```: All groupvalue from Groups, where groupname equal nervatype
682
-
683
- - ```logstate```: Valid values: update, closed, deleted, print, login, logout
684
- */
685
- message Log {
686
- int64 id = 1;
687
- // Reference to [Employee](#employee).id
688
- int64 employee_id = 2;
689
- // Date-time
690
- string crdate = 3;
691
- // Reference to [Groups](#groups).id (only where groupname = 'nervatype')
692
- optional int64 nervatype = 4;
693
- // Reference to {nervatype}.id
694
- optional int64 ref_id = 5;
695
- // Reference to [Groups](#groups).id (only where groupname = 'logstate')
696
- int64 logstate = 6;
697
- // Log meta data
698
- repeated MetaData metadata = 16;
699
- }
700
-
701
- /*
702
- RequestUpdate Key->ID keys:
703
-
704
- - ```id```: Trans and Item *transnumber~rownumber*
705
-
706
- - ```trans_id```: Trans *transnumber*
707
-
708
- - ```product_id```: Product *partnumber*
709
-
710
- - ```movetype```: Valid values: *inventory, tool, plan, head*
711
-
712
- - ```tool_id```: Tool *serial*
713
-
714
- - ```place_id```: Place *planumber*
715
- */
716
- message Movement {
717
- int64 id = 1;
718
- // Reference to [Trans](#trans).id
719
- int64 trans_id = 2;
720
- // Date-time
721
- string shippingdate = 3;
722
- // Reference to [Groups](#groups).id (only where groupname = 'movetype')
723
- int64 movetype = 4;
724
- // Reference to [Product](#product).id
725
- optional int64 product_id = 5;
726
- // Reference to [Tool](#tool).id
727
- optional int64 tool_id = 6;
728
- // Reference to [Place](#place).id
729
- optional int64 place_id = 7;
730
- double qty = 8;
731
- string description = 9;
732
- bool shared = 10;
733
- // Movement meta data
734
- repeated MetaData metadata = 16;
735
- }
736
-
737
- /*
738
- RequestUpdate Key->ID keys:
739
-
740
- - ```id```: Numberdef *numberkey*
741
- */
742
- message Numberdef {
743
- int64 id = 1;
744
- // Unique key
745
- string numberkey = 2;
746
- // The text prefix of the identifier. It can be any length, but usage of special characters, spaces in the text is not recommended.
747
- string prefix = 3;
748
- // The current status of the counter, the next sequence number will be one value higher than this one. It is possible to re-set the counter, but the uniqueness must be ensured in all cases!
749
- int64 curvalue = 4;
750
- // If selected, the created identifier will contain the year.
751
- bool isyear = 5;
752
- // The separator character in the identifier. Default: "/"
753
- string sep = 6;
754
- // The value field is arranged in such length to the right and filled with zeros.
755
- int64 len = 7;
756
- string description = 8;
757
- bool visible = 9;
758
- bool readonly = 10;
759
- int64 orderby = 11;
760
- }
761
-
762
- /*
763
- RequestUpdate Key->ID keys:
764
-
765
- - ```id```: Pattern *description*
766
- */
767
- message Pattern {
768
- int64 id = 1;
769
- string description = 2;
770
- // Reference to [Groups](#groups).id (only where groupname = 'transtype')
771
- int64 transtype = 3;
772
- string notes = 4;
773
- bool defpattern = 5;
774
- }
775
-
776
- /*
777
- RequestUpdate Key->ID keys:
778
-
779
- - ```id```: Trans and Item *transnumber~rownumber*
780
-
781
- - ```trans_id```: Trans *transnumber*
782
- */
783
- message Payment {
784
- int64 id = 1;
785
- // Reference to [Trans](#trans).id
786
- int64 trans_id = 2;
787
- string paiddate = 3;
788
- double amount = 4;
789
- string notes = 5;
790
- // Payment meta data
791
- repeated MetaData metadata = 6;
792
- }
793
-
794
- /*
795
- RequestUpdate Key->ID keys:
796
-
797
- - ```id```: Place *planumber*
798
-
799
- - ```placetype```: Valid values: *bank, cash, warehouse, other*
800
- */
801
- message Place {
802
- int64 id = 1;
803
- // Unique ID. If you set it to numberdef, it will be generated at the first data save. The format and value of the next data in row is taken from the numberdef (numberkey = planumber) data series.
804
- string planumber = 2;
805
- // Reference to [Groups](#groups).id (only where groupname = 'placetype')
806
- int64 placetype = 3;
807
- string description = 4;
808
- optional string curr = 5;
809
- bool defplace = 6;
810
- string notes = 7;
811
- bool inactive = 8;
812
- // Place meta data
813
- repeated MetaData metadata = 9;
814
- }
815
-
816
- /*
817
- RequestUpdate Key->ID keys:
818
-
819
- - ```id```: Price *partnumber~validfrom~curr~qty*
820
-
821
- - ```product_id```: Product *partnumber*
822
- */
823
- message Price {
824
- int64 id = 1;
825
- // Reference to [Product](#product).id
826
- int64 product_id = 2;
827
- // Start of validity, mandatory data.
828
- string validfrom = 3;
829
- // End of validity, can be left empty.
830
- optional string validto = 4;
831
- string curr = 5;
832
- // Price ranges can also be specified, thus different price can be set for a smaller and bigger quantity of the same product. The quantity should be used as the lower threshold, ie. this should be the minimum quantity for the price set.
833
- double qty = 6;
834
- // Price value
835
- double pricevalue = 7;
836
- // Supplier (if marked) or customer price. By default the customer price.
837
- bool vendorprice = 8;
838
- // Price meta data
839
- repeated MetaData metadata = 9;
840
- }
841
-
842
- /*
843
- RequestUpdate Key->ID keys:
844
-
845
- - ```id```: Product *partnumber*
846
-
847
- - ```protype```: Valid values: *item, service*
848
-
849
- - ```tax_id```: Tax *taxcode*
850
- */
851
- message Product {
852
- int64 id = 1;
853
- // Unique ID. If you set it to numberdef, it will be generated at the first data save. The format and value of the next data in row is taken from the numberdef (numberkey = partnumber) data series.
854
- string partnumber = 2;
855
- // Reference to [Groups](#groups).id (only where groupname = 'protype')
856
- int64 protype = 3;
857
- // The full name of the product or short description.
858
- string description = 4;
859
- string unit = 5;
860
- // Reference to [Tax](#tax).id
861
- int64 tax_id = 6;
862
- string notes = 7;
863
- bool webitem = 8;
864
- bool inactive = 9;
865
- // Product meta data
866
- repeated MetaData metadata = 10;
867
- }
868
-
869
- /*
870
- RequestUpdate Key->ID keys:
871
-
872
- - ```id```: Project *pronumber*
873
-
874
- - ```customer_id```: Tax *custnumber*
875
- */
876
- message Project {
877
- int64 id = 1;
878
- // Unique ID. If you set it to numberdef, it will be generated at the first data save. The format and value of the next data in row is taken from the numberdef (numberkey = pronumber) data series.
879
- string pronumber = 2;
880
- // The name of the project.
881
- string description = 3;
882
- // Reference to [Customer](#customer).id
883
- optional int64 customer_id = 4;
884
- optional string startdate = 5;
885
- optional string enddate = 6;
886
- string notes = 7;
887
- bool inactive = 8;
888
- // Project meta data
889
- repeated MetaData metadata = 10;
890
- }
891
-
892
- /*
893
- RequestUpdate Key->ID keys:
894
-
895
- - ```id```: Rate *ratetype~ratedate~curr~planumber*
896
-
897
- - ```place_id```: Place *planumber*
898
-
899
- - ```ratetype```: Valid values: *rate, buy, sell,average*
900
-
901
- - ```rategroup```: all groupvalue from Groups, where groupname equal rategroup
902
- */
903
- message Rate {
904
- int64 id = 1;
905
- // Reference to [Groups](#groups).id (only where groupname = 'ratetype')
906
- int64 ratetype = 2;
907
- string ratedate = 3;
908
- string curr = 4;
909
- // Reference to [Place](#place).id
910
- optional int64 place_id = 5;
911
- // Reference to [Groups](#groups).id (only where groupname = 'rategroup')
912
- optional int64 rategroup = 6;
913
- // Rate or interest value
914
- double ratevalue = 7;
915
- // Rate meta data
916
- repeated MetaData metadata = 10;
917
- }
918
-
919
- /*
920
- RequestUpdate Key->ID keys:
921
-
922
- - ```id```: Tax *taxcode*
923
- */
924
- message Tax {
925
- int64 id = 1;
926
- // Unique ID.
927
- string taxcode = 2;
928
- string description = 3;
929
- // Rate or interest value
930
- double rate = 4;
931
- bool inactive = 5;
932
- // Tax meta data
933
- repeated MetaData metadata = 10;
934
- }
935
-
936
- /*
937
- RequestUpdate Key->ID keys:
938
-
939
- - ```id```: Tool *serial*
940
-
941
- - ```toolgroup```: all groupvalue from Groups, where groupname equal toolgroup
942
-
943
- - ```product_id```: Product *partnumber*
944
- */
945
- message Tool {
946
- int64 id = 1;
947
- // Unique ID. If you set it to numberdef, it will be generated at the first data save. The format and value of the next data in row is taken from the numberdef (numberkey = serial) data series.
948
- string serial = 2;
949
- string description = 3;
950
- // Reference to [Product](#product).id
951
- int64 product_id = 4;
952
- // Reference to [Groups](#groups).id (only where groupname = 'toolgroup')
953
- optional int64 toolgroup = 5;
954
- string notes = 6;
955
- bool inactive = 7;
956
- // Tool meta data
957
- repeated MetaData metadata = 10;
958
- }
959
-
960
- /*
961
- RequestUpdate Key->ID keys:
962
-
963
- - ```id```: Trans *transnumber*
964
-
965
- - ```transtype```: all groupvalue from Groups, where groupname equal transtype
966
-
967
- - ```direction```: Valid values *in, out, transfer*
968
-
969
- - ```customer_id```: Customer *custnumber*
970
-
971
- - ```employee_id```: Employee *empnumber*
972
-
973
- - ```department```: all groupvalue from Groups, where groupname equal department
974
-
975
- - ```project_id```: Project *pronumber*
976
-
977
- - ```place_id```: Place *planumber*
978
-
979
- - ```paidtype```: all groupvalue from Groups, where groupname equal paidtype
980
-
981
- - ```transtate```: all groupvalue from Groups, where groupname equal transtate
982
- */
983
- message Trans {
984
- int64 id = 1;
985
- // Unique ID. If you set it to numberdef, it will be generated at the first data save. The format and value of the next data in row is taken from the numberdef (numberkey = transnumber) data series.
986
- string transnumber = 2;
987
- // Reference to [Groups](#groups).id (only where groupname = 'transtype')[Groups](#groups).id
988
- int64 transtype = 3;
989
- // Reference to [Groups](#groups).id (only where groupname = 'direction')
990
- int64 direction = 4;
991
- optional string ref_transnumber = 5;
992
- string crdate = 6;
993
- string transdate = 7;
994
- // Date-time
995
- optional string duedate = 8;
996
- // Reference to [Customer](#customer).id
997
- optional int64 customer_id = 9;
998
- // Reference to [Employee](#employee).id
999
- optional int64 employee_id = 10;
1000
- // Reference to [Groups](#groups).id (only where groupname = 'department')
1001
- optional int64 department = 11;
1002
- // Reference to [Project](#project).id
1003
- optional int64 project_id = 12;
1004
- // Reference to [Place](#place).id
1005
- optional int64 place_id = 13;
1006
- // Reference to [Groups](#groups).id (only where groupname = 'paidtype')
1007
- optional int64 paidtype = 14;
1008
- optional string curr = 15;
1009
- bool notax = 16;
1010
- bool paid = 17;
1011
- double acrate = 18;
1012
- string notes = 19;
1013
- string intnotes = 20;
1014
- string fnote = 21;
1015
- // Reference to [Groups](#groups).id (only where groupname = 'transtate')
1016
- int64 transtate = 22;
1017
- bool closed = 23;
1018
- // Trans meta data
1019
- repeated MetaData metadata = 24;
1020
- }
1021
-
1022
- /*
1023
- RequestUpdate Key->ID keys:
1024
-
1025
- - ```id```: UiAudit *{usergroup}~{nervatype}~{transtype}*
1026
-
1027
- - ```usergroup```: all groupvalue from Groups, where groupname equal usergroup
1028
-
1029
- - ```nervatype```: all groupvalue from Groups, where groupname equal nervatype
1030
-
1031
- - ```subtype```: all groupvalue from Groups, where groupname equal transtype, movetype, protype, custtype, placetype
1032
-
1033
- - ```inputfilter```: Valid values *disabled, readonly, update, all*
1034
- */
1035
- message UiAudit {
1036
- int64 id = 1;
1037
- // Reference to [Groups](#groups).id (only where groupname = 'usergroup')
1038
- int64 usergroup = 2;
1039
- // Reference to [Groups](#groups).id (only where groupname = 'nervatype')
1040
- int64 nervatype = 3;
1041
- // Reference to [Groups](#groups).id (only where groupname = 'movetype')
1042
- optional int64 subtype = 4;
1043
- // Reference to [Groups](#groups).id (only where groupname = 'inputfilter')
1044
- int64 inputfilter = 5;
1045
- bool supervisor = 6;
1046
- }
1047
-
1048
- /*
1049
- RequestUpdate Key->ID keys:
1050
-
1051
- - ```id```: UiMenu *menukey*
1052
- */
1053
- message UiMenu {
1054
- int64 id = 1;
1055
- string menukey = 2;
1056
- string description = 3;
1057
- string modul = 4;
1058
- string icon = 5;
1059
- // Reference to [Groups](#groups).id (only where groupname = 'method')
1060
- int64 method = 6;
1061
- string funcname = 7;
1062
- string address = 8;
1063
- }
1064
-
1065
- /*
1066
- RequestUpdate Key->ID keys:
1067
-
1068
- - ```id```: UiMenufields *{menukey}~{fieldname}*
1069
-
1070
- - ```menu_id```: UiMenu *menukey*
1071
- */
1072
- message UiMenufields {
1073
- int64 id = 1;
1074
- // Reference to [UiMenu](#UiMenu).id
1075
- int64 menu_id = 2;
1076
- string fieldname = 3;
1077
- string description = 4;
1078
- // Reference to [Groups](#groups).id (only where groupname = 'fieldtype')
1079
- int64 fieldtype = 5;
1080
- int64 orderby = 6;
1081
- }
1082
-
1083
- /*
1084
- RequestUpdate Key->ID keys:
1085
-
1086
- - ```id```: UiMessage *{secname}~{fieldname}~{lang}*
1087
- */
1088
- message UiMessage {
1089
- int64 id = 1;
1090
- string secname = 2;
1091
- string fieldname = 3;
1092
- string lang = 4;
1093
- string msg = 5;
1094
- }
1095
-
1096
- message UiPrintqueue {
1097
- int64 id = 1;
1098
- // Reference to [Groups](#groups).id (only where groupname = 'nervatype')
1099
- optional int64 nervatype = 2;
1100
- // Reference to {nervatype}.id
1101
- int64 ref_id = 3;
1102
- double qty = 4;
1103
- // Reference to [Employee](#employee).id
1104
- optional int64 employee_id = 5;
1105
- // Reference to [UiReport](#UiReport).id
1106
- int64 report_id = 6;
1107
- // Date-time
1108
- string crdate = 7;
1109
- }
1110
-
1111
- /*
1112
- RequestUpdate Key->ID keys:
1113
-
1114
- - ```id```: UiReport *reportkey*
1115
-
1116
- - ```nervatype```: all groupvalue from Groups, where groupname equal nervatype
1117
-
1118
- - ```transtype```: all groupvalue from Groups, where groupname equal transtype
1119
-
1120
- - ```direction```: all groupvalue from Groups, where groupname equal direction
1121
-
1122
- - ```filetype```: all groupvalue from Groups, where groupname equal filetype
1123
- */
1124
- message UiReport {
1125
- int64 id = 1;
1126
- string reportkey = 2;
1127
- // Reference to [Groups](#groups).id (only where groupname = 'nervatype')
1128
- int64 nervatype = 3;
1129
- // Reference to [Groups](#groups).id (only where groupname = 'transtype')
1130
- optional int64 transtype = 4;
1131
- // Reference to [Groups](#groups).id (only where groupname = 'direction')
1132
- optional int64 direction = 5;
1133
- string repname = 6;
1134
- string description = 7;
1135
- string label = 8;
1136
- // Reference to [Groups](#groups).id (only where groupname = 'filetype')
1137
- int64 filetype = 9;
1138
- string report = 10;
1139
- }
1140
-
1141
- /*
1142
- RequestUpdate Key->ID keys:
1143
-
1144
- - ```id```: *{empnumber}~{section}~{cfgroup}~{cfname}*
1145
-
1146
- - ```employee_id```: Employee *{empnumber}*
1147
- */
1148
- message UiUserconfig {
1149
- int64 id = 1;
1150
- // Reference to [Employee](#employee).id
1151
- optional int64 employee_id = 2;
1152
- optional string section = 3;
1153
- string cfgroup = 4;
1154
- string cfname = 5;
1155
- optional string cfvalue = 6;
1156
- int64 orderby = 7;
1157
- }