Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add duplicate shop endpoint #161

Merged
merged 3 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ exports[`module exports > exposes the correct data from index.ts 1`] = `
"PostCarrierOptions": [Function],
"PostShipments": [Function],
"PostShop": [Function],
"PostShopDuplicate": [Function],
"PostSubscriptions": [Function],
"PostWebhookSubscriptions": [Function],
"PutAccount": [Function],
Expand Down
20 changes: 20 additions & 0 deletions src/endpoints/private/shops/PostShopDuplicate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {AbstractPrivateEndpoint} from '@/model/endpoint/AbstractPrivateEndpoint';
import {type CreateDefinition} from '@/model/endpoint/AbstractEndpoint.types';
import {type HttpMethod} from '@/types/request.types';
import {type DuplicateShop} from './Shop.types';

type PostShopDuplicateDefinition = CreateDefinition<{
name: typeof PostShopDuplicate.name;
body: DuplicateShop[];
response: {ids: [{id: number}]};
}>;

/**
* The PostShopDuplicate endpoint is used to add a new shop.
*/
export class PostShopDuplicate extends AbstractPrivateEndpoint<PostShopDuplicateDefinition> {
public readonly method: HttpMethod = 'POST';
public readonly name = 'postShopDuplicate';
public readonly path = 'shops/duplicate';
public readonly property = 'ids';
}
5 changes: 5 additions & 0 deletions src/endpoints/private/shops/Shop.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,8 @@ export interface MyParcelShop {
return: ShopReturn;
tracktrace: ShopTrackTrace;
}

export interface DuplicateShop {
name: string;
account_id: number;
}
1 change: 1 addition & 0 deletions src/endpoints/private/shops/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ export * from './GetShop';
export * from './PostShop';
export * from './PutShop';
export * from './Shop.types';
export * from './PostShopDuplicate';
Loading