- I extended the
Addressentity:
@Entity()
export class Address extends MedusaAddress {
@IsString()
@IsOptional()
vat_id: string;
}
- I extended and registered both Validators:
export class StorePostCustomersCustomerAddressesAddressReq extends MedusaStorePostCustomersCustomerAddressesAddressReq {
@IsString()
@IsOptional()
vat_id: string;
}
export class AddressPayload extends MedusaAddressPayload {
@IsString()
@IsOptional()
vat_id: string;
}
registerOverriddenValidators(StorePostCustomersCustomerAddressesAddressReq);
registerOverriddenValidators(AddressPayload);
- I can see that the call to
/store/customers/mereturns 200 and has the proper payload with thebilling_address.vat_idattached to it. - The server stores / updates all address information BUT leaves the extended column
vat_idout. Its null basically - The database has the new field (vat_id) that I created during a migration before but I simply fail to populate it on an upte / creation.
I am probably missing some sort validation or other logical break. This one is not so straight forward as Addresses is referenced by shipping and billling addresses.
Thanks for any pointers or examples of someone who has extended the address entity 🙏