-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
intf.OpenMasterdata.Types.pas
1701 lines (1564 loc) · 74.7 KB
/
intf.OpenMasterdata.Types.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
License OpenMasterdata-for-Delphi
Copyright (C) 2024 Landrix Software GmbH & Co. KG
Sven Harazim, [email protected]
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
}
unit intf.OpenMasterdata.Types;
interface
uses
System.Classes,System.SysUtils,System.IOUtils,DateUtils,System.StrUtils
,System.Generics.Collections,System.Generics.Defaults
,System.Json,REST.Json
;
type
TOpenMasterdataAPIHelper = class(TObject)
public
class function JSONStrToDate(_Val : String) : TDate;
class function JSONStrToFloat(_Val : String) : double;
end;
TOpenMasterdataAPI_AuthResult = class
private
Fexpires_in: Integer;
Frefresh_token: String;
Ftoken_type: String;
Faccess_token: String;
Fscope: String;
public
property access_token : String read Faccess_token write Faccess_token;
property token_type : String read Ftoken_type write Ftoken_type;
property expires_in : Integer read Fexpires_in write Fexpires_in;
property refresh_token : String read Frefresh_token write Frefresh_token;
property scope : String read Fscope write Fscope;
end;
TOpenMasterdataAPI_AuthResultHelper = class helper for TOpenMasterdataAPI_AuthResult
public
procedure LoadFromJson(const _JsonValue : String);
end;
TOpenMasterdataAPI_DataPackage = (omd_datapackage_basic,
omd_datapackage_additional,
omd_datapackage_prices,
omd_datapackage_descriptions,
omd_datapackage_logistics,
omd_datapackage_sparepartlists,
omd_datapackage_pictures,
omd_datapackage_documents);
TOpenMasterdataAPI_DataPackages = set of TOpenMasterdataAPI_DataPackage;
TOpenMasterdataAPI_DataPackageHelper = class
public const
ALL_DATAPACKAGES = [omd_datapackage_basic,
omd_datapackage_additional,
omd_datapackage_prices,
omd_datapackage_descriptions,
omd_datapackage_logistics,
omd_datapackage_sparepartlists,
omd_datapackage_pictures,
omd_datapackage_documents];
public
class function DataPackageAsString(_Val : TOpenMasterdataAPI_DataPackage) : String;
class function DataPackagesAsString(_Val : TOpenMasterdataAPI_DataPackages) : String;
end;
TOpenMasterdataAPI_Document = class
private
Ffilename: String;
Fhash: String;
Ftype_: String;
Fsize: Integer;
Furl: String;
Fdescription: String;
FsortOrder: Integer;
public
property url : String read Furl write Furl;
property type_ : String read Ftype_ write Ftype_; //Typ des Dokuments\nCode Beschreibung\n- 2D = 2D-Draufsicht\n- 2F = 2D-Frontale\n- 2S = 2D-Seitenansicht\n- 3C = 3D-Daten\n- 3B = 3D-Daten\n- 3A = 3D-Daten zur Darstellung im Browser\n- AN = Animation\n- DB = Datenblatt\n- GG = Gefahrgut – Datenblatt\n- IS = Instruktion/Bedienungsanleitung\n- MA = Montageanleitung\n- VM = Montagevideo\n- TI = Technische Info\n- VT = Tutorial\n- TZ = Technische Zeichnung \n- VI = Video\n- WA = Wartungsanleitung\n- VP = Produktvideo\n- PA = Planungsanleitung\n- PP = Prospekte\n- ZL = Zulassung\n- SB = Schaltbild\n- SF = Schulungsfolie\n- PF = Pflegeanleitung\n- LE = Bauproduktenverordnung\n- EL = ErP-Label\n- EP = Einzelprospekt\n- UP = UBA-Positivliste\n- WL = WELL-Label\n- BS = Brandschutz \n- EX = EX-Schut \n- AS = Arbeitsschutz \n- KS = Korrisionsschutz \n- CE = CE-Konformitätserklärung \n- VD = VDS-Zulassung \n- SS = Schallschutznachweis \n- PL = Prüfreport Lithiumbatterie
property description : String read Fdescription write Fdescription; //max 40 Beschreibung
property sortOrder : Integer read FsortOrder write FsortOrder; //max 2 Reihenfolge
property size : Integer read Fsize write Fsize; //Dokumentgröße in Byte
property filename : String read Ffilename write Ffilename; //max 35 Dateiname
property hash : String read Fhash write Fhash;
end;
TOpenMasterdataAPI_DocumentList = class(TObjectList<TOpenMasterdataAPI_Document>)
end;
TOpenMasterdataAPI_LinkedProduct = class(TObject)
private
FproductShortDescr: String;
FmanufacturerPid: String;
Fgtin: String;
FmanufacturerId: String;
FmanufacturerIdType: String;
FimageLink: String;
FthumbnailUrl: String;
FsupplierPid: String;
public
property supplierPid : String read FsupplierPid write FsupplierPid;
property manufacturerId : String read FmanufacturerId write FmanufacturerId;
property manufacturerIdType : String read FmanufacturerIdType write FmanufacturerIdType;
property manufacturerPid : String read FmanufacturerPid write FmanufacturerPid;
property gtin : String read Fgtin write Fgtin;
property productShortDescr : String read FproductShortDescr write FproductShortDescr;
property imageLink : String read FimageLink write FimageLink;
property thumbnailUrl : String read FthumbnailUrl write FthumbnailUrl;
end;
TOpenMasterdataAPI_LinkedHistoricProduct = class(TObject)
private
FhistoricProduct: String;
FproductShortDescr: String;
FmanufacturerIdType: String;
FconstructionFrom: String;
FimageLink: String;
FmanufacturerId: String;
public
property manufacturerId : String read FmanufacturerId write FmanufacturerId;
property manufacturerIdType : String read FmanufacturerIdType write FmanufacturerIdType;
property historicProduct : String read FhistoricProduct write FhistoricProduct;
property constructionFrom : String read FconstructionFrom write FconstructionFrom;
property productShortDescr : String read FproductShortDescr write FproductShortDescr;
property imageLink : String read FimageLink write FimageLink;
end;
TOpenMasterdataAPI_Accessory = class(TOpenMasterdataAPI_LinkedProduct)
private
FnecessaryForFunction: Boolean;
FreferenceType: String;
Famount: double;
public
property amount : double read Famount write Famount;
property referenceType : String read FreferenceType write FreferenceType;
property necessaryForFunction : Boolean read FnecessaryForFunction write FnecessaryForFunction;
end;
TOpenMasterdataAPI_AccessoryList = class(TObjectList<TOpenMasterdataAPI_Accessory>)
end;
TOpenMasterdataAPI_Set = class(TOpenMasterdataAPI_LinkedProduct)
private
Famount: double;
public
property amount : double read Famount write Famount;
end;
TOpenMasterdataAPI_SetList = class(TObjectList<TOpenMasterdataAPI_Set>)
end;
TOpenMasterdataAPI_AlternativeProduct = class(TOpenMasterdataAPI_LinkedProduct)
private
FreferenceType: String;
public
property referenceType : String read FreferenceType write FreferenceType;
end;
TOpenMasterdataAPI_AlternativeProductList = class(TObjectList<TOpenMasterdataAPI_AlternativeProduct>)
end;
TOpenMasterdataAPI_FollowupProduct = class(TOpenMasterdataAPI_LinkedProduct)
private
FreferenceType: String;
public
property referenceType : String read FreferenceType write FreferenceType;
end;
TOpenMasterdataAPI_FollowupProductList = class(TObjectList<TOpenMasterdataAPI_FollowupProduct>)
end;
TOpenMasterdataAPI_Attribute = class
private
FattributeSystem: String;
FattributeUnitDesc: String;
FattributeDesc: String;
FattributeUnit: String;
FattributeName: String;
FattributeValue1Descr: String;
FattributeClassDesc: String;
FattributeValue1: String;
public
property attributeSystem : String read FattributeSystem write FattributeSystem;
property attributeName : String read FattributeName write FattributeName;
property attributeValue1 : String read FattributeValue1 write FattributeValue1;
property attributeUnit : String read FattributeUnit write FattributeUnit;
property attributeClassDesc : String read FattributeClassDesc write FattributeClassDesc;
property attributeDesc : String read FattributeDesc write FattributeDesc;
property attributeValue1Descr : String read FattributeValue1Descr write FattributeValue1Descr;
property attributeUnitDesc : String read FattributeUnitDesc write FattributeUnitDesc;
end;
TOpenMasterdataAPI_AttributeList = class(TObjectList<TOpenMasterdataAPI_Attribute>)
end;
TOpenMasterdataAPI_Additional = class
private
FexpiringProduct: Boolean;
FminOrderQuantity: double;
FdeepLink: String;
FminOrderUnit: String;
Fsets: TOpenMasterdataAPI_SetList;
Faccessories: TOpenMasterdataAPI_AccessoryList;
FexpiringDate: TDate;
FarticleNumberCatalogue: String;
FalternativeProduct: TOpenMasterdataAPI_AlternativeProductList;
FfollowupProduct: TOpenMasterdataAPI_FollowupProductList;
FconstructionText: String;
FdiscountGroupDescrManufacturer: String;
FconstructionTo: String;
FcommodityGroupIdManufacturer: String;
Fattribute: TOpenMasterdataAPI_AttributeList;
FcommodityGroupDescrManufacturer: String;
FconstructionFrom: String;
FdiscoundGroupIdManufacturer: String;
FbonusGroupIdManufacturer: String;
FproductGroupIdManufacturer: String;
FenergyEfficiencyClass: String;
FbonusGroupDescrManufacturer: String;
FproductGroupDescrManufacturer: String;
public
constructor Create;
destructor Destroy; override;
property minOrderQuantity : double read FminOrderQuantity write FminOrderQuantity; //Mindestbestellmenge
property minOrderUnit : String read FminOrderUnit write FminOrderUnit; //Units (Mengeneinheiten) -- Code Beschreibung\n- CMK = Quadratzentimeter\n- CMQ = Kubikzentimeter\n- CMT = Zentimeter\n- DZN = Dutzend\n- GRM = Gramm\n- HLT = Hektoliter\n- KGM = Kilogramm\n- KTM = Kilometer\n- LTR = Liter\n- MMT = Millimeter\n- MTK = Quadratmeter\n- MTQ = Kubikmeter\n- MTR = Meter\n- PCE = Stück\n- PR = Paar\n- SET = Satz\n- TNE = Tonne
property articleNumberCatalogue : String read FarticleNumberCatalogue write FarticleNumberCatalogue; //max 15 Werksartikelnummer Katalog
property alternativeProduct : TOpenMasterdataAPI_AlternativeProductList read FalternativeProduct write FalternativeProduct;
property followupProduct : TOpenMasterdataAPI_FollowupProductList read FfollowupProduct write FfollowupProduct;
property deepLink : String read FdeepLink write FdeepLink; //max 256 Deeplink zum Artikel
property expiringProduct : Boolean read FexpiringProduct write FexpiringProduct; //enum" : [ true, "Yes-Successor", false ] Auslaufartikel\n - Yes = Artikel ist Auslauf\n - Yes-Successor = Artikel ist Auslauf und Nachfolgeartikel existiert\n - No = Artikel ist nicht Auslauf
property expiringDate : TDate read FexpiringDate write FexpiringDate; //Auslaufdatum
property energyEfficiencyClass : String read FenergyEfficiencyClass write FenergyEfficiencyClass;
property commodityGroupIdManufacturer : String read FcommodityGroupIdManufacturer write FcommodityGroupIdManufacturer;
property commodityGroupDescrManufacturer : String read FcommodityGroupDescrManufacturer write FcommodityGroupDescrManufacturer;
property productGroupIdManufacturer : String read FproductGroupIdManufacturer write FproductGroupIdManufacturer;
property productGroupDescrManufacturer : String read FproductGroupDescrManufacturer write FproductGroupDescrManufacturer;
property discoundGroupIdManufacturer : String read FdiscoundGroupIdManufacturer write FdiscoundGroupIdManufacturer;
property discountGroupDescrManufacturer : String read FdiscountGroupDescrManufacturer write FdiscountGroupDescrManufacturer;
property bonusGroupIdManufacturer : String read FbonusGroupIdManufacturer write FbonusGroupIdManufacturer;
property bonusGroupDescrManufacturer : String read FbonusGroupDescrManufacturer write FbonusGroupDescrManufacturer;
property accessories : TOpenMasterdataAPI_AccessoryList read Faccessories write Faccessories;
property sets : TOpenMasterdataAPI_SetList read Fsets write Fsets;
property attribute : TOpenMasterdataAPI_AttributeList read Fattribute write Fattribute;
property constructionFrom : String read FconstructionFrom write FconstructionFrom;
property constructionTo : String read FconstructionTo write FconstructionTo;
property constructionText : String read FconstructionText write FconstructionText;
end;
TOpenMasterdataAPI_LogisticsMeasure = class
private
Funit_: String;
Fmeasure: String;
public
property measure : String read Fmeasure write Fmeasure;
property unit_ : String read Funit_ write Funit_;
end;
TOpenMasterdataAPI_LogisticsWeight = class
private
Funit_: String;
Fweight: String;
public
property weight : String read Fweight write Fweight;
property unit_ : String read Funit_ write Funit_;
end;
TOpenMasterdataAPI_CarryingCategory = (
omdCarryingCategory_0,
omdCarryingCategory_1,
omdCarryingCategory_2,
omdCarryingCategory_3,
omdCarryingCategory_4
);
//Art der Verpackungseinheit
TOpenMasterdataAPI_PackageType = (
omdPackageType_BB, //BB = Rolle
omdPackageType_BG, //BG = Sack
omdPackageType_BH, //BH = Bund/Bündel
omdPackageType_BK, //BK = Korb
omdPackageType_CF, //CF = Kiste
omdPackageType_CG,//CG = Käfig
omdPackageType_CH,//CH = Gitterbox
omdPackageType_CT,//CT = Karton
omdPackageType_PA, //PA = Päckchen
omdPackageType_PC,//PC = Paket
omdPackageType_PG,//PG = Einwegpalette
omdPackageType_PK,//PK = Colli
omdPackageType_PN,//PN = Europalette
omdPackageType_PU, //PU = Kasten
omdPackageType_RG,//RG = Ring
omdPackageType_SC,//SC = Mischpalette
omdPackageType_HP, //HP = Halbpalette
omdPackageType_TU, //TU = Rohr
omdPackageType_BTL,//BTL = Beutel (Tüte)
omdPackageType_BX, //BX = Box
omdPackageType_CO, //CO = Container
omdPackageType_DY, //DY = Display
omdPackageType_STG,//STG = Stange
omdPackageType_TRO,//TRO = Trommel
omdPackageType_PLA,//PLA = Platte
omdPackageType_CI, //CI = Kanister
omdPackageType_GEB,//GEB = Gebinde
omdPackageType_Unknown
);
TOpenMasterdataAPI_PackageTypeHelper = class(TObject)
public
class function PackageTypeToStr(_Val : TOpenMasterdataAPI_PackageType) : String;
class function PackageTypeFromStr(_Val : String) : TOpenMasterdataAPI_PackageType;
end;
TOpenMasterdataAPI_PackagingUnit = class
public
constructor Create;
destructor Destroy; override;
private
FmeasureB: TOpenMasterdataAPI_LogisticsMeasure;
FmeasureC: TOpenMasterdataAPI_LogisticsMeasure;
FmeasureA: TOpenMasterdataAPI_LogisticsMeasure;
FpackagingType: TOpenMasterdataAPI_PackageType;
Fgtin: String;
Fquantity: double;
Fweight: TOpenMasterdataAPI_LogisticsWeight;
public
property packagingType : TOpenMasterdataAPI_PackageType read FpackagingType write FpackagingType;
property quantity : double read Fquantity write Fquantity;
property gtin : String read Fgtin write Fgtin;
property measureA : TOpenMasterdataAPI_LogisticsMeasure read FmeasureA write FmeasureA;
property measureB : TOpenMasterdataAPI_LogisticsMeasure read FmeasureB write FmeasureB;
property measureC : TOpenMasterdataAPI_LogisticsMeasure read FmeasureC write FmeasureC;
property weight : TOpenMasterdataAPI_LogisticsWeight read Fweight write Fweight;
end;
TOpenMasterdataAPI_PackagingUnitList = class(TObjectList<TOpenMasterdataAPI_PackagingUnit>);
TOpenMasterdataAPI_Logistics = class
private
FmeasureB: TOpenMasterdataAPI_LogisticsMeasure;
FmeasureC: TOpenMasterdataAPI_LogisticsMeasure;
FmeasureA: TOpenMasterdataAPI_LogisticsMeasure;
FhazardousMaterial: Boolean;
Fexportable: Boolean;
Fweight: TOpenMasterdataAPI_LogisticsWeight;
FcommodityNumber: Integer;
FcountryOfOrigin: String;
FpackagingDisposalProvider: String;
FstandardDeliveryPeriod: Integer;
FpackagingQuantity: Integer;
FubaListConform: Boolean;
FubaListRelevant: Boolean;
FpackagingUnits: TOpenMasterdataAPI_PackagingUnitList;
FreachInfo: String;
FlucidNumber: String;
FdangerClass: String;
FunNumber: String;
FweeeNumber: String;
FcarryingCategory: TOpenMasterdataAPI_CarryingCategory;
FreachDate: TDate;
FdurabilityPeriod: Integer;
public
constructor Create;
destructor Destroy; override;
public
property exportable : Boolean read Fexportable write Fexportable;
property commodityNumber : Integer read FcommodityNumber write FcommodityNumber;
property countryOfOrigin : String read FcountryOfOrigin write FcountryOfOrigin;
property hazardousMaterial : Boolean read FhazardousMaterial write FhazardousMaterial;
property unNumber : String read FunNumber write FunNumber;
property dangerClass : String read FdangerClass write FdangerClass;
property carryingCategory : TOpenMasterdataAPI_CarryingCategory read FcarryingCategory write FcarryingCategory;
property reachInfo : String read FreachInfo write FreachInfo;
property reachDate : TDate read FreachDate write FreachDate;
property ubaListRelevant : Boolean read FubaListRelevant write FubaListRelevant;
property ubaListConform : Boolean read FubaListConform write FubaListConform;
property durabilityPeriod : Integer read FdurabilityPeriod write FdurabilityPeriod;
property standardDeliveryPeriod : Integer read FstandardDeliveryPeriod write FstandardDeliveryPeriod;
property lucidNumber : String read FlucidNumber write FlucidNumber;
property packagingDisposalProvider : String read FpackagingDisposalProvider write FpackagingDisposalProvider;
property weeeNumber : String read FweeeNumber write FweeeNumber;
property measureA : TOpenMasterdataAPI_LogisticsMeasure read FmeasureA write FmeasureA;
property measureB : TOpenMasterdataAPI_LogisticsMeasure read FmeasureB write FmeasureB;
property measureC : TOpenMasterdataAPI_LogisticsMeasure read FmeasureC write FmeasureC;
property weight : TOpenMasterdataAPI_LogisticsWeight read Fweight write Fweight;
property packagingQuantity : Integer read FpackagingQuantity write FpackagingQuantity;
property packagingUnits : TOpenMasterdataAPI_PackagingUnitList read FpackagingUnits write FpackagingUnits;
end;
TOpenMasterdataAPI_TextRow = class
private
Ftext: String;
Fposition: String;
public
property position : String read Fposition write Fposition;
property text : String read Ftext write Ftext;
end;
TOpenMasterdataAPI_ArticleRow = class
private
FlinkedHistoricProduct: TOpenMasterdataAPI_LinkedHistoricProduct;
Fpricegroup: String;
FlinkedProduct: TOpenMasterdataAPI_LinkedProduct;
Ftext: String;
Fposition: String;
public
/// <summary>
/// Position
/// </summary>
property position : String read Fposition write Fposition;
/// <summary>
/// Preisgruppe
/// </summary>
property pricegroup : String read Fpricegroup write Fpricegroup;
/// <summary>
/// Text
/// </summary>
property text : String read Ftext write Ftext;
property linkedProduct : TOpenMasterdataAPI_LinkedProduct read FlinkedProduct write FlinkedProduct;
property linkedHistoricProduct : TOpenMasterdataAPI_LinkedHistoricProduct read FlinkedHistoricProduct write FlinkedHistoricProduct;
public
constructor Create;
destructor Destroy; override;
end;
TOpenMasterdataAPI_SparepartlistRow = class
private
FtextRow: TOpenMasterdataAPI_TextRow;
FarticleRow: TOpenMasterdataAPI_ArticleRow;
public
property textRow : TOpenMasterdataAPI_TextRow read FtextRow write FtextRow;
property articleRow : TOpenMasterdataAPI_ArticleRow read FarticleRow write FarticleRow;
public
constructor Create;
destructor Destroy; override;
end;
TOpenMasterdataAPI_SparepartlistRowList = class(TObjectList<TOpenMasterdataAPI_SparepartlistRow>)
end;
TOpenMasterdataAPI_Sparepartlist = class
private
FlistNumber : String;
FsparepartlistRow : TOpenMasterdataAPI_SparepartlistRowList;
public
property listNumber : String read FlistNumber write FlistNumber;
property sparepartlistRow : TOpenMasterdataAPI_SparepartlistRowList read FsparepartlistRow write FsparepartlistRow;
public
constructor Create;
destructor Destroy; override;
end;
TOpenMasterdataAPI_Price = class
private
Fbasis: Integer;
FquantityUnit: String;
Fvalue: String;
Fcurrency: String;
public
property value : String read Fvalue write Fvalue;
property currency : String read Fcurrency write Fcurrency;
property basis : Integer read Fbasis write Fbasis;
property quantityUnit : String read FquantityUnit write FquantityUnit;
end;
TOpenMasterdataAPI_PriceHelper = class helper for TOpenMasterdataAPI_Price
public
function ValueAsCurrency : Currency;
end;
TOpenMasterdataAPI_Basic = class
private
FproductShortDescr: String;
FpriceOnDemand: Boolean;
FstartOfValidity: TDate;
Fserie: String;
FproductType: String;
FnoteOfUse: String;
FcommodityGroupId: String;
Frrp: TOpenMasterdataAPI_Price;
FcommodityGroupDescr: String;
FmainCommodityGroupId: String;
FmodelNumber: String;
Fmatchcode: String;
FmainCommodityGroupDescr: String;
public
constructor Create;
destructor Destroy; override;
property productType : String read FproductType write FproductType; //Artikeltyp -- Code Beschreibung\n- STD = Standardartikel\n- ERA = Ersatzteil A\n- ERB = Ersatzteil B\n- ERC = Ersatzteil C\n- VA = Variante\n- MA = Maßanfertigung\n- DLS = Dienstleistung / Software\n- PAK = Paket / Set\n- SON = Sonderartikel\n- KAL = Kalkulationsartikel\n- STG = Schüttgut\n",
property startOfValidity : TDate read FstartOfValidity write FstartOfValidity; //Gültigkeitsbeginn
property productShortDescr : String read FproductShortDescr write FproductShortDescr; //max 256 Artikelkurzbeschreibung (neuer Text aus dem Textgipfel)
property priceOnDemand : Boolean read FpriceOnDemand write FpriceOnDemand; //Angabe, ob der Preis des Artikels nur auf Anfrage übermittelt wird
property rrp : TOpenMasterdataAPI_Price read Frrp write Frrp;
property mainCommodityGroupId : String read FmainCommodityGroupId write FmainCommodityGroupId; //max 3 Hauptwarengruppe Handel
property mainCommodityGroupDescr : String read FmainCommodityGroupDescr write FmainCommodityGroupDescr; //max 40 Hauptwarengruppe Beschreibung Handel
property commodityGroupId : String read FcommodityGroupId write FcommodityGroupId; //max 10 Warengruppe Handel
property commodityGroupDescr : String read FcommodityGroupDescr write FcommodityGroupDescr; // max 40 Warengruppe Beschreibung Handel
property noteOfUse : String read FnoteOfUse write FnoteOfUse; //max 512 Verwendungshinweis
property matchcode : String read Fmatchcode write Fmatchcode; //max 15 Matchcode
property serie : String read Fserie write Fserie; //max 80 Serie
property modelNumber : String read FmodelNumber write FmodelNumber; //max 15 Modell
end;
//Rohstoffangaben
TOpenMasterdataAPI_RawMaterial = (
rawMaterial_AL, //Aluminium
rawMaterial_PB, //Blei
rawMaterial_CR, //Chrom
rawMaterial_AU, //Gold
rawMaterial_CD, //Kadmium
rawMaterial_CU, //Kupfer
rawMaterial_MG, //Magnesium
rawMaterial_MS, //Messing
rawMaterial_NI, //Nickel
rawMaterial_PL, //Platin
rawMaterial_AG, //Silber
rawMaterial_W, //Wolfram
rawMaterial_ZN, //Zink
rawMaterial_SN, //Zinn
rawMaterial_Unknown
);
TOpenMasterdataAPI_RawMaterialHelper = class(TObject)
public
class function RawMaterialToStr(_Val : TOpenMasterdataAPI_RawMaterial) : String;
class function RawMaterialFromStr(_Val : String) : TOpenMasterdataAPI_RawMaterial;
end;
TOpenMasterdataAPI_Material = class
private
FbasisUnit: String;
Fmaterial: TOpenMasterdataAPI_RawMaterial;
FproportionUnit: String;
FquotationOfRawMaterial: double;
FweightBasis: double;
FproportionByWeight: double;
public
property material : TOpenMasterdataAPI_RawMaterial read Fmaterial write Fmaterial;
property weightBasis : double read FweightBasis write FweightBasis;
property basisUnit: String read FbasisUnit write FbasisUnit;
property proportionByWeight : double read FproportionByWeight write FproportionByWeight;
property proportionUnit : String read FproportionUnit write FproportionUnit;
property quotationOfRawMaterial : double read FquotationOfRawMaterial write FquotationOfRawMaterial;
end;
TOpenMasterdataAPI_Materials = class(TObjectList<TOpenMasterdataAPI_Material>)
end;
TOpenMasterdataAPI_Prices = class
private
FlistPrice: TOpenMasterdataAPI_Price;
frrp : TOpenMasterdataAPI_Price;
FnetPrice: TOpenMasterdataAPI_Price;
FtaxCode: Integer;
FbillBasis : String;
FrawMaterial: TOpenMasterdataAPI_Materials;
public
constructor Create;
destructor Destroy; override;
property listPrice : TOpenMasterdataAPI_Price read FlistPrice write FlistPrice;
property rrp : TOpenMasterdataAPI_Price read Frrp write Frrp;
property netPrice : TOpenMasterdataAPI_Price read FnetPrice write FnetPrice;
property taxCode : Integer read FtaxCode write FtaxCode; //Umsatzsteuer - 0 = voller Satz Ust.-Artikel - 1 = halber Satz Ust.-Artikel - 7 = Umkehr der Steuerschuld nach §13b UstG - 8 = Umsatzsteuerfrei nach §13b UstG „Bauleistungen
property billBasis : String read FbillBasis write FbillBasis; //Abrechnungsbasis
property rawMaterial : TOpenMasterdataAPI_Materials read FrawMaterial write FrawMaterial; //Liste von Materialzuschlägen
end;
TOpenMasterdataAPI_Descriptions = class
private
FproductDescr: String;
Fshorttext2: String;
Fshorttext1: String;
FmarketingText: String;
public
property shorttext1 : String read Fshorttext1 write Fshorttext1;
property productDescr : String read FproductDescr write FproductDescr;
property shorttext2 : String read Fshorttext2 write Fshorttext2;
property marketingText : String read FmarketingText write FmarketingText;
end;
TOpenMasterdataAPI_Picture = class
private
Ffilename: String;
Fhash: String;
Fuse: String;
FsubstituteId: Boolean;
Ftype_: String;
Fsize: Integer;
FurlThumbnail: String;
Furl: String;
Fdescription: String;
FsortOrder: Integer;
public
property url : String read Furl write Furl;
property urlThumbnail : String read FurlThumbnail write FurlThumbnail;
property type_ : String read Ftype_ write Ftype_; //Typ des Bildes\nCode Beschreibung\n- B_ = Fotorealistisches Produktbild in Farbe\n- S_ = Fotorealistisches Schwarz-Weiß-Bild\n- U_ = Unvermaßtes Bild (Strichzeichnung)\n- V_ = Vermaßtes Bild (Strichzeichnung)\n- X_ = Explosionszeichnung\n- MI = Milieubild, Badszene\n- DT = Detailbild/-ansicht\n- KV = Keyvisuals – Leitbilder\n- LO = Logo\n- LS = Lifestyle (Emotionsbilder mit Menschen)
property use : String read Fuse write Fuse; //Verwendung des Dokumentes\nCode Beschreibung\n- Druck = Bild ist für die Verwendung in Printmedien geeignet\n- Web = Bild ist für die Verwendung im Web geeignet
property substituteId : Boolean read FsubstituteId write FsubstituteId; //Stellvertreterkennzeichen
property description : String read Fdescription write Fdescription; //max 40 Beschreibung
property sortOrder : Integer read FsortOrder write FsortOrder; //max 2 Reihenfolge
property size : Integer read Fsize write Fsize; //Bildgröße in Byte
property filename : String read Ffilename write Ffilename; //max 35 Dateiname
property hash : String read Fhash write Fhash; //max 100 Hash-Wert der Datei als Fingerprint
end;
TOpenMasterdataAPI_PictureList = class(TObjectList<TOpenMasterdataAPI_Picture>)
end;
TOpenMasterdataAPI_Result = class
private
Fprices: TOpenMasterdataAPI_Prices;
Fdocuments: TOpenMasterdataAPI_DocumentList;
Fdescriptions: TOpenMasterdataAPI_Descriptions;
Flogistics: TOpenMasterdataAPI_Logistics;
Fbasic: TOpenMasterdataAPI_Basic;
Fpictures: TOpenMasterdataAPI_PictureList;
Fadditional: TOpenMasterdataAPI_Additional;
FsupplierPid: String;
FmanufacturerPid: String;
FmanufacturerId: String;
FmanufacturerIdType: String;
Fgtin: String;
Fsparepartlist: TOpenMasterdataAPI_Sparepartlist;
public
constructor Create;
destructor Destroy; override;
public
property supplierPid : String read FsupplierPid write FsupplierPid; //Artikelnummer innerhalb des angefragten Lieferanten (Großhandelsnummer)
property manufacturerId : String read FmanufacturerId write FmanufacturerId; //Herstellerartikelnummer
property manufacturerIdType : String read FmanufacturerIdType write FmanufacturerIdType; //Typ der Identifikation des Herstellers (z. B. DUNS, GLN, ...)
property manufacturerPid : String read FmanufacturerPid write FmanufacturerPid; //Identifikation des Herstellers
property gtin : String read Fgtin write Fgtin; //GTIN des Artikels
property basic : TOpenMasterdataAPI_Basic read Fbasic write Fbasic;
property additional : TOpenMasterdataAPI_Additional read Fadditional write Fadditional;
property logistics : TOpenMasterdataAPI_Logistics read Flogistics write Flogistics;
property prices : TOpenMasterdataAPI_Prices read Fprices write Fprices;
property descriptions : TOpenMasterdataAPI_Descriptions read Fdescriptions write Fdescriptions;
property pictures : TOpenMasterdataAPI_PictureList read Fpictures write Fpictures;
property sparepartlist : TOpenMasterdataAPI_Sparepartlist read Fsparepartlist write Fsparepartlist;
property documents : TOpenMasterdataAPI_DocumentList read Fdocuments write Fdocuments;
end;
TOpenMasterdataAPI_ResultHelper = class helper for TOpenMasterdataAPI_Result
public
procedure LoadFromJson(const _JsonValue : String);
end;
TOpenMasterdataHelper = class
public
class function FixJson(const _JsonValue : String) : String;
end;
implementation
{ TOpenMasterdataAPI_AuthResultHelper }
procedure TOpenMasterdataAPI_AuthResultHelper.LoadFromJson(
const _JsonValue: String);
var
messageJson : TJSONValue;
jsonString : TJSONString;
jsonValue : TJSONValue;
begin
messageJson := TJSONObject.ParseJSONValue(_JsonValue) as TJSONValue;
try
if messageJson.TryGetValue<TJSONString>('access_token',jsonString) then
access_token := jsonString.Value;
if messageJson.TryGetValue<TJSONString>('token_type',jsonString) then
token_type := jsonString.Value;
if messageJson.TryGetValue<TJSONValue>('expires_in',jsonValue) then
expires_in := StrToIntDef(jsonValue.Value,0);
if messageJson.TryGetValue<TJSONString>('refresh_token',jsonString) then
refresh_token := jsonString.Value;
if messageJson.TryGetValue<TJSONString>('scope',jsonString) then
scope := jsonString.Value;
finally
messageJson.Free;
end;
end;
{ TOpenMasterdataAPI_DataPackageHelper }
class function TOpenMasterdataAPI_DataPackageHelper.DataPackageAsString(
_Val: TOpenMasterdataAPI_DataPackage): String;
begin
case _Val of
omd_datapackage_additional: Result := 'additional';
omd_datapackage_prices: Result := 'prices';
omd_datapackage_descriptions: Result := 'descriptions';
omd_datapackage_logistics: Result := 'logistics';
omd_datapackage_sparepartlists: Result := 'sparepartlists';
omd_datapackage_pictures: Result := 'pictures';
omd_datapackage_documents: Result := 'documents';
else Result := 'basic';
end;
end;
class function TOpenMasterdataAPI_DataPackageHelper.DataPackagesAsString(
_Val: TOpenMasterdataAPI_DataPackages): String;
var
i : TOpenMasterdataAPI_DataPackage;
begin
Result := '';
//basic|additional|prices|descriptions|logistics|sparepartlists|pictures|documents
for i := Low(TOpenMasterdataAPI_DataPackage) to High(TOpenMasterdataAPI_DataPackage) do
if i in _Val then
begin
if Result <> '' then
Result := Result + '%7C';
Result := Result + TOpenMasterdataAPI_DataPackageHelper.DataPackageAsString(i);
end;
end;
{ TOpenMasterdataAPI_Prices }
constructor TOpenMasterdataAPI_Prices.Create;
begin
FlistPrice := TOpenMasterdataAPI_Price.Create;
frrp := TOpenMasterdataAPI_Price.Create;
FnetPrice := TOpenMasterdataAPI_Price.Create;
FrawMaterial := TOpenMasterdataAPI_Materials.Create;
end;
destructor TOpenMasterdataAPI_Prices.Destroy;
begin
if Assigned(FlistPrice) then begin FlistPrice.Free; FlistPrice := nil; end;
if Assigned(frrp) then begin frrp.Free; frrp := nil; end;
if Assigned(FnetPrice) then begin FnetPrice.Free; FnetPrice := nil; end;
if Assigned(FrawMaterial) then begin FrawMaterial.Free; FrawMaterial := nil; end;
inherited;
end;
{ TOpenMasterdataAPI_Additional }
constructor TOpenMasterdataAPI_Additional.Create;
begin
FalternativeProduct := TOpenMasterdataAPI_AlternativeProductList.Create;
FfollowupProduct := TOpenMasterdataAPI_FollowupProductList.Create;
Faccessories := TOpenMasterdataAPI_AccessoryList.Create;
Fsets := TOpenMasterdataAPI_SetList.Create;
Fattribute := TOpenMasterdataAPI_AttributeList.Create;
end;
destructor TOpenMasterdataAPI_Additional.Destroy;
begin
if Assigned(FalternativeProduct) then begin FalternativeProduct.Free; FalternativeProduct := nil; end;
if Assigned(FfollowupProduct) then begin FfollowupProduct.Free; FfollowupProduct := nil; end;
if Assigned(Faccessories) then begin Faccessories.Free; Faccessories := nil; end;
if Assigned(Fsets) then begin Fsets.Free; Fsets := nil; end;
if Assigned(Fattribute) then begin Fattribute.Free; Fattribute := nil; end;
inherited;
end;
{ TOpenMasterdataAPI_Logistics }
constructor TOpenMasterdataAPI_Logistics.Create;
begin
FmeasureA := TOpenMasterdataAPI_LogisticsMeasure.Create;
FmeasureB := TOpenMasterdataAPI_LogisticsMeasure.Create;
FmeasureC := TOpenMasterdataAPI_LogisticsMeasure.Create;
Fweight := TOpenMasterdataAPI_LogisticsWeight.Create;
FpackagingUnits := TOpenMasterdataAPI_PackagingUnitList.Create;
end;
destructor TOpenMasterdataAPI_Logistics.Destroy;
begin
if Assigned(FmeasureA) then begin FmeasureA.Free; FmeasureA := nil; end;
if Assigned(FmeasureB) then begin FmeasureB.Free; FmeasureB := nil; end;
if Assigned(FmeasureC) then begin FmeasureC.Free; FmeasureC := nil; end;
if Assigned(Fweight) then begin Fweight.Free; Fweight := nil; end;
if Assigned(FpackagingUnits) then begin FpackagingUnits.Free; FpackagingUnits := nil; end;
inherited;
end;
{ TOpenMasterdataAPI_Result }
constructor TOpenMasterdataAPI_Result.Create;
begin
Fdocuments := TOpenMasterdataAPI_DocumentList.Create;
Fadditional := TOpenMasterdataAPI_Additional.Create;
Flogistics := TOpenMasterdataAPI_Logistics.Create;
Fbasic := TOpenMasterdataAPI_Basic.Create;
Fprices := TOpenMasterdataAPI_Prices.Create;
Fdescriptions := TOpenMasterdataAPI_Descriptions.Create;
Fpictures := TOpenMasterdataAPI_PictureList.Create;
Fsparepartlist := TOpenMasterdataAPI_Sparepartlist.Create;
end;
destructor TOpenMasterdataAPI_Result.Destroy;
begin
if Assigned(Fdocuments) then begin Fdocuments.Free; Fdocuments := nil; end;
if Assigned(Fadditional) then begin Fadditional.Free; Fadditional := nil; end;
if Assigned(Flogistics) then begin Flogistics.Free; Flogistics := nil; end;
if Assigned(Fbasic) then begin Fbasic.Free; Fbasic := nil; end;
if Assigned(Fprices) then begin Fprices.Free; Fprices := nil; end;
if Assigned(Fdescriptions) then begin Fdescriptions.Free; Fdescriptions := nil; end;
if Assigned(Fpictures) then begin Fpictures.Free; Fpictures := nil; end;
if Assigned(Fsparepartlist) then begin Fsparepartlist.Free; Fsparepartlist := nil; end;
inherited;
end;
{ TOpenMasterdataAPI_ResultHelper }
procedure TOpenMasterdataAPI_ResultHelper.LoadFromJson(const _JsonValue: String);
var
messageJson: TJSONValue;
jsonString : TJSONString;
jsonNumber : TJSONNumber;
jsonArray : TJSONArray;
jsonBool : TJSONBool;
jsonValue,jsonValue2,jsonValue3 : TJSONValue;
itemSparepartlistRow : TOpenMasterdataAPI_SparepartlistRow;
procedure LoadMeasureUnitFromJson(_Val : TJSONValue; _Result : TOpenMasterdataAPI_LogisticsMeasure);
var jsonString2 : TJSONString;
begin
if _Val = nil then exit;
if _Result = nil then exit;
if _Val.TryGetValue<TJSONString>('measure',jsonString2) then
_Result.measure := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('unit',jsonString2) then
_Result.unit_ := jsonString2.Value;
end;
procedure LoadWeightFromJson(_Val : TJSONValue; _Result : TOpenMasterdataAPI_LogisticsWeight);
var jsonString2 : TJSONString;
begin
if _Val = nil then exit;
if _Result = nil then exit;
if _Val.TryGetValue<TJSONString>('weight',jsonString2) then
_Result.weight := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('unit',jsonString2) then
_Result.unit_ := jsonString2.Value;
end;
procedure LoadTextRowFromJson(_Val : TJSONValue; _Result : TOpenMasterdataAPI_TextRow);
var jsonString2 : TJSONString;
begin
if _Val = nil then exit;
if _Result = nil then exit;
if _Val.TryGetValue<TJSONString>('position',jsonString2) then
_Result.position := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('text',jsonString2) then
_Result.text := jsonString2.Value;
end;
procedure LoadLinkedProductFromJson(_Val : TJSONValue; _Result : TOpenMasterdataAPI_LinkedProduct);
var jsonString2 : TJSONString;
begin
if _Val = nil then exit;
if _Result = nil then exit;
if _Val.TryGetValue<TJSONString>('supplierPid',jsonString2) then
_Result.supplierPid := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('manufacturerId',jsonString2) then
_Result.manufacturerId := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('manufacturerIdType',jsonString2) then
_Result.manufacturerIdType := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('manufacturerPid',jsonString2) then
_Result.manufacturerPid := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('gtin',jsonString2) then
_Result.gtin := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('productShortDescr',jsonString2) then
_Result.productShortDescr := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('imageLink',jsonString2) then
_Result.imageLink := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('thumbnailUrl',jsonString2) then
_Result.thumbnailUrl := jsonString2.Value;
end;
procedure LoadLinkedHistoricProductFromJson(_Val : TJSONValue; _Result : TOpenMasterdataAPI_LinkedHistoricProduct);
var jsonString2 : TJSONString;
begin
if _Val = nil then exit;
if _Result = nil then exit;
if _Val.TryGetValue<TJSONString>('manufacturerId',jsonString2) then
_Result.manufacturerId := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('manufacturerIdType',jsonString2) then
_Result.manufacturerIdType := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('historicProduct',jsonString2) then
_Result.historicProduct := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('constructionFrom',jsonString2) then
_Result.constructionFrom := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('productShortDescr',jsonString2) then
_Result.productShortDescr := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('imageLink',jsonString2) then
_Result.imageLink := jsonString2.Value;
end;
procedure LoadArticleRowFromJson(_Val : TJSONValue; _Result : TOpenMasterdataAPI_ArticleRow);
var jsonString2 : TJSONString;
jsonValue : TJSONValue;
begin
if _Val = nil then exit;
if _Result = nil then exit;
if _Val.TryGetValue<TJSONString>('position',jsonString2) then
_Result.position := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('pricegroup',jsonString2) then
_Result.pricegroup := jsonString2.Value;
if _Val.TryGetValue<TJSONString>('text',jsonString2) then
_Result.text := jsonString2.Value;
if _Val.TryGetValue<TJSONValue>('linkedProduct',jsonValue) then
LoadLinkedProductFromJson(jsonValue,_Result.linkedProduct);
if _Val.TryGetValue<TJSONValue>('linkedHistoricProduct',jsonValue) then
LoadLinkedHistoricProductFromJson(jsonValue,_Result.linkedHistoricProduct);
end;
begin
messageJson := TJSONObject.ParseJSONValue(
TOpenMasterdataHelper.FixJson(_JsonValue),
false,true) as TJSONValue;
if messageJson = nil then
exit;
try
if messageJson.TryGetValue<TJSONString>('supplierPid',jsonString) then
supplierPid := jsonString.Value;
if messageJson.TryGetValue<TJSONString>('manufacturerId',jsonString) then
manufacturerId := jsonString.Value;
if messageJson.TryGetValue<TJSONString>('manufacturerIdType',jsonString) then
manufacturerIdType := jsonString.Value;
if messageJson.TryGetValue<TJSONString>('manufacturerPid',jsonString) then
manufacturerPid := jsonString.Value;
if messageJson.TryGetValue<TJSONString>('gtin',jsonString) then
gtin := jsonString.Value;
if messageJson.TryGetValue<TJSONValue>('prices',jsonValue) then
begin
if jsonValue.TryGetValue<TJSONValue>('listPrice',jsonValue2) then
begin
if jsonValue2.TryGetValue<TJSONString>('value',jsonString) then
prices.listPrice.value := jsonString.Value;
if jsonValue2.TryGetValue<TJSONString>('currency',jsonString) then
prices.listPrice.currency := jsonString.Value;
if jsonValue2.TryGetValue<TJSONValue>('basis',jsonValue3) then
prices.listPrice.basis := StrToIntDef(jsonValue3.Value,1);
if jsonValue2.TryGetValue<TJSONString>('quantityUnit',jsonString) then
prices.listPrice.quantityUnit := jsonString.Value;
end;
if jsonValue.TryGetValue<TJSONValue>('rrp',jsonValue2) then
begin
if jsonValue2.TryGetValue<TJSONString>('value',jsonString) then
prices.rrp.value := jsonString.Value;
if jsonValue2.TryGetValue<TJSONString>('currency',jsonString) then
prices.rrp.currency := jsonString.Value;
if jsonValue2.TryGetValue<TJSONValue>('basis',jsonValue3) then
prices.rrp.basis := StrToIntDef(jsonValue3.Value,1);
if jsonValue2.TryGetValue<TJSONString>('quantityUnit',jsonString) then
prices.rrp.quantityUnit := jsonString.Value;
end;
if jsonValue.TryGetValue<TJSONValue>('netPrice',jsonValue2) then
begin
if jsonValue2.TryGetValue<TJSONString>('value',jsonString) then
prices.netprice.value := jsonString.Value;
if jsonValue2.TryGetValue<TJSONString>('currency',jsonString) then
prices.netprice.currency := jsonString.Value;
if jsonValue2.TryGetValue<TJSONValue>('basis',jsonValue3) then
prices.netPrice.basis := StrToIntDef(jsonValue3.Value,1);
if jsonValue2.TryGetValue<TJSONString>('quantityUnit',jsonString) then
prices.netprice.quantityUnit := jsonString.Value;
end;
if jsonValue.TryGetValue<TJSONNumber>('taxCode',jsonNumber) then
prices.taxCode := jsonNumber.AsInt;
if jsonValue.TryGetValue<TJSONString>('billBasis',jsonString) then
prices.billBasis := jsonString.Value;
if jsonValue.TryGetValue<TJSONArray>('rawMaterial',jsonArray) then
for jsonValue2 in jsonArray do
begin
var itemMaterial : TOpenMasterdataAPI_Material := TOpenMasterdataAPI_Material.Create;