Files
TREK/server/src/nest/packing/packing.dto.ts
T
Maurice 7bbb5a9f71 fix(packing): anyone on the trip can be put down as the bringer of a shared item, and taken off again (#3098)
A common item only let you pledge yourself. Nobody else could be named,
and a bringer could never be removed, so an item that went personal and back
kept its owner's avatar for good. The item menu now lists every member to
tick on or off, a click on the avatar opens it there, and the add route takes
an optional user_id limited to the trip's members. Taking the owner off
clears the owner. The remove route now checks visibility for the caller, not
for the user named in the path.
2026-11-15 11:00:21 +01:00

40 lines
2.1 KiB
TypeScript

import {
adminTemplateNameRequestSchema,
packingCreateItemRequestSchema,
packingUpdateItemRequestSchema,
packingSetSharingRequestSchema,
packingAddContributorRequestSchema,
packingImportRequestSchema,
packingReorderRequestSchema,
packingCreateBagRequestSchema,
packingUpdateBagRequestSchema,
packingBagMembersRequestSchema,
packingSaveTemplateRequestSchema,
packingApplyTemplateRequestSchema,
packingCategoryAssigneesRequestSchema,
} from '@trek/shared';
import { createZodDto } from 'nestjs-zod';
/**
* Server-side createZodDto wrappers over the @trek/shared packing contracts.
* The global ZodValidationPipe (APP_PIPE in app.module.ts) validates any
* @Body() parameter typed with one of these classes by metatype — the Zod
* schemas in shared/ remain the single source of truth for the wire contract.
*/
export class PackingCreateItemDto extends createZodDto(packingCreateItemRequestSchema) {}
export class PackingUpdateItemDto extends createZodDto(packingUpdateItemRequestSchema) {}
export class PackingSetSharingDto extends createZodDto(packingSetSharingRequestSchema) {}
export class PackingAddContributorDto extends createZodDto(packingAddContributorRequestSchema) {}
export class PackingImportDto extends createZodDto(packingImportRequestSchema) {}
export class PackingReorderDto extends createZodDto(packingReorderRequestSchema) {}
export class PackingCreateBagDto extends createZodDto(packingCreateBagRequestSchema) {}
export class PackingUpdateBagDto extends createZodDto(packingUpdateBagRequestSchema) {}
export class PackingBagMembersDto extends createZodDto(packingBagMembersRequestSchema) {}
export class PackingSaveTemplateDto extends createZodDto(packingSaveTemplateRequestSchema) {}
export class PackingApplyTemplateDto extends createZodDto(packingApplyTemplateRequestSchema) {}
export class PackingCategoryAssigneesDto extends createZodDto(packingCategoryAssigneesRequestSchema) {}
/** The six packing-template create/update routes of AdminPackingTemplatesController share this body. */
export class AdminTemplateNameDto extends createZodDto(adminTemplateNameRequestSchema) {}