Payment
The Payment
resource will be pretty simple. This time, choose no to CRUD entry points.
This time, as we didn't create CRUD entry points, an entity was not created, so please create it in entities -> payment.entity. Then, define the attributes.
Also associate the ORM decorators, and register it inside the TypeOrmModule
.
An order may or may not have a payment, and a payment always belongs to an order. So we can declare a one-to-one relationship, starting on the order's side.
We can now do the same on the payment's side.
Let's finish by generating and running the migration create-payment.
Commit - Creating payment entity and handling one to one relation
Last updated