This commit is contained in:
seb
2026-07-31 05:34:45 +02:00
parent 806d077d57
commit 09c7a8bc74
19 changed files with 405 additions and 30 deletions

View File

@@ -9,10 +9,46 @@ INNER JOIN companyuser cu ON cu.company_id = c.id
WHERE cu.id = @companyUserId
`;
export const GET_BY_NAME = `
SELECT id, name, root_category_id, default_language_id, taxrate, reducedtaxrate, taxfreerate
FROM company
WHERE name = @name
`;
export const GET_BY_ID = `
SELECT id, name, root_category_id, default_language_id, taxrate, reducedtaxrate, taxfreerate
FROM company
WHERE id = @id
`;
export const CREATE = `
INSERT INTO company (name, root_category_id)
INSERT INTO company (
name,
root_category_id,
default_language_id,
taxrate,
reducedtaxrate,
taxfreerate
)
OUTPUT INSERTED.id
VALUES (@name, @rootCategoryId)
VALUES (
@name,
@rootCategoryId,
@languageId,
@taxrate,
@reducedtaxrate,
@taxfreerate
)
`;
export const UPDATE = `
UPDATE company
SET
name = @name,
default_language_id = @languageId,
taxrate = @taxrate,
reducedtaxrate = @reducedtaxrate
WHERE id = @id
`;
export const LIST = `

View File

@@ -26,3 +26,9 @@ export const DEL = `
DELETE FROM google_auth
WHERE id = @id
`;
export const SET_SELECTED_COMPANY = `
UPDATE google_auth
SET selected_company = @companyId
WHERE id = @id
`;

View File

@@ -4,6 +4,12 @@ OUTPUT INSERTED.id
VALUES (@iso639)
`;
export const GET_BY_ISO639 = `
SELECT id, iso639
FROM language
WHERE iso639 = @iso639
`;
export const LIST = `
SELECT id, iso639
FROM language

16
src/sql/tax.js Normal file
View File

@@ -0,0 +1,16 @@
export const GET_BY_RATE = `
SELECT id, rate
FROM tax
WHERE rate = @rate
`;
export const CREATE = `
INSERT INTO tax (rate)
OUTPUT INSERTED.id
VALUES (@rate)
`;
export const LIST = `
SELECT id, rate
FROM tax
`;