Skip to content

fix: create event type with output of create event type #21252

@linear

Description

@linear

Problem

If we create event type X and then try to copy paste response as body for Y there are errors related to booking fields and offset:

https://calcominc.slack.com/archives/C08A5QYSTJ6/p1746967955511829

Solution

  1. Update booking-fields.input.ts to allow passing location default booking field - users can only specify label. In create-event-type.input.ts and update-event-type.input.ts allow passing offsetStart 0 because that is the default value and should be valid.
    1. Since we have location field input - update booking-fields.ts to transform it and then input-event-types.service.ts to use custom location field and if no location field is passed have a default one like with other booking fields.
  2. Return location default booking field label in booking-fields.ts and then reflect that in output type booking-fields.output.ts.
  3. Add a test in event-types.controller.e2e-spec.ts to test that if we create event type X and then take its response as body for creating event type Y but with new slug and name that the response of Y matches X successfully.

Bonus

Refactor platform libraries yarn publish to yarn publish-npm so pre-publish and post-publish steps run one after another.

Metadata

Metadata

Assignees

No one assigned

    Labels

    apiarea: API, enterprise API, access token, OAuthevent-typesarea: event types, event-typesplatformAnything related to our platform plan

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions