@@ -3,14 +3,14 @@ import { DSelectOption } from '../design-system/select-option.model';
33
44/** Estado interno do formulário de criação (campos do POST) */
55export interface ProductCreateFormState {
6- categoryId : string ;
7- manufacturerId : string ;
8- partOriginId : string ;
9- unitId : string ;
10- internalCode : string ;
6+ category_id : string ;
7+ manufacturer_id : string ;
8+ part_origin_id : string ;
9+ unit_id : string ;
10+ internal_code : string ;
1111 barcode : string ;
1212 name : string ;
13- shortDescription : string ;
13+ short_description : string ;
1414 description : string ;
1515 weight : number ;
1616 height : number ;
@@ -21,14 +21,14 @@ export interface ProductCreateFormState {
2121
2222export function defaultProductCreateFormState ( ) : ProductCreateFormState {
2323 return {
24- categoryId : '' ,
25- manufacturerId : '' ,
26- partOriginId : '' ,
27- unitId : '' ,
28- internalCode : '' ,
24+ category_id : '' ,
25+ manufacturer_id : '' ,
26+ part_origin_id : '' ,
27+ unit_id : '' ,
28+ internal_code : '' ,
2929 barcode : '' ,
3030 name : '' ,
31- shortDescription : '' ,
31+ short_description : '' ,
3232 description : '' ,
3333 weight : 0 ,
3434 height : 0 ,
@@ -42,7 +42,7 @@ export function createFormToGeneralSource(state: ProductCreateFormState): Produc
4242 return {
4343 ...state ,
4444 slug : '' ,
45- statusId : '' ,
45+ status_id : '' ,
4646 active : true ,
4747 } ;
4848}
@@ -69,15 +69,15 @@ export interface CreateProductPayload {
6969export interface ProductGeneralFormData {
7070 name : string ;
7171 slug : string ;
72- shortDescription : string ;
72+ short_description : string ;
7373 description : string ;
74- categoryId : string ;
75- manufacturerId : string ;
76- partOriginId : string ;
77- statusId : string ;
78- internalCode : string ;
74+ category_id : string ;
75+ manufacturer_id : string ;
76+ part_origin_id : string ;
77+ status_id : string ;
78+ internal_code : string ;
7979 barcode : string ;
80- unitId : string ;
80+ unit_id : string ;
8181 weight : number ;
8282 height : number ;
8383 width : number ;
@@ -94,20 +94,21 @@ export interface ProductGeneralFormOptions {
9494 partOriginOptions : DSelectOption [ ] ;
9595 unitOptions : DSelectOption [ ] ;
9696 statusOptions : DSelectOption [ ] ;
97+ warehouseOptions : DSelectOption [ ] ;
9798}
9899
99100export interface ProductGeneralFormSource {
100101 name : string ;
101102 slug : string ;
102- shortDescription : string ;
103+ short_description : string ;
103104 description : string ;
104- categoryId : string ;
105- manufacturerId : string ;
106- partOriginId : string ;
107- statusId : string ;
108- internalCode : string ;
105+ category_id : string ;
106+ manufacturer_id : string ;
107+ part_origin_id : string ;
108+ status_id : string ;
109+ internal_code : string ;
109110 barcode : string ;
110- unitId : string ;
111+ unit_id : string ;
111112 weight : number ;
112113 height : number ;
113114 width : number ;
@@ -120,15 +121,15 @@ export function toProductGeneralFormData(source: ProductGeneralFormSource): Prod
120121 return {
121122 name : source . name ,
122123 slug : source . slug ,
123- shortDescription : source . shortDescription ,
124+ short_description : source . short_description ,
124125 description : source . description ,
125- categoryId : source . categoryId ,
126- manufacturerId : source . manufacturerId ,
127- partOriginId : source . partOriginId ,
128- statusId : source . statusId ,
129- internalCode : source . internalCode ,
126+ category_id : source . category_id ,
127+ manufacturer_id : source . manufacturer_id ,
128+ part_origin_id : source . part_origin_id ,
129+ status_id : source . status_id ,
130+ internal_code : source . internal_code ,
130131 barcode : source . barcode ,
131- unitId : source . unitId ,
132+ unit_id : source . unit_id ,
132133 weight : source . weight ,
133134 height : source . height ,
134135 width : source . width ,
@@ -140,14 +141,14 @@ export function toProductGeneralFormData(source: ProductGeneralFormSource): Prod
140141
141142export function toCreateProductPayload ( source : ProductGeneralFormSource ) : CreateProductPayload {
142143 return {
143- category_id : source . categoryId ,
144- manufacturer_id : source . manufacturerId ,
145- part_origin_id : source . partOriginId ,
146- unit_id : source . unitId ,
147- internal_code : source . internalCode ,
144+ category_id : source . category_id ,
145+ manufacturer_id : source . manufacturer_id ,
146+ part_origin_id : source . part_origin_id ,
147+ unit_id : source . unit_id ,
148+ internal_code : source . internal_code ,
148149 barcode : source . barcode ,
149150 name : source . name ,
150- short_description : source . shortDescription ,
151+ short_description : source . short_description ,
151152 description : source . description ,
152153 weight : source . weight ,
153154 height : source . height ,
0 commit comments