Add entity customer numbers and scope APIs via selected company.
Entity gets an optional unique-per-company number with allocate/peek/isNumberFree helpers. Company-scoped store methods no longer take companyId and resolve google_auth.selected_company instead.
This commit is contained in:
@@ -40,7 +40,12 @@ export const TABLES = [
|
||||
'meta',
|
||||
];
|
||||
|
||||
export const PROCEDURES = ['getnextnumberwithprefixandpadding'];
|
||||
export const PROCEDURES = [
|
||||
'getnextnumberwithprefixandpadding',
|
||||
'peeknextnumberwithprefixandpadding',
|
||||
];
|
||||
|
||||
export const VIEWS = ['v_entity_company_number'];
|
||||
|
||||
/** Drop before tables — breaks company ↔ customergroup cycle for purge. */
|
||||
export const CONSTRAINTS = [
|
||||
@@ -54,6 +59,10 @@ export function buildPurgeSql() {
|
||||
(name) =>
|
||||
`IF OBJECT_ID(N'dbo.${name}', N'P') IS NOT NULL DROP PROCEDURE dbo.[${name}];`,
|
||||
),
|
||||
...VIEWS.map(
|
||||
(name) =>
|
||||
`IF OBJECT_ID(N'dbo.${name}', N'V') IS NOT NULL DROP VIEW dbo.[${name}];`,
|
||||
),
|
||||
...CONSTRAINTS,
|
||||
...TABLES.map(
|
||||
(name) =>
|
||||
|
||||
Reference in New Issue
Block a user