@@ -53,7 +53,7 @@ type DeviceDefinitionOnChainService interface {
5353 GetDefinitionByID (ctx context.Context , ID string , reader * db.DB ) (* models2.DeviceDefinitionTablelandModel , * big.Int , error )
5454 GetDefinitionTableland (ctx context.Context , manufacturerID * big.Int , ID string ) (* models2.DeviceDefinitionTablelandModel , error )
5555 GetDeviceDefinitions (ctx context.Context , manufacturerID types.NullDecimal , ID string , model string , year int , pageIndex , pageSize int32 ) ([]models2.DeviceDefinitionTablelandModel , error )
56- Create (ctx context.Context , mk models. DeviceMake , dd models2.DeviceDefinitionTablelandModel ) (* string , error )
56+ Create (ctx context.Context , manufacturerName string , dd models2.DeviceDefinitionTablelandModel ) (* string , error )
5757 Update (ctx context.Context , manufacturerName string , input contracts.DeviceDefinitionUpdateInput ) (* string , error )
5858 Delete (ctx context.Context , manufacturerName , id string ) (* string , error )
5959 QueryDefinitionsCustom (ctx context.Context , manufacturerID int , whereClause string , pageIndex int ) ([]models2.DeviceDefinitionTablelandModel , error )
@@ -298,7 +298,7 @@ const (
298298)
299299
300300// Create does a create for tableland, on-chain operation - checks if already exists, inserts transaction in db. returns the onchain transaction
301- func (e * deviceDefinitionOnChainService ) Create (ctx context.Context , mk models. DeviceMake , dd models2.DeviceDefinitionTablelandModel ) (* string , error ) {
301+ func (e * deviceDefinitionOnChainService ) Create (ctx context.Context , manufacturerName string , dd models2.DeviceDefinitionTablelandModel ) (* string , error ) {
302302
303303 metrics .Success .With (prometheus.Labels {"method" : TablelandRequests }).Inc ()
304304 e .logger .Info ().Msgf ("OnChain Start Create for device definition %s. EthereumSendTransaction %t. payload: %+v" , dd .ID , e .settings .EthereumSendTransaction , dd )
@@ -349,11 +349,11 @@ func (e *deviceDefinitionOnChainService) Create(ctx context.Context, mk models.D
349349 }
350350
351351 // Validate if manufacturer exists
352- bigManufID , err := queryInstance .GetManufacturerIdByName (& bind.CallOpts {Context : ctx , Pending : true }, mk . Name )
352+ bigManufID , err := queryInstance .GetManufacturerIdByName (& bind.CallOpts {Context : ctx , Pending : true }, manufacturerName )
353353 if err != nil {
354354 e .logger .Err (err ).Msgf ("OnChainError - %s" , dd .ID )
355355 metrics .InternalError .With (prometheus.Labels {"method" : TablelandErrors }).Inc ()
356- return nil , fmt .Errorf ("failed get GetManufacturerIdByName => %s: %w" , mk . Name , err )
356+ return nil , fmt .Errorf ("failed get GetManufacturerIdByName => %s: %w" , manufacturerName , err )
357357 }
358358 instance , err := contracts .NewRegistryTransactor (contractAddress , e .client )
359359 if err != nil {
0 commit comments