Error converting value \"DAYSAFTERBILLMONTH\" to type 'ScheduleDueType'
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- nodejs, typescript
- Área
- api
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 264
- Forks
- 177
- Merge medio
- 10 h 5 min
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de XeroAPI/xero-node
-
`getClientCredentialsToken()` sends `scopes` (comma-joined) instead of the OAuth `scope` parameterAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 3/5 Medio día Aptitud para principiantes 55/100
-
TrackingOptionId value missing from accountingApi.getInvoices()Posiblemente ocupada @miachillgood la tomó hace 152 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 18/100
-
BankTransaction type is missing the batchPayment object.Posiblemente ocupada @miachillgood la tomó hace 171 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 22/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 25/100
Todos los issues de XeroAPI/xero-node
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
super-productivity/super-productivity#12128 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
A docs change can fail pnpm check, because outreach lint and gen:types both write .astro/ at oncePosiblemente ocupada @2389400626lh-ops la tomó hoy. AbiertoArea: Infrastructure Area: Outreach Bug Difficulty: Low Good First Issue Priority: Low
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
DouglasNeuroInformatics/OpenDataCapture#1956 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 72/100
justyns/silverbullet-ai#199 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
spartan-ng/spartan#1931 ·
Los mantenedores suelen responder en 2 días