docs: expand input and output object types in API signatures

This commit is contained in:
seb
2026-09-16 17:45:46 +02:00
parent 9b1b7615e2
commit 5a7773df79
22 changed files with 128 additions and 89 deletions

View File

@@ -43,7 +43,7 @@ export default function create(pool) {
* @param {string} [input.city] - The city.
* @param {string} [input.county] - The county.
* @param {number} [input.sort] - Optional sort order.
* @returns {Promise<object>} The created address.
* @returns {Promise<{id: number, entityId: number, firstName: string|null, name: string|null, street: string|null, streetNumber: string|null, zip: string|null, city: string|null, county: string|null, addressType: string, sort: number}>} The created address.
* @throws {Error} If the address type is missing.
*
* @example

View File

@@ -27,7 +27,7 @@ export default function list(pool) {
*
* @param {number} googleAuthId - The id of the Google auth user.
* @param {number} entityId - The id of the entity.
* @returns {Promise<Array<object>>} The addresses.
* @returns {Promise<Array<{id: number, entityId: number, firstName: string|null, name: string|null, street: string|null, streetNumber: string|null, zip: string|null, city: string|null, county: string|null, addressType: string, sort: number}>>} The addresses.
*
* @example
* const addresses = await store.entityaddress.list(42, 5);

View File

@@ -35,7 +35,16 @@ export default function update(pool) {
* @param {number} entityId - The id of the entity.
* @param {number} id - The id of the address to update.
* @param {object} patch - The update patch (any subset of address fields).
* @returns {Promise<object>} The updated address.
* @param {string} [patch.addressType] - The address type.
* @param {string} [patch.firstName] - The first name.
* @param {string} [patch.name] - The name.
* @param {string} [patch.street] - The street.
* @param {string} [patch.streetNumber] - The street number.
* @param {string} [patch.zip] - The zip code.
* @param {string} [patch.city] - The city.
* @param {string} [patch.county] - The county.
* @param {number} [patch.sort] - The sort order.
* @returns {Promise<{id: number, entityId: number, firstName: string|null, name: string|null, street: string|null, streetNumber: string|null, zip: string|null, city: string|null, county: string|null, addressType: string, sort: number}>} The updated address.
* @throws {Error} If the address is not found.
*
* @example