question

hernanzbucki avatar image
hernanzbucki asked sam Deactivated answered

Extending Clover default entities.

Hi everyone,

We are supposed to start developing third-party apps for clover devices. But our apps manage our custom entities. Some of these entities represent customers, merchants, orders (as Clover entities do), but we also have other proprietary entities that CLover doesn't have by deafult.

So, our questions are:
1) In the case of merchants, customers, orders, etc, how can we "extend" those default clover entities with our own properties, without affecting other Clover apps? For instance, if I want to add two new properties to "Customer" entity, how would be the best way to do it?

2) If we want to add brand new entities, where should we do it? Should we fork clover-sdk and add new classes? Should we edit those entities in our own project?

Thanks in advance,
Best,
Clover Android SDK
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

sam avatar image
sam Deactivated answered
You won't be able to make changes directly on our SDK so you would need to create and maintain those new extended classes on your own project with your own DB. I would use the uuid of the Clover objects and use it as the foreign key to associate with your classes.

eg.
public class MyCustomer extends Customer {
                
private String my_attr;

MyCustomer() {
super();
my_attr = "hello!";
}
}



10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community