Error converting value \"DAYSAFTERBILLMONTH\" to type 'ScheduleDueType'
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- nodejs, typescript
- Domaine
- api
Piste de recherche
The failure is in the Schedule model's DueDateTypeEnum, which the SDK generates from the Xero OpenAPI spec, so the source is likely the spec or generator, not hand-written code. Start by comparing the enum values in the generated Schedule model with the DAYSAFTERINVOICEDATE value from the issue, and reproduce the error the issue describes with a minimal createRepeatingInvoices call. Done means the enum accepts the value the API expects and the error no longer occurs for the 14-days-after-invoice-date case.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
SDK you're using (please complete the following information):
- Version [e.g. 13.0.1]
Describe the bug
I'm trying to create a repeating invoice with due date 14 days after the invoice date. But the enum DAYSAFTERINVOICEDATE has issues with the API.
Here's my code
async createRepeatingInvoice(invoiceDetails: InvoiceDetails) {
await this.setAccessToken();
const { contactId, itemCode, reference, quantity, invoiceDate } =
invoiceDetails;
// const brandingTheme = await this.getBrandingThemeByName("sss");
const invoiceData: RepeatingInvoice = {
type: RepeatingInvoice.TypeEnum.ACCREC,
status: RepeatingInvoice.StatusEnum.AUTHORISED,
contact: {
contactID: contactId,
},
lineItems: [
{
itemCode,
quantity,
},
],
reference: reference,
schedule: {
period: 1,
unit: Schedule.UnitEnum.MONTHLY,
startDate: new Date(invoiceDate).toISOString(),
dueDate: 14,
dueDateType: Schedule.DueDateTypeEnum.DAYSAFTERINVOICEDATE,
},
markAsSent: true,
// brandingThemeID: brandingTheme?.brandingThemeID,
};
const { body } = await this.xero.accountingApi.createRepeatingInvoices("", {
repeatingInvoices: [invoiceData],
});
return body?.repeatingInvoices?.[0];
}
Here's the error
Error converting value \"DAYSAFTERBILLMONTH\" to type 'ScheduleDueType'
To Reproduce
Steps to reproduce the behavior:
I can also reproduce this with the API explorer
Screenshots
Additional context
Add any other context about the problem here.
- Langage dominant
- TypeScript
- Étoiles
- 264
- Forks
- 177
- Merge moyen
- 10 h 5 min
- PR mergées (30 j)
- 5
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de XeroAPI/xero-node
-
`getClientCredentialsToken()` sends `scopes` (comma-joined) instead of the OAuth `scope` parameterOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
-
Difficulté 3/5 Une demi-journée Accessibilité débutants 55/100
-
TrackingOptionId value missing from accountingApi.getInvoices()Peut-être pris @miachillgood l’a pris il y a 152 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 18/100
-
BankTransaction type is missing the batchPayment object.Peut-être pris @miachillgood l’a pris il y a 171 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 22/100
-
Difficulté 3/5 1-2 jours Accessibilité débutants 25/100
Toutes les issues de XeroAPI/xero-node
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
super-productivity/super-productivity#12128 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
A docs change can fail pnpm check, because outreach lint and gen:types both write .astro/ at oncePeut-être pris @2389400626lh-ops l’a pris aujourd’hui. OuverteArea: Infrastructure Area: Outreach Bug Difficulty: Low Good First Issue Priority: Low
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
DouglasNeuroInformatics/OpenDataCapture#1956 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 1-3 heures Accessibilité débutants 72/100
justyns/silverbullet-ai#199 ·
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
spartan-ng/spartan#1931 ·
Les mainteneurs répondent en général sous 2 jours