Add address fields to sales invoices and implement related validations
- Introduced new columns `address`, `latitude`, and `longitude` in the `sales_invoices` table to store location details. - Updated the `SalesInvoicesService` to handle the new fields, including validation for address format and geographical coordinates. - Enhanced the `SalesInvoiceDto` and related data transfer objects to include the new fields for API requests and responses. - Added unit and e2e tests to ensure proper handling of the new fields and validate their integration within the sales invoice workflow. - Created a new migration script to apply the database schema changes for the sales invoices.
This commit is contained in:
@@ -165,12 +165,18 @@ describe('Sales invoices (e2e)', () => {
|
||||
branchId,
|
||||
divisionId,
|
||||
customerId,
|
||||
address: 'Jl Sudirman 1',
|
||||
latitude: -6.2,
|
||||
longitude: 106.8,
|
||||
products: [{ productId, quantity: '2' }],
|
||||
})
|
||||
.expect(201);
|
||||
expect(created.body).toMatchObject({
|
||||
status: 'draft',
|
||||
balance: '25000.0000',
|
||||
address: 'Jl Sudirman 1',
|
||||
latitude: -6.2,
|
||||
longitude: 106.8,
|
||||
});
|
||||
expect((created.body as { code: string }).code).toMatch(/^SI-/);
|
||||
const id = (created.body as { id: string }).id;
|
||||
|
||||
Reference in New Issue
Block a user