Skip to content

Commit 33785b7

Browse files
remcohendriksmyparcel-bot[bot]
authored andcommitted
feat: duplicate shop endpoint
1 parent 8bbb51d commit 33785b7

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import {AbstractPrivateEndpoint} from '@/model/endpoint/AbstractPrivateEndpoint';
2+
import {type CreateDefinition} from '@/model/endpoint/AbstractEndpoint.types';
3+
import {type HttpMethod} from '@/types/request.types';
4+
import {type DuplicateShop} from './Shop.types';
5+
6+
type PostShopDuplicateDefinition = CreateDefinition<{
7+
name: typeof PostShopDuplicate.name;
8+
body: DuplicateShop[];
9+
response: {ids: [{id: number}]};
10+
}>;
11+
12+
/**
13+
* The PostShopDuplicate endpoint is used to add a new shop.
14+
*/
15+
export class PostShopDuplicate extends AbstractPrivateEndpoint<PostShopDuplicateDefinition> {
16+
public readonly method: HttpMethod = 'POST';
17+
public readonly name = 'postShopDuplicate';
18+
public readonly path = 'shops/duplicate';
19+
public readonly property = 'ids';
20+
}

src/endpoints/private/shops/Shop.types.ts

+5
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,8 @@ export interface MyParcelShop {
8383
return: ShopReturn;
8484
tracktrace: ShopTrackTrace;
8585
}
86+
87+
export interface DuplicateShop {
88+
name: string;
89+
account_id: number;
90+
}

src/endpoints/private/shops/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ export * from './GetShop';
22
export * from './PostShop';
33
export * from './PutShop';
44
export * from './Shop.types';
5+
export * from './PostShopDuplicate';

0 commit comments

Comments
 (0)