Currently customerId and employeeId accept any string value with no format enforcement
or uniqueness guarantee. Gender also accepts any string value.
Tasks
- Convert gender field in Customer to a Gender enum (MALE, FEMALE, OTHER)
- Add @pattern validation on customerId — format CUST\d{4} e.g. CUST0001
- Add @pattern validation on employeeId — format EMP\d{4} e.g. EMP0001
- Add @indexed(unique = true) on:
- customerId and email in Customer
- employeeId in Employee
- isbn in Book
Currently customerId and employeeId accept any string value with no format enforcement
or uniqueness guarantee. Gender also accepts any string value.
Tasks