u
This commit is contained in:
13
README.md
13
README.md
@@ -42,12 +42,11 @@ Company-scoped methods take **no** `companyId` argument: they use `google_auth.s
|
||||
|
||||
For `POST /api/company`:
|
||||
|
||||
1. Fails if `name` is taken (`Company name not available`)
|
||||
2. Ensures language by `iso639` (get or create)
|
||||
3. Ensures tax rows for `taxrate`, `reducedtaxrate`, and `0` → `taxfreerateId`
|
||||
4. Creates root category (`parentId = null`)
|
||||
5. Creates POS `customergroup` (name `POS`), then inserts company with `poscustomergroup_id` (**NOT NULL**), then links the group via `customergroup.company_id`
|
||||
6. Links creator as `companyuser` (`googleAuthId` → `company_id`)
|
||||
1. Ensures language by `iso639` (get or create)
|
||||
2. Ensures tax rows for `taxrate`, `reducedtaxrate`, and `0` → `taxfreerateId`
|
||||
3. Creates root category (`parentId = null`)
|
||||
4. Creates POS `customergroup` (name `POS`), then inserts company with `poscustomergroup_id` (**NOT NULL**), then links the group via `customergroup.company_id`
|
||||
5. Links creator as `companyuser` (`googleAuthId` → `company_id`)
|
||||
|
||||
`company.poscustomergroup_id` is required (POS pricing in `getTreeForCompany` / category articles). Circular FK with `customergroup.company_id`: the group is inserted first with `company_id` null, then linked after the company row exists.
|
||||
|
||||
@@ -59,7 +58,7 @@ Returns only companies where `googleAuthId` has a `companyuser` row.
|
||||
|
||||
For `PATCH /api/company/:id`:
|
||||
|
||||
1. Fails if company missing / name taken by another company
|
||||
1. Fails if company missing
|
||||
2. Ensures lang + tax rates
|
||||
3. Updates `name`, `default_language_id`, `taxrate`, `reducedtaxrate`
|
||||
(`taxfreerateId` / root category unchanged)
|
||||
|
||||
Reference in New Issue
Block a user